Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix electra state to safe share references on pending fields when append #14895

Merged
merged 2 commits into from
Feb 8, 2025

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Feb 7, 2025

This PR fixes:

  • Pending queue objects: References were not shared correctly. If the reference count is greater than 1 (meaning another process is holding it), a copy is required.
  • Rebuild trie misuse: It was incorrectly applied to fields like uint64, which should not be rebuilt this way.
  • Dirty indices: Now properly added after appending.

Note to the reviewers: please review DequeuePendingPartialWithdrawals, I added a unit test, the current implementation seems ok as test passes, but please double check no action is needed there

@terencechain terencechain requested a review from a team as a code owner February 7, 2025 19:41
@james-prysm james-prysm added the Electra electra hardfork label Feb 8, 2025
b.markFieldAsDirty(types.PendingConsolidations)
b.rebuildTrie[types.PendingConsolidations] = true
b.addDirtyIndices(types.PendingConsolidations, []uint64{uint64(len(b.pendingConsolidations) - 1)})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the dirty indices line, this is only used if we maintain a field trie for the particular field

b.markFieldAsDirty(types.PendingDeposits)
b.rebuildTrie[types.PendingDeposits] = true
b.addDirtyIndices(types.PendingDeposits, []uint64{uint64(len(b.pendingDeposits) - 1)})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

b.markFieldAsDirty(types.PendingPartialWithdrawals)
b.rebuildTrie[types.PendingPartialWithdrawals] = true
b.addDirtyIndices(types.PendingPartialWithdrawals, []uint64{uint64(len(b.pendingPartialWithdrawals) - 1)})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@terencechain terencechain added this pull request to the merge queue Feb 8, 2025
Merged via the queue into develop with commit 81a2a17 Feb 8, 2025
17 checks passed
@terencechain terencechain deleted the fix-electra-state branch February 8, 2025 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Electra electra hardfork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants