-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the feature
compute_trie_input is used to compute the in-memory overlay which will be passed to the MultiProofTask so that proof computation can take into account in-memory blocks which haven't been persisted to the database yet.
reth/crates/engine/tree/src/tree/payload_validator.rs
Lines 999 to 1006 in 4548209
| fn compute_trie_input<TP: DBProvider + BlockNumReader + TrieReader>( | |
| &self, | |
| persisting_kind: PersistingKind, | |
| provider: TP, | |
| parent_hash: B256, | |
| state: &EngineApiTreeState<N>, | |
| allocated_trie_input: Option<TrieInput>, | |
| ) -> ProviderResult<TrieInput> { |
This step takes a few milliseconds on every block:
Once #18906 is complete this method will no longer rely on the state of persistence to perform its computation, as it will no longer deal with collecting reverts.
At that point it will be possible to not compute the trie input at the start of a block's payload validation, but instead at the end of its parent, after the RPC response has been returned to the caller.
This will likely involve modifying ExecutedBlock to retain the full trie input. It will also require that when in-memory blocks are removed from the tree the trie input of each block is re-computed, as the trie input of one in-memory block is dependent on the trie input of its parent.
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status