Skip to content
Merged
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ allprojects {
}

def nightly = System.getenv("NIGHTLY") != null
def refTestVersion = nightly ? "nightly" : "v1.7.0-alpha.8"
def refTestVersion = nightly ? "nightly" : "v1.7.0-alpha.9"
def blsRefTestVersion = 'v0.1.2'
def slashingProtectionInterchangeRefTestVersion = 'v5.3.0'
def refTestBaseUrl = 'https://github.com/ethereum/consensus-specs/releases/download'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public class ForkChoiceTestExecutor implements TestExecutor {
.put("fork_choice/on_merge_block", IGNORE_TESTS) // TTD Logic is deprecated
.put("fork_choice/withholding", new ForkChoiceTestExecutor())
.put("sync/optimistic", new ForkChoiceTestExecutor())
.put("fork_choice/should_override_forkchoice_update", new ForkChoiceTestExecutor())
.put("fork_choice/get_proposer_head", new ForkChoiceTestExecutor())
.put("fork_choice/deposit_with_reorg", new ForkChoiceTestExecutor())
.put("fork_choice/get_parent_payload_status", new ForkChoiceTestExecutor())
Expand Down Expand Up @@ -645,21 +644,6 @@ private void applyChecks(
.isEqualTo(expectedProposerHead);
}

case "should_override_forkchoice_update" -> {
final Map<String, Boolean> shouldOverrideForkChoiceUpdateCheck = get(checks, checkType);
final boolean expectedResult = shouldOverrideForkChoiceUpdateCheck.get("result");
final boolean expectedValidatorIsConnected =
shouldOverrideForkChoiceUpdateCheck.get("validator_is_connected");
final boolean shouldOverrideChainHead =
recentChainData.shouldOverrideForkChoiceUpdate(
recentChainData.getBestBlockRoot().orElseThrow(),
recentChainData.getHeadSlot());
assertThat(shouldOverrideChainHead).isEqualTo(expectedResult);
// We've currently only handled the validatorIsConnected 'true' case in reftests,
// lets validate we're dealing with that and don't have to extend tests further.
assertThat(expectedValidatorIsConnected).isTrue();
}

case "viable_for_head_roots_and_weights" -> {
final List<Map<String, Object>> viableHeadRootsAndWeightsData = get(checks, checkType);
final Map<Bytes32, UInt64> viableHeadRootsAndWeights =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public void processDepositRequests(
new SszSignature(depositRequest.getSignature()),
SszUInt64.of(state.getSlot()));
pendingDeposits.append(deposit);
;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import tech.pegasys.teku.spec.datastructures.state.Validator;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconStateCache;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.electra.BeaconStateElectra;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.electra.MutableBeaconStateElectra;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingConsolidation;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingDeposit;
Expand Down Expand Up @@ -233,13 +234,7 @@ public void processPendingDeposits(final MutableBeaconState state) {
miscHelpers.computeStartSlotAtEpoch(stateElectra.getFinalizedCheckpoint().getEpoch());

for (final PendingDeposit deposit : stateElectra.getPendingDeposits()) {
// Do not process deposit requests if Eth1 bridge deposits are not yet applied.
final boolean isDepositRequest = deposit.getSlot().isGreaterThan(GENESIS_SLOT);
final boolean hasPendingEth1BridgeDeposits =
stateElectra
.getEth1DepositIndex()
.isLessThan(stateElectra.getDepositRequestsStartIndex());
if (isDepositRequest && hasPendingEth1BridgeDeposits) {
if (areEth1BridgeDepositsNotApplied(deposit, stateElectra)) {
break;
}

Expand Down Expand Up @@ -304,6 +299,14 @@ public void processPendingDeposits(final MutableBeaconState state) {
}
}

public boolean areEth1BridgeDepositsNotApplied(
final PendingDeposit deposit, final BeaconStateElectra state) {
final boolean isDepositRequest = deposit.getSlot().isGreaterThan(GENESIS_SLOT);
final boolean hasPendingEth1BridgeDeposits =
state.getEth1DepositIndex().isLessThan(state.getDepositRequestsStartIndex());
return isDepositRequest && hasPendingEth1BridgeDeposits;
}

/** process_pending_consolidations */
@Override
public void processPendingConsolidations(final MutableBeaconState state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import tech.pegasys.teku.spec.logic.versions.electra.weaksubjectivity.WeakSubjectivityCalculatorElectra;
import tech.pegasys.teku.spec.logic.versions.electra.withdrawals.WithdrawalsHelpersElectra;
import tech.pegasys.teku.spec.logic.versions.fulu.block.BlockProcessorFulu;
import tech.pegasys.teku.spec.logic.versions.fulu.execution.ExecutionRequestsProcessorFulu;
import tech.pegasys.teku.spec.logic.versions.fulu.forktransition.FuluStateUpgrade;
import tech.pegasys.teku.spec.logic.versions.fulu.helpers.BeaconStateAccessorsFulu;
import tech.pegasys.teku.spec.logic.versions.fulu.helpers.MiscHelpersFulu;
Expand Down Expand Up @@ -186,8 +187,8 @@ public static SpecLogicFulu create(
final WithdrawalsHelpersElectra withdrawalsHelpers =
new WithdrawalsHelpersElectra(
schemaDefinitions, miscHelpers, config, predicates, beaconStateMutators);
final ExecutionRequestsProcessorElectra executionRequestsProcessor =
new ExecutionRequestsProcessorElectra(
final ExecutionRequestsProcessorFulu executionRequestsProcessor =
new ExecutionRequestsProcessorFulu(
schemaDefinitions,
miscHelpers,
config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@

package tech.pegasys.teku.spec.logic.versions.fulu.block;

import static com.google.common.base.Preconditions.checkArgument;

import tech.pegasys.teku.infrastructure.ssz.SszList;
import tech.pegasys.teku.spec.config.SpecConfigElectra;
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.BeaconBlockBody;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsDataCodec;
import tech.pegasys.teku.spec.datastructures.operations.Deposit;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState;
import tech.pegasys.teku.spec.logic.common.helpers.Predicates;
import tech.pegasys.teku.spec.logic.common.operations.OperationSignatureVerifier;
import tech.pegasys.teku.spec.logic.common.operations.validation.OperationValidator;
Expand Down Expand Up @@ -75,4 +81,17 @@ public int getMaxBlobsPerBlock(final BeaconState state) {
.getBlobParameters(miscHelpers.computeEpochAtSlot(state.getSlot()))
.maxBlobsPerBlock();
}

@Override
protected void verifyOutstandingDepositsAreProcessed(
final BeaconState state, final BeaconBlockBody body) {
checkArgument(
body.getDeposits().isEmpty(),
"process_operations: Verify that former deposit mechanism has been disabled");
}

@Override
public void processDeposits(final MutableBeaconState state, final SszList<Deposit> deposits) {
// NO-OP: modified to remove support for the former deposit mechanism.
}
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright Consensys Software Inc., 2026
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.spec.logic.versions.fulu.execution;

import java.util.List;
import tech.pegasys.teku.infrastructure.ssz.SszMutableList;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
import tech.pegasys.teku.spec.config.SpecConfigFulu;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.DepositRequest;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.electra.MutableBeaconStateElectra;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingDeposit;
import tech.pegasys.teku.spec.datastructures.type.SszPublicKey;
import tech.pegasys.teku.spec.datastructures.type.SszSignature;
import tech.pegasys.teku.spec.logic.common.util.ValidatorsUtil;
import tech.pegasys.teku.spec.logic.versions.electra.execution.ExecutionRequestsProcessorElectra;
import tech.pegasys.teku.spec.logic.versions.electra.helpers.BeaconStateMutatorsElectra;
import tech.pegasys.teku.spec.logic.versions.electra.helpers.PredicatesElectra;
import tech.pegasys.teku.spec.logic.versions.fulu.helpers.BeaconStateAccessorsFulu;
import tech.pegasys.teku.spec.logic.versions.fulu.helpers.MiscHelpersFulu;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsFulu;

public class ExecutionRequestsProcessorFulu extends ExecutionRequestsProcessorElectra {

public ExecutionRequestsProcessorFulu(
final SchemaDefinitionsFulu schemaDefinitions,
final MiscHelpersFulu miscHelpers,
final SpecConfigFulu specConfig,
final PredicatesElectra predicates,
final ValidatorsUtil validatorsUtil,
final BeaconStateMutatorsElectra beaconStateMutators,
final BeaconStateAccessorsFulu beaconStateAccessors) {
super(
schemaDefinitions,
miscHelpers,
specConfig,
predicates,
validatorsUtil,
beaconStateMutators,
beaconStateAccessors);
}

/*
The function `process_deposit_request` is modified to remove support for the former deposit mechanism.
*/
@Override
public void processDepositRequests(
final MutableBeaconState state, final List<DepositRequest> depositRequests) {
final MutableBeaconStateElectra stateElectra = MutableBeaconStateElectra.required(state);
for (DepositRequest depositRequest : depositRequests) {
final SszMutableList<PendingDeposit> pendingDeposits = stateElectra.getPendingDeposits();
final PendingDeposit deposit =
schemaDefinitions
.getPendingDepositSchema()
.create(
new SszPublicKey(depositRequest.getPubkey()),
SszBytes32.of(depositRequest.getWithdrawalCredentials()),
SszUInt64.of(depositRequest.getAmount()),
new SszSignature(depositRequest.getSignature()),
SszUInt64.of(state.getSlot()));
pendingDeposits.append(deposit);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.config.SpecConfigFulu;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.electra.BeaconStateElectra;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.fulu.MutableBeaconStateFulu;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingDeposit;
import tech.pegasys.teku.spec.logic.common.helpers.BeaconStateMutators;
import tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatusFactory;
import tech.pegasys.teku.spec.logic.common.util.BeaconStateUtil;
Expand Down Expand Up @@ -59,6 +61,13 @@ public EpochProcessorFulu(
this.schemaDefinitionsFulu = SchemaDefinitionsFulu.required(schemaDefinitions);
}

// modified to remove support for the former deposit mechanism
@Override
public boolean areEth1BridgeDepositsNotApplied(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it "Not"? if it should be, I'd find another name for it, boolean with "not" is confusing

final PendingDeposit deposit, final BeaconStateElectra state) {
return false;
}

/** process_proposer_lookahead */
@Override
public void processProposerLookahead(final MutableBeaconState state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingDeposit;
import tech.pegasys.teku.spec.datastructures.type.SszPublicKey;
import tech.pegasys.teku.spec.datastructures.type.SszSignature;
import tech.pegasys.teku.spec.logic.common.util.ValidatorsUtil;
import tech.pegasys.teku.spec.logic.versions.electra.execution.ExecutionRequestsProcessorElectra;
import tech.pegasys.teku.spec.logic.versions.fulu.execution.ExecutionRequestsProcessorFulu;
import tech.pegasys.teku.spec.logic.versions.gloas.helpers.BeaconStateAccessorsGloas;
import tech.pegasys.teku.spec.logic.versions.gloas.helpers.BeaconStateMutatorsGloas;
import tech.pegasys.teku.spec.logic.versions.gloas.helpers.MiscHelpersGloas;
import tech.pegasys.teku.spec.logic.versions.gloas.helpers.PredicatesGloas;
import tech.pegasys.teku.spec.logic.versions.gloas.util.ValidatorsUtilGloas;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsGloas;

public class ExecutionRequestsProcessorGloas extends ExecutionRequestsProcessorElectra {
public class ExecutionRequestsProcessorGloas extends ExecutionRequestsProcessorFulu {

private final MiscHelpersGloas miscHelpersGloas;
private final PredicatesGloas predicatesGloas;
Expand All @@ -51,7 +51,7 @@ public ExecutionRequestsProcessorGloas(
final MiscHelpersGloas miscHelpers,
final SpecConfigGloas specConfig,
final PredicatesGloas predicates,
final ValidatorsUtil validatorsUtil,
final ValidatorsUtilGloas validatorsUtil,
final BeaconStateMutatorsGloas beaconStateMutators,
final BeaconStateAccessorsGloas beaconStateAccessors) {
super(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@ public BeaconStateAccessorsGloas(
this.schemaDefinitions = schemaDefinitions;
}

/**
* EIP-8045: `get_beacon_proposer_indices` is modified to exclude slashed validators from the
* candidate pool before invoking `compute_proposer_indices`, so the `proposer_lookahead` only
* contains active and unslashed validators.
*/
@Override
public List<Integer> getBeaconProposerIndices(final BeaconState state, final UInt64 epoch) {
final IntList indices =
getActiveValidatorIndices(state, epoch)
.intStream()
.filter(index -> !state.getValidators().get(index).isSlashed())
.collect(IntArrayList::new, IntList::add, IntList::addAll);
final Bytes32 seed = getSeed(state, epoch, Domain.BEACON_PROPOSER);
return miscHelpers.computeProposerIndices(state, epoch, seed, indices);
}

/**
* EIP-8061: scaled balance churn limit using the supplied quotient. Returns
* max(MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA, total_active_balance // quotient), rounded down to
Expand Down
23 changes: 22 additions & 1 deletion specrefs/.ethspecify.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: v1.7.0-alpha.8
version: v1.7.0-alpha.9
style: full

specrefs:
Expand Down Expand Up @@ -29,6 +29,7 @@ specrefs:

# Constant for max value, defined elsewhere
- UINT64_MAX_SQRT
- EMPTY_BLOCK_HASH#bellatrix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we have this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is part of Tuweni, on the other side we have MAX_SQRT, will do some changes

# No light client support
- MAX_REQUEST_LIGHT_CLIENT_UPDATES
Expand Down Expand Up @@ -102,6 +103,8 @@ specrefs:
- Seen#capella
- Seen#deneb
- Seen#electra
- Seen#fulu
- Seen#gloas

# Not implemented: heze
- GetInclusionListResponse#heze
Expand Down Expand Up @@ -254,6 +257,13 @@ specrefs:
- update_fast_confirmation_variables#phase0
- will_current_target_be_justified#phase0
- will_no_conflicting_checkpoint_be_justified#phase0
- get_node_for_root#phase0
- get_node_for_root#gloas
- get_safe_execution_block_hash#bellatrix
- get_safe_execution_block_hash#gloas

# Not implemented: phase0
- get_dependent_root#phase0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have this probably

# Not implemented: capella
- prepare_execution_payload#capella
Expand Down Expand Up @@ -289,13 +299,24 @@ specrefs:
- recover_matrix#fulu
- verify_partial_data_column_header_inclusion_proof#fulu
- verify_partial_data_column_sidecar_kzg_proofs#fulu
- validate_beacon_block_gossip#fulu
- validate_data_column_sidecar_gossip#fulu
- validate_partial_data_column_sidecar_gossip#fulu

# Not implemented: gloas
- get_proposer_dependent_root#gloas
- get_dependent_root#gloas

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably have this

# Will be fixed later: gloas
- get_payload_due_ms#gloas

# Will be fixed later phase0 and gloas
- get_supported_node#phase0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean what scope it fits better?

- get_supported_node#gloas
- is_ancestor#phase0
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
- is_ancestor#gloas
- is_previous_slot_payload_decision#gloas

# Not implemented: heze
- get_forkchoice_store#heze
- get_inclusion_list_bits#heze
Expand Down
7 changes: 7 additions & 0 deletions specrefs/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@
DOMAIN_VOLUNTARY_EXIT: DomainType = '0x04000000'
</spec>

- name: EMPTY_BLOCK_HASH#bellatrix
sources: []
spec: |
<spec constant_var="EMPTY_BLOCK_HASH" fork="bellatrix" hash="23cdf402">
EMPTY_BLOCK_HASH: Hash32 =
</spec>

- name: ENDIANNESS#phase0
sources: []
spec: |
Expand Down
10 changes: 0 additions & 10 deletions specrefs/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1145,16 +1145,6 @@
epoch: Epoch
</spec>

- name: ForkChoiceNode#gloas
sources:
- file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/ForkChoiceNode.java
spec: |
<spec container="ForkChoiceNode" fork="gloas" hash="755a4b34">
class ForkChoiceNode(Container):
root: Root
payload_status: PayloadStatus # One of PAYLOAD_STATUS_* values
</spec>

- name: ForkData#phase0
sources:
- file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/ForkData.java
Expand Down
Loading
Loading