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

eip7251: Bugfix and more withdrawal tests #14578

Merged
merged 13 commits into from
Oct 31, 2024
Merged

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Oct 24, 2024

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?
implements ethereum/consensus-specs#3979 for devnet 5

should be updated along with new spec tests.

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@james-prysm james-prysm added the Electra electra hardfork label Oct 24, 2024
@james-prysm james-prysm requested a review from a team as a code owner October 24, 2024 19:01
@james-prysm james-prysm marked this pull request as draft October 24, 2024 19:01
@james-prysm james-prysm added the Blocked Blocked by research or external factors label Oct 24, 2024
@james-prysm james-prysm marked this pull request as ready for review October 24, 2024 20:26
beacon-chain/core/blocks/withdrawals.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated
@@ -43,6 +43,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- Fixed mesh size by appending `gParams.Dhi = gossipSubDhi`
- Fix skipping partial withdrawals count.
- wait for the async StreamEvent writer to exit before leaving the http handler, avoiding race condition panics [pr](https://github.com/prysmaticlabs/prysm/pull/14557)
- EIP7521 - fixing withdrawal bug
Copy link
Member

Choose a reason for hiding this comment

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

Can we be more specific with this change log? High level: what is the bug?

@@ -155,6 +158,15 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err
if err != nil {
return nil, 0, errors.Wrapf(err, "could not retrieve balance at index %d", validatorIndex)
}
if b.version >= version.Electra {
var partiallyWithdrawnBalance uint64
for _, w := range withdrawals {
Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine and not really worth optimizing, it's nice to read along the spec, but if you want to optimize it, we could use a map or track the length of withdrawals before entering the for loop and break at that index.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'm not sure if that's worth it, the withdrawals should be pretty short here

CHANGELOG.md Outdated Show resolved Hide resolved
terencechain
terencechain previously approved these changes Oct 26, 2024
@james-prysm james-prysm added Ready For Review A pull request ready for code review and removed Blocked Blocked by research or external factors labels Oct 31, 2024
@james-prysm
Copy link
Contributor Author

need to update devnet 5 spec tests later

@james-prysm james-prysm enabled auto-merge October 31, 2024 17:00
@james-prysm james-prysm added this pull request to the merge queue Oct 31, 2024
Merged via the queue into develop with commit 61c296e Oct 31, 2024
17 of 18 checks passed
@james-prysm james-prysm deleted the withdrawal-bug-electra branch October 31, 2024 17:09
@kasey kasey added the changelog/fixed Changelog Section: Fixed label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/fixed Changelog Section: Fixed Electra electra hardfork Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants