You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(levm): don't read from parent block when processing withdrawals (#2556)
**Motivation**
When processing withdrawals with levm, accounts that are not cached are
fetched directly from the `Store` (aka our DB) using the block's parent
hash instead of using the `StoreWrapper` api that already knows which
block's state to read accounts from (as we do for all other DB reads).
This works fine when executing one block at a time as the block that the
StoreWrapper reads from is the block's parent. But when we execute
blocks in batch, the StoreWrapper reads from the parent of the first
block in the batch, as changes from the following blocks will be
recorded in the cache, so when processing withdrawals we may not have
the state of the current block's parent in the Store.
This PR fixes this issue by using the `StoreWrapper` to read uncached
accounts from the batch's parent block instead of looking for an
accounts in a parent state that may not exist. It also removes the
method `get_account_info_by_hash` so we don't run into the same issue in
the future
<!-- Why does this pull request exist? What are its goals? -->
**Description**
* Remove misleading method `get_account_info_by_hash` from levm Database
trait (this can lead us to read state from a block that is not the
designated parent block and which's state may not exist leading to
Inconsistent Trie errors)
* Remove the argument `parent_block_hash` from `process_withdrawals`
<!-- A clear and concise general description of the changes this PR
introduces -->
<!-- Link to issues: Resolves#111, Resolves#222 -->
Closes #issue_number
0 commit comments