mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Address @jtraglia's comments regarding Electra code (#14833)
* change field IDs in `AggregateAttestationAndProofElectra`
* fix typo in `validator.proto`
* correct slashing indices length and shashings length
* check length in indexed attestation's `ToConsensus` method
* use `fieldparams.BLSSignatureLength`
* Add length checks for execution request
* fix typo in `beacon_state.proto`
* fix typo in `ssz_proto_library.bzl`
* fix error messages about incorrect types in block factory
* add Electra case to `BeaconBlockContainerToSignedBeaconBlock`
* move PeerDAS config items to PeerDAS section
* remove redundant params
* rename `PendingDepositLimit` to `PendingDepositsLimit`
* improve requests unmarshaling errors
* rename `get_validator_max_effective_balance` to `get_max_effective_balance`
* fix typo in `consolidations.go`
* rename `index` to `validator_index` in `PendingPartialWithdrawal`
* rename `randomByte` to `randomBytes` in `validators.go`
* fix for version in a comment in `validator.go`
* changelog <3
* Revert "rename `index` to `validator_index` in `PendingPartialWithdrawal`"
This reverts commit 87e4da0ea2.
This commit is contained in:
@@ -63,7 +63,7 @@ func (ebe *ExecutionBundleElectra) GetDecodedExecutionRequests() (*ExecutionRequ
|
||||
|
||||
func unmarshalDeposits(requestListInSSZBytes []byte) ([]*DepositRequest, error) {
|
||||
if len(requestListInSSZBytes) < drSize {
|
||||
return nil, errors.New("invalid deposit requests length, requests should be at least the size of 1 request")
|
||||
return nil, fmt.Errorf("invalid deposit requests length, requests should be at least the size of %d", drSize)
|
||||
}
|
||||
if uint64(len(requestListInSSZBytes)) > uint64(drSize)*params.BeaconConfig().MaxDepositRequestsPerPayload {
|
||||
return nil, fmt.Errorf("invalid deposit requests length, requests should not be more than the max per payload, got %d max %d", len(requestListInSSZBytes), drSize)
|
||||
@@ -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, fmt.Errorf("invalid withdrawal requests length, requests should be at least the size of %d", wrSize)
|
||||
}
|
||||
if uint64(len(requestListInSSZBytes)) > uint64(wrSize)*params.BeaconConfig().MaxWithdrawalRequestsPerPayload {
|
||||
return nil, fmt.Errorf("invalid withdrawal requests length, requests should not be more than the max per payload, got %d max %d", len(requestListInSSZBytes), wrSize)
|
||||
@@ -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, fmt.Errorf("invalid consolidation requests length, requests should be at least the size of %d", crSize)
|
||||
}
|
||||
if uint64(len(requestListInSSZBytes)) > uint64(crSize)*params.BeaconConfig().MaxConsolidationsRequestsPerPayload {
|
||||
return nil, fmt.Errorf("invalid consolidation requests length, requests should not be more than the max per payload, got %d max %d", len(requestListInSSZBytes), crSize)
|
||||
|
||||
8
proto/prysm/v1alpha1/attestation.pb.go
generated
8
proto/prysm/v1alpha1/attestation.pb.go
generated
@@ -400,8 +400,8 @@ type AggregateAttestationAndProofElectra struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
AggregatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=aggregator_index,json=aggregatorIndex,proto3" json:"aggregator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"`
|
||||
Aggregate *AttestationElectra `protobuf:"bytes,3,opt,name=aggregate,proto3" json:"aggregate,omitempty"`
|
||||
SelectionProof []byte `protobuf:"bytes,2,opt,name=selection_proof,json=selectionProof,proto3" json:"selection_proof,omitempty" ssz-size:"96"`
|
||||
Aggregate *AttestationElectra `protobuf:"bytes,2,opt,name=aggregate,proto3" json:"aggregate,omitempty"`
|
||||
SelectionProof []byte `protobuf:"bytes,3,opt,name=selection_proof,json=selectionProof,proto3" json:"selection_proof,omitempty" ssz-size:"96"`
|
||||
}
|
||||
|
||||
func (x *AggregateAttestationAndProofElectra) Reset() {
|
||||
@@ -821,12 +821,12 @@ var file_proto_prysm_v1alpha1_attestation_proto_rawDesc = []byte{
|
||||
0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67,
|
||||
0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x47, 0x0a, 0x09, 0x61, 0x67, 0x67,
|
||||
0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65,
|
||||
0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65,
|
||||
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c,
|
||||
0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
|
||||
0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
|
||||
0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18,
|
||||
0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18,
|
||||
0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72,
|
||||
0x6f, 0x6f, 0x66, 0x22, 0xbf, 0x02, 0x0a, 0x12, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x65, 0x0a, 0x10, 0x61, 0x67,
|
||||
|
||||
@@ -127,11 +127,10 @@ message AggregateAttestationAndProofElectra {
|
||||
"primitives.ValidatorIndex" ];
|
||||
|
||||
// The aggregated attestation that was submitted.
|
||||
AttestationElectra aggregate = 3;
|
||||
AttestationElectra aggregate = 2;
|
||||
|
||||
// 96 byte selection proof signed by the aggregator, which is the signature of
|
||||
// the slot to aggregate.
|
||||
bytes selection_proof = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
|
||||
// 96 byte selection proof signed by the aggregator, which is the signature of the slot to aggregate.
|
||||
bytes selection_proof = 3 [ (ethereum.eth.ext.ssz_size) = "96" ];
|
||||
}
|
||||
|
||||
message AttestationElectra {
|
||||
|
||||
@@ -604,7 +604,7 @@ message BeaconStateElectra {
|
||||
repeated HistoricalSummary historical_summaries = 11003
|
||||
[ (ethereum.eth.ext.ssz_max) = "16777216" ];
|
||||
|
||||
// Fields introduced in EIP-7251 fork [12001-13000]
|
||||
// Fields introduced in Electra fork [12001-13000]
|
||||
uint64 deposit_requests_start_index = 12001;
|
||||
uint64 deposit_balance_to_consume = 12002 [
|
||||
(ethereum.eth.ext.cast_type) =
|
||||
|
||||
@@ -466,7 +466,7 @@ message StreamBlocksResponse {
|
||||
// Representing a deneb block.
|
||||
SignedBeaconBlockDeneb deneb_block = 5;
|
||||
|
||||
// Representing a electra block.
|
||||
// Representing an electra block.
|
||||
SignedBeaconBlockElectra electra_block = 6;
|
||||
|
||||
// Representing a fulu block.
|
||||
|
||||
@@ -26,7 +26,7 @@ mainnet = {
|
||||
"max_blobs_per_block.size": "6",
|
||||
"max_blob_commitments.size": "4096",
|
||||
"kzg_commitment_inclusion_proof_depth.size": "17",
|
||||
"max_withdrawal_requests_per_payload.size":"16",
|
||||
"max_withdrawal_requests_per_payload.size": "16",
|
||||
"max_deposit_requests_per_payload.size": "8192",
|
||||
"max_attesting_indices.size": "131072",
|
||||
"max_committees_per_slot.size": "64",
|
||||
@@ -63,7 +63,7 @@ minimal = {
|
||||
"max_blobs_per_block.size": "6",
|
||||
"max_blob_commitments.size": "32",
|
||||
"kzg_commitment_inclusion_proof_depth.size": "10",
|
||||
"max_withdrawal_requests_per_payload.size":"2",
|
||||
"max_withdrawal_requests_per_payload.size": "2",
|
||||
"max_deposit_requests_per_payload.size": "4",
|
||||
"max_attesting_indices.size": "8192",
|
||||
"max_committees_per_slot.size": "4",
|
||||
|
||||
Reference in New Issue
Block a user