From fb9a4c5840c74a984204a35bb258e70d83f4ac61 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 15 Apr 2025 13:03:11 -0300 Subject: [PATCH 1/4] Added missing schemas to the match_schema macro --- native/ssz_nif/src/utils/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/native/ssz_nif/src/utils/mod.rs b/native/ssz_nif/src/utils/mod.rs index 3adaec86a..5e54bfa4c 100644 --- a/native/ssz_nif/src/utils/mod.rs +++ b/native/ssz_nif/src/utils/mod.rs @@ -53,6 +53,14 @@ macro_rules! schema_match { Epoch, BlobSidecar, BlobIdentifier, + PendingDeposit, + PendingPartialWithdrawal, + PendingConsolidation, + DepositRequest, + WithdrawalRequest, + ConsolidationRequest, + ExecutionRequests, + SingleAttestation, } ) }; From a3cc4bb42cadec2bd9e7e59efa77f04b1305744a Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 15 Apr 2025 16:37:09 -0300 Subject: [PATCH 2/4] Some minor fixes to types --- lib/types/beacon_chain/beacon_block_body.ex | 2 +- native/ssz_nif/src/ssz_types/config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/types/beacon_chain/beacon_block_body.ex b/lib/types/beacon_chain/beacon_block_body.ex index 92968e17c..332f9dab8 100644 --- a/lib/types/beacon_chain/beacon_block_body.ex +++ b/lib/types/beacon_chain/beacon_block_body.ex @@ -38,7 +38,7 @@ defmodule Types.BeaconBlockBody do # max MAX_DEPOSITS deposits: list(Types.Deposit.t()), # max MAX_VOLUNTARY_EXITS - voluntary_exits: list(Types.VoluntaryExit.t()), + voluntary_exits: list(Types.SignedVoluntaryExit.t()), sync_aggregate: Types.SyncAggregate.t(), execution_payload: Types.ExecutionPayload.t(), # max MAX_BLS_TO_EXECUTION_CHANGES diff --git a/native/ssz_nif/src/ssz_types/config.rs b/native/ssz_nif/src/ssz_types/config.rs index c1c4ffff7..aec3681d2 100644 --- a/native/ssz_nif/src/ssz_types/config.rs +++ b/native/ssz_nif/src/ssz_types/config.rs @@ -132,7 +132,7 @@ impl Config for Minimal { type MaxWithdrawalsPerPayload = U4; type FieldElementsPerBlob = U4096; type MaxBlobCommitmentsPerBlock = U16; - type KzgCommitmentInclusionProofDepth = U9; + type KzgCommitmentInclusionProofDepth = U10; type MaxCommitteesPerSlot = U4; // Electra added fields type MaxDepositRequestsPerPayload = U4; From e820129e90bdadd822ded1135db9d1e7e58c960a Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 15 Apr 2025 16:51:43 -0300 Subject: [PATCH 3/4] Fix some blob sidecar related configs and move others to the correct place --- config/networks/mainnet/config.yaml | 6 ++++-- config/networks/minimal/config.yaml | 6 ++++-- config/presets/minimal/deneb.yaml | 6 ++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/config/networks/mainnet/config.yaml b/config/networks/mainnet/config.yaml index 37c1b6828..4bc84c29a 100644 --- a/config/networks/mainnet/config.yaml +++ b/config/networks/mainnet/config.yaml @@ -135,12 +135,14 @@ ATTESTATION_SUBNET_PREFIX_BITS: 6 # Deneb # `2**7` (=128) MAX_REQUEST_BLOCKS_DENEB: 128 -# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK -MAX_REQUEST_BLOB_SIDECARS: 768 # `2**12` (= 4096 epochs, ~18 days) MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096 # `6` BLOB_SIDECAR_SUBNET_COUNT: 6 +## 6 blobs +MAX_BLOBS_PER_BLOCK: 6 +# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK (= 128 * 6) sidecars +MAX_REQUEST_BLOB_SIDECARS: 768 # Whisk # `Epoch(2**8)` diff --git a/config/networks/minimal/config.yaml b/config/networks/minimal/config.yaml index 0e08d07f2..291883bef 100644 --- a/config/networks/minimal/config.yaml +++ b/config/networks/minimal/config.yaml @@ -135,12 +135,14 @@ ATTESTATION_SUBNET_PREFIX_BITS: 6 # Deneb # `2**7` (=128) MAX_REQUEST_BLOCKS_DENEB: 128 -# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK -MAX_REQUEST_BLOB_SIDECARS: 768 # `2**12` (= 4096 epochs, ~18 days) MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096 # `6` BLOB_SIDECAR_SUBNET_COUNT: 6 +## 6 blobs +MAX_BLOBS_PER_BLOCK: 6 +# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK (= 128 * 6) sidecars +MAX_REQUEST_BLOB_SIDECARS: 768 # Whisk WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4 diff --git a/config/presets/minimal/deneb.yaml b/config/presets/minimal/deneb.yaml index bc4fe4369..38c4d7655 100644 --- a/config/presets/minimal/deneb.yaml +++ b/config/presets/minimal/deneb.yaml @@ -5,8 +5,6 @@ # `uint64(4096)` FIELD_ELEMENTS_PER_BLOB: 4096 # [customized] -MAX_BLOB_COMMITMENTS_PER_BLOCK: 16 -# `uint64(6)` -MAX_BLOBS_PER_BLOCK: 6 +MAX_BLOB_COMMITMENTS_PER_BLOCK: 32 # [customized] `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 4 = 9 -KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 9 +KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 10 From 2a50593cdb25a9d35d7de8dd40f1b762603d1916 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 15 Apr 2025 18:14:25 -0300 Subject: [PATCH 4/4] Fixed MaxBlobCommitmentsPerBlock value for minimal --- config/presets/minimal/deneb.yaml | 2 +- native/ssz_nif/src/ssz_types/config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/presets/minimal/deneb.yaml b/config/presets/minimal/deneb.yaml index 38c4d7655..8dde60e86 100644 --- a/config/presets/minimal/deneb.yaml +++ b/config/presets/minimal/deneb.yaml @@ -6,5 +6,5 @@ FIELD_ELEMENTS_PER_BLOB: 4096 # [customized] MAX_BLOB_COMMITMENTS_PER_BLOCK: 32 -# [customized] `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 4 = 9 +# [customized] floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK) (= 4 + 1 + 5 = 10) KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 10 diff --git a/native/ssz_nif/src/ssz_types/config.rs b/native/ssz_nif/src/ssz_types/config.rs index aec3681d2..e3f8728f6 100644 --- a/native/ssz_nif/src/ssz_types/config.rs +++ b/native/ssz_nif/src/ssz_types/config.rs @@ -131,7 +131,7 @@ impl Config for Minimal { type SyncCommitteeSize = U32; type MaxWithdrawalsPerPayload = U4; type FieldElementsPerBlob = U4096; - type MaxBlobCommitmentsPerBlock = U16; + type MaxBlobCommitmentsPerBlock = U32; type KzgCommitmentInclusionProofDepth = U10; type MaxCommitteesPerSlot = U4; // Electra added fields