-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
A-staged-syncRelated to staged sync (pipelines and stages)Related to staged sync (pipelines and stages)A-trieRelated to Merkle Patricia Trie implementationRelated to Merkle Patricia Trie implementationC-enhancementNew feature or requestNew feature or requestC-perfA change motivated by improving speed, memory usage or disk footprintA change motivated by improving speed, memory usage or disk footprint
Milestone
Description
Describe the feature
The issue #12527 turns out to be because the XEN contract causes a from-scratch storage root calculation to allocate ~100G.
This assumption from the original root code is now false due to how large XEN is:
reth/crates/trie/trie/src/trie.rs
Lines 195 to 201 in 39f1ee8
// We assume we can always calculate a storage root without | |
// OOMing. This opens us up to a potential DOS vector if | |
// a contract had too many storage entries and they were | |
// all buffered w/o us returning and committing our intermediate | |
// progress. | |
// TODO: We can consider introducing the TrieProgress::Progress/Complete | |
// abstraction inside StorageRoot, but let's give it a try as-is for now. |
And the task described in the TODO is now relevant. This involves:
- Adding helpers for restoring a storage root computation progress
- Methods for stopping the storage root calculation after a threshold is met
- Data structures for saving the storage root progress
- Logic for stopping / resuming an incremental storage root calculation in StateRoot
Additional context
No response
Metadata
Metadata
Assignees
Labels
A-staged-syncRelated to staged sync (pipelines and stages)Related to staged sync (pipelines and stages)A-trieRelated to Merkle Patricia Trie implementationRelated to Merkle Patricia Trie implementationC-enhancementNew feature or requestNew feature or requestC-perfA change motivated by improving speed, memory usage or disk footprintA change motivated by improving speed, memory usage or disk footprint
Type
Projects
Status
Backlog