-
Notifications
You must be signed in to change notification settings - Fork 390
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
Trie recovery #5861
Trie recovery #5861
Conversation
increase timeout
This reverts commit 1c6e52b.
…ry-snap-sync # Conflicts: # src/Nethermind/Nethermind.Init/Steps/InitializeBlockchain.cs # src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs # src/Nethermind/Nethermind.Trie/PatriciaTree.cs
…ry-snap-sync # Conflicts: # src/Nethermind/Nethermind.Trie/TrieException.cs
This reverts commit 37f46cf.
src/Nethermind/Nethermind.Synchronization/Trie/HealingStateTree.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Synchronization/Trie/HealingStorageTree.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Synchronization/Trie/HealingTrieStore.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! The only thing I would change is to not keep snap protocol enabled after syncing - IMO we should try to avoid introducing solution which will make nethermind work a bit worse in normal mode to support the feature which is great, but will be used rarely. Worth to try with P2P AddCapability
, enable snap protocol only when node is corrupted and request all peers to add satellite protocol
src/Nethermind/Nethermind.Synchronization/Trie/TrieNodeRecovery.cs
Outdated
Show resolved
Hide resolved
This won't work as |
* - Added Eip4788 to ReleaseSpecs - Added Eip4788 wiring to ChainSpecs * - Added passing state to Precompiles - Added Eip4788 stateful precompile * - Adds consensus logic of Eip4788 * - Tests update * - Minor fixes, Missing migration code * - Test improvements * - Test progress, Cleanup * - More tests fixes * - Whitespace fixes * - Attempt fix failing JsonRpc.Tests * - Fix whistespace check failure * - move setup precompile 4788 to instance method - make Instance field in Precompile static generic to match class type * - fix some build issue * - fixed failing tests * - Apply changes * - Fix failing tests * - ws fixes * - Introduce IBeaconBlockRootHandler * - Removed unnecessary "null" default value * - Fixed some naming inconsistensies * - Fix ws problems * - Fix default behavior of beaconBlockRootHandler argument in BlockProcessor.ctor * - fix * - Fix ws * small improvements * Add EngineApiVersions * - refactor PayloadAttributes.Validate * - ws fix * Init beacon root precompile state for genesis (#5982) * - Applied suggested changes * Fix merge * Fix name, whitespaces * Fix expected code * Remove balance set * genesis.json beacon root. * jsonrpc: fix parentBeaconBlockRoot naming, add isEip4788. * Catch args issue * - ignore 0x0b from precompile checks * Ignore for genesis * Don't count RLP wrapper, when calc tx size for pooled txs msg * Revert "Trie recovery (#5861)" This reverts commit a099f0f. * Use main EIP to detect fork * Adding some workarounds * Add system acc * Another workaround * What if zero bloc * Another idea * Another idea * + * + * Another attempt * 1) What * No genesis * 2) H * Revert "Revert "Trie recovery (#5861)"" This reverts commit 1425d3c. * Adhere a formal rule of encoding * Decline payloads with v3 fields * 2) The * Fix 2) The * clarification comment * fix typo in file name * Add RLP testing scenarios * FIx tracer type * - 4788 cleanup * - Make Eip4788 settabe from chainspec * Fix merge * - other tests fixes * Working on review comments * fix build * remove BeaconBlock from precompile list * - moved ParentBeaconBlockRoot type from byte[] to Keccak - removed commented precompile line from VirtualMachine * - fixed some tests - removed deprectated tests * - more cleanup * - adjusted expected size in blob tx size tests * - ws fix * Default addr * more cosmetic stuff * Remove worldState parameter * Revert "more cosmetic stuff" This reverts commit 872bce8. --------- Co-authored-by: Demuirgos <ayman.bouchareb@outlook.fr> Co-authored-by: lukasz.rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Alexey <me@flcl.me> Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk> Co-authored-by: smartprogrammer <smartprogrammer@windowslive.com>
Changes
If node will be missing in the trie this PR will attempt to recover it for the network.
If there are peers<=eth66 the
HealingTrieStore
will catchTrieNodeException
and useGetNodeDataTrieNodeRecovery
to connect to <=eth66 peers and recoverrlp
byhash
withGetNodeData
, then store it back in db.If this fails,
HealingStateTree
andHealingStorageTree
will catchMissingTrieNodeException
thrown inPatriciaTree
durign traversing and will try to useSnapTrieNodeRecovery
to recover withGetTrieNodes
.All this happens only when
BlockchainProcessor.IsMainProcessingThread
istrue
.Limitations:
GetNodeData
it might be longer, but forGetTrieNodes
there is hard limit of 128 blocks. Past that time-window recovery is not possible.GetTrieNodes
doesn't currently verify receivedrlp
not sure if it can be added easily.Example logs (ignore
will throw
message it was for testing):Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Documentation
Requires documentation update
Requires explanation in Release Notes