BlockchainProvider2::block_state_provider
may return inconsistent state provider
#34
Closed
1 task done
Describe the bug
gravity-reth/crates/storage/provider/src/providers/blockchain_provider.rs
Lines 1116 to 1119 in 3c51ce0
gravity-reth/crates/storage/provider/src/providers/blockchain_provider.rs
Lines 174 to 183 in 3c51ce0
gravity-reth/crates/chain-state/src/in_memory.rs
Lines 510 to 522 in 3c51ce0
In the
block_state_provider
, the in memoryBlockState
is first obtained fromCanonicalInMemoryState
, and with the anchor hash of thisBlockState
, an already written state provider in the database is retrieved, attempting to construct aMemoryOverlayStateProvider
by combining the in memoryBlockState
and the state provider returned from the database. However, when constructing theMemoryOverlayStateProvider
, theBlockState
used is obtained again fromCanonicalInMemoryState
by hash, where this newBlockState
may have an anchor hash different from the state provider obtained from the database (for example, the memory layout ofCanonicalInMemoryState
may have been modified by advancing persistent block between two calls toCanonicalInMemoryState::state_by_hash
), resulting in an inconsistentCanonicalInMemoryState
between the memory portion and the database portion.Platform(s)
Linux (x86)
What version/commit are you on?
v1.0.7-gravity
Which chain / network are you on?
reth --chain
What type of node are you running?
Full via --full flag
Code of Conduct
The text was updated successfully, but these errors were encountered: