Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R4R] Resolve conflicts between fastnode and develop branch #848

Closed
wants to merge 3 commits into from

Conversation

qinglin89
Copy link
Contributor

@qinglin89 qinglin89 commented Apr 8, 2022

Description

Resolve conflicts between fastnode and develop branch
#640

Rationale

conflicts in files both modified:
cmd/geth/snapshot.go
core/blockchain.go
core/state/pruner/pruner.go
core/state/statedb.go
eth/backend.go

Example

N/A

Changes

Notable changes:

  • cmd/geth/snapshot.go
    • line:228 snaptree, err := snap.New(..., false), add a param false at the end of param list
    • line:425 chaindb := utils.MakeChainDatabase(..., false), add a param false at the end of param list
  • core/blockchain.go
  • core/state/pruner/pruner.go
  • core/state/statedb.go
    • func newStateDB(...)... set sdb.noTrie after error check from develop branch
    • func(s *StateDB) Commit(...) (...) keep develop structure refactor commitFuncs with commitTrie and commitFuncs, add noTrie check in commitTire
  • eth/backend.go
    • line 204:
    func New(...) (...){
        ...
        if config.DiffSync && !config.NoTries && !config.PipeCommit 
        ...
    }

@@ -1096,6 +1098,15 @@ func (bc *BlockChain) HasFastBlock(hash common.Hash, number uint64) bool {

// HasState checks if state trie is fully present in the database or not.
func (bc *BlockChain) HasState(hash common.Hash) bool {
if bc.stateCache.NoTries() {
if bc.pipeCommit && bc.snaps != nil {
Copy link
Contributor

@realuncle realuncle Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not true here. And try disable pipeCommit when it is a fast node

db Database
prefetcher *triePrefetcher
originalRoot common.Hash // The pre-state root, before any changes were made
currentRoot common.Hash // only used when noTrie is true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expectedRoot and currentRoot can be merged

@unclezoro unclezoro closed this Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants