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

CodeReview: State Expiry #37

Open
wants to merge 52 commits into
base: state_expiry_base
Choose a base branch
from

Conversation

setunapo
Copy link
Owner

@setunapo setunapo commented May 6, 2023

Description

NA

0xbundler and others added 30 commits March 28, 2023 21:34
txpool: add hard fork & witness check;
trie: add MPTProofCache, include verify proof, MPTProofNubs;
trie: add trie node type;
core/StateTransition: add witness verify;
refactor(trie): change prefixKey to prefixKeyHex

feat(trie): add ReviveTrie()

refactor(MPTProof): change RootKey to RootKeyHex

refactor: fix VerifyProof and ExpireByPrefix bugs

feat(revive): add ReviveTrie and UTs

minor: edit some comments

refactor(trie): add resolveHash and comments
state/journal: add revive journal;
state/stateDB: opt revive state;
state/state_object: record AccessedState, opt pending revive trie;
state/journal: add access state journal;
fix: fix some compile error and ut failures;
add TryRevive again

refactor: add getter for MPTProofNub
StateEpoch: add new epoch type, add expired utility function;
StateObject: support complete state R&W, opt revive trie cache & state;
Snapshot: support parse state epoch;
EVM: opt sLoad & sStore error handle, add EVM error collection;
State expire: implementation of MPT R&W
asyukii and others added 22 commits April 28, 2023 17:34
fix logic error

fix logic error

fix comments

Squashed commit of the following:

commit 27110c9
Merge: 1cf57da 9c2297d
Author: cryyl <[email protected]>
Date:   Wed Apr 26 10:34:14 2023 +0800

    Merge pull request #91 from cryyl/state_expire_mpt

    State expire: implementation of MPT R&W

commit 9c2297d
Author: cryyl <[email protected]>
Date:   Tue Apr 18 16:58:00 2023 +0800

    state expriy: implement of MPT read and write

    Signed-off-by: cryyl <[email protected]>

fix
blockchain: handle shadow node tree;
statedb: using shadow node database, commit later;
trie: support resolve shadow node, and r&w, add root node parse;
trie/shadownode: support shadow node history store & query;
trie/shadownode_difflayer: support diff layers flatten to DB;
complete estimate gas and revive state

add test and function comments

remove TODO
everything is fine at this point

refactor(trie): add shadow logic to MPT Revive

add shadow logic
chore: remove comment

refactor(trie): change variable naming

add epoch parameter to tryRevive

refactor(trie): restructure if-else statements

refactor(trie): restructure if-else statements

deconstruct if layers

minor comment

minor typo
trie/shadownode: support commit root node & shadow nodes;
fix: fix some broken UTs;

parlia: add state epoch config;
trie: fix trie hash root node bug;

state/statedb: add system contracts to expiry white list;
state/state_object: using expiry white list;
state/state_object: opt shadow node diff layers update;
state/state_object: opt snap state query, opt insert dup check;
state/statedb: fix copy bugs;
trie/trie: opt trie root epoch bug, remove node's epoch methods;
state/state_object: recall dirty revive trie for accuracy expired info;
vm/evm: fix sstore calculate expired state gas bug;
ethapi/api: fix EstimateGasAndReviveState resolve witness issues;
trie/trie: opt shadow hash calculation, recalloect branch node epoch map;
trie/trie: keep as hashNode when meet expired node, opt expired node checking;
trie/trie: fix expired check bug when child is nil;
feat(prune): inline prune expired nodes

fix dereference codes

fix: raw node

fix: add BEP-206 prune rules
trie/shadow_node_history: remove history when in pruning mode;
pruner: opt init with chain config;
state/statedb: generate witness fron pendingReviveTrie;
log: add some logs;
fix: temporarily do not prune account trie node

fix: estimate size for root node
setunapo pushed a commit that referenced this pull request Mar 27, 2024
…unt-check (#24765)

* cmd/geth, core/state/snapshot: rework journal loading, implement account-check

* core/state/snapshot, cmd/geth: polish code (#37)

* core/state/snapshot: minor nits

* core/state/snapshot: simplify error logic

* cmd/geth: go format

Co-authored-by: rjl493456442 <[email protected]>
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.

4 participants