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

Async verify #2785

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
53d6ed6
feat: async verify and commit
joeylichang Dec 6, 2024
91a1b4c
chore: forbidden txpool and blobpool
joeylichang Dec 6, 2024
8f5ac08
fix: active verify loop
joeylichang Dec 6, 2024
7f8183c
fix: write head block
joeylichang Dec 6, 2024
5556680
fix: delay open trie
joeylichang Dec 6, 2024
e6042bd
fix: add statedb data after execute
joeylichang Dec 6, 2024
d6d9595
add compare and debug infor
flywukong Dec 10, 2024
e43c66e
get verified state root for CA before update CA trie
flywukong Dec 10, 2024
34f4f06
get verified state root for CA before update CA trie
flywukong Dec 10, 2024
f950485
remove panic check
flywukong Dec 10, 2024
162decf
fix: write code after executing
joeylichang Dec 11, 2024
a4d56ad
not update state root with newly created account
RenRick Dec 12, 2024
0217ae8
fix metrics & remove log
flywukong Dec 10, 2024
f666b61
set flatten difflayer as verified
RenRick Dec 16, 2024
695b225
Add CorrectAccounts for snapshot diff
RenRick Dec 16, 2024
9ebdf9e
async commit and fix bug
RenRick Dec 16, 2024
7285e6c
remove cap after correct accounts
RenRick Dec 16, 2024
68a51d9
remove log
flywukong Dec 16, 2024
d16ff08
comment bloomfilter query
RenRick Dec 16, 2024
e4c0884
set code to code cache
RenRick Dec 16, 2024
de440e9
async snapshot diff cap
RenRick Dec 17, 2024
d9b73af
remove some stats and add snapshot commit metrics
RenRick Dec 17, 2024
b4ca893
fix: chang sync wait rebuild snapshot
joeylichang Dec 17, 2024
7e50fe7
change prefetch for state
RenRick Dec 19, 2024
0283900
enable bloom filter of difflayer
RenRick Dec 19, 2024
8ca7566
add metrics of commit and snap read
flywukong Dec 17, 2024
d88b8a7
correct accounts after commit finished
RenRick Dec 22, 2024
bf4c3ad
wait verify task done during shutdown
RenRick Dec 22, 2024
f4fa999
add verifying cache for pipeline
RenRick Dec 23, 2024
13919bd
check verify task result
flywukong Dec 24, 2024
b37908f
Add warning for failare to open state trie
RenRick Dec 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
}
return nil
},
func() error {
if !v.bc.HasBlockAndState(block.ParentHash(), block.NumberU64()-1) {
if !v.bc.HasBlock(block.ParentHash(), block.NumberU64()-1) {
return consensus.ErrUnknownAncestor
}
return consensus.ErrPrunedAncestor
}
return nil
},
//func() error {
// if !v.bc.HasBlockAndState(block.ParentHash(), block.NumberU64()-1) {
// if !v.bc.HasBlock(block.ParentHash(), block.NumberU64()-1) {
// return consensus.ErrUnknownAncestor
// }
// return consensus.ErrPrunedAncestor
// }
// return nil
//},
func() error {
if v.remoteValidator != nil && !v.remoteValidator.AncestorVerified(block.Header()) {
return fmt.Errorf("%w, number: %s, hash: %s", ErrAncestorHasNotBeenVerified, block.Number(), block.Hash())
Expand Down Expand Up @@ -187,7 +187,7 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD
}
validateFuns = append(validateFuns, func() error {
if root := statedb.IntermediateRoot(v.config.IsEIP158(header.Number)); header.Root != root {
return fmt.Errorf("invalid merkle root (remote: %x local: %x) dberr: %w", header.Root, root, statedb.Error())
return fmt.Errorf("invalid merkle root (block: %d block_hash: %x remote: %x local: %x) dberr: %w", block.Number(), header.Hash(), header.Root, root, statedb.Error())
}
return nil
})
Expand Down
Loading