mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Update consensus spec to v1.6.0-alpha.5 and adjust minimal config (#15621)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
version: v1.6.0-alpha.4
|
||||
version: v1.6.0-alpha.5
|
||||
style: full
|
||||
|
||||
specrefs:
|
||||
@@ -17,6 +17,11 @@ exceptions:
|
||||
- CELLS_PER_EXT_BLOB#fulu
|
||||
- UPDATE_TIMEOUT#altair
|
||||
|
||||
# Not implemented: gloas (future fork)
|
||||
- KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH_GLOAS#gloas
|
||||
- MAX_PAYLOAD_ATTESTATIONS#gloas
|
||||
- PTC_SIZE#gloas
|
||||
|
||||
constants:
|
||||
# Constants in the KZG library
|
||||
- BLS_MODULUS#deneb
|
||||
@@ -34,6 +39,7 @@ exceptions:
|
||||
- RANDOM_CHALLENGE_KZG_CELL_BATCH_DOMAIN#fulu
|
||||
|
||||
# Not implemented
|
||||
- BASIS_POINTS#phase0
|
||||
- ENDIANNESS#phase0
|
||||
- MAX_CONCURRENT_REQUESTS#phase0
|
||||
- PARTICIPATION_FLAG_WEIGHTS#altair
|
||||
@@ -42,11 +48,57 @@ exceptions:
|
||||
- UINT64_MAX#phase0
|
||||
- UINT64_MAX_SQRT#phase0
|
||||
|
||||
# Not implemented: gloas (future fork)
|
||||
- BUILDER_PAYMENT_THRESHOLD_DENOMINATOR#gloas
|
||||
- BUILDER_PAYMENT_THRESHOLD_NUMERATOR#gloas
|
||||
- BUILDER_PENDING_WITHDRAWALS_LIMIT#gloas
|
||||
- BUILDER_WITHDRAWAL_PREFIX#gloas
|
||||
- DOMAIN_BEACON_BUILDER#gloas
|
||||
- DOMAIN_PTC_ATTESTER#gloas
|
||||
- PAYLOAD_STATUS_EMPTY#gloas
|
||||
- PAYLOAD_STATUS_FULL#gloas
|
||||
- PAYLOAD_STATUS_PENDING#gloas
|
||||
|
||||
configs:
|
||||
# Not implemented (placeholders)
|
||||
- AGGREGRATE_DUE_BPS#phase0
|
||||
- ATTESTATION_DUE_BPS#phase0
|
||||
- CONTRIBUTION_DUE_BPS#altair
|
||||
- PROPOSER_REORG_CUTOFF_BPS#phase0
|
||||
- SLOT_DURATION_MS#phase0
|
||||
- SYNC_MESSAGE_DUE_BPS#altair
|
||||
|
||||
# Not implemented: gloas (future fork)
|
||||
- AGGREGRATE_DUE_BPS_GLOAS#gloas
|
||||
- ATTESTATION_DUE_BPS_GLOAS#gloas
|
||||
- CONTRIBUTION_DUE_BPS_GLOAS#gloas
|
||||
- GLOAS_FORK_EPOCH#gloas
|
||||
- GLOAS_FORK_VERSION#gloas
|
||||
- MAX_REQUEST_PAYLOADS#gloas
|
||||
- PAYLOAD_ATTESTATION_DUE_BPS#gloas
|
||||
- SYNC_MESSAGE_DUE_BPS_GLOAS#gloas
|
||||
|
||||
ssz_objects:
|
||||
# Not implemented
|
||||
- Eth1Block#phase0
|
||||
- MatrixEntry#fulu
|
||||
|
||||
# Not implemented: gloas (future fork)
|
||||
- BeaconBlockBody#gloas
|
||||
- BeaconState#gloas
|
||||
- BuilderPendingPayment#gloas
|
||||
- BuilderPendingWithdrawal#gloas
|
||||
- DataColumnSidecar#gloas
|
||||
- ExecutionPayloadEnvelope#gloas
|
||||
- ExecutionPayloadHeader#gloas
|
||||
- ForkChoiceNode#gloas
|
||||
- IndexedPayloadAttestation#gloas
|
||||
- PayloadAttestation#gloas
|
||||
- PayloadAttestationData#gloas
|
||||
- PayloadAttestationMessage#gloas
|
||||
- SignedExecutionPayloadEnvelope#gloas
|
||||
- SignedExecutionPayloadHeader#gloas
|
||||
|
||||
dataclasses:
|
||||
# Not implemented
|
||||
- BlobParameters#fulu
|
||||
@@ -55,6 +107,10 @@ exceptions:
|
||||
- OptimisticStore#bellatrix
|
||||
- Store#phase0
|
||||
|
||||
# Not implemented: gloas (future fork)
|
||||
- LatestMessage#gloas
|
||||
- Store#gloas
|
||||
|
||||
functions:
|
||||
# Functions implemented by KZG library for EIP-4844
|
||||
- bit_reversal_permutation#deneb
|
||||
@@ -130,6 +186,7 @@ exceptions:
|
||||
- get_matching_target_attestations#phase0
|
||||
- get_proposer_head#phase0
|
||||
- get_proposer_score#phase0
|
||||
- get_slot_component_duration_ms#phase0
|
||||
- get_slot_signature#phase0
|
||||
- get_unslashed_attesting_indices#phase0
|
||||
- get_voting_source#phase0
|
||||
@@ -145,6 +202,7 @@ exceptions:
|
||||
- is_valid_merkle_branch#phase0
|
||||
- on_tick#phase0
|
||||
- on_tick_per_slot#phase0
|
||||
- seconds_to_milliseconds#phase0
|
||||
- store_target_checkpoint_state#phase0
|
||||
- update_latest_messages#phase0
|
||||
- validate_on_attestation#phase0
|
||||
@@ -227,3 +285,64 @@ exceptions:
|
||||
- get_data_column_sidecars_from_column_sidecar#fulu
|
||||
- get_extended_sample_count#fulu
|
||||
- recover_matrix#fulu
|
||||
|
||||
# Not implemented: gloas (future fork)
|
||||
- compute_balance_weighted_acceptance#gloas
|
||||
- compute_balance_weighted_selection#gloas
|
||||
- compute_fork_version#gloas
|
||||
- compute_proposer_indices#gloas
|
||||
- get_ancestor#gloas
|
||||
- get_attestation_participation_flag_indices#gloas
|
||||
- get_builder_payment_quorum_threshold#gloas
|
||||
- get_checkpoint_block#gloas
|
||||
- get_data_column_sidecars#gloas
|
||||
- get_data_column_sidecars_from_block#gloas
|
||||
- get_execution_payload_envelope_signature#gloas
|
||||
- get_execution_payload_header_signature#gloas
|
||||
- get_expected_withdrawals#gloas
|
||||
- get_forkchoice_store#gloas
|
||||
- get_head#gloas
|
||||
- get_indexed_payload_attestation#gloas
|
||||
- get_next_sync_committee_indices#gloas
|
||||
- get_node_children#gloas
|
||||
- get_parent_payload_status#gloas
|
||||
- get_payload_attestation_message_signature#gloas
|
||||
- get_payload_status_tiebreaker#gloas
|
||||
- get_ptc#gloas
|
||||
- get_ptc_assignment#gloas
|
||||
- get_weight#gloas
|
||||
- has_builder_withdrawal_credential#gloas
|
||||
- has_compounding_withdrawal_credential#gloas
|
||||
- is_attestation_same_slot#gloas
|
||||
- is_builder_payment_withdrawable#gloas
|
||||
- is_builder_withdrawal_credential#gloas
|
||||
- is_merge_transition_complete#gloas
|
||||
- is_parent_block_full#gloas
|
||||
- is_parent_node_full#gloas
|
||||
- is_payload_timely#gloas
|
||||
- is_supporting_vote#gloas
|
||||
- is_valid_indexed_payload_attestation#gloas
|
||||
- notify_ptc_messages#gloas
|
||||
- on_block#gloas
|
||||
- on_execution_payload#gloas
|
||||
- on_payload_attestation_message#gloas
|
||||
- prepare_execution_payload#gloas
|
||||
- process_attestation#gloas
|
||||
- process_block#gloas
|
||||
- process_builder_pending_payments#gloas
|
||||
- process_epoch#gloas
|
||||
- process_execution_payload#gloas
|
||||
- process_execution_payload_header#gloas
|
||||
- process_operations#gloas
|
||||
- process_payload_attestation#gloas
|
||||
- process_slot#gloas
|
||||
- process_withdrawals#gloas
|
||||
- remove_flag#gloas
|
||||
- should_extend_payload#gloas
|
||||
- update_latest_messages#gloas
|
||||
- upgrade_to_gloas#gloas
|
||||
- validate_merge_block#gloas
|
||||
- validate_on_attestation#gloas
|
||||
- verify_data_column_sidecar_inclusion_proof#gloas
|
||||
- verify_execution_payload_envelope_signature#gloas
|
||||
- verify_execution_payload_header_signature#gloas
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
ALTAIR_FORK_VERSION: Version = '0x01000000'
|
||||
</spec>
|
||||
|
||||
- name: AGGREGRATE_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="AGGREGRATE_DUE_BPS" fork="phase0" hash="74073466">
|
||||
AGGREGRATE_DUE_BPS: uint64 = 6667
|
||||
</spec>
|
||||
|
||||
- name: ATTESTATION_PROPAGATION_SLOT_RANGE
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -58,6 +65,13 @@
|
||||
ATTESTATION_SUBNET_PREFIX_BITS: int = 6
|
||||
</spec>
|
||||
|
||||
- name: ATTESTATION_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="ATTESTATION_DUE_BPS" fork="phase0" hash="929dd1c9">
|
||||
ATTESTATION_DUE_BPS: uint64 = 3333
|
||||
</spec>
|
||||
|
||||
- name: BALANCE_PER_ADDITIONAL_CUSTODY_GROUP
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -529,6 +543,13 @@
|
||||
PROPOSER_SCORE_BOOST: uint64 = 40
|
||||
</spec>
|
||||
|
||||
- name: PROPOSER_REORG_CUTOFF_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="PROPOSER_REORG_CUTOFF_BPS" fork="phase0" hash="a487cc43">
|
||||
PROPOSER_REORG_CUTOFF_BPS: uint64 = 1667
|
||||
</spec>
|
||||
|
||||
- name: REORG_HEAD_WEIGHT_THRESHOLD
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -589,6 +610,13 @@
|
||||
SECONDS_PER_SLOT: uint64 = 12
|
||||
</spec>
|
||||
|
||||
- name: SLOT_DURATION_MS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="SLOT_DURATION_MS" fork="phase0" hash="b6d4ba6d">
|
||||
SLOT_DURATION_MS: uint64 = 12000
|
||||
</spec>
|
||||
|
||||
- name: SHARD_COMMITTEE_PERIOD
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -648,3 +676,18 @@
|
||||
<spec config_var="VALIDATOR_CUSTODY_REQUIREMENT" fork="fulu" hash="4dfc4457">
|
||||
VALIDATOR_CUSTODY_REQUIREMENT = 8
|
||||
</spec>
|
||||
|
||||
- name: CONTRIBUTION_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="CONTRIBUTION_DUE_BPS" fork="altair" hash="a3808203">
|
||||
CONTRIBUTION_DUE_BPS: uint64 = 6667
|
||||
</spec>
|
||||
|
||||
- name: SYNC_MESSAGE_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="SYNC_MESSAGE_DUE_BPS" fork="altair" hash="791b29d8">
|
||||
SYNC_MESSAGE_DUE_BPS: uint64 = 3333
|
||||
</spec>
|
||||
|
||||
|
||||
@@ -9,6 +9,13 @@
|
||||
BASE_REWARDS_PER_EPOCH: uint64 = 4
|
||||
</spec>
|
||||
|
||||
- name: BASIS_POINTS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec constant_var="BASIS_POINTS" fork="phase0" hash="cb0c8561">
|
||||
BASIS_POINTS: uint64 = 10000
|
||||
</spec>
|
||||
|
||||
- name: BLS_MODULUS
|
||||
sources: []
|
||||
spec: |
|
||||
|
||||
@@ -3209,6 +3209,17 @@
|
||||
return (store.time - store.genesis_time) // SECONDS_PER_SLOT
|
||||
</spec>
|
||||
|
||||
- name: get_slot_component_duration_ms
|
||||
sources: []
|
||||
spec: |
|
||||
<spec fn="get_slot_component_duration_ms" fork="phase0" hash="b81504df">
|
||||
def get_slot_component_duration_ms(basis_points: uint64) -> uint64:
|
||||
"""
|
||||
Calculate the duration of a slot component in milliseconds.
|
||||
"""
|
||||
return basis_points * SLOT_DURATION_MS // BASIS_POINTS
|
||||
</spec>
|
||||
|
||||
- name: get_source_deltas
|
||||
sources:
|
||||
- file: beacon-chain/core/epoch/precompute/reward_penalty.go
|
||||
@@ -4240,12 +4251,12 @@
|
||||
- name: is_proposing_on_time
|
||||
sources: []
|
||||
spec: |
|
||||
<spec fn="is_proposing_on_time" fork="phase0" hash="81d1985f">
|
||||
<spec fn="is_proposing_on_time" fork="phase0" hash="cadfde05">
|
||||
def is_proposing_on_time(store: Store) -> bool:
|
||||
# Use half `SECONDS_PER_SLOT // INTERVALS_PER_SLOT` as the proposer reorg deadline
|
||||
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
|
||||
proposer_reorg_cutoff = SECONDS_PER_SLOT // INTERVALS_PER_SLOT // 2
|
||||
return time_into_slot <= proposer_reorg_cutoff
|
||||
seconds_since_genesis = store.time - store.genesis_time
|
||||
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
|
||||
proposer_reorg_cutoff_ms = get_slot_component_duration_ms(PROPOSER_REORG_CUTOFF_BPS)
|
||||
return time_into_slot_ms <= proposer_reorg_cutoff_ms
|
||||
</spec>
|
||||
|
||||
- name: is_shuffling_stable
|
||||
@@ -4695,7 +4706,7 @@
|
||||
- file: beacon-chain/blockchain/receive_block.go
|
||||
search: func (s *Service) ReceiveBlock(
|
||||
spec: |
|
||||
<spec fn="on_block" fork="phase0" hash="f44d049a">
|
||||
<spec fn="on_block" fork="phase0" hash="0bd081f0">
|
||||
def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
|
||||
block = signed_block.message
|
||||
# Parent block must be known
|
||||
@@ -4726,8 +4737,10 @@
|
||||
store.block_states[block_root] = state
|
||||
|
||||
# Add block timeliness to the store
|
||||
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
|
||||
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
|
||||
seconds_since_genesis = store.time - store.genesis_time
|
||||
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
|
||||
attestation_threshold_ms = get_slot_component_duration_ms(ATTESTATION_DUE_BPS)
|
||||
is_before_attesting_interval = time_into_slot_ms < attestation_threshold_ms
|
||||
is_timely = get_current_slot(store) == block.slot and is_before_attesting_interval
|
||||
store.block_timeliness[hash_tree_root(block)] = is_timely
|
||||
|
||||
@@ -4748,7 +4761,7 @@
|
||||
- file: beacon-chain/blockchain/receive_block.go
|
||||
search: func (s *Service) ReceiveBlock(
|
||||
spec: |
|
||||
<spec fn="on_block" fork="bellatrix" hash="1b2d9640">
|
||||
<spec fn="on_block" fork="bellatrix" hash="cceac63a">
|
||||
def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
|
||||
"""
|
||||
Run ``on_block`` upon receiving a new block.
|
||||
@@ -4790,8 +4803,10 @@
|
||||
store.block_states[block_root] = state
|
||||
|
||||
# Add block timeliness to the store
|
||||
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
|
||||
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
|
||||
seconds_since_genesis = store.time - store.genesis_time
|
||||
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
|
||||
attestation_threshold_ms = get_slot_component_duration_ms(ATTESTATION_DUE_BPS)
|
||||
is_before_attesting_interval = time_into_slot_ms < attestation_threshold_ms
|
||||
is_timely = get_current_slot(store) == block.slot and is_before_attesting_interval
|
||||
store.block_timeliness[hash_tree_root(block)] = is_timely
|
||||
|
||||
@@ -4812,7 +4827,7 @@
|
||||
- file: beacon-chain/blockchain/receive_block.go
|
||||
search: func (s *Service) ReceiveBlock(
|
||||
spec: |
|
||||
<spec fn="on_block" fork="capella" hash="14995ab0">
|
||||
<spec fn="on_block" fork="capella" hash="b051b7c6">
|
||||
def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
|
||||
"""
|
||||
Run ``on_block`` upon receiving a new block.
|
||||
@@ -4846,8 +4861,10 @@
|
||||
store.block_states[block_root] = state
|
||||
|
||||
# Add block timeliness to the store
|
||||
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
|
||||
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
|
||||
seconds_since_genesis = store.time - store.genesis_time
|
||||
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
|
||||
attestation_threshold_ms = get_slot_component_duration_ms(ATTESTATION_DUE_BPS)
|
||||
is_before_attesting_interval = time_into_slot_ms < attestation_threshold_ms
|
||||
is_timely = get_current_slot(store) == block.slot and is_before_attesting_interval
|
||||
store.block_timeliness[hash_tree_root(block)] = is_timely
|
||||
|
||||
@@ -4868,7 +4885,7 @@
|
||||
- file: beacon-chain/blockchain/receive_block.go
|
||||
search: func (s *Service) ReceiveBlock(
|
||||
spec: |
|
||||
<spec fn="on_block" fork="deneb" hash="34d79a7b">
|
||||
<spec fn="on_block" fork="deneb" hash="1f48df4d">
|
||||
def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
|
||||
"""
|
||||
Run ``on_block`` upon receiving a new block.
|
||||
@@ -4892,9 +4909,7 @@
|
||||
|
||||
# [New in Deneb:EIP4844]
|
||||
# Check if blob data is available
|
||||
# If not, this block MAY be queued and subsequently considered when blob data becomes available
|
||||
# *Note*: Extraneous or invalid Blobs (in addition to the expected/referenced valid blobs)
|
||||
# received on the p2p network MUST NOT invalidate a block that is otherwise valid and available
|
||||
# If not, this payload MAY be queued and subsequently considered when blob data becomes available
|
||||
assert is_data_available(hash_tree_root(block), block.body.blob_kzg_commitments)
|
||||
|
||||
# Check the block is valid and compute the post-state
|
||||
@@ -4909,8 +4924,10 @@
|
||||
store.block_states[block_root] = state
|
||||
|
||||
# Add block timeliness to the store
|
||||
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
|
||||
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
|
||||
seconds_since_genesis = store.time - store.genesis_time
|
||||
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
|
||||
attestation_threshold_ms = get_slot_component_duration_ms(ATTESTATION_DUE_BPS)
|
||||
is_before_attesting_interval = time_into_slot_ms < attestation_threshold_ms
|
||||
is_timely = get_current_slot(store) == block.slot and is_before_attesting_interval
|
||||
store.block_timeliness[hash_tree_root(block)] = is_timely
|
||||
|
||||
@@ -4931,7 +4948,7 @@
|
||||
- file: beacon-chain/blockchain/receive_block.go
|
||||
search: func (s *Service) ReceiveBlock(
|
||||
spec: |
|
||||
<spec fn="on_block" fork="fulu" hash="b01ca61f">
|
||||
<spec fn="on_block" fork="fulu" hash="a27a9edb">
|
||||
def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
|
||||
"""
|
||||
Run ``on_block`` upon receiving a new block.
|
||||
@@ -4956,6 +4973,8 @@
|
||||
assert store.finalized_checkpoint.root == finalized_checkpoint_block
|
||||
|
||||
# [Modified in Fulu:EIP7594]
|
||||
# Check if blob data is available
|
||||
# If not, this payload MAY be queued and subsequently considered when blob data becomes available
|
||||
assert is_data_available(hash_tree_root(block))
|
||||
|
||||
# Check the block is valid and compute the post-state
|
||||
@@ -4968,8 +4987,10 @@
|
||||
store.block_states[block_root] = state
|
||||
|
||||
# Add block timeliness to the store
|
||||
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
|
||||
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
|
||||
seconds_since_genesis = store.time - store.genesis_time
|
||||
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
|
||||
attestation_threshold_ms = get_slot_component_duration_ms(ATTESTATION_DUE_BPS)
|
||||
is_before_attesting_interval = time_into_slot_ms < attestation_threshold_ms
|
||||
is_timely = get_current_slot(store) == block.slot and is_before_attesting_interval
|
||||
store.block_timeliness[hash_tree_root(block)] = is_timely
|
||||
|
||||
@@ -7540,6 +7561,20 @@
|
||||
assert block.state_root == hash_tree_root(state)
|
||||
</spec>
|
||||
|
||||
- name: seconds_to_milliseconds
|
||||
sources: []
|
||||
spec: |
|
||||
<spec fn="seconds_to_milliseconds" fork="phase0" hash="b2cc9743">
|
||||
def seconds_to_milliseconds(seconds: uint64) -> uint64:
|
||||
"""
|
||||
Convert seconds to milliseconds with overflow protection.
|
||||
Returns ``UINT64_MAX`` if the result would overflow.
|
||||
"""
|
||||
if seconds > UINT64_MAX // 1000:
|
||||
return UINT64_MAX
|
||||
return seconds * 1000
|
||||
</spec>
|
||||
|
||||
- name: store_target_checkpoint_state
|
||||
sources: []
|
||||
spec: |
|
||||
@@ -8572,17 +8607,16 @@
|
||||
- file: beacon-chain/core/peerdas/p2p_interface.go
|
||||
search: func VerifyDataColumnSidecarInclusionProof(
|
||||
spec: |
|
||||
<spec fn="verify_data_column_sidecar_inclusion_proof" fork="fulu" hash="a6757e5e">
|
||||
<spec fn="verify_data_column_sidecar_inclusion_proof" fork="fulu" hash="aaa9b8d8">
|
||||
def verify_data_column_sidecar_inclusion_proof(sidecar: DataColumnSidecar) -> bool:
|
||||
"""
|
||||
Verify if the given KZG commitments included in the given beacon block.
|
||||
"""
|
||||
gindex = get_subtree_index(get_generalized_index(BeaconBlockBody, "blob_kzg_commitments"))
|
||||
return is_valid_merkle_branch(
|
||||
leaf=hash_tree_root(sidecar.kzg_commitments),
|
||||
branch=sidecar.kzg_commitments_inclusion_proof,
|
||||
depth=KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH,
|
||||
index=gindex,
|
||||
index=get_subtree_index(get_generalized_index(BeaconBlockBody, "blob_kzg_commitments")),
|
||||
root=sidecar.signed_block_header.message.body_root,
|
||||
)
|
||||
</spec>
|
||||
|
||||
Reference in New Issue
Block a user