diff --git a/packages/beacon-node/test/spec/general/ssz_generic_types.ts b/packages/beacon-node/test/spec/general/ssz_generic_types.ts index 76a1c5f8115b..886c18c3173d 100644 --- a/packages/beacon-node/test/spec/general/ssz_generic_types.ts +++ b/packages/beacon-node/test/spec/general/ssz_generic_types.ts @@ -8,6 +8,7 @@ import { ListBasicType, ListCompositeType, ProgressiveBitListType, + ProgressiveByteListType, ProgressiveContainerType, ProgressiveListBasicType, ProgressiveListCompositeType, @@ -85,7 +86,7 @@ const ComplexTestStruct = new ContainerType({ // C: ProgressiveList[SmallTestStruct] // D: ProgressiveList[ProgressiveList[VarTestStruct]] const ProgressiveTestStruct = new ContainerType({ - A: new ProgressiveListBasicType(byte), + A: new ProgressiveByteListType(), B: new ProgressiveListBasicType(uint64), C: new ProgressiveListCompositeType(SmallTestStruct), D: new ProgressiveListCompositeType(new ProgressiveListCompositeType(VarTestStruct)), diff --git a/packages/beacon-node/test/spec/presets/fast_confirmation.test.ts b/packages/beacon-node/test/spec/presets/fast_confirmation.test.ts index 8537f604e7b6..d0153c7c8173 100644 --- a/packages/beacon-node/test/spec/presets/fast_confirmation.test.ts +++ b/packages/beacon-node/test/spec/presets/fast_confirmation.test.ts @@ -578,7 +578,12 @@ const fastConfirmationTest = // and these tests are failing until we update our implementation. name.includes("voting_source_beyond_two_epoch") || name.includes("justified_update_always_if_better") || - name.includes("justified_update_not_realized_finality"), + name.includes("justified_update_not_realized_finality") || + // TODO: lodestar's fast-confirmation rule (FCR) needs a broader overhaul. These two + // is_one_confirmed cases (new in v1.7.0-alpha.12, present in electra + fulu) currently + // fail. Unskip once the FCR is reworked. + name.includes("is_one_confirmed_fails_large_validator_slashed") || + name.includes("is_one_confirmed_fails_recently_activated_validator_voting_in_empty_slot"), }, }; }; @@ -717,5 +722,13 @@ specTestIterator( { ...defaultSkipOpts, skippedRunners: [], + skippedTestSuites: [ + ...(defaultSkipOpts.skippedTestSuites ?? []), + // TODO-GLOAS: lodestar's fast-confirmation rule is block-root based and does not model the + // ePBS payload_status dimension required by specs/gloas/fast-confirmation.md (PTC payload + // presence/timeliness, get_node_for_root with PAYLOAD_STATUS_PENDING). Head/justified/ + // finalized/proposer-head all match; only getConfirmedRoot diverges. + /^gloas\/fast_confirmation\/.*/, + ], } ); diff --git a/packages/beacon-node/test/spec/utils/specTestIterator.ts b/packages/beacon-node/test/spec/utils/specTestIterator.ts index aa96c83ae8c8..ff8abaa6eec9 100644 --- a/packages/beacon-node/test/spec/utils/specTestIterator.ts +++ b/packages/beacon-node/test/spec/utils/specTestIterator.ts @@ -75,7 +75,7 @@ export const defaultSkipOpts: SkipOpts = { /^.+\/light_client\/data_collection\/.*/, // Ignore the partial data column container additions for now. Unskip them when // cell level DAS is ready - /^fulu\/ssz_static\/PartialDataColumn(Header|PartsMetadata|Sidecar)\/.*$/, + /^fulu\/ssz_static\/PartialDataColumn(GroupID|Header|PartsMetadata|Sidecar)\/.*$/, /^gloas\/ssz_static\/PartialDataColumn(GroupID|PartsMetadata|Sidecar)\/.*$/, // TODO-GLOAS: re-enable after Gloas light-client sync deserializes updates by fork digest. /^gloas\/light_client\/sync\/.*/, @@ -83,10 +83,29 @@ export const defaultSkipOpts: SkipOpts = { // New test suite added in v1.7.0-alpha.8 (consensus-specs #5206); gloas PTC fork choice // handling is not yet implemented in Lodestar. /^gloas\/fork_choice\/on_payload_attestation_message\/.*$/, + // TODO GLOAS: Unskip in #9606 + /^gloas\/operations\/builder_deposit_request\/.*$/, ], skippedTests: [ // TODO-GLOAS: re-enable after gloas light client is implemented /\/gloas_fork$/, + // TODO GLOAS: Unskip in #9606 + /^gloas\/operations\/builder_deposit_request\/.*$/, + /\/fork_builder_deposit_followed_by_non_builder_credentials$/, + /\/fork_builder_deposit_uses_deposit_slot_epoch$/, + /\/fork_builder_deposit_version$/, + /\/fork_invalid_builder_deposit_followed_by_valid_builder_deposit$/, + /\/fork_invalid_validator_deposit_followed_by_builder_credentials$/, + /\/fork_mixed_pending_deposits$/, + /\/fork_multiple_builder_deposits$/, + /\/fork_multiple_deposits_same_builder$/, + /\/fork_single_builder_deposit$/, + /\/fork_valid_builder_deposit_followed_by_invalid_builder_deposit$/, + /\/deposit_requests_greater_than_electra_max$/, + /\/process_parent_execution_payload__new_builder_does_not_reuse_topped_up_builder_slot$/, + /\/process_builder_exit_request__success$/, + /\/process_parent_execution_payload__builder_exit_request$/, + /\/switch_to_compounding_with_pending_consolidations_at_limit$/, ], // TODO GLOAS: Investigate why networking tests are failing since alpha.5 skippedRunners: ["networking"], diff --git a/packages/config/test/e2e/ensure-config-is-synced.test.ts b/packages/config/test/e2e/ensure-config-is-synced.test.ts index 946b4e7456eb..d874c98f9d04 100644 --- a/packages/config/test/e2e/ensure-config-is-synced.test.ts +++ b/packages/config/test/e2e/ensure-config-is-synced.test.ts @@ -57,6 +57,9 @@ const ignoredRemoteConfigFields: (keyof ChainConfig)[] = [ // These are preset values, not config values - they're tested separately "PRESET_BASE", "CONFIG_NAME", + // TODO GLOAS: Unskip in #9606 + "PAYLOAD_DUE_BPS" as keyof ChainConfig, + "MIN_BUILDER_WITHDRAWABILITY_DELAY" as keyof ChainConfig, ]; /** diff --git a/packages/params/test/e2e/ensure-config-is-synced.test.ts b/packages/params/test/e2e/ensure-config-is-synced.test.ts index b1bab52a76f8..f6f8784cffef 100644 --- a/packages/params/test/e2e/ensure-config-is-synced.test.ts +++ b/packages/params/test/e2e/ensure-config-is-synced.test.ts @@ -11,7 +11,16 @@ import {loadConfigYaml} from "../yaml.js"; * Fields that we filter from local config when doing comparison. * Ideally this should be empty as it is not spec compliant */ -const ignoredLocalPresetFields: (keyof BeaconPreset)[] = []; +// TODO GLOAS: Remove in #9606 +const ignoredLocalPresetFields: (keyof BeaconPreset)[] = [ + "BUILDER_REGISTRY_LIMIT", + "BUILDER_PENDING_WITHDRAWALS_LIMIT", + "MAX_SIGNED_BEACON_BLOCK_SIZE", + "MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD", +]; + +// TODO GLOAS: Remove in #9606 +const ignoredRemotePresetFields: string[] = ["MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD"]; describe("Ensure config is synced", () => { vi.setConfig({testTimeout: 60 * 1000}); @@ -38,15 +47,25 @@ function assertCorrectPreset(localPreset: BeaconPreset, remotePreset: BeaconPres {} as Partial ); + const filteredRemotePreset: Partial = Object.keys(remotePreset) + .filter((key) => !ignoredRemotePresetFields.includes(key)) + .reduce( + (acc, key) => { + acc[key as keyof BeaconPreset] = remotePreset[key as keyof BeaconPreset]; + return acc; + }, + {} as Partial + ); + // Check each key for better debuggability - for (const key of Object.keys(remotePreset) as (keyof BeaconPreset)[]) { + for (const key of Object.keys(filteredRemotePreset) as (keyof BeaconPreset)[]) { const localValue = filteredLocalPreset[key]; - const remoteValue = remotePreset[key]; + const remoteValue = filteredRemotePreset[key]; expect(localValue).toBeWithMessage(remoteValue, `${key} does not match ${localValue} != ${remoteValue}`); } - expect(filteredLocalPreset).toEqual(remotePreset); + expect(filteredLocalPreset).toEqual(filteredRemotePreset); } async function downloadRemoteConfig(preset: "mainnet" | "minimal", commit: string): Promise { diff --git a/spec-tests-version.json b/spec-tests-version.json index 8a46f885ec4f..96a969e1f642 100644 --- a/spec-tests-version.json +++ b/spec-tests-version.json @@ -1,6 +1,6 @@ { "ethereumConsensusSpecsTests": { - "specVersion": "v1.7.0-alpha.11", + "specVersion": "v1.7.0-alpha.12", "specTestsRepoUrl": "https://github.com/ethereum/consensus-specs", "outputDirBase": "spec-tests", "testsToDownload": [ diff --git a/specrefs/.ethspecify.yml b/specrefs/.ethspecify.yml index d401b729c095..18508bd952b3 100644 --- a/specrefs/.ethspecify.yml +++ b/specrefs/.ethspecify.yml @@ -1,4 +1,4 @@ -version: v1.7.0-alpha.11 +version: v1.7.0-alpha.12 style: full specrefs: @@ -68,6 +68,7 @@ exceptions: - PartialDataColumnSidecar#gloas # fulu (not implemented yet) + - PartialDataColumnGroupID#fulu - PartialDataColumnHeader#fulu - PartialDataColumnPartsMetadata#fulu - PartialDataColumnSidecar#fulu @@ -128,6 +129,8 @@ exceptions: presets: # heze (not implemented) - INCLUSION_LIST_COMMITTEE_SIZE#heze + - MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE_HEZE#heze + - MAX_SIGNED_INCLUSION_LIST_SIZE#heze functions: # phase0 @@ -152,7 +155,6 @@ exceptions: - get_base_reward#phase0 - get_checkpoint_block#phase0 - get_current_store_epoch#phase0 - - get_dependent_root#phase0 - get_eligible_validator_indices#phase0 - get_eth1_vote#phase0 - get_filtered_block_tree#phase0 @@ -346,7 +348,6 @@ exceptions: - get_builder_withdrawals#gloas - get_builders_sweep_withdrawals#gloas - get_checkpoint_block#gloas - - get_dependent_root#gloas - get_execution_payload_bid_signature#gloas - get_execution_payload_envelope_signature#gloas - get_forkchoice_store#gloas @@ -360,7 +361,6 @@ exceptions: - get_payload_attestation_message_signature#gloas - get_payload_status_tiebreaker#gloas - get_pending_balance_to_withdraw#gloas - - get_proposer_preferences_signature#gloas - get_ptc_assignment#gloas - get_safe_execution_block_hash#gloas - get_supported_node#gloas @@ -398,7 +398,6 @@ exceptions: - update_proposer_boost_root#gloas - validate_merge_block#gloas - validate_on_attestation#gloas - - get_proposer_dependent_root#gloas # gloas (new in alpha.3, not yet implemented) - compute_weak_subjectivity_period#gloas @@ -412,6 +411,16 @@ exceptions: - upgrade_lc_store_to_gloas#gloas - upgrade_lc_update_to_gloas#gloas + # gloas (slot-based gindex helpers; lodestar uses fork-based currentSyncCommitteeGindexAtFork) + - current_sync_committee_gindex_at_slot#gloas + - finalized_root_gindex_at_slot#gloas + - next_sync_committee_gindex_at_slot#gloas + + # gloas (attestation upgrade helpers; lodestar ssz types are structurally cross-fork compatible) + - upgrade_attestation_to_gloas#gloas + - upgrade_attester_slashing_to_gloas#gloas + - upgrade_indexed_attestation_to_gloas#gloas + # computed helpers replacing config vars (added in alpha.3) # the following are hardcoded in config files rather than computed at runtime - compute_max_request_blob_sidecars#deneb @@ -422,12 +431,14 @@ exceptions: # heze (not implemented) - compute_fork_version#heze - get_forkchoice_store#heze + - get_inclusion_list_bits#heze - get_inclusion_list_committee#heze - get_inclusion_list_committee_assignment#heze - get_inclusion_list_due_ms#heze - get_inclusion_list_signature#heze - get_inclusion_list_store#heze - get_inclusion_list_transactions#heze + - is_inclusion_list_bits_inclusive#heze - is_payload_inclusion_list_satisfied#heze - is_valid_inclusion_list_signature#heze - on_inclusion_list#heze diff --git a/specrefs/configs.yml b/specrefs/configs.yml index 96f2858ebcc2..47fdb0f91e7d 100644 --- a/specrefs/configs.yml +++ b/specrefs/configs.yml @@ -220,8 +220,8 @@ search: '^\s+CUSTODY_REQUIREMENT:' regex: true spec: | - - CUSTODY_REQUIREMENT = 4 + + CUSTODY_REQUIREMENT: uint64 = 4 - name: DATA_COLUMN_SIDECAR_SUBNET_COUNT#fulu @@ -229,8 +229,8 @@ - file: packages/config/src/chainConfig/configs/mainnet.ts search: "DATA_COLUMN_SIDECAR_SUBNET_COUNT:" spec: | - - DATA_COLUMN_SIDECAR_SUBNET_COUNT = 128 + + DATA_COLUMN_SIDECAR_SUBNET_COUNT: uint64 = 128 - name: DENEB_FORK_EPOCH#deneb @@ -516,8 +516,8 @@ - file: packages/config/src/chainConfig/configs/mainnet.ts search: "MIN_BUILDER_WITHDRAWABILITY_DELAY:" spec: | - - MIN_BUILDER_WITHDRAWABILITY_DELAY: uint64 = 8192 + + MIN_BUILDER_WITHDRAWABILITY_DELAY: uint64 = 64 - name: MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS#deneb @@ -534,8 +534,8 @@ - file: packages/config/src/chainConfig/configs/mainnet.ts search: "MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:" spec: | - - MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS = 4096 + + MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: uint64 = 4096 - name: MIN_GENESIS_ACTIVE_VALIDATOR_COUNT#phase0 @@ -588,8 +588,8 @@ - file: packages/config/src/chainConfig/configs/mainnet.ts search: "NUMBER_OF_CUSTODY_GROUPS:" spec: | - - NUMBER_OF_CUSTODY_GROUPS = 128 + + NUMBER_OF_CUSTODY_GROUPS: uint64 = 128 - name: PAYLOAD_ATTESTATION_DUE_BPS#gloas @@ -606,8 +606,8 @@ - file: packages/config/src/chainConfig/configs/mainnet.ts search: "PAYLOAD_DUE_BPS:" spec: | - - PAYLOAD_DUE_BPS: uint64 = 7500 + + PAYLOAD_DUE_BPS: uint64 = 5000 - name: PROPOSER_REORG_CUTOFF_BPS#phase0 @@ -660,8 +660,8 @@ - file: packages/config/src/chainConfig/configs/mainnet.ts search: "SAMPLES_PER_SLOT:" spec: | - - SAMPLES_PER_SLOT = 8 + + SAMPLES_PER_SLOT: uint64 = 8 - name: SECONDS_PER_ETH1_BLOCK#phase0 diff --git a/specrefs/constants.yml b/specrefs/constants.yml index 7eb9dab55a00..90eb03fa256a 100644 --- a/specrefs/constants.yml +++ b/specrefs/constants.yml @@ -98,8 +98,8 @@ - file: packages/params/src/index.ts search: export const BUILDER_WITHDRAWAL_PREFIX = spec: | - - BUILDER_WITHDRAWAL_PREFIX: Bytes1 = '0x03' + + BUILDER_WITHDRAWAL_PREFIX: Bytes1 = '0xB0' - name: BYTES_PER_COMMITMENT#deneb @@ -427,8 +427,8 @@ - name: KZG_SETUP_G2_LENGTH#deneb sources: [] spec: | - - KZG_SETUP_G2_LENGTH = 65 + + KZG_SETUP_G2_LENGTH: uint64 = 65 - name: KZG_SETUP_G2_MONOMIAL#deneb @@ -590,8 +590,8 @@ - file: packages/params/src/index.ts search: export const SYNC_COMMITTEE_SUBNET_COUNT = spec: | - - SYNC_COMMITTEE_SUBNET_COUNT = 4 + + SYNC_COMMITTEE_SUBNET_COUNT: uint64 = 2**2 - name: SYNC_REWARD_WEIGHT#altair @@ -617,8 +617,8 @@ - file: packages/params/src/index.ts search: export const TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE = spec: | - - TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE = 2**4 + + TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE: uint64 = 2**4 - name: TIMELY_HEAD_FLAG_INDEX#altair diff --git a/specrefs/containers.yml b/specrefs/containers.yml index 6461b202a5e1..1571d300cca0 100644 --- a/specrefs/containers.yml +++ b/specrefs/containers.yml @@ -40,16 +40,29 @@ - file: packages/types/src/electra/sszTypes.ts search: export const Attestation = spec: | - + class Attestation(Container): # [Modified in Electra:EIP7549] - aggregation_bits: Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT] + aggregation_bits: AggregationBits data: AttestationData signature: BLSSignature # [New in Electra:EIP7549] committee_bits: Bitvector[MAX_COMMITTEES_PER_SLOT] +- name: Attestation#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const Attestation = + spec: | + + class Attestation(ProgressiveContainer(active_fields=[1] * 4)): # type: ignore + aggregation_bits: AggregationBits + data: AttestationData + signature: BLSSignature + committee_bits: Bitvector[MAX_COMMITTEES_PER_SLOT] + + - name: AttestationData#phase0 sources: - file: packages/types/src/phase0/sszTypes.ts @@ -244,20 +257,26 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const BeaconBlockBody = spec: | - - class BeaconBlockBody(Container): + + class BeaconBlockBody(ProgressiveContainer(active_fields=[1] * 13)): # type: ignore randao_reveal: BLSSignature eth1_data: Eth1Data graffiti: Bytes32 - proposer_slashings: List[ProposerSlashing, MAX_PROPOSER_SLASHINGS] - attester_slashings: List[AttesterSlashing, MAX_ATTESTER_SLASHINGS_ELECTRA] - attestations: List[Attestation, MAX_ATTESTATIONS_ELECTRA] - deposits: List[Deposit, MAX_DEPOSITS] - voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS] + # [Modified in Gloas:EIP7688] + proposer_slashings: ProgressiveList[ProposerSlashing] + # [Modified in Gloas:EIP7688] + attester_slashings: ProgressiveList[AttesterSlashing] + # [Modified in Gloas:EIP7688] + attestations: ProgressiveList[Attestation] + # [Modified in Gloas:EIP7688] + deposits: ProgressiveList[Deposit] + # [Modified in Gloas:EIP7688] + voluntary_exits: ProgressiveList[SignedVoluntaryExit] sync_aggregate: SyncAggregate # [Modified in Gloas:EIP7732] # Removed `execution_payload` - bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES] + # [Modified in Gloas:EIP7688] + bls_to_execution_changes: ProgressiveList[SignedBLSToExecutionChange] # [Modified in Gloas:EIP7732] # Removed `blob_kzg_commitments` # [Modified in Gloas:EIP7732] @@ -265,7 +284,7 @@ # [New in Gloas:EIP7732] signed_execution_payload_bid: SignedExecutionPayloadBid # [New in Gloas:EIP7732] - payload_attestations: List[PayloadAttestation, MAX_PAYLOAD_ATTESTATIONS] + payload_attestations: ProgressiveList[PayloadAttestation] # [New in Gloas:EIP7732] parent_execution_requests: ExecutionRequests @@ -574,8 +593,8 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const BeaconState = spec: | - - class BeaconState(Container): + + class BeaconState(ProgressiveContainer(active_fields=[1] * 46)): # type: ignore genesis_time: uint64 genesis_validators_root: Root slot: Slot @@ -587,17 +606,22 @@ eth1_data: Eth1Data eth1_data_votes: List[Eth1Data, EPOCHS_PER_ETH1_VOTING_PERIOD * SLOTS_PER_EPOCH] eth1_deposit_index: uint64 - validators: List[Validator, VALIDATOR_REGISTRY_LIMIT] - balances: List[Gwei, VALIDATOR_REGISTRY_LIMIT] + # [Modified in Gloas:EIP7688] + validators: ProgressiveList[Validator] + # [Modified in Gloas:EIP7688] + balances: ProgressiveList[Gwei] randao_mixes: Vector[Bytes32, EPOCHS_PER_HISTORICAL_VECTOR] slashings: Vector[Gwei, EPOCHS_PER_SLASHINGS_VECTOR] - previous_epoch_participation: List[ParticipationFlags, VALIDATOR_REGISTRY_LIMIT] - current_epoch_participation: List[ParticipationFlags, VALIDATOR_REGISTRY_LIMIT] + # [Modified in Gloas:EIP7688] + previous_epoch_participation: ProgressiveList[ParticipationFlags] + # [Modified in Gloas:EIP7688] + current_epoch_participation: ProgressiveList[ParticipationFlags] justification_bits: Bitvector[JUSTIFICATION_BITS_LENGTH] previous_justified_checkpoint: Checkpoint current_justified_checkpoint: Checkpoint finalized_checkpoint: Checkpoint - inactivity_scores: List[uint64, VALIDATOR_REGISTRY_LIMIT] + # [Modified in Gloas:EIP7688] + inactivity_scores: ProgressiveList[uint64] current_sync_committee: SyncCommittee next_sync_committee: SyncCommittee # [Modified in Gloas:EIP7732] @@ -613,12 +637,15 @@ earliest_exit_epoch: Epoch consolidation_balance_to_consume: Gwei earliest_consolidation_epoch: Epoch - pending_deposits: List[PendingDeposit, PENDING_DEPOSITS_LIMIT] - pending_partial_withdrawals: List[PendingPartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] - pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT] + # [Modified in Gloas:EIP7688] + pending_deposits: ProgressiveList[PendingDeposit] + # [Modified in Gloas:EIP7688] + pending_partial_withdrawals: ProgressiveList[PendingPartialWithdrawal] + # [Modified in Gloas:EIP7688] + pending_consolidations: ProgressiveList[PendingConsolidation] proposer_lookahead: Vector[ValidatorIndex, (MIN_SEED_LOOKAHEAD + 1) * SLOTS_PER_EPOCH] # [New in Gloas:EIP7732] - builders: List[Builder, BUILDER_REGISTRY_LIMIT] + builders: ProgressiveList[Builder] # [New in Gloas:EIP7732] next_withdrawal_builder_index: BuilderIndex # [New in Gloas:EIP7732] @@ -626,11 +653,11 @@ # [New in Gloas:EIP7732] builder_pending_payments: Vector[BuilderPendingPayment, 2 * SLOTS_PER_EPOCH] # [New in Gloas:EIP7732] - builder_pending_withdrawals: List[BuilderPendingWithdrawal, BUILDER_PENDING_WITHDRAWALS_LIMIT] + builder_pending_withdrawals: ProgressiveList[BuilderPendingWithdrawal] # [New in Gloas:EIP7732] latest_execution_payload_bid: ExecutionPayloadBid # [New in Gloas:EIP7732] - payload_expected_withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] + payload_expected_withdrawals: ProgressiveList[Withdrawal] # [New in Gloas:EIP7732] ptc_window: Vector[Vector[ValidatorIndex, PTC_SIZE], (2 + MIN_SEED_LOOKAHEAD) * SLOTS_PER_EPOCH] @@ -638,8 +665,8 @@ - name: BeaconState#heze sources: [] spec: | - - class BeaconState(Container): + + class BeaconState(ProgressiveContainer(active_fields=[1] * 46)): # type: ignore genesis_time: uint64 genesis_validators_root: Root slot: Slot @@ -651,22 +678,19 @@ eth1_data: Eth1Data eth1_data_votes: List[Eth1Data, EPOCHS_PER_ETH1_VOTING_PERIOD * SLOTS_PER_EPOCH] eth1_deposit_index: uint64 - validators: List[Validator, VALIDATOR_REGISTRY_LIMIT] - balances: List[Gwei, VALIDATOR_REGISTRY_LIMIT] + validators: ProgressiveList[Validator] + balances: ProgressiveList[Gwei] randao_mixes: Vector[Bytes32, EPOCHS_PER_HISTORICAL_VECTOR] slashings: Vector[Gwei, EPOCHS_PER_SLASHINGS_VECTOR] - previous_epoch_participation: List[ParticipationFlags, VALIDATOR_REGISTRY_LIMIT] - current_epoch_participation: List[ParticipationFlags, VALIDATOR_REGISTRY_LIMIT] + previous_epoch_participation: ProgressiveList[ParticipationFlags] + current_epoch_participation: ProgressiveList[ParticipationFlags] justification_bits: Bitvector[JUSTIFICATION_BITS_LENGTH] previous_justified_checkpoint: Checkpoint current_justified_checkpoint: Checkpoint finalized_checkpoint: Checkpoint - inactivity_scores: List[uint64, VALIDATOR_REGISTRY_LIMIT] + inactivity_scores: ProgressiveList[uint64] current_sync_committee: SyncCommittee next_sync_committee: SyncCommittee - # [Modified in Gloas:EIP7732] - # Removed `latest_execution_payload_header` - # [New in Gloas:EIP7732] latest_block_hash: Hash32 next_withdrawal_index: WithdrawalIndex next_withdrawal_validator_index: ValidatorIndex @@ -677,25 +701,18 @@ earliest_exit_epoch: Epoch consolidation_balance_to_consume: Gwei earliest_consolidation_epoch: Epoch - pending_deposits: List[PendingDeposit, PENDING_DEPOSITS_LIMIT] - pending_partial_withdrawals: List[PendingPartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] - pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT] + pending_deposits: ProgressiveList[PendingDeposit] + pending_partial_withdrawals: ProgressiveList[PendingPartialWithdrawal] + pending_consolidations: ProgressiveList[PendingConsolidation] proposer_lookahead: Vector[ValidatorIndex, (MIN_SEED_LOOKAHEAD + 1) * SLOTS_PER_EPOCH] - # [New in Gloas:EIP7732] - builders: List[Builder, BUILDER_REGISTRY_LIMIT] - # [New in Gloas:EIP7732] + builders: ProgressiveList[Builder] next_withdrawal_builder_index: BuilderIndex - # [New in Gloas:EIP7732] execution_payload_availability: Bitvector[SLOTS_PER_HISTORICAL_ROOT] - # [New in Gloas:EIP7732] builder_pending_payments: Vector[BuilderPendingPayment, 2 * SLOTS_PER_EPOCH] - # [New in Gloas:EIP7732] - builder_pending_withdrawals: List[BuilderPendingWithdrawal, BUILDER_PENDING_WITHDRAWALS_LIMIT] - # [New in Gloas:EIP7732] + builder_pending_withdrawals: ProgressiveList[BuilderPendingWithdrawal] + # [Modified in Heze:EIP7805] latest_execution_payload_bid: ExecutionPayloadBid - # [New in Gloas:EIP7732] - payload_expected_withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] - # [New in Gloas:EIP7732] + payload_expected_withdrawals: ProgressiveList[Withdrawal] ptc_window: Vector[Vector[ValidatorIndex, PTC_SIZE], (2 + MIN_SEED_LOOKAHEAD) * SLOTS_PER_EPOCH] @@ -843,13 +860,15 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const DataColumnSidecar = spec: | - + class DataColumnSidecar(Container): index: ColumnIndex - column: List[Cell, MAX_BLOB_COMMITMENTS_PER_BLOCK] + # [Modified in Gloas:EIP7688] + column: ProgressiveList[Cell] # [Modified in Gloas:EIP7732] # Removed `kzg_commitments` - kzg_proofs: List[KZGProof, MAX_BLOB_COMMITMENTS_PER_BLOCK] + # [Modified in Gloas:EIP7688] + kzg_proofs: ProgressiveList[KZGProof] # [Modified in Gloas:EIP7732] # Removed `signed_block_header` # [Modified in Gloas:EIP7732] @@ -1026,8 +1045,8 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const ExecutionPayload = spec: | - - class ExecutionPayload(Container): + + class ExecutionPayload(ProgressiveContainer(active_fields=[1] * 19)): # type: ignore parent_hash: Hash32 fee_recipient: ExecutionAddress state_root: Bytes32 @@ -1041,8 +1060,10 @@ extra_data: ByteList[MAX_EXTRA_DATA_BYTES] base_fee_per_gas: uint256 block_hash: Hash32 - transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] - withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] + # [Modified in Gloas:EIP7688] + transactions: ProgressiveList[Transaction] + # [Modified in Gloas:EIP7688] + withdrawals: ProgressiveList[Withdrawal] blob_gas_used: uint64 excess_blob_gas: uint64 # [New in Gloas:EIP7928] @@ -1056,8 +1077,8 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const ExecutionPayloadBid = spec: | - - class ExecutionPayloadBid(Container): + + class ExecutionPayloadBid(ProgressiveContainer(active_fields=[1] * 12)): # type: ignore parent_block_hash: Hash32 parent_block_root: Root block_hash: Hash32 @@ -1068,15 +1089,15 @@ slot: Slot value: Gwei execution_payment: Gwei - blob_kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK] + blob_kzg_commitments: ProgressiveList[KZGCommitment] execution_requests_root: Root - name: ExecutionPayloadBid#heze sources: [] spec: | - - class ExecutionPayloadBid(Container): + + class ExecutionPayloadBid(ProgressiveContainer(active_fields=[1] * 13)): # type: ignore parent_block_hash: Hash32 parent_block_root: Root block_hash: Hash32 @@ -1087,8 +1108,10 @@ slot: Slot value: Gwei execution_payment: Gwei - blob_kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK] + blob_kzg_commitments: ProgressiveList[KZGCommitment] execution_requests_root: Root + # [New in Heze:EIP7805] + inclusion_list_bits: Bitvector[INCLUSION_LIST_COMMITTEE_SIZE] - name: ExecutionPayloadEnvelope#gloas @@ -1096,8 +1119,8 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const ExecutionPayloadEnvelope = spec: | - - class ExecutionPayloadEnvelope(Container): + + class ExecutionPayloadEnvelope(ProgressiveContainer(active_fields=[1] * 5)): # type: ignore payload: ExecutionPayload execution_requests: ExecutionRequests builder_index: BuilderIndex @@ -1186,14 +1209,14 @@ - file: packages/types/src/electra/sszTypes.ts search: export const ExecutionRequests = spec: | - + class ExecutionRequests(Container): # [New in Electra:EIP6110] - deposits: List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD] + deposits: DepositRequests # [New in Electra:EIP7002:EIP7251] - withdrawals: List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD] + withdrawals: WithdrawalRequests # [New in Electra:EIP7251] - consolidations: List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD] + consolidations: ConsolidationRequests - name: ExecutionRequests#gloas @@ -1201,15 +1224,15 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const ExecutionRequests = spec: | - - class ExecutionRequests(Container): - deposits: List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD] - withdrawals: List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD] - consolidations: List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD] + + class ExecutionRequests(ProgressiveContainer(active_fields=[1] * 5)): # type: ignore + deposits: DepositRequests + withdrawals: WithdrawalRequests + consolidations: ConsolidationRequests # [New in Gloas:EIP8282] - builder_deposits: List[BuilderDepositRequest, MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD] + builder_deposits: BuilderDepositRequests # [New in Gloas:EIP8282] - builder_exits: List[BuilderExitRequest, MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD] + builder_exits: BuilderExitRequests - name: Fork#phase0 @@ -1260,12 +1283,12 @@ - name: InclusionList#heze sources: [] spec: | - + class InclusionList(Container): slot: Slot validator_index: ValidatorIndex inclusion_list_committee_root: Root - transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] + transactions: ProgressiveList[Transaction] - name: IndexedAttestation#phase0 @@ -1285,10 +1308,22 @@ - file: packages/types/src/electra/sszTypes.ts search: export const IndexedAttestation = spec: | - + class IndexedAttestation(Container): # [Modified in Electra:EIP7549] - attesting_indices: List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT] + attesting_indices: AttestingIndices + data: AttestationData + signature: BLSSignature + + +- name: IndexedAttestation#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const IndexedAttestation = + spec: | + + class IndexedAttestation(ProgressiveContainer(active_fields=[1] * 3)): # type: ignore + attesting_indices: AttestingIndices data: AttestationData signature: BLSSignature @@ -1298,8 +1333,8 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const IndexedPayloadAttestation = spec: | - - class IndexedPayloadAttestation(Container): + + class IndexedPayloadAttestation(ProgressiveContainer(active_fields=[1] * 3)): # type: ignore attesting_indices: List[ValidatorIndex, PTC_SIZE] data: PayloadAttestationData signature: BLSSignature @@ -1484,23 +1519,32 @@ row_index: RowIndex +- name: PartialDataColumnGroupID#fulu + sources: [] + spec: | + + class PartialDataColumnGroupID(Container): + beacon_block_root: Root + + - name: PartialDataColumnGroupID#gloas sources: [] spec: | - + class PartialDataColumnGroupID(Container): - slot: Slot beacon_block_root: Root + # [New in Gloas:EIP7732] + slot: Slot - name: PartialDataColumnSidecar#gloas sources: [] spec: | - + class PartialDataColumnSidecar(Container): - cells_present_bitmap: Bitlist[MAX_BLOB_COMMITMENTS_PER_BLOCK] - partial_column: List[Cell, MAX_BLOB_COMMITMENTS_PER_BLOCK] - kzg_proofs: List[KZGProof, MAX_BLOB_COMMITMENTS_PER_BLOCK] + cells_present_bitmap: ProgressiveBitlist + partial_column: ProgressiveList[Cell] + kzg_proofs: ProgressiveList[KZGProof] - name: PayloadAttestation#gloas @@ -1508,8 +1552,8 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const PayloadAttestation = spec: | - - class PayloadAttestation(Container): + + class PayloadAttestation(ProgressiveContainer(active_fields=[1] * 3)): # type: ignore aggregation_bits: Bitvector[PTC_SIZE] data: PayloadAttestationData signature: BLSSignature @@ -1708,8 +1752,9 @@ - name: SignedExecutionPayloadBid#heze sources: [] spec: | - + class SignedExecutionPayloadBid(Container): + # [Modified in Heze:EIP7805] message: ExecutionPayloadBid signature: BLSSignature diff --git a/specrefs/functions.yml b/specrefs/functions.yml index 54bfc184ec35..6c2706d9d391 100644 --- a/specrefs/functions.yml +++ b/specrefs/functions.yml @@ -195,7 +195,7 @@ - file: packages/state-transition/src/block/processParentExecutionPayload.ts search: export function applyParentExecutionPayload( spec: | - + def apply_parent_execution_payload( state: BeaconState, requests: ExecutionRequests, @@ -204,6 +204,11 @@ parent_slot = parent_bid.slot parent_epoch = compute_epoch_at_slot(parent_slot) + assert len(requests.withdrawals) <= MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD + assert len(requests.consolidations) <= MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD + assert len(requests.builder_deposits) <= MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD + assert len(requests.builder_exits) <= MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD + # Process execution requests from parent's payload. The execution # requests are processed at state.slot (child's slot), not the parent's slot. def for_ops(operations: Sequence[Any], fn: Callable[[BeaconState, Any], None]) -> None: @@ -213,9 +218,7 @@ for_ops(requests.deposits, process_deposit_request) for_ops(requests.withdrawals, process_withdrawal_request) for_ops(requests.consolidations, process_consolidation_request) - # [New in Gloas:EIP8282] for_ops(requests.builder_deposits, process_builder_deposit_request) - # [New in Gloas:EIP8282] for_ops(requests.builder_exits, process_builder_exit_request) # Settle the builder payment @@ -1212,14 +1215,14 @@ - name: compute_on_chain_aggregate#electra sources: [] spec: | - + def compute_on_chain_aggregate(network_aggregates: Sequence[Attestation]) -> Attestation: aggregates = sorted( network_aggregates, key=lambda a: get_committee_indices(a.committee_bits)[0] ) data = aggregates[0].data - aggregation_bits = Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]() + aggregation_bits = AggregationBits() for a in aggregates: for b in a.aggregation_bits: aggregation_bits.append(b) @@ -1885,6 +1888,21 @@ return CURRENT_SYNC_COMMITTEE_GINDEX +- name: current_sync_committee_gindex_at_slot#gloas + sources: [] + spec: | + + def current_sync_committee_gindex_at_slot(slot: Slot) -> GeneralizedIndex: + epoch = compute_epoch_at_slot(slot) + + # [Modified in Gloas:EIP7688] + if epoch >= GLOAS_FORK_EPOCH: + return CURRENT_SYNC_COMMITTEE_GINDEX_GLOAS + if epoch >= ELECTRA_FORK_EPOCH: + return CURRENT_SYNC_COMMITTEE_GINDEX_ELECTRA + return CURRENT_SYNC_COMMITTEE_GINDEX + + - name: decrease_balance#phase0 sources: - file: packages/state-transition/src/util/balance.ts @@ -2056,6 +2074,21 @@ return FINALIZED_ROOT_GINDEX +- name: finalized_root_gindex_at_slot#gloas + sources: [] + spec: | + + def finalized_root_gindex_at_slot(slot: Slot) -> GeneralizedIndex: + epoch = compute_epoch_at_slot(slot) + + # [Modified in Gloas:EIP7688] + if epoch >= GLOAS_FORK_EPOCH: + return FINALIZED_ROOT_GINDEX_GLOAS + if epoch >= ELECTRA_FORK_EPOCH: + return FINALIZED_ROOT_GINDEX_ELECTRA + return FINALIZED_ROOT_GINDEX + + - name: find_latest_confirmed_descendant#phase0 sources: [] spec: | @@ -3556,40 +3589,6 @@ ) -- name: get_dependent_root#phase0 - sources: [] - spec: | - - def get_dependent_root(store: Store, root: Root) -> Root: - epoch = get_current_store_epoch(store) - if epoch <= MIN_SEED_LOOKAHEAD: - # Genesis block parent - return Root() - - node = ForkChoiceNode(root=root) - dependent_slot = Slot(compute_start_slot_at_epoch(epoch - MIN_SEED_LOOKAHEAD) - 1) - return get_ancestor(store, node, dependent_slot).root - - -- name: get_dependent_root#gloas - sources: [] - spec: | - - def get_dependent_root(store: Store, root: Root) -> Root: - epoch = get_current_store_epoch(store) - if epoch <= MIN_SEED_LOOKAHEAD: - # Genesis block parent - return Root() - - # [Modified in Gloas:EIP7732] - node = ForkChoiceNode( - root=root, - payload_status=PAYLOAD_STATUS_PENDING, - ) - dependent_slot = Slot(compute_start_slot_at_epoch(epoch - MIN_SEED_LOOKAHEAD) - 1) - return get_ancestor(store, node, dependent_slot).root - - - name: get_domain#phase0 sources: - file: packages/config/src/genesisConfig/index.ts @@ -3803,7 +3802,7 @@ - file: packages/beacon-node/src/execution/engine/types.ts search: export function deserializeExecutionRequests( spec: | - + def get_execution_requests(execution_requests_list: Sequence[bytes]) -> ExecutionRequests: deposits = [] withdrawals = [] @@ -3829,17 +3828,11 @@ prev_request_type = request_type if request_type == DEPOSIT_REQUEST_TYPE: - deposits = ssz_deserialize( - List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD], request_data - ) + deposits = ssz_deserialize(DepositRequests, request_data) elif request_type == WITHDRAWAL_REQUEST_TYPE: - withdrawals = ssz_deserialize( - List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD], request_data - ) + withdrawals = ssz_deserialize(WithdrawalRequests, request_data) elif request_type == CONSOLIDATION_REQUEST_TYPE: - consolidations = ssz_deserialize( - List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD], request_data - ) + consolidations = ssz_deserialize(ConsolidationRequests, request_data) return ExecutionRequests( deposits=deposits, @@ -3853,7 +3846,7 @@ - file: packages/beacon-node/src/execution/engine/types.ts search: export function deserializeExecutionRequests( spec: | - + def get_execution_requests(execution_requests_list: Sequence[bytes]) -> ExecutionRequests: deposits = [] withdrawals = [] @@ -3887,28 +3880,17 @@ prev_request_type = request_type if request_type == DEPOSIT_REQUEST_TYPE: - deposits = ssz_deserialize( - List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD], request_data - ) + deposits = ssz_deserialize(DepositRequests, request_data) elif request_type == WITHDRAWAL_REQUEST_TYPE: - withdrawals = ssz_deserialize( - List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD], request_data - ) + withdrawals = ssz_deserialize(WithdrawalRequests, request_data) elif request_type == CONSOLIDATION_REQUEST_TYPE: - consolidations = ssz_deserialize( - List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD], request_data - ) + consolidations = ssz_deserialize(ConsolidationRequests, request_data) # [New in Gloas:EIP8282] elif request_type == BUILDER_DEPOSIT_REQUEST_TYPE: - builder_deposits = ssz_deserialize( - List[BuilderDepositRequest, MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD], - request_data, - ) + builder_deposits = ssz_deserialize(BuilderDepositRequests, request_data) # [New in Gloas:EIP8282] elif request_type == BUILDER_EXIT_REQUEST_TYPE: - builder_exits = ssz_deserialize( - List[BuilderExitRequest, MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD], request_data - ) + builder_exits = ssz_deserialize(BuilderExitRequests, request_data) return ExecutionRequests( deposits=deposits, @@ -3926,9 +3908,9 @@ - file: packages/beacon-node/src/execution/engine/types.ts search: export function serializeExecutionRequests( spec: | - + def get_execution_requests_list(execution_requests: ExecutionRequests) -> Sequence[bytes]: - requests = [ + requests: Sequence[Tuple[Bytes1, List]] = [ (DEPOSIT_REQUEST_TYPE, execution_requests.deposits), (WITHDRAWAL_REQUEST_TYPE, execution_requests.withdrawals), (CONSOLIDATION_REQUEST_TYPE, execution_requests.consolidations), @@ -3946,9 +3928,9 @@ - file: packages/beacon-node/src/execution/engine/types.ts search: export function serializeExecutionRequests( spec: | - + def get_execution_requests_list(execution_requests: ExecutionRequests) -> Sequence[bytes]: - requests = [ + requests: Sequence[Tuple[Bytes1, ProgressiveList]] = [ (DEPOSIT_REQUEST_TYPE, execution_requests.deposits), (WITHDRAWAL_REQUEST_TYPE, execution_requests.withdrawals), (CONSOLIDATION_REQUEST_TYPE, execution_requests.consolidations), @@ -4431,6 +4413,36 @@ return rewards, penalties +- name: get_inclusion_list_bits#heze + sources: [] + spec: | + + def get_inclusion_list_bits( + store: InclusionListStore, state: BeaconState, slot: Slot, only_timely: bool = True + ) -> Bitvector[INCLUSION_LIST_COMMITTEE_SIZE]: + """ + Return a ``Bitvector`` over inclusion list committee indices with bits set + for those who provided valid, non-equivocating inclusion lists for the given ``slot``. + """ + committee = get_inclusion_list_committee(state, slot) + key = hash_tree_root(committee) + + inclusion_lists = store.inclusion_lists[key] + equivocators = store.equivocators[key] + timeliness = store.inclusion_list_timeliness + + validator_indices = [ + inclusion_lists[inclusion_list_root].validator_index + for inclusion_list_root in inclusion_lists + if inclusion_lists[inclusion_list_root].validator_index not in equivocators + if not only_timely or timeliness[inclusion_list_root] + ] + + return Bitvector[INCLUSION_LIST_COMMITTEE_SIZE]( + validator_index in validator_indices for validator_index in committee + ) + + - name: get_inclusion_list_committee#heze sources: [] spec: | @@ -5202,25 +5214,12 @@ return GENESIS_EPOCH if current_epoch == GENESIS_EPOCH else Epoch(current_epoch - 1) -- name: get_proposer_dependent_root#gloas - sources: [] - spec: | - - def get_proposer_dependent_root(state: BeaconState, epoch: Epoch) -> Root: - """ - Return the dependent root for the proposer lookahead at ``epoch``. - """ - return get_block_root_at_slot( - state, Slot(compute_start_slot_at_epoch(Epoch(epoch - MIN_SEED_LOOKAHEAD)) - 1) - ) - - - name: get_proposer_head#phase0 sources: - file: packages/fork-choice/src/forkChoice/forkChoice.ts search: "* Same as https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/fork-choice.md#get_proposer_head" spec: | - + def get_proposer_head(store: Store, head_node: ForkChoiceNode, slot: Slot) -> ForkChoiceNode: head_block = store.blocks[head_node.root] parent_root = head_block.parent_root @@ -5231,7 +5230,7 @@ head_late = is_head_late(store, head_node.root) # Do not re-org on an epoch boundary. - epoch_boundary = is_epoch_boundary(slot) + not_epoch_boundary = is_not_epoch_boundary(slot) # Ensure that the FFG information of the new head will be competitive with the current head. ffg_competitive = is_ffg_competitive(store, head_node.root, parent_root) @@ -5259,7 +5258,7 @@ if all([ head_late, - epoch_boundary, + not_epoch_boundary, ffg_competitive, finalization_ok, proposing_on_time, @@ -5280,7 +5279,7 @@ - file: packages/fork-choice/src/forkChoice/forkChoice.ts search: "* Same as https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/fork-choice.md#get_proposer_head" spec: | - + def get_proposer_head(store: Store, head_node: ForkChoiceNode, slot: Slot) -> ForkChoiceNode: head_block = store.blocks[head_node.root] parent_root = head_block.parent_root @@ -5293,7 +5292,7 @@ head_late = is_head_late(store, head_node.root) # Do not re-org on an epoch boundary. - epoch_boundary = is_epoch_boundary(slot) + not_epoch_boundary = is_not_epoch_boundary(slot) # Ensure that the FFG information of the new head will be competitive with the current head. ffg_competitive = is_ffg_competitive(store, head_node.root, parent_root) @@ -5321,7 +5320,7 @@ if all([ head_late, - epoch_boundary, + not_epoch_boundary, ffg_competitive, finalization_ok, proposing_on_time, @@ -5337,20 +5336,6 @@ return head_node -- name: get_proposer_preferences_signature#gloas - sources: [] - spec: | - - def get_proposer_preferences_signature( - state: BeaconState, preferences: ProposerPreferences, privkey: int - ) -> BLSSignature: - domain = get_domain( - state, DOMAIN_PROPOSER_PREFERENCES, compute_epoch_at_slot(preferences.proposal_slot) - ) - signing_root = compute_signing_root(preferences, domain) - return bls.Sign(privkey, signing_root) - - - name: get_proposer_reorg_cutoff_ms#phase0 sources: - file: packages/config/src/forkConfig/index.ts @@ -5503,6 +5488,73 @@ return hash(domain_type + uint_to_bytes(epoch) + mix) +- name: get_shuffling_dependent_root#phase0 + sources: + - file: packages/beacon-node/src/util/dependentRoot.ts + search: export function getShufflingDependentRoot( + spec: | + + def get_shuffling_dependent_root(store: Store, root: Root, epoch: Epoch) -> Root: + if epoch <= MIN_SEED_LOOKAHEAD: + # Genesis block parent + return Root() + + node = ForkChoiceNode(root=root) + dependent_slot = Slot(compute_start_slot_at_epoch(epoch - MIN_SEED_LOOKAHEAD) - 1) + return get_ancestor(store, node, dependent_slot).root + + +- name: get_shuffling_dependent_root#gloas + sources: + - file: packages/beacon-node/src/util/dependentRoot.ts + search: export function getShufflingDependentRoot( + spec: | + + def get_shuffling_dependent_root(store: Store, root: Root, epoch: Epoch) -> Root: + if epoch <= MIN_SEED_LOOKAHEAD: + # Genesis block parent + return Root() + + # [Modified in Gloas:EIP7732] + node = ForkChoiceNode( + root=root, + payload_status=PAYLOAD_STATUS_PENDING, + ) + dependent_slot = Slot(compute_start_slot_at_epoch(epoch - MIN_SEED_LOOKAHEAD) - 1) + return get_ancestor(store, node, dependent_slot).root + + +- name: get_signed_proposer_preferences#gloas + sources: + - file: packages/state-transition/src/signatureSets/proposerPreferences.ts + search: export function getProposerPreferencesSigningRoot( + spec: | + + def get_signed_proposer_preferences( + store: Store, + state: BeaconState, + head_root: Root, + proposal_slot: Slot, + validator_index: ValidatorIndex, + fee_recipient: ExecutionAddress, + target_gas_limit: uint64, + privkey: int, + ) -> SignedProposerPreferences: + proposal_epoch = compute_epoch_at_slot(proposal_slot) + dependent_root = get_shuffling_dependent_root(store, head_root, proposal_epoch) + preferences = ProposerPreferences( + dependent_root=dependent_root, + proposal_slot=proposal_slot, + validator_index=validator_index, + fee_recipient=fee_recipient, + target_gas_limit=target_gas_limit, + ) + domain = get_domain(state, DOMAIN_PROPOSER_PREFERENCES, proposal_epoch) + signing_root = compute_signing_root(preferences, domain) + signature = bls.Sign(privkey, signing_root) + return SignedProposerPreferences(message=preferences, signature=signature) + + - name: get_slot_committee#phase0 sources: [] spec: | @@ -6790,16 +6842,6 @@ ) -- name: is_epoch_boundary#phase0 - sources: - - file: packages/state-transition/src/util/epoch.ts - search: export function isStartSlotOfEpoch( - spec: | - - def is_epoch_boundary(slot: Slot) -> bool: - return slot % SLOTS_PER_EPOCH != 0 - - - name: is_execution_block#bellatrix sources: [] spec: | @@ -6988,6 +7030,31 @@ return get_finality_delay(state) > MIN_EPOCHS_TO_INACTIVITY_PENALTY +- name: is_inclusion_list_bits_inclusive#heze + sources: [] + spec: | + + def is_inclusion_list_bits_inclusive( + store: InclusionListStore, + state: BeaconState, + slot: Slot, + inclusion_list_bits: Bitvector[INCLUSION_LIST_COMMITTEE_SIZE], + only_timely: bool = True, + ) -> bool: + """ + Return ``True`` if and only if ``inclusion_list_bits`` has a bit set for + every bit set in the local inclusion list bits for the given ``slot``. + """ + local_inclusion_list_bits = get_inclusion_list_bits(store, state, slot, only_timely) + + return not any( + local_inclusion_bit and not inclusion_bit + for inclusion_bit, local_inclusion_bit in zip( + inclusion_list_bits, local_inclusion_list_bits, strict=True + ) + ) + + - name: is_merge_transition_block#bellatrix sources: [] spec: | @@ -7037,6 +7104,16 @@ return False +- name: is_not_epoch_boundary#phase0 + sources: + - file: packages/state-transition/src/util/epoch.ts + search: export function isStartSlotOfEpoch( + spec: | + + def is_not_epoch_boundary(slot: Slot) -> bool: + return slot % SLOTS_PER_EPOCH != 0 + + - name: is_one_confirmed#phase0 sources: [] spec: | @@ -7418,6 +7495,34 @@ return bls.FastAggregateVerify(pubkeys, signing_root, indexed_attestation.signature) +- name: is_valid_indexed_attestation#gloas + sources: + - file: packages/state-transition/src/block/isValidIndexedAttestation.ts + search: export function isValidIndexedAttestation( + spec: | + + def is_valid_indexed_attestation( + state: BeaconState, indexed_attestation: IndexedAttestation + ) -> bool: + """ + Check if ``indexed_attestation`` is not empty, has sorted and unique indices and has a valid aggregate signature. + """ + # Verify indices are sorted and unique + indices = indexed_attestation.attesting_indices + if ( + len(indices) == 0 + # [New in Gloas:EIP7688] + or len(indices) > MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT + or indices != sorted(set(indices)) + ): + return False + # Verify aggregate signature + pubkeys = [state.validators[i].pubkey for i in indices] + domain = get_domain(state, DOMAIN_BEACON_ATTESTER, indexed_attestation.data.target.epoch) + signing_root = compute_signing_root(indexed_attestation.data, domain) + return bls.FastAggregateVerify(pubkeys, signing_root, indexed_attestation.signature) + + - name: is_valid_indexed_payload_attestation#gloas sources: - file: packages/state-transition/src/block/isValidIndexedPayloadAttestation.ts @@ -7750,6 +7855,21 @@ return NEXT_SYNC_COMMITTEE_GINDEX +- name: next_sync_committee_gindex_at_slot#gloas + sources: [] + spec: | + + def next_sync_committee_gindex_at_slot(slot: Slot) -> GeneralizedIndex: + epoch = compute_epoch_at_slot(slot) + + # [Modified in Gloas:EIP7688] + if epoch >= GLOAS_FORK_EPOCH: + return NEXT_SYNC_COMMITTEE_GINDEX_GLOAS + if epoch >= ELECTRA_FORK_EPOCH: + return NEXT_SYNC_COMMITTEE_GINDEX_ELECTRA + return NEXT_SYNC_COMMITTEE_GINDEX + + - name: normalize_merkle_branch#electra sources: - file: packages/state-transition/src/lightClient/spec/utils.ts @@ -9201,15 +9321,19 @@ - file: packages/state-transition/src/block/processBuilderDepositRequest.ts search: export function processBuilderDepositRequest( spec: | - + def process_builder_deposit_request(state: BeaconState, request: BuilderDepositRequest) -> None: + # Ignore deposits with unexpected withdrawal credential prefixes + if not is_builder_withdrawal_credential(request.withdrawal_credentials): + return + builder_pubkeys = [b.pubkey for b in state.builders] if request.pubkey not in builder_pubkeys: if is_valid_builder_deposit_signature(request): add_builder_to_registry( state, request.pubkey, - uint8(request.withdrawal_credentials[0]), + PAYLOAD_BUILDER_VERSION, ExecutionAddress(request.withdrawal_credentials[12:]), request.amount, state.slot, @@ -9218,13 +9342,13 @@ builder_index = BuilderIndex(builder_pubkeys.index(request.pubkey)) builder = state.builders[builder_index] - # Increase balance by deposit amount - builder.balance += request.amount - - # If exited, reset the withdrawable epoch - if builder.withdrawable_epoch != FAR_FUTURE_EPOCH: + # If exited and swept, reset the withdrawable epoch + if builder.withdrawable_epoch != FAR_FUTURE_EPOCH and builder.balance == 0: epoch = get_current_epoch(state) builder.withdrawable_epoch = epoch + MIN_BUILDER_WITHDRAWABILITY_DELAY + + # Increase balance by deposit amount + builder.balance += request.amount - name: process_builder_exit_request#gloas @@ -10452,7 +10576,7 @@ - name: process_operations#gloas sources: [] spec: | - + def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: assert len(body.deposits) == 0 @@ -10460,6 +10584,14 @@ for operation in operations: fn(state, operation) + # [New in Gloas:EIP7688] + assert len(body.proposer_slashings) <= MAX_PROPOSER_SLASHINGS + assert len(body.attester_slashings) <= MAX_ATTESTER_SLASHINGS_ELECTRA + assert len(body.attestations) <= MAX_ATTESTATIONS_ELECTRA + assert len(body.voluntary_exits) <= MAX_VOLUNTARY_EXITS + assert len(body.bls_to_execution_changes) <= MAX_BLS_TO_EXECUTION_CHANGES + assert len(body.payload_attestations) <= MAX_PAYLOAD_ATTESTATIONS + # [Modified in Gloas:EIP7732] for_ops(body.proposer_slashings, process_proposer_slashing) for_ops(body.attester_slashings, process_attester_slashing) @@ -12209,11 +12341,11 @@ - name: update_payload_expected_withdrawals#gloas sources: [] spec: | - + def update_payload_expected_withdrawals( state: BeaconState, withdrawals: Sequence[Withdrawal] ) -> None: - state.payload_expected_withdrawals = List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD](withdrawals) + state.payload_expected_withdrawals = ProgressiveList[Withdrawal](withdrawals) - name: update_pending_partial_withdrawals#electra @@ -12231,11 +12363,14 @@ - name: update_proposer_boost_root#phase0 sources: [] spec: | - + def update_proposer_boost_root(store: Store, head: Root, root: Root) -> None: is_first_block = store.proposer_boost_root == Root() is_timely = store.block_timeliness[root] - is_same_dependent_root = get_dependent_root(store, root) == get_dependent_root(store, head) + epoch = get_current_store_epoch(store) + head_dependent_root = get_shuffling_dependent_root(store, head, epoch) + block_dependent_root = get_shuffling_dependent_root(store, root, epoch) + is_same_dependent_root = head_dependent_root == block_dependent_root # Add proposer score boost if the block is timely, not conflicting with an # existing block, with the same dependent root as the canonical chain head. @@ -12246,12 +12381,15 @@ - name: update_proposer_boost_root#gloas sources: [] spec: | - + def update_proposer_boost_root(store: Store, head: Root, root: Root) -> None: is_first_block = store.proposer_boost_root == Root() # [Modified in Gloas:EIP7732] is_timely = store.block_timeliness[root][ATTESTATION_TIMELINESS_INDEX] - is_same_dependent_root = get_dependent_root(store, root) == get_dependent_root(store, head) + epoch = get_current_store_epoch(store) + head_dependent_root = get_shuffling_dependent_root(store, head, epoch) + block_dependent_root = get_shuffling_dependent_root(store, root, epoch) + is_same_dependent_root = head_dependent_root == block_dependent_root # Add proposer score boost if the block is timely, not conflicting with an # existing block, with the same dependent root as the canonical chain head. @@ -12283,6 +12421,42 @@ store.unrealized_finalized_checkpoint = unrealized_finalized_checkpoint +- name: upgrade_attestation_to_gloas#gloas + sources: [] + spec: | + + def upgrade_attestation_to_gloas(pre: fulu.Attestation) -> Attestation: + return Attestation( + aggregation_bits=AggregationBits(list(pre.aggregation_bits)), + data=pre.data, + signature=pre.signature, + committee_bits=pre.committee_bits, + ) + + +- name: upgrade_attester_slashing_to_gloas#gloas + sources: [] + spec: | + + def upgrade_attester_slashing_to_gloas(pre: fulu.AttesterSlashing) -> AttesterSlashing: + return AttesterSlashing( + attestation_1=upgrade_indexed_attestation_to_gloas(pre.attestation_1), + attestation_2=upgrade_indexed_attestation_to_gloas(pre.attestation_2), + ) + + +- name: upgrade_indexed_attestation_to_gloas#gloas + sources: [] + spec: | + + def upgrade_indexed_attestation_to_gloas(pre: fulu.IndexedAttestation) -> IndexedAttestation: + return IndexedAttestation( + attesting_indices=AttestingIndices(list(pre.attesting_indices)), + data=pre.data, + signature=pre.signature, + ) + + - name: upgrade_lc_bootstrap_to_capella#capella sources: - file: packages/state-transition/src/lightClient/spec/utils.ts @@ -12330,12 +12504,14 @@ - name: upgrade_lc_bootstrap_to_gloas#gloas sources: [] spec: | - + def upgrade_lc_bootstrap_to_gloas(pre: electra.LightClientBootstrap) -> LightClientBootstrap: return LightClientBootstrap( header=upgrade_lc_header_to_gloas(pre.header), current_sync_committee=pre.current_sync_committee, - current_sync_committee_branch=pre.current_sync_committee_branch, + current_sync_committee_branch=normalize_merkle_branch( + pre.current_sync_committee_branch, CURRENT_SYNC_COMMITTEE_GINDEX_GLOAS + ), ) @@ -12396,14 +12572,14 @@ - name: upgrade_lc_finality_update_to_gloas#gloas sources: [] spec: | - + def upgrade_lc_finality_update_to_gloas( pre: electra.LightClientFinalityUpdate, ) -> LightClientFinalityUpdate: return LightClientFinalityUpdate( attested_header=upgrade_lc_header_to_gloas(pre.attested_header), finalized_header=upgrade_lc_header_to_gloas(pre.finalized_header), - finality_branch=pre.finality_branch, + finality_branch=normalize_merkle_branch(pre.finality_branch, FINALIZED_ROOT_GINDEX_GLOAS), sync_aggregate=pre.sync_aggregate, signature_slot=pre.signature_slot, ) @@ -12736,14 +12912,16 @@ - name: upgrade_lc_update_to_gloas#gloas sources: [] spec: | - + def upgrade_lc_update_to_gloas(pre: electra.LightClientUpdate) -> LightClientUpdate: return LightClientUpdate( attested_header=upgrade_lc_header_to_gloas(pre.attested_header), next_sync_committee=pre.next_sync_committee, - next_sync_committee_branch=pre.next_sync_committee_branch, + next_sync_committee_branch=normalize_merkle_branch( + pre.next_sync_committee_branch, NEXT_SYNC_COMMITTEE_GINDEX_GLOAS + ), finalized_header=upgrade_lc_header_to_gloas(pre.finalized_header), - finality_branch=pre.finality_branch, + finality_branch=normalize_merkle_branch(pre.finality_branch, FINALIZED_ROOT_GINDEX_GLOAS), sync_aggregate=pre.sync_aggregate, signature_slot=pre.signature_slot, ) @@ -13154,7 +13332,7 @@ - file: packages/state-transition/src/slot/upgradeStateToGloas.ts search: export function upgradeStateToGloas( spec: | - + def upgrade_to_gloas(pre: fulu.BeaconState) -> BeaconState: epoch = fulu.get_current_epoch(pre) @@ -13175,17 +13353,26 @@ eth1_data=pre.eth1_data, eth1_data_votes=pre.eth1_data_votes, eth1_deposit_index=pre.eth1_deposit_index, - validators=pre.validators, - balances=pre.balances, + # [Modified in Gloas:EIP7688] + validators=ProgressiveList[Validator](list(pre.validators)), + # [Modified in Gloas:EIP7688] + balances=ProgressiveList[Gwei](list(pre.balances)), randao_mixes=pre.randao_mixes, slashings=pre.slashings, - previous_epoch_participation=pre.previous_epoch_participation, - current_epoch_participation=pre.current_epoch_participation, + # [Modified in Gloas:EIP7688] + previous_epoch_participation=ProgressiveList[ParticipationFlags]( + list(pre.previous_epoch_participation) + ), + # [Modified in Gloas:EIP7688] + current_epoch_participation=ProgressiveList[ParticipationFlags]( + list(pre.current_epoch_participation) + ), justification_bits=pre.justification_bits, previous_justified_checkpoint=pre.previous_justified_checkpoint, current_justified_checkpoint=pre.current_justified_checkpoint, finalized_checkpoint=pre.finalized_checkpoint, - inactivity_scores=pre.inactivity_scores, + # [Modified in Gloas:EIP7688] + inactivity_scores=ProgressiveList[uint64](list(pre.inactivity_scores)), current_sync_committee=pre.current_sync_committee, next_sync_committee=pre.next_sync_committee, # [Modified in Gloas:EIP7732] @@ -13201,9 +13388,16 @@ earliest_exit_epoch=pre.earliest_exit_epoch, consolidation_balance_to_consume=pre.consolidation_balance_to_consume, earliest_consolidation_epoch=pre.earliest_consolidation_epoch, - pending_deposits=pre.pending_deposits, - pending_partial_withdrawals=pre.pending_partial_withdrawals, - pending_consolidations=pre.pending_consolidations, + # [Modified in Gloas:EIP7688] + pending_deposits=ProgressiveList[PendingDeposit](list(pre.pending_deposits)), + # [Modified in Gloas:EIP7688] + pending_partial_withdrawals=ProgressiveList[PendingPartialWithdrawal]( + list(pre.pending_partial_withdrawals) + ), + # [Modified in Gloas:EIP7688] + pending_consolidations=ProgressiveList[PendingConsolidation]( + list(pre.pending_consolidations) + ), proposer_lookahead=pre.proposer_lookahead, # [New in Gloas:EIP7732] builders=[], @@ -13236,9 +13430,25 @@ - name: upgrade_to_heze#heze sources: [] spec: | - + def upgrade_to_heze(pre: gloas.BeaconState) -> BeaconState: epoch = gloas.get_current_epoch(pre) + latest_execution_payload_bid = ExecutionPayloadBid( + parent_block_hash=pre.latest_execution_payload_bid.parent_block_hash, + parent_block_root=pre.latest_execution_payload_bid.parent_block_root, + block_hash=pre.latest_execution_payload_bid.block_hash, + prev_randao=pre.latest_execution_payload_bid.prev_randao, + fee_recipient=pre.latest_execution_payload_bid.fee_recipient, + gas_limit=pre.latest_execution_payload_bid.gas_limit, + builder_index=pre.latest_execution_payload_bid.builder_index, + slot=pre.latest_execution_payload_bid.slot, + value=pre.latest_execution_payload_bid.value, + execution_payment=pre.latest_execution_payload_bid.execution_payment, + blob_kzg_commitments=pre.latest_execution_payload_bid.blob_kzg_commitments, + execution_requests_root=pre.latest_execution_payload_bid.execution_requests_root, + # [New in Heze:EIP7805] + inclusion_list_bits=Bitvector[INCLUSION_LIST_COMMITTEE_SIZE](), + ) post = BeaconState( genesis_time=pre.genesis_time, @@ -13289,7 +13499,8 @@ execution_payload_availability=pre.execution_payload_availability, builder_pending_payments=pre.builder_pending_payments, builder_pending_withdrawals=pre.builder_pending_withdrawals, - latest_execution_payload_bid=pre.latest_execution_payload_bid, + # [Modified in Heze:EIP7805] + latest_execution_payload_bid=latest_execution_payload_bid, payload_expected_withdrawals=pre.payload_expected_withdrawals, ptc_window=pre.ptc_window, ) @@ -14858,15 +15069,15 @@ - name: validate_partial_data_column_sidecar_gossip#fulu sources: [] spec: | - + def validate_partial_data_column_sidecar_gossip( seen: Seen, store: Store, state: BeaconState, sidecar: PartialDataColumnSidecar, - block_root: Root, - column_index: ColumnIndex, current_time_ms: uint64, + group_id: PartialDataColumnGroupID, + column_index: ColumnIndex, ) -> None: """ Validate a PartialDataColumnSidecar for gossip propagation on a subnet. @@ -14880,11 +15091,11 @@ if not (has_header or has_cells): raise GossipReject("partial message is semantically empty") - # [REJECT] The cell count equals the number of bits set in cells_present_bitmap + # [REJECT] The cell count equals the number of set bits in the bitmap if len(sidecar.partial_column) != num_cells_present: raise GossipReject("number of cells does not match number of set bits") - # [REJECT] The proof count equals the number of bits set in cells_present_bitmap + # [REJECT] The proof count equals the number of set bits in the bitmap if len(sidecar.kzg_proofs) != num_cells_present: raise GossipReject("number of proofs does not match number of set bits") @@ -14893,13 +15104,13 @@ block_header = header.signed_block_header.message # [REJECT] The received header MUST equal any previously validated header for this block - prior_header = seen.partial_data_column_headers.get(block_root) + prior_header = seen.partial_data_column_headers.get(group_id.beacon_block_root) if prior_header is not None and prior_header != header: raise GossipReject("header differs from previously validated header") # [REJECT] The signed_block_header hash matches the partial message's group id - if hash_tree_root(block_header) != block_root: - raise GossipReject("header's block root does not match partial message group id") + if hash_tree_root(block_header) != group_id.beacon_block_root: + raise GossipReject("header's block root does not match group id's block root") # [REJECT] The header's kzg_commitments list is non-empty if len(header.kzg_commitments) == 0: @@ -14959,11 +15170,11 @@ raise GossipReject("header proposer_index does not match expected proposer") # Mark this header as seen - seen.partial_data_column_headers[block_root] = header + seen.partial_data_column_headers[group_id.beacon_block_root] = header if has_cells: # [IGNORE] A valid corresponding PartialDataColumnHeader has been seen - header = seen.partial_data_column_headers.get(block_root) + header = seen.partial_data_column_headers.get(group_id.beacon_block_root) if header is None: raise GossipIgnore("valid corresponding header has not been seen") @@ -14981,11 +15192,11 @@ "corresponding header is not from a slot greater than the latest finalized slot" ) - # [REJECT] The cells_present_bitmap length equals the number of header kzg_commitments + # [REJECT] The cells present bitmap length equals the number of header commitments if len(sidecar.cells_present_bitmap) != len(header.kzg_commitments): raise GossipReject("bitmap length does not match commitments length") - # [REJECT] The sidecar's cell and proof data is valid + # [REJECT] The sidecar's cell and proof data passes KZG verification if not verify_partial_data_column_sidecar_kzg_proofs( sidecar, header.kzg_commitments, column_index ): @@ -15295,11 +15506,11 @@ - file: packages/beacon-node/src/chain/validation/dataColumnSidecar.ts search: function verifyGloasDataColumnSidecar( spec: | - + def verify_data_column_sidecar( sidecar: DataColumnSidecar, # [New in Gloas:EIP7732] - kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK], + kzg_commitments: ProgressiveList[KZGCommitment], ) -> bool: """ Verify if the data column sidecar is valid. @@ -15369,11 +15580,11 @@ - file: packages/beacon-node/src/chain/validation/dataColumnSidecar.ts search: export async function verifyDataColumnSidecarKzgProofs( spec: | - + def verify_data_column_sidecar_kzg_proofs( sidecar: DataColumnSidecar, # [New in Gloas:EIP7732] - kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK], + kzg_commitments: ProgressiveList[KZGCommitment], ) -> bool: """ Verify if the KZG proofs are correct. diff --git a/specrefs/presets.yml b/specrefs/presets.yml index cb7bef8a6500..4233892e8d6b 100644 --- a/specrefs/presets.yml +++ b/specrefs/presets.yml @@ -7,24 +7,6 @@ BASE_REWARD_FACTOR: uint64 = 64 -- name: BUILDER_PENDING_WITHDRAWALS_LIMIT#gloas - sources: - - file: packages/params/src/presets/mainnet.ts - search: "BUILDER_PENDING_WITHDRAWALS_LIMIT:" - spec: | - - BUILDER_PENDING_WITHDRAWALS_LIMIT: uint64 = 1048576 - - -- name: BUILDER_REGISTRY_LIMIT#gloas - sources: - - file: packages/params/src/presets/mainnet.ts - search: "BUILDER_REGISTRY_LIMIT:" - spec: | - - BUILDER_REGISTRY_LIMIT: uint64 = 1099511627776 - - - name: BYTES_PER_LOGS_BLOOM#bellatrix sources: - file: packages/params/src/presets/mainnet.ts @@ -208,8 +190,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_ATTESTATIONS:" spec: | - - MAX_ATTESTATIONS = 128 + + MAX_ATTESTATIONS: uint64 = 128 - name: MAX_ATTESTATIONS_ELECTRA#electra @@ -217,8 +199,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_ATTESTATIONS_ELECTRA:" spec: | - - MAX_ATTESTATIONS_ELECTRA = 8 + + MAX_ATTESTATIONS_ELECTRA: uint64 = 8 - name: MAX_ATTESTER_SLASHINGS#phase0 @@ -226,8 +208,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_ATTESTER_SLASHINGS:" spec: | - - MAX_ATTESTER_SLASHINGS = 2 + + MAX_ATTESTER_SLASHINGS: uint64 = 2 - name: MAX_ATTESTER_SLASHINGS_ELECTRA#electra @@ -235,8 +217,17 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_ATTESTER_SLASHINGS_ELECTRA:" spec: | - - MAX_ATTESTER_SLASHINGS_ELECTRA = 1 + + MAX_ATTESTER_SLASHINGS_ELECTRA: uint64 = 1 + + +- name: MAX_ATTESTER_SLASHING_SIZE#gloas + sources: + - file: packages/params/src/presets/mainnet.ts + search: "MAX_ATTESTER_SLASHING_SIZE:" + spec: | + + MAX_ATTESTER_SLASHING_SIZE: uint64 = 2097616 - name: MAX_BLOB_COMMITMENTS_PER_BLOCK#deneb @@ -253,8 +244,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_BLS_TO_EXECUTION_CHANGES:" spec: | - - MAX_BLS_TO_EXECUTION_CHANGES = 16 + + MAX_BLS_TO_EXECUTION_CHANGES: uint64 = 16 - name: MAX_BUILDERS_PER_WITHDRAWALS_SWEEP#gloas @@ -262,8 +253,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_BUILDERS_PER_WITHDRAWALS_SWEEP:" spec: | - - MAX_BUILDERS_PER_WITHDRAWALS_SWEEP = 16384 + + MAX_BUILDERS_PER_WITHDRAWALS_SWEEP: uint64 = 16384 - name: MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD#gloas @@ -271,8 +262,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD:" spec: | - - MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD: uint64 = 256 + + MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD: uint64 = 64 - name: MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD#gloas @@ -311,13 +302,22 @@ MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: uint64 = 2 +- name: MAX_DATA_COLUMN_SIDECAR_SIZE#gloas + sources: + - file: packages/params/src/presets/mainnet.ts + search: "MAX_DATA_COLUMN_SIDECAR_SIZE:" + spec: | + + MAX_DATA_COLUMN_SIDECAR_SIZE: uint64 = 8585272 + + - name: MAX_DEPOSITS#phase0 sources: - file: packages/params/src/presets/mainnet.ts search: "MAX_DEPOSITS:" spec: | - - MAX_DEPOSITS = 16 + + MAX_DEPOSITS: uint64 = 16 - name: MAX_DEPOSIT_REQUESTS_PER_PAYLOAD#electra @@ -352,8 +352,17 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_EXTRA_DATA_BYTES:" spec: | - - MAX_EXTRA_DATA_BYTES = 32 + + MAX_EXTRA_DATA_BYTES: uint64 = 32 + + +- name: MAX_PARTIAL_DATA_COLUMN_SIDECAR_SIZE#gloas + sources: + - file: packages/params/src/presets/mainnet.ts + search: "MAX_PARTIAL_DATA_COLUMN_SIDECAR_SIZE:" + spec: | + + MAX_PARTIAL_DATA_COLUMN_SIDECAR_SIZE: uint64 = 8585741 - name: MAX_PAYLOAD_ATTESTATIONS#gloas @@ -361,8 +370,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_PAYLOAD_ATTESTATIONS:" spec: | - - MAX_PAYLOAD_ATTESTATIONS = 4 + + MAX_PAYLOAD_ATTESTATIONS: uint64 = 4 - name: MAX_PENDING_DEPOSITS_PER_EPOCH#electra @@ -388,8 +397,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_PROPOSER_SLASHINGS:" spec: | - - MAX_PROPOSER_SLASHINGS = 16 + + MAX_PROPOSER_SLASHINGS: uint64 = 16 - name: MAX_SEED_LOOKAHEAD#phase0 @@ -401,6 +410,38 @@ MAX_SEED_LOOKAHEAD: uint64 = 4 +- name: MAX_SIGNED_AGGREGATE_AND_PROOF_SIZE#gloas + sources: + - file: packages/params/src/presets/mainnet.ts + search: "MAX_SIGNED_AGGREGATE_AND_PROOF_SIZE:" + spec: | + + MAX_SIGNED_AGGREGATE_AND_PROOF_SIZE: uint64 = 16829 + + +- name: MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE#gloas + sources: + - file: packages/params/src/presets/mainnet.ts + search: "MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE:" + spec: | + + MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE: uint64 = 196932 + + +- name: MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE_HEZE#heze + sources: [] + spec: | + + MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE_HEZE: uint64 = 196934 + + +- name: MAX_SIGNED_INCLUSION_LIST_SIZE#heze + sources: [] + spec: | + + MAX_SIGNED_INCLUSION_LIST_SIZE: uint64 = 8348 + + - name: MAX_TRANSACTIONS_PER_PAYLOAD#bellatrix sources: - file: packages/params/src/presets/mainnet.ts @@ -424,8 +465,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP:" spec: | - - MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP = 16384 + + MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP: uint64 = 16384 - name: MAX_VOLUNTARY_EXITS#phase0 @@ -433,8 +474,8 @@ - file: packages/params/src/presets/mainnet.ts search: "MAX_VOLUNTARY_EXITS:" spec: | - - MAX_VOLUNTARY_EXITS = 16 + + MAX_VOLUNTARY_EXITS: uint64 = 16 - name: MAX_WITHDRAWALS_PER_PAYLOAD#capella @@ -550,8 +591,8 @@ - file: packages/params/src/presets/mainnet.ts search: "NUMBER_OF_COLUMNS:" spec: | - - NUMBER_OF_COLUMNS: uint64 = 128 + + NUMBER_OF_COLUMNS = 128 - name: PENDING_CONSOLIDATIONS_LIMIT#electra diff --git a/specrefs/types.yml b/specrefs/types.yml index 09b3007cdbcd..f0028ee3aa41 100644 --- a/specrefs/types.yml +++ b/specrefs/types.yml @@ -1,3 +1,39 @@ +- name: AggregationBits#electra + sources: + - file: packages/types/src/electra/sszTypes.ts + search: export const AggregationBits = + spec: | + + AggregationBits = Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT] + + +- name: AggregationBits#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const AggregationBits = + spec: | + + AggregationBits = ProgressiveBitlist + + +- name: AttestingIndices#electra + sources: + - file: packages/types/src/electra/sszTypes.ts + search: export const AttestingIndices = + spec: | + + AttestingIndices = List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT] + + +- name: AttestingIndices#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const AttestingIndices = + spec: | + + AttestingIndices = ProgressiveList[ValidatorIndex] + + - name: BLSPubkey#phase0 sources: - file: packages/types/src/primitive/sszTypes.ts @@ -39,8 +75,26 @@ - file: packages/types/src/gloas/sszTypes.ts search: export const BlockAccessList = spec: | - - BlockAccessList = ByteList[MAX_BYTES_PER_TRANSACTION] + + BlockAccessList = ProgressiveByteList + + +- name: BuilderDepositRequests#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const BuilderDepositRequests = + spec: | + + BuilderDepositRequests = ProgressiveList[BuilderDepositRequest] + + +- name: BuilderExitRequests#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const BuilderExitRequests = + spec: | + + BuilderExitRequests = ProgressiveList[BuilderExitRequest] - name: BuilderIndex#gloas @@ -93,6 +147,24 @@ CommitteeIndex = uint64 +- name: ConsolidationRequests#electra + sources: + - file: packages/types/src/electra/sszTypes.ts + search: export const ConsolidationRequests = + spec: | + + ConsolidationRequests = List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD] + + +- name: ConsolidationRequests#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const ConsolidationRequests = + spec: | + + ConsolidationRequests = ProgressiveList[ConsolidationRequest] + + - name: CurrentSyncCommitteeBranch#altair sources: - file: packages/types/src/altair/sszTypes.ts @@ -111,6 +183,15 @@ CurrentSyncCommitteeBranch = Vector[Bytes32, floorlog2(CURRENT_SYNC_COMMITTEE_GINDEX_ELECTRA)] +- name: CurrentSyncCommitteeBranch#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const CurrentSyncCommitteeBranch = + spec: | + + CurrentSyncCommitteeBranch = Vector[Bytes32, floorlog2(CURRENT_SYNC_COMMITTEE_GINDEX_GLOAS)] + + - name: CustodyIndex#fulu sources: - file: packages/types/src/primitive/sszTypes.ts @@ -120,6 +201,24 @@ CustodyIndex = uint64 +- name: DepositRequests#electra + sources: + - file: packages/types/src/electra/sszTypes.ts + search: export const DepositRequests = + spec: | + + DepositRequests = List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD] + + +- name: DepositRequests#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const DepositRequests = + spec: | + + DepositRequests = ProgressiveList[DepositRequest] + + - name: Domain#phase0 sources: - file: packages/types/src/primitive/sszTypes.ts @@ -197,6 +296,15 @@ FinalityBranch = Vector[Bytes32, floorlog2(FINALIZED_ROOT_GINDEX_ELECTRA)] +- name: FinalityBranch#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const FinalityBranch = + spec: | + + FinalityBranch = Vector[Bytes32, floorlog2(FINALIZED_ROOT_GINDEX_GLOAS)] + + - name: ForkDigest#phase0 sources: - file: packages/types/src/primitive/sszTypes.ts @@ -276,6 +384,15 @@ NextSyncCommitteeBranch = Vector[Bytes32, floorlog2(NEXT_SYNC_COMMITTEE_GINDEX_ELECTRA)] +- name: NextSyncCommitteeBranch#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const NextSyncCommitteeBranch = + spec: | + + NextSyncCommitteeBranch = Vector[Bytes32, floorlog2(NEXT_SYNC_COMMITTEE_GINDEX_GLOAS)] + + - name: NodeID#phase0 sources: [] spec: | @@ -356,6 +473,15 @@ Transaction = ByteList[MAX_BYTES_PER_TRANSACTION] +- name: Transaction#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const Transaction = + spec: | + + Transaction = ProgressiveByteList + + - name: ValidatorIndex#phase0 sources: - file: packages/types/src/primitive/sszTypes.ts @@ -391,3 +517,21 @@ WithdrawalIndex = uint64 + +- name: WithdrawalRequests#electra + sources: + - file: packages/types/src/electra/sszTypes.ts + search: export const WithdrawalRequests = + spec: | + + WithdrawalRequests = List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD] + + +- name: WithdrawalRequests#gloas + sources: + - file: packages/types/src/gloas/sszTypes.ts + search: export const WithdrawalRequests = + spec: | + + WithdrawalRequests = ProgressiveList[WithdrawalRequest] +