From 60d945fe459a321d31cc647a347c61b6aaa8db9f Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Tue, 1 Oct 2024 11:35:21 +0800 Subject: [PATCH] fix spotless and assemble hopefully --- .../BlockOperationSelectorFactory.java | 2 +- .../tech/pegasys/teku/spec/SpecVersion.java | 3 +- .../blockbody/BeaconBlockBodyBuilder.java | 2 +- .../phase0/BeaconBlockBodyBuilderPhase0.java | 2 +- .../eip7732/ExecutionPayloadEip7732Impl.java | 76 +++++++++---------- .../eip7732/block/BlockProcessorEip7732.java | 2 +- .../pegasys/teku/spec/SpecVersionTest.java | 19 ++--- 7 files changed, 50 insertions(+), 56 deletions(-) diff --git a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java index 7673c8a4594..a8796c78e43 100644 --- a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java +++ b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java @@ -280,7 +280,7 @@ private SafeFuture setExecutionData( if (bodyBuilder.supportsExecutionRequests()) { bodyBuilder.executionRequests( new ExecutionRequestsBuilderElectra( - SchemaDefinitionsElectra.required(schemaDefinitions).getExecutionRequestsSchema()) + SchemaDefinitionsElectra.required(schemaDefinitions).getExecutionRequestsSchema()) .build()); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecVersion.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecVersion.java index 3ecb86ae7bf..54eff0137ab 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecVersion.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecVersion.java @@ -156,7 +156,8 @@ static SpecVersion createElectra( return new SpecVersion(SpecMilestone.ELECTRA, specConfig, schemaDefinitions, specLogic); } - static SpecVersion createEip7732(final SpecConfigEip7732 specConfig, final SchemaRegistryBuilder schemaRegistryBuilder) { + static SpecVersion createEip7732( + final SpecConfigEip7732 specConfig, final SchemaRegistryBuilder schemaRegistryBuilder) { final SchemaRegistry schemaRegistry = schemaRegistryBuilder.build(SpecMilestone.EIP7732, specConfig); final SchemaDefinitionsEip7732 schemaDefinitions = new SchemaDefinitionsEip7732(schemaRegistry); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/BeaconBlockBodyBuilder.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/BeaconBlockBodyBuilder.java index 9bd6e10a437..82575181efc 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/BeaconBlockBodyBuilder.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/BeaconBlockBodyBuilder.java @@ -20,8 +20,8 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.SyncAggregate; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; -import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests; import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeader; +import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing; import tech.pegasys.teku.spec.datastructures.operations.Deposit; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodyBuilderPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodyBuilderPhase0.java index d1183977965..ddddb88b97d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodyBuilderPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodyBuilderPhase0.java @@ -27,8 +27,8 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.SyncAggregate; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; -import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests; import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeader; +import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing; import tech.pegasys.teku.spec.datastructures.operations.Deposit; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732Impl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732Impl.java index efa666943f2..39b7703e4da 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732Impl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/eip7732/ExecutionPayloadEip7732Impl.java @@ -34,46 +34,46 @@ public class ExecutionPayloadEip7732Impl extends Container17< - ExecutionPayloadEip7732Impl, - SszBytes32, - SszByteVector, - SszBytes32, - SszBytes32, - SszByteVector, - SszBytes32, - SszUInt64, - SszUInt64, - SszUInt64, - SszUInt64, - SszByteList, - SszUInt256, - SszBytes32, - SszList, - SszList, - SszUInt64, - SszUInt64> + ExecutionPayloadEip7732Impl, + SszBytes32, + SszByteVector, + SszBytes32, + SszBytes32, + SszByteVector, + SszBytes32, + SszUInt64, + SszUInt64, + SszUInt64, + SszUInt64, + SszByteList, + SszUInt256, + SszBytes32, + SszList, + SszList, + SszUInt64, + SszUInt64> implements ExecutionPayloadEip7732 { public ExecutionPayloadEip7732Impl( final ContainerSchema17< - ExecutionPayloadEip7732Impl, - SszBytes32, - SszByteVector, - SszBytes32, - SszBytes32, - SszByteVector, - SszBytes32, - SszUInt64, - SszUInt64, - SszUInt64, - SszUInt64, - SszByteList, - SszUInt256, - SszBytes32, - SszList, - SszList, - SszUInt64, - SszUInt64> + ExecutionPayloadEip7732Impl, + SszBytes32, + SszByteVector, + SszBytes32, + SszBytes32, + SszByteVector, + SszBytes32, + SszUInt64, + SszUInt64, + SszUInt64, + SszUInt64, + SszByteList, + SszUInt256, + SszBytes32, + SszList, + SszList, + SszUInt64, + SszUInt64> schema, final TreeNode backingNode) { super(schema, backingNode); @@ -226,8 +226,6 @@ public UInt64 getExcessBlobGas() { @Override public List getUnblindedTreeNodes() { - return List.of( - getTransactions().getBackingNode(), - getWithdrawals().getBackingNode()); + return List.of(getTransactions().getBackingNode(), getWithdrawals().getBackingNode()); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java index 2290a442921..e9615bd00a0 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java @@ -303,5 +303,5 @@ public ExecutionPayloadHeader extractExecutionPayloadHeader(final BeaconBlockBod return null; } - //EIP7732 TODO: remove processStuff + // EIP7732 TODO: remove processStuff } diff --git a/ethereum/spec/src/test/java/tech/pegasys/teku/spec/SpecVersionTest.java b/ethereum/spec/src/test/java/tech/pegasys/teku/spec/SpecVersionTest.java index 76b3194d30c..47cb22628aa 100644 --- a/ethereum/spec/src/test/java/tech/pegasys/teku/spec/SpecVersionTest.java +++ b/ethereum/spec/src/test/java/tech/pegasys/teku/spec/SpecVersionTest.java @@ -82,6 +82,13 @@ void shouldCreateSpec(final SpecMilestone milestone) { actualVersion = SpecVersion.create(SpecMilestone.ELECTRA, minimalConfig, schemaRegistryBuilder); } + case EIP7732 -> { + expectedVersion = + SpecVersion.createEip7732( + SpecConfigEip7732.required(minimalConfig), schemaRegistryBuilder); + actualVersion = + SpecVersion.create(SpecMilestone.EIP7732, minimalConfig, schemaRegistryBuilder); + } } assertThat(actualVersion).isPresent(); @@ -91,16 +98,4 @@ void shouldCreateSpec(final SpecMilestone milestone) { assertThat(actualVersion.get().getSchemaDefinitions().getSchemaRegistry().getMilestone()) .isSameAs(milestone); } - - @Test - void shouldCreateEip7732Spec() { - final SpecConfigEip7732 eip7732SpecConfig = SpecConfigEip7732.required(minimalConfig); - final SpecVersion expectedVersion = SpecVersion.createEip7732(eip7732SpecConfig); - final Optional actualVersion = - SpecVersion.create(SpecMilestone.EIP7732, minimalConfig); - assertThat(actualVersion).isPresent(); - assertThat(actualVersion.get().getMilestone()).isEqualTo(SpecMilestone.EIP7732); - assertThat(actualVersion.get().getSchemaDefinitions()) - .hasSameClassAs(expectedVersion.getSchemaDefinitions()); - } }