diff --git a/beacon_chain/spec/datatypes/base.nim b/beacon_chain/spec/datatypes/base.nim index 92a0e9a6f..c29b43fae 100644 --- a/beacon_chain/spec/datatypes/base.nim +++ b/beacon_chain/spec/datatypes/base.nim @@ -224,6 +224,11 @@ type CommitteeValidatorsBits* = BitList[Limit MAX_VALIDATORS_PER_COMMITTEE] + ElectraCommitteeValidatorsBits* = + BitList[Limit MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT] + + AttestationCommitteeBits* = BitArray[MAX_COMMITTEES_PER_SLOT.int] + ForkDigest* = distinct array[4, byte] # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/phase0/beacon-chain.md#forkdata @@ -389,6 +394,20 @@ type address*: ExecutionAddress amount*: Gwei + # https://github.com/ethereum/consensus-specs/blob/94a0b6c581f2809aa8aca4ef7ee6fbb63f9d74e9/specs/electra/beacon-chain.md#depositreceipt + DepositReceipt* = object + pubkey*: ValidatorPubKey + withdrawal_credentials*: Eth2Digest + amount*: Gwei + signature*: ValidatorSig + index*: uint64 + + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#executionlayerwithdrawalrequest + ExecutionLayerWithdrawalRequest* = object + source_address*: ExecutionAddress + validator_pubkey*: ValidatorPubKey + amount*: Gwei + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/capella/beacon-chain.md#historicalsummary HistoricalSummary* = object # `HistoricalSummary` matches the components of the phase0 diff --git a/beacon_chain/spec/datatypes/electra.nim b/beacon_chain/spec/datatypes/electra.nim index 95a247829..330223d0f 100644 --- a/beacon_chain/spec/datatypes/electra.nim +++ b/beacon_chain/spec/datatypes/electra.nim @@ -49,14 +49,6 @@ const NEXT_SYNC_COMMITTEE_GINDEX = 87.GeneralizedIndex # next_sync_committee type - # https://github.com/ethereum/consensus-specs/blob/94a0b6c581f2809aa8aca4ef7ee6fbb63f9d74e9/specs/electra/beacon-chain.md#depositreceipt - DepositReceipt* = object - pubkey*: ValidatorPubKey - withdrawal_credentials*: Eth2Digest - amount*: Gwei - signature*: ValidatorSig - index*: uint64 - # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.0/specs/electra/beacon-chain.md#indexedattestation IndexedAttestation* = object attesting_indices*: @@ -161,12 +153,6 @@ type amount*: Gwei withdrawable_epoch*: Epoch - # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#executionlayerwithdrawalrequest - ExecutionLayerWithdrawalRequest* = object - source_address*: ExecutionAddress - validator_pubkey*: ValidatorPubKey - amount*: Gwei - # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#consolidation Consolidation* = object source_index*: uint64 @@ -593,11 +579,6 @@ type root* {.dontSerialize.}: Eth2Digest # cached root of signed beacon block - ElectraCommitteeValidatorsBits* = - BitList[Limit MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT] - - AttestationCommitteeBits* = BitArray[MAX_COMMITTEES_PER_SLOT.int] - # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.0/specs/electra/beacon-chain.md#attestation Attestation* = object aggregation_bits*: ElectraCommitteeValidatorsBits