-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Address @jtraglia's comments regarding Electra code #14833
Conversation
@@ -207,7 +207,7 @@ func ProcessConsolidationRequests(ctx context.Context, st state.BeaconState, req | |||
|
|||
if npc, err := st.NumPendingConsolidations(); err != nil { | |||
return fmt.Errorf("failed to fetch number of pending consolidations: %w", err) // This should never happen. | |||
} else if npc >= pcLimit { | |||
} else if npc == pcLimit { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait is this correct? don't we need a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's this line in the spec:
Using >=
is fine but technically it's not what the spec does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>=
may be safer here. Does NumPendingConsolidations
ensure linearity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be executed sequentially, so this should always work properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would rather have >=
here just because it's strictly safer than ==
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning to address this? @rkapka
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is no longer in the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider smaller PRs in the future. This will take multiple review passes to ensure that the PR addresses all of the items in the nitpick list as intended by the PR description.
validator/client/beacon-api/test-helpers/electra_beacon_block_test_helpers.go
Show resolved
Hide resolved
|
||
// Representing a Fulu block. | ||
SignedBeaconBlockFulu fulu_block = 13; | ||
|
||
// Representing a blinded Fulu block. | ||
SignedBlindedBeaconBlockFulu blinded_fulu_block = 14; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this in the nits doc. Is this related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer in the PR
proto/engine/v1/electra.go
Outdated
@@ -73,7 +73,7 @@ func unmarshalDeposits(requestListInSSZBytes []byte) ([]*DepositRequest, error) | |||
|
|||
func unmarshalWithdrawals(requestListInSSZBytes []byte) ([]*WithdrawalRequest, error) { | |||
if len(requestListInSSZBytes) < wrSize { | |||
return nil, errors.New("invalid withdrawal request length, requests should be at least the size of 1 request") | |||
return nil, errors.New("invalid withdrawal requests length, requests should be at least the size of 1 request") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to nitpick here, then the error should be like this:
return nil, errors.New("invalid withdrawal requests length, requests should be at least the size of 1 request") | |
return nil, fmt.Errorf("invalid withdrawal requests length, requests should be at least the size of %d requests", wrSize) |
Otherwise 1 is a magic number and may not match wrSize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
proto/engine/v1/electra.go
Outdated
@@ -83,7 +83,7 @@ func unmarshalWithdrawals(requestListInSSZBytes []byte) ([]*WithdrawalRequest, e | |||
|
|||
func unmarshalConsolidations(requestListInSSZBytes []byte) ([]*ConsolidationRequest, error) { | |||
if len(requestListInSSZBytes) < crSize { | |||
return nil, errors.New("invalid consolidations request length, requests should be at least the size of 1 request") | |||
return nil, errors.New("invalid consolidation requests length, requests should be at least the size of 1 request") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same feedback here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -207,7 +207,7 @@ func ProcessConsolidationRequests(ctx context.Context, st state.BeaconState, req | |||
|
|||
if npc, err := st.NumPendingConsolidations(); err != nil { | |||
return fmt.Errorf("failed to fetch number of pending consolidations: %w", err) // This should never happen. | |||
} else if npc >= pcLimit { | |||
} else if npc == pcLimit { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning to address this? @rkapka
changelog/radek_electra-nits.md
Outdated
### Changed | ||
|
||
- Modified `ProcessConsolidationRequests` to match the specification. | ||
- Changed order of `aggregate` and `selection_proof` in `AggregateAttestationAndProofElectra` protobuf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Changed order of `aggregate` and `selection_proof` in `AggregateAttestationAndProofElectra` protobuf. | |
- Changed proto field ID of `aggregate` and `selection_proof` in `AggregateAttestationAndProofElectra` protobuf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a new changelog fragment now. Do you want me to mention this item?
@@ -208,7 +208,7 @@ func TestService_ValidateSyncContributionAndProof(t *testing.T) { | |||
want: pubsub.ValidationIgnore, | |||
}, | |||
{ | |||
name: "Invalid Subcommittee Index", | |||
name: "Invalid Subcommittee ValidatorIndex", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -199,7 +199,7 @@ func TestService_ValidateBlsToExecutionChange(t *testing.T) { | |||
want: pubsub.ValidationAccept, | |||
}, | |||
{ | |||
name: "Non-existent Validator Index", | |||
name: "Non-existent Validator ValidatorIndex", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?? revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
…wal`" This reverts commit 87e4da0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for splitting this PR into individual commits. This was a much better review experience!
validator/client/beacon-api/test-helpers/electra_beacon_block_test_helpers.go
Show resolved
Hide resolved
@@ -112,7 +112,7 @@ func MinimalSpecConfig() *BeaconChainConfig { | |||
minimalConfig.MaxDepositRequestsPerPayload = 4 | |||
minimalConfig.PendingPartialWithdrawalsLimit = 64 | |||
minimalConfig.MaxPendingPartialsPerWithdrawalsSweep = 2 | |||
minimalConfig.PendingDepositLimit = 134217728 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same value as mainnet? This isn't an override so you could just delete this line, if you want.
What type of PR is this?
Other
What does this PR do? Why is it needed?
Addresses @jtraglia 's feedback from https://notes.ethereum.org/@jtraglia/prysm_nits.
Each commit addresses one suggestion:
Acknowledgements