From b567ae113c7c54285663d5eb91ecdd4c27b49e8b Mon Sep 17 00:00:00 2001 From: Dmitrii Shmatko Date: Thu, 21 May 2026 21:55:09 +0200 Subject: [PATCH 1/3] Update specrefs to alpha.8 --- specrefs/configs.yml | 4 ++- specrefs/functions.yml | 82 +++++++++++++++++++++++++++++++++++------- 2 files changed, 73 insertions(+), 13 deletions(-) diff --git a/specrefs/configs.yml b/specrefs/configs.yml index f3b204a61e7..b7ba59f90d4 100644 --- a/specrefs/configs.yml +++ b/specrefs/configs.yml @@ -613,7 +613,9 @@ - name: PAYLOAD_DUE_BPS#gloas - sources: [] + sources: + - file: ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/mainnet.yaml + search: "PAYLOAD_DUE_BPS:" spec: | PAYLOAD_DUE_BPS: uint64 = 7500 diff --git a/specrefs/functions.yml b/specrefs/functions.yml index e28106d3c42..a6e648e2377 100644 --- a/specrefs/functions.yml +++ b/specrefs/functions.yml @@ -5466,6 +5466,16 @@ return bls.Sign(privkey, signing_root) +- name: get_payload_due_ms#gloas + sources: + - file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/gloas/util/ForkChoiceUtilGloas.java + search: public Optional getPayloadDueMillis() + spec: | + + def get_payload_due_ms() -> uint64: + return get_slot_component_duration_ms(PAYLOAD_DUE_BPS) + + - name: get_payload_due_ms#gloas sources: [] spec: | @@ -7283,6 +7293,30 @@ return gas_limit == min_gas_limit +- name: is_gas_limit_target_compatible#gloas + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/ExecutionPayloadBidGossipValidator.java + search: static boolean isGasLimitTargetCompatible( + spec: | + + def is_gas_limit_target_compatible( + parent_gas_limit: uint64, gas_limit: uint64, target_gas_limit: uint64 + ) -> bool: + """ + Check if ``gas_limit`` is compatible with ``target_gas_limit`` under the + EIP-1559 transition rule from ``parent_gas_limit``. + """ + max_gas_limit_difference = max(parent_gas_limit // 1024, 1) - 1 + min_gas_limit = parent_gas_limit - max_gas_limit_difference + max_gas_limit = parent_gas_limit + max_gas_limit_difference + + if target_gas_limit >= min_gas_limit and target_gas_limit <= max_gas_limit: + return gas_limit == target_gas_limit + if target_gas_limit > max_gas_limit: + return gas_limit == max_gas_limit + return gas_limit == min_gas_limit + + - name: is_head_late#phase0 sources: - file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ForkChoiceUtil.java @@ -8750,7 +8784,9 @@ - name: payload_data_availability#gloas - sources: [] + sources: + - file: storage/src/main/java/tech/pegasys/teku/storage/protoarray/ForkChoiceModelGloas.java + search: private boolean payloadDataAvailability( spec: | def payload_data_availability(store: Store, root: Root, available: bool) -> bool: @@ -8772,7 +8808,9 @@ - name: payload_timeliness#gloas - sources: [] + sources: + - file: storage/src/main/java/tech/pegasys/teku/storage/protoarray/ForkChoiceModelGloas.java + search: private boolean payloadTimeliness( spec: | def payload_timeliness(store: Store, root: Root, timely: bool) -> bool: @@ -11926,7 +11964,9 @@ - name: should_build_on_full#gloas - sources: [] + sources: + - file: storage/src/main/java/tech/pegasys/teku/storage/protoarray/ForkChoiceModelGloas.java + search: public boolean shouldBuildOnFull( spec: | def should_build_on_full(store: Store, head: ForkChoiceNode) -> bool: @@ -13470,7 +13510,9 @@ - name: validate_beacon_aggregate_and_proof_gossip#deneb - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AggregateAttestationValidator.java + search: validate(final ValidatableAttestation attestation) spec: | def validate_beacon_aggregate_and_proof_gossip( @@ -13601,7 +13643,9 @@ - name: validate_beacon_aggregate_and_proof_gossip#electra - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AggregateAttestationValidator.java + search: validate(final ValidatableAttestation attestation) spec: | def validate_beacon_aggregate_and_proof_gossip( @@ -13835,7 +13879,9 @@ - name: validate_beacon_attestation_gossip#deneb - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttestationValidator.java + search: public SafeFuture validate( spec: | def validate_beacon_attestation_gossip( @@ -13942,7 +13988,9 @@ - name: validate_beacon_attestation_gossip#electra - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttestationValidator.java + search: public SafeFuture validate( spec: | def validate_beacon_attestation_gossip( @@ -14329,7 +14377,9 @@ - name: validate_beacon_block_gossip#deneb - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/BlockGossipValidator.java + search: public SafeFuture validate( spec: | def validate_beacon_block_gossip( @@ -14428,7 +14478,9 @@ - name: validate_beacon_block_gossip#electra - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/BlockGossipValidator.java + search: public SafeFuture validate( spec: | def validate_beacon_block_gossip( @@ -14527,7 +14579,9 @@ - name: validate_blob_sidecar_gossip#deneb - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/BlobSidecarGossipValidator.java + search: public SafeFuture validate(final BlobSidecar blobSidecar) spec: | def validate_blob_sidecar_gossip( @@ -14622,7 +14676,9 @@ - name: validate_blob_sidecar_gossip#electra - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/BlobSidecarGossipValidator.java + search: public SafeFuture validate(final BlobSidecar blobSidecar) spec: | def validate_blob_sidecar_gossip( @@ -15319,7 +15375,9 @@ - name: validate_voluntary_exit_gossip#deneb - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/VoluntaryExitValidator.java + search: validateForGossip(final SignedVoluntaryExit exit) spec: | def validate_voluntary_exit_gossip( From b7abd2585e5793170e8598316d08709012ac51b6 Mon Sep 17 00:00:00 2001 From: Dmitrii Shmatko Date: Mon, 1 Jun 2026 14:45:50 +0200 Subject: [PATCH 2/3] merge fixes --- specrefs/.ethspecify.yml | 20 ++------------ specrefs/configs.yml | 4 +-- specrefs/functions.yml | 57 ++++++++++++++++++---------------------- 3 files changed, 28 insertions(+), 53 deletions(-) diff --git a/specrefs/.ethspecify.yml b/specrefs/.ethspecify.yml index 59b98e1f2a2..384aa57da9e 100644 --- a/specrefs/.ethspecify.yml +++ b/specrefs/.ethspecify.yml @@ -228,22 +228,6 @@ specrefs: - prepare_execution_payload#bellatrix - prepare_execution_payload#gloas - # Will be fixed later - - get_payload_due_ms#gloas - - is_gas_limit_target_compatible#gloas - - payload_data_availability#gloas - - payload_timeliness#gloas - - should_build_on_full#gloas - - validate_beacon_aggregate_and_proof_gossip#deneb - - validate_beacon_aggregate_and_proof_gossip#electra - - validate_beacon_attestation_gossip#deneb - - validate_beacon_attestation_gossip#electra - - validate_beacon_block_gossip#deneb - - validate_beacon_block_gossip#electra - - validate_blob_sidecar_gossip#deneb - - validate_blob_sidecar_gossip#electra - - validate_voluntary_exit_gossip#deneb - # Not implemented: fast confirmation - adjust_committee_weight_estimate_to_ensure_safety#phase0 - compute_adversarial_weight#phase0 @@ -318,8 +302,8 @@ specrefs: # Not needed: gloas - get_proposer_dependent_root#gloas - # Not implemented: gloas - - compute_weak_subjectivity_period#gloas + # Will be fixed later: gloas + - get_payload_due_ms#gloas # Not implemented: heze - get_forkchoice_store#heze diff --git a/specrefs/configs.yml b/specrefs/configs.yml index b7ba59f90d4..f3b204a61e7 100644 --- a/specrefs/configs.yml +++ b/specrefs/configs.yml @@ -613,9 +613,7 @@ - name: PAYLOAD_DUE_BPS#gloas - sources: - - file: ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/mainnet.yaml - search: "PAYLOAD_DUE_BPS:" + sources: [] spec: | PAYLOAD_DUE_BPS: uint64 = 7500 diff --git a/specrefs/functions.yml b/specrefs/functions.yml index a6e648e2377..ccbb08d487e 100644 --- a/specrefs/functions.yml +++ b/specrefs/functions.yml @@ -2126,6 +2126,31 @@ + return MIN_VALIDATOR_WITHDRAWABILITY_DELAY + epochs_for_validator_set_churn +- name: compute_weak_subjectivity_period#gloas + sources: + - file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/gloas/weaksubjectivity/WeakSubjectivityCalculatorGloas.java + search: public UInt64 computeWeakSubjectivityPeriod( + spec: | + + def compute_weak_subjectivity_period(state: BeaconState) -> uint64: + """ + Returns the weak subjectivity period for the current ``state``. + This computation takes into account the effect of: + - exit churn (weighted 2/3) + - activation churn (weighted 1/3) + - consolidation churn (weighted 1) + """ + t = get_total_active_balance(state) + # [Modified in Gloas:EIP8061] + delta = ( + 2 * get_exit_churn_limit(state) // 3 + + get_activation_churn_limit(state) // 3 + + get_consolidation_churn_limit(state) + ) + epochs_for_validator_set_churn = SAFETY_DECAY * t // (2 * delta * 100) + return MIN_VALIDATOR_WITHDRAWABILITY_DELAY + epochs_for_validator_set_churn + + - name: construct_vanishing_polynomial#fulu sources: [] spec: | @@ -5466,16 +5491,6 @@ return bls.Sign(privkey, signing_root) -- name: get_payload_due_ms#gloas - sources: - - file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/gloas/util/ForkChoiceUtilGloas.java - search: public Optional getPayloadDueMillis() - spec: | - - def get_payload_due_ms() -> uint64: - return get_slot_component_duration_ms(PAYLOAD_DUE_BPS) - - - name: get_payload_due_ms#gloas sources: [] spec: | @@ -7271,28 +7286,6 @@ ) -- name: is_gas_limit_target_compatible#gloas - sources: [] - spec: | - - def is_gas_limit_target_compatible( - parent_gas_limit: uint64, gas_limit: uint64, target_gas_limit: uint64 - ) -> bool: - """ - Check if ``gas_limit`` is compatible with ``target_gas_limit`` under the - EIP-1559 transition rule from ``parent_gas_limit``. - """ - max_gas_limit_difference = max(parent_gas_limit // 1024, 1) - 1 - min_gas_limit = parent_gas_limit - max_gas_limit_difference - max_gas_limit = parent_gas_limit + max_gas_limit_difference - - if target_gas_limit >= min_gas_limit and target_gas_limit <= max_gas_limit: - return gas_limit == target_gas_limit - if target_gas_limit > max_gas_limit: - return gas_limit == max_gas_limit - return gas_limit == min_gas_limit - - - name: is_gas_limit_target_compatible#gloas sources: - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/ExecutionPayloadBidGossipValidator.java From 7d118fa88af46887be7e122bfa6c54752b952994 Mon Sep 17 00:00:00 2001 From: Dmitrii Shmatko Date: Mon, 1 Jun 2026 14:57:35 +0200 Subject: [PATCH 3/3] more exceptions removed --- specrefs/.ethspecify.yml | 11 +---------- specrefs/functions.yml | 29 ++++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/specrefs/.ethspecify.yml b/specrefs/.ethspecify.yml index 384aa57da9e..50b9abd22ac 100644 --- a/specrefs/.ethspecify.yml +++ b/specrefs/.ethspecify.yml @@ -219,15 +219,6 @@ specrefs: - upgrade_lc_store_to_gloas#gloas - upgrade_lc_update_to_gloas#gloas - # Still need to implement this for Electra - - compute_weak_subjectivity_period#electra - - # Temporary exceptions: ignored until updated to alpha.8 spec - - apply_parent_execution_payload#gloas - - get_proposer_head#phase0 - - prepare_execution_payload#bellatrix - - prepare_execution_payload#gloas - # Not implemented: fast confirmation - adjust_committee_weight_estimate_to_ensure_safety#phase0 - compute_adversarial_weight#phase0 @@ -299,7 +290,7 @@ specrefs: - verify_partial_data_column_header_inclusion_proof#fulu - verify_partial_data_column_sidecar_kzg_proofs#fulu - # Not needed: gloas + # Not implemented: gloas - get_proposer_dependent_root#gloas # Will be fixed later: gloas diff --git a/specrefs/functions.yml b/specrefs/functions.yml index ccbb08d487e..5a218d15c8e 100644 --- a/specrefs/functions.yml +++ b/specrefs/functions.yml @@ -241,7 +241,9 @@ - name: apply_parent_execution_payload#gloas - sources: [] + sources: + - file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/gloas/block/BlockProcessorGloas.java + search: public void applyParentExecutionPayload( spec: | def apply_parent_execution_payload( @@ -2086,7 +2088,9 @@ - name: compute_weak_subjectivity_period#electra - sources: [] + sources: + - file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/weaksubjectivity/WeakSubjectivityCalculatorElectra.java + search: public UInt64 computeWeakSubjectivityPeriod( spec: | --- phase0 @@ -5659,7 +5663,9 @@ - name: get_proposer_head#phase0 - sources: [] + sources: + - file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ForkChoiceUtil.java + search: public ForkChoiceNode getProposerHead( spec: | def get_proposer_head(store: Store, head_root: Root, slot: Slot) -> Root: @@ -8839,7 +8845,16 @@ - name: prepare_execution_payload#bellatrix - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceUpdateData.java + search: final Optional terminalBlockHash) { + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ProposersDataManager.java + search: private SafeFuture> calculatePayloadBuildingAttributes( + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceUpdateData.java + search: public Optional> send( + - file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannel.java + search: ^ SafeFuture engineForkChoiceUpdated\( + regex: true spec: | def prepare_execution_payload( @@ -8956,7 +8971,11 @@ - name: prepare_execution_payload#gloas - sources: [] + sources: + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java + search: private Optional resolveProposerHeadOverride( + - file: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ProposersDataManager.java + search: private SafeFuture> calculatePayloadBuildingAttributes( spec: | def prepare_execution_payload(