Skip to content

fix(evm): sync full persistent account state when selecting a fork#14432

Open
AissataF wants to merge 1 commit intofoundry-rs:masterfrom
AissataF:fix-fork
Open

fix(evm): sync full persistent account state when selecting a fork#14432
AissataF wants to merge 1 commit intofoundry-rs:masterfrom
AissataF:fix-fork

Conversation

@AissataF
Copy link
Copy Markdown

On select_fork, the persistent-account loop only wrote present_value into slots that were already tracked in the target fork's journal, so slots newly added on the active fork and any info changes were dropped, and SSTORE could see a stale original_value. Now use Entry::and_modify/or_insert_with to insert missing slots, copy info from the active db, and initialize new EvmStorageSlots with aligned original_value/present_value.

On `select_fork`, the persistent-account loop only wrote `present_value` into slots that were already tracked in the target fork's journal, so slots newly added on the active fork and any `info` changes were dropped, and `SSTORE` could see a stale `original_value`. Now use `Entry::and_modify`/`or_insert_with` to insert missing slots, copy `info` from the active db, and initialize new `EvmStorageSlot`s with aligned `original_value`/`present_value`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant