From a3f7ebc75f24ec942286b0c1ae192e411f84aa7e Mon Sep 17 00:00:00 2001 From: Gabriel Fukushima Date: Mon, 22 Apr 2024 10:51:28 +1000 Subject: [PATCH] Error prone `final` - ethereum module (#8219) * add missing final Signed-off-by: Gabriel Fukushima --------- Signed-off-by: Gabriel Fukushima --- .../generators/StateGenerator.java | 2 +- .../dataproviders/lookup/BlockProvider.java | 2 +- .../ethereum/execution/types/Eth1Address.java | 19 ++++---- .../ethereum/executionclient/auth/Token.java | 2 +- .../schema/ClientVersionV1.java | 8 ++-- .../schema/ExecutionPayloadCommon.java | 26 +++++----- .../schema/ExecutionPayloadV1.java | 33 ++++++------- .../schema/ExecutionPayloadV2.java | 35 +++++++------- .../schema/ExecutionPayloadV3.java | 34 ++++++------- .../schema/ExecutionPayloadV4.java | 38 +++++++-------- .../schema/ForkChoiceStateV1.java | 9 ++-- .../schema/ForkChoiceUpdatedResult.java | 4 +- .../schema/PayloadAttributesV1.java | 8 ++-- .../schema/PayloadAttributesV2.java | 10 ++-- .../schema/PayloadAttributesV3.java | 10 ++-- .../schema/PayloadStatusV1.java | 6 +-- .../executionclient/schema/Response.java | 2 +- .../serialization/Bytes20Deserializer.java | 3 +- .../serialization/Bytes20Serializer.java | 3 +- .../serialization/Bytes32Deserializer.java | 3 +- .../serialization/Bytes8Deserializer.java | 3 +- .../serialization/BytesDeserializer.java | 3 +- .../serialization/BytesSerializer.java | 3 +- .../UInt256AsHexDeserializer.java | 3 +- .../serialization/UInt256AsHexSerializer.java | 3 +- .../UInt64AsHexDeserializer.java | 3 +- .../serialization/UInt64AsHexSerializer.java | 5 +- .../executionclient/web3j/Web3JClient.java | 4 +- .../web3j/Web3JExecutionEngineClient.java | 12 +++-- .../web3j/Web3jClientBuilder.java | 10 ++-- .../web3j/Web3jWebsocketClient.java | 2 +- .../ExecutionLayerManagerStub.java | 2 +- .../beacon/GetGenesisApiDataBuilder.java | 6 +-- .../json/types/beacon/StateValidatorData.java | 2 +- .../beacon/StateValidatorDataBuilder.java | 8 ++-- .../validator/AttesterDutiesBuilder.java | 6 +-- .../types/validator/AttesterDutyBuilder.java | 14 +++--- .../validator/ProposerDutiesBuilder.java | 6 +-- .../types/validator/ProposerDutyBuilder.java | 6 +-- .../validator/SyncCommitteeDutiesBuilder.java | 4 +- .../validator/SyncCommitteeDutyBuilder.java | 6 +-- .../networks/Eth2NetworkConfiguration.java | 10 ++-- .../teku/ethereum/pow/api/Deposit.java | 10 ++-- .../ethereum/pow/api/Eth1EventsChannel.java | 5 +- .../pow/api/MinGenesisTimeBlockEvent.java | 3 +- .../java/tech/pegasys/teku/spec/Spec.java | 43 +++++++++-------- .../tech/pegasys/teku/spec/SpecFactory.java | 2 +- .../teku/spec/config/SpecConfigAltair.java | 2 +- .../teku/spec/config/SpecConfigBellatrix.java | 2 +- .../teku/spec/config/SpecConfigCapella.java | 2 +- .../teku/spec/config/SpecConfigReader.java | 6 +-- .../spec/constants/ParticipationFlags.java | 4 +- .../attestation/ValidatableAttestation.java | 2 +- .../blobs/versions/deneb/BlobSchema.java | 2 +- .../versions/deneb/BlobSidecarSchema.java | 2 +- .../datastructures/blocks/BeaconBlock.java | 16 +++---- .../blocks/BeaconBlockHeader.java | 12 +++-- .../blocks/BeaconBlockSchema.java | 2 +- .../spec/datastructures/blocks/Eth1Data.java | 6 +-- .../spec/datastructures/blocks/NodeSlot.java | 4 +- .../blocks/SignedBeaconBlock.java | 2 +- .../blocks/SignedBeaconBlockHeader.java | 2 +- .../blocks/SignedBeaconBlockHeaderSchema.java | 2 +- .../blocks/SignedBeaconBlockSchema.java | 2 +- .../blocks/SlotAndBlockRoot.java | 2 +- .../AbstractSignedBeaconBlockBlinder.java | 2 +- .../altair/BeaconBlockBodyAltairImpl.java | 25 +++++----- .../BeaconBlockBodySchemaAltairImpl.java | 20 ++++---- .../BeaconBlockBodyBellatrixImpl.java | 27 ++++++----- .../BeaconBlockBodySchemaBellatrixImpl.java | 22 ++++----- .../BlindedBeaconBlockBodyBellatrixImpl.java | 26 +++++----- ...dedBeaconBlockBodySchemaBellatrixImpl.java | 22 ++++----- .../SignedBeaconBlockUnblinderBellatrix.java | 2 +- .../capella/BeaconBlockBodyCapellaImpl.java | 29 +++++------ .../BeaconBlockBodySchemaCapellaImpl.java | 2 +- .../BlindedBeaconBlockBodyCapellaImpl.java | 4 +- ...indedBeaconBlockBodySchemaCapellaImpl.java | 24 +++++----- .../deneb/BeaconBlockBodyDenebImpl.java | 26 +++++----- .../phase0/BeaconBlockBodyPhase0.java | 22 ++++----- .../phase0/BeaconBlockBodySchemaPhase0.java | 18 +++---- .../builder/SignedBuilderBid.java | 2 +- .../builder/SignedBuilderBidSchema.java | 2 +- .../builder/SignedValidatorRegistration.java | 3 +- .../SignedValidatorRegistrationSchema.java | 2 +- .../SignedValidatorRegistrationsSchema.java | 5 +- .../builder/ValidatorRegistration.java | 13 ++--- .../builder/ValidatorRegistrationSchema.java | 2 +- .../bellatrix/BuilderBidSchemaBellatrix.java | 2 +- .../datastructures/execution/PowBlock.java | 5 +- .../datastructures/execution/Transaction.java | 2 +- .../execution/TransactionSchema.java | 2 +- .../bellatrix/ExecutionPayloadBellatrix.java | 34 ++++++------- .../ExecutionPayloadHeaderBellatrix.java | 34 ++++++------- ...ExecutionPayloadHeaderSchemaBellatrix.java | 2 +- .../ExecutionPayloadSchemaBellatrix.java | 2 +- .../capella/ExecutionPayloadCapellaImpl.java | 36 +++++++------- .../ExecutionPayloadHeaderCapellaImpl.java | 36 +++++++------- .../ExecutionPayloadHeaderSchemaCapella.java | 2 +- .../ExecutionPayloadSchemaCapella.java | 2 +- .../deneb/ExecutionPayloadDenebImpl.java | 40 ++++++++-------- .../ExecutionPayloadHeaderDenebImpl.java | 40 ++++++++-------- .../electra/ExecutionPayloadElectraImpl.java | 44 ++++++++--------- .../ExecutionPayloadHeaderElectraImpl.java | 44 ++++++++--------- .../forkchoice/ReadOnlyStore.java | 2 +- .../forkchoice/VoteTracker.java | 12 ++--- .../datastructures/hashtree/HashTree.java | 11 +++-- .../BreadthFirstTraversalTreeIterator.java | 4 +- .../hashtree/traversal/OrderedTreeStream.java | 6 +-- .../PreOrderTraversalTreeIterator.java | 4 +- .../LightClientBootstrapSchema.java | 8 ++-- .../lightclient/LightClientHeaderSchema.java | 4 +- .../LightClientUpdateResponseSchema.java | 4 +- .../lightclient/LightClientUpdateSchema.java | 16 +++---- .../metadata/ObjectAndMetaDataBuilder.java | 10 ++-- .../BeaconBlocksByRangeRequestMessage.java | 4 +- .../rpc/BeaconBlocksByRootRequestMessage.java | 6 +-- .../networking/libp2p/rpc/EmptyMessage.java | 2 +- .../networking/libp2p/rpc/EnrForkId.java | 4 +- .../networking/libp2p/rpc/GoodbyeMessage.java | 6 +-- .../networking/libp2p/rpc/PingMessage.java | 6 +-- .../libp2p/rpc/RpcErrorMessage.java | 6 +-- .../networking/libp2p/rpc/StatusMessage.java | 14 +++--- .../phase0/MetadataMessagePhase0.java | 8 ++-- .../phase0/MetadataMessageSchemaPhase0.java | 2 +- .../operations/AggregateAndProof.java | 12 ++--- .../operations/Attestation.java | 2 +- .../operations/AttestationData.java | 12 +++-- .../operations/AttesterSlashing.java | 4 +- .../datastructures/operations/Deposit.java | 8 ++-- .../operations/DepositData.java | 9 ++-- .../operations/DepositMessage.java | 4 +- .../operations/DepositWithIndex.java | 7 +-- .../operations/IndexedAttestation.java | 4 +- .../operations/ProposerSlashing.java | 7 +-- .../operations/SignedAggregateAndProof.java | 8 ++-- .../operations/SignedVoluntaryExit.java | 4 +- .../operations/VoluntaryExit.java | 6 +-- .../bellatrix/BeaconPreparableProposer.java | 2 +- .../datastructures/state/AnchorPoint.java | 13 +++-- .../spec/datastructures/state/Checkpoint.java | 6 +-- .../state/CommitteeAssignment.java | 5 +- .../teku/spec/datastructures/state/Fork.java | 6 +-- .../spec/datastructures/state/ForkData.java | 4 +- .../datastructures/state/HistoricalBatch.java | 11 +++-- .../state/PendingAttestation.java | 4 +- .../datastructures/state/SigningData.java | 6 +-- .../datastructures/state/SyncCommittee.java | 2 +- .../spec/datastructures/state/Validator.java | 48 +++++++++---------- .../state/beaconstate/BeaconStateCache.java | 4 +- .../state/beaconstate/MutableBeaconState.java | 38 +++++++-------- .../common/AbstractBeaconState.java | 6 +-- .../common/AbstractBeaconStateSchema.java | 3 +- .../common/AbstractMutableBeaconState.java | 11 +++-- .../common/BeaconStateInvariants.java | 6 +-- .../beaconstate/common/TransitionCaches.java | 26 +++++----- .../common/analysis/ValidatorStats.java | 3 +- .../versions/altair/BeaconStateAltair.java | 2 +- .../altair/BeaconStateAltairImpl.java | 17 +++---- .../altair/BeaconStateSchemaAltair.java | 2 +- .../altair/MutableBeaconStateAltair.java | 6 +-- .../altair/MutableBeaconStateAltairImpl.java | 15 +++--- .../bellatrix/BeaconStateBellatrix.java | 4 +- .../bellatrix/BeaconStateBellatrixImpl.java | 14 +++--- .../bellatrix/BeaconStateSchemaBellatrix.java | 2 +- .../MutableBeaconStateBellatrix.java | 5 +- .../MutableBeaconStateBellatrixImpl.java | 17 +++---- .../versions/capella/BeaconStateCapella.java | 6 +-- .../capella/BeaconStateCapellaImpl.java | 14 +++--- .../capella/BeaconStateSchemaCapella.java | 2 +- .../capella/MutableBeaconStateCapella.java | 6 +-- .../MutableBeaconStateCapellaImpl.java | 5 +- .../versions/deneb/BeaconStateDeneb.java | 2 +- .../deneb/BeaconStateSchemaDeneb.java | 2 +- .../versions/electra/BeaconStateElectra.java | 2 +- .../electra/BeaconStateSchemaElectra.java | 2 +- .../phase0/BeaconStatePhase0Impl.java | 19 ++++---- .../phase0/BeaconStateSchemaPhase0.java | 2 +- .../phase0/MutableBeaconStatePhase0Impl.java | 19 ++++---- .../versions/capella/HistoricalSummary.java | 11 +++-- .../electra/PendingBalanceDeposit.java | 2 +- .../electra/PendingConsolidation.java | 4 +- .../electra/PendingPartialWithdrawal.java | 7 +-- .../datastructures/type/SszPublicKey.java | 6 +-- .../type/SszPublicKeySchema.java | 2 +- .../datastructures/type/SszSignature.java | 4 +- .../type/SszSignatureSchema.java | 2 +- .../spec/datastructures/util/DepositUtil.java | 2 +- .../util/SlotAndBlockRootAndBlobIndex.java | 2 +- .../validator/SubnetSubscription.java | 2 +- .../ExecutionLayerChannelStub.java | 2 +- .../ForkChoiceUpdatedResult.java | 3 +- .../spec/executionlayer/PayloadStatus.java | 20 ++++---- .../teku/spec/genesis/GenesisGenerator.java | 6 ++- .../teku/spec/logic/StateTransition.java | 2 +- .../common/block/AbstractBlockProcessor.java | 42 ++++++++-------- .../common/helpers/BeaconStateAccessors.java | 35 +++++++------- .../common/helpers/BeaconStateMutators.java | 9 ++-- .../logic/common/helpers/MiscHelpers.java | 24 +++++----- .../spec/logic/common/helpers/Predicates.java | 10 ++-- .../OperationSignatureVerifier.java | 8 ++-- .../BatchSignatureVerifier.java | 8 +++- .../blockvalidator/BlockValidationResult.java | 4 +- .../epoch/AbstractEpochProcessor.java | 7 +-- .../statetransition/epoch/EpochProcessor.java | 4 +- .../exceptions/BlockProcessingException.java | 6 +-- .../exceptions/EpochProcessingException.java | 4 +- .../exceptions/SlotProcessingException.java | 4 +- .../exceptions/StateTransitionException.java | 4 +- ...OptimisticSuccessfulBlockImportResult.java | 2 +- .../util/AsyncBLSSignatureVerifier.java | 4 +- .../logic/common/util/BeaconStateUtil.java | 10 ++-- .../util/BlockRewardCalculatorUtil.java | 5 +- .../common/util/EpochAttestationSchedule.java | 2 +- .../logic/common/util/ForkChoiceUtil.java | 45 +++++++++-------- .../logic/common/util/ValidatorsUtil.java | 3 +- .../altair/block/BlockProcessorAltair.java | 8 ++-- .../RewardsAndPenaltiesCalculatorAltair.java | 18 +++---- .../versions/deneb/types/VersionedHash.java | 4 +- .../electra/helpers/PredicatesElectra.java | 2 +- .../phase0/block/BlockProcessorPhase0.java | 2 +- .../validation/OperationValidatorPhase0.java | 2 +- .../validation/VoluntaryExitValidator.java | 4 +- .../epoch/EpochProcessorPhase0.java | 2 +- .../teku/spec/signatures/DeletableSigner.java | 3 +- .../LocalSlashingProtectionRecord.java | 5 +- .../RejectingSlashingProtector.java | 2 +- .../teku/spec/signatures/SigningRootUtil.java | 2 +- .../statetransition/MappedOperationPool.java | 6 +-- .../statetransition/OperationPoolEntry.java | 4 +- .../statetransition/SimpleOperationPool.java | 2 +- .../attestation/AttestationForkChecker.java | 2 +- .../attestation/AttestationManager.java | 10 ++-- .../block/BlockImportChannel.java | 2 +- .../statetransition/block/BlockImporter.java | 15 +++--- .../attestation/ProcessedAggregateEvent.java | 2 +- .../ProcessedAttestationEvent.java | 2 +- .../forkchoice/ExpiringInfo.java | 2 +- .../forkchoice/ForkChoice.java | 8 ++-- .../forkchoice/ForkChoiceNotifierImpl.java | 9 ++-- .../forkchoice/ForkChoiceStateProvider.java | 3 +- .../forkchoice/ForkChoiceUpdateData.java | 2 +- .../forkchoice/PreparedProposerInfo.java | 2 +- .../forkchoice/ProposersDataManager.java | 2 +- .../forkchoice/TerminalPowBlockMonitor.java | 4 +- .../genesis/GenesisHandler.java | 8 ++-- .../SignedContributionAndProofValidator.java | 5 +- .../SyncCommitteeContributionPool.java | 4 +- .../SyncCommitteeMessagePool.java | 2 +- .../statetransition/util/PendingPool.java | 7 +-- .../validation/AttestationStateSelector.java | 2 +- .../validation/AttesterSlashingValidator.java | 6 +-- .../validation/GossipValidationHelper.java | 2 +- .../validation/ProposerSlashingValidator.java | 8 ++-- .../SignedBlsToExecutionChangeValidator.java | 4 +- .../validation/VoluntaryExitValidator.java | 9 ++-- .../WeakSubjectivityValidator.java | 12 ++--- .../config/WeakSubjectivityConfig.java | 11 +++-- ...xitingWeakSubjectivityViolationPolicy.java | 6 ++- ...oggingWeakSubjectivityViolationPolicy.java | 4 +- 259 files changed, 1188 insertions(+), 1085 deletions(-) diff --git a/ethereum/dataproviders/src/main/java/tech/pegasys/teku/dataproviders/generators/StateGenerator.java b/ethereum/dataproviders/src/main/java/tech/pegasys/teku/dataproviders/generators/StateGenerator.java index dadb22a485e..d18047f5695 100644 --- a/ethereum/dataproviders/src/main/java/tech/pegasys/teku/dataproviders/generators/StateGenerator.java +++ b/ethereum/dataproviders/src/main/java/tech/pegasys/teku/dataproviders/generators/StateGenerator.java @@ -47,7 +47,7 @@ private StateGenerator( } public static StateGenerator create( - Spec spec, + final Spec spec, final HashTree blockTree, final StateAndBlockSummary rootBlockAndState, final BlockProvider blockProvider) { diff --git a/ethereum/dataproviders/src/main/java/tech/pegasys/teku/dataproviders/lookup/BlockProvider.java b/ethereum/dataproviders/src/main/java/tech/pegasys/teku/dataproviders/lookup/BlockProvider.java index c5e61f4a22f..e37c19d009d 100644 --- a/ethereum/dataproviders/src/main/java/tech/pegasys/teku/dataproviders/lookup/BlockProvider.java +++ b/ethereum/dataproviders/src/main/java/tech/pegasys/teku/dataproviders/lookup/BlockProvider.java @@ -32,7 +32,7 @@ public interface BlockProvider { BlockProvider NOOP = (roots) -> SafeFuture.completedFuture(Collections.emptyMap()); - static BlockProvider fromDynamicMap(Supplier> mapSupplier) { + static BlockProvider fromDynamicMap(final Supplier> mapSupplier) { return (roots) -> fromMap(mapSupplier.get()).getBlocks(roots); } diff --git a/ethereum/execution-types/src/main/java/tech/pegasys/teku/ethereum/execution/types/Eth1Address.java b/ethereum/execution-types/src/main/java/tech/pegasys/teku/ethereum/execution/types/Eth1Address.java index 4d261c191b5..981f96317d4 100644 --- a/ethereum/execution-types/src/main/java/tech/pegasys/teku/ethereum/execution/types/Eth1Address.java +++ b/ethereum/execution-types/src/main/java/tech/pegasys/teku/ethereum/execution/types/Eth1Address.java @@ -30,23 +30,24 @@ public class Eth1Address extends Bytes20 { private final String encodedAddress; - private Eth1Address(String value) { + private Eth1Address(final String value) { super(Bytes.fromHexString(value)); + String valueWithPrefix = value; if (!value.startsWith("0x")) { - value = "0x" + value; + valueWithPrefix = "0x" + value; } - this.encodedAddress = toChecksumAddress(value); - validate(value); + this.encodedAddress = toChecksumAddress(valueWithPrefix); + validate(valueWithPrefix); } - private Eth1Address(Bytes bytes) { + private Eth1Address(final Bytes bytes) { super(bytes); final String value = bytes.toHexString(); this.encodedAddress = toChecksumAddress(value); validate(value); } - private void validate(String value) { + private void validate(final String value) { if (isMixedCase(value.substring("0x".length()))) { checkArgument( value.equals(encodedAddress), @@ -56,11 +57,11 @@ private void validate(String value) { } } - public static Eth1Address fromBytes(Bytes value) { + public static Eth1Address fromBytes(final Bytes value) { return new Eth1Address(value); } - public static Eth1Address fromHexString(String value) { + public static Eth1Address fromHexString(final String value) { try { return new Eth1Address(value); } catch (RuntimeException ex) { @@ -75,7 +76,7 @@ public static Eth1Address fromHexString(String value) { * @param value The string representation of an Ethereum address. * @return The encoded address with mixed-case checksum. */ - private static String toChecksumAddress(String value) { + private static String toChecksumAddress(final String value) { final String address = value.replace("0x", "").toLowerCase(Locale.ROOT); final String hashString = Hash.keccak256(Bytes.wrap(address.getBytes(StandardCharsets.US_ASCII))) diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/auth/Token.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/auth/Token.java index f76304213cb..b4fb2d8eb9d 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/auth/Token.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/auth/Token.java @@ -34,7 +34,7 @@ public String getJwtToken() { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ClientVersionV1.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ClientVersionV1.java index 6709fe15065..084a1d1bf24 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ClientVersionV1.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ClientVersionV1.java @@ -36,10 +36,10 @@ public class ClientVersionV1 { public final Bytes4 commit; public ClientVersionV1( - @JsonProperty("code") String code, - @JsonProperty("name") String name, - @JsonProperty("version") String version, - @JsonProperty("commit") Bytes4 commit) { + final @JsonProperty("code") String code, + final @JsonProperty("name") String name, + final @JsonProperty("version") String version, + final @JsonProperty("commit") Bytes4 commit) { checkNotNull(code, "code"); checkNotNull(name, "name"); checkNotNull(version, "version"); diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadCommon.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadCommon.java index 545422f691e..6a51159318a 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadCommon.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadCommon.java @@ -89,19 +89,19 @@ public class ExecutionPayloadCommon { public final Bytes32 blockHash; public ExecutionPayloadCommon( - @JsonProperty("parentHash") Bytes32 parentHash, - @JsonProperty("feeRecipient") Bytes20 feeRecipient, - @JsonProperty("stateRoot") Bytes32 stateRoot, - @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, - @JsonProperty("logsBloom") Bytes logsBloom, - @JsonProperty("prevRandao") Bytes32 prevRandao, - @JsonProperty("blockNumber") UInt64 blockNumber, - @JsonProperty("gasLimit") UInt64 gasLimit, - @JsonProperty("gasUsed") UInt64 gasUsed, - @JsonProperty("timestamp") UInt64 timestamp, - @JsonProperty("extraData") Bytes extraData, - @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, - @JsonProperty("blockHash") Bytes32 blockHash) { + final @JsonProperty("parentHash") Bytes32 parentHash, + final @JsonProperty("feeRecipient") Bytes20 feeRecipient, + final @JsonProperty("stateRoot") Bytes32 stateRoot, + final @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, + final @JsonProperty("logsBloom") Bytes logsBloom, + final @JsonProperty("prevRandao") Bytes32 prevRandao, + final @JsonProperty("blockNumber") UInt64 blockNumber, + final @JsonProperty("gasLimit") UInt64 gasLimit, + final @JsonProperty("gasUsed") UInt64 gasUsed, + final @JsonProperty("timestamp") UInt64 timestamp, + final @JsonProperty("extraData") Bytes extraData, + final @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, + final @JsonProperty("blockHash") Bytes32 blockHash) { checkNotNull(parentHash, "parentHash"); checkNotNull(feeRecipient, "feeRecipient"); checkNotNull(stateRoot, "stateRoot"); diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV1.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV1.java index 1dde13dee36..2ff41f33f1f 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV1.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV1.java @@ -37,20 +37,20 @@ public class ExecutionPayloadV1 extends ExecutionPayloadCommon { public final List transactions; public ExecutionPayloadV1( - @JsonProperty("parentHash") Bytes32 parentHash, - @JsonProperty("feeRecipient") Bytes20 feeRecipient, - @JsonProperty("stateRoot") Bytes32 stateRoot, - @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, - @JsonProperty("logsBloom") Bytes logsBloom, - @JsonProperty("prevRandao") Bytes32 prevRandao, - @JsonProperty("blockNumber") UInt64 blockNumber, - @JsonProperty("gasLimit") UInt64 gasLimit, - @JsonProperty("gasUsed") UInt64 gasUsed, - @JsonProperty("timestamp") UInt64 timestamp, - @JsonProperty("extraData") Bytes extraData, - @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, - @JsonProperty("blockHash") Bytes32 blockHash, - @JsonProperty("transactions") List transactions) { + final @JsonProperty("parentHash") Bytes32 parentHash, + final @JsonProperty("feeRecipient") Bytes20 feeRecipient, + final @JsonProperty("stateRoot") Bytes32 stateRoot, + final @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, + final @JsonProperty("logsBloom") Bytes logsBloom, + final @JsonProperty("prevRandao") Bytes32 prevRandao, + final @JsonProperty("blockNumber") UInt64 blockNumber, + final @JsonProperty("gasLimit") UInt64 gasLimit, + final @JsonProperty("gasUsed") UInt64 gasUsed, + final @JsonProperty("timestamp") UInt64 timestamp, + final @JsonProperty("extraData") Bytes extraData, + final @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, + final @JsonProperty("blockHash") Bytes32 blockHash, + final @JsonProperty("transactions") List transactions) { super( parentHash, feeRecipient, @@ -69,7 +69,7 @@ public ExecutionPayloadV1( } public ExecutionPayload asInternalExecutionPayload( - ExecutionPayloadSchema executionPayloadSchema) { + final ExecutionPayloadSchema executionPayloadSchema) { return executionPayloadSchema.createExecutionPayload( builder -> applyToBuilder(executionPayloadSchema, builder)); } @@ -94,7 +94,8 @@ protected ExecutionPayloadBuilder applyToBuilder( .transactions(transactions); } - public static ExecutionPayloadV1 fromInternalExecutionPayload(ExecutionPayload executionPayload) { + public static ExecutionPayloadV1 fromInternalExecutionPayload( + final ExecutionPayload executionPayload) { return new ExecutionPayloadV1( executionPayload.getParentHash(), executionPayload.getFeeRecipient(), diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV2.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV2.java index 59ca7794e81..0434a4ab323 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV2.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV2.java @@ -35,21 +35,21 @@ public class ExecutionPayloadV2 extends ExecutionPayloadV1 { public final List withdrawals; public ExecutionPayloadV2( - @JsonProperty("parentHash") Bytes32 parentHash, - @JsonProperty("feeRecipient") Bytes20 feeRecipient, - @JsonProperty("stateRoot") Bytes32 stateRoot, - @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, - @JsonProperty("logsBloom") Bytes logsBloom, - @JsonProperty("prevRandao") Bytes32 prevRandao, - @JsonProperty("blockNumber") UInt64 blockNumber, - @JsonProperty("gasLimit") UInt64 gasLimit, - @JsonProperty("gasUsed") UInt64 gasUsed, - @JsonProperty("timestamp") UInt64 timestamp, - @JsonProperty("extraData") Bytes extraData, - @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, - @JsonProperty("blockHash") Bytes32 blockHash, - @JsonProperty("transactions") List transactions, - @JsonProperty("withdrawals") List withdrawals) { + final @JsonProperty("parentHash") Bytes32 parentHash, + final @JsonProperty("feeRecipient") Bytes20 feeRecipient, + final @JsonProperty("stateRoot") Bytes32 stateRoot, + final @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, + final @JsonProperty("logsBloom") Bytes logsBloom, + final @JsonProperty("prevRandao") Bytes32 prevRandao, + final @JsonProperty("blockNumber") UInt64 blockNumber, + final @JsonProperty("gasLimit") UInt64 gasLimit, + final @JsonProperty("gasUsed") UInt64 gasUsed, + final @JsonProperty("timestamp") UInt64 timestamp, + final @JsonProperty("extraData") Bytes extraData, + final @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, + final @JsonProperty("blockHash") Bytes32 blockHash, + final @JsonProperty("transactions") List transactions, + final @JsonProperty("withdrawals") List withdrawals) { super( parentHash, feeRecipient, @@ -68,7 +68,8 @@ public ExecutionPayloadV2( this.withdrawals = withdrawals; } - public static ExecutionPayloadV2 fromInternalExecutionPayload(ExecutionPayload executionPayload) { + public static ExecutionPayloadV2 fromInternalExecutionPayload( + final ExecutionPayload executionPayload) { List withdrawalsList = getWithdrawals(executionPayload.getOptionalWithdrawals()); return new ExecutionPayloadV2( executionPayload.getParentHash(), @@ -103,7 +104,7 @@ protected ExecutionPayloadBuilder applyToBuilder( } private Withdrawal createInternalWithdrawal( - final WithdrawalV1 withdrawalV1, ExecutionPayloadSchema executionPayloadSchema) { + final WithdrawalV1 withdrawalV1, final ExecutionPayloadSchema executionPayloadSchema) { return executionPayloadSchema .getWithdrawalSchemaRequired() .create( diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV3.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV3.java index d15b5986cbf..3f8239063a0 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV3.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV3.java @@ -42,23 +42,23 @@ public class ExecutionPayloadV3 extends ExecutionPayloadV2 { public final UInt64 excessBlobGas; public ExecutionPayloadV3( - @JsonProperty("parentHash") Bytes32 parentHash, - @JsonProperty("feeRecipient") Bytes20 feeRecipient, - @JsonProperty("stateRoot") Bytes32 stateRoot, - @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, - @JsonProperty("logsBloom") Bytes logsBloom, - @JsonProperty("prevRandao") Bytes32 prevRandao, - @JsonProperty("blockNumber") UInt64 blockNumber, - @JsonProperty("gasLimit") UInt64 gasLimit, - @JsonProperty("gasUsed") UInt64 gasUsed, - @JsonProperty("timestamp") UInt64 timestamp, - @JsonProperty("extraData") Bytes extraData, - @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, - @JsonProperty("blockHash") Bytes32 blockHash, - @JsonProperty("transactions") List transactions, - @JsonProperty("withdrawals") List withdrawals, - @JsonProperty("blobGasUsed") UInt64 blobGasUsed, - @JsonProperty("excessBlobGas") UInt64 excessBlobGas) { + final @JsonProperty("parentHash") Bytes32 parentHash, + final @JsonProperty("feeRecipient") Bytes20 feeRecipient, + final @JsonProperty("stateRoot") Bytes32 stateRoot, + final @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, + final @JsonProperty("logsBloom") Bytes logsBloom, + final @JsonProperty("prevRandao") Bytes32 prevRandao, + final @JsonProperty("blockNumber") UInt64 blockNumber, + final @JsonProperty("gasLimit") UInt64 gasLimit, + final @JsonProperty("gasUsed") UInt64 gasUsed, + final @JsonProperty("timestamp") UInt64 timestamp, + final @JsonProperty("extraData") Bytes extraData, + final @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, + final @JsonProperty("blockHash") Bytes32 blockHash, + final @JsonProperty("transactions") List transactions, + final @JsonProperty("withdrawals") List withdrawals, + final @JsonProperty("blobGasUsed") UInt64 blobGasUsed, + final @JsonProperty("excessBlobGas") UInt64 excessBlobGas) { super( parentHash, feeRecipient, diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV4.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV4.java index b1805e3f13d..2fadd870d29 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV4.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ExecutionPayloadV4.java @@ -41,25 +41,25 @@ public class ExecutionPayloadV4 extends ExecutionPayloadV3 { public final List withdrawalRequests; public ExecutionPayloadV4( - @JsonProperty("parentHash") Bytes32 parentHash, - @JsonProperty("feeRecipient") Bytes20 feeRecipient, - @JsonProperty("stateRoot") Bytes32 stateRoot, - @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, - @JsonProperty("logsBloom") Bytes logsBloom, - @JsonProperty("prevRandao") Bytes32 prevRandao, - @JsonProperty("blockNumber") UInt64 blockNumber, - @JsonProperty("gasLimit") UInt64 gasLimit, - @JsonProperty("gasUsed") UInt64 gasUsed, - @JsonProperty("timestamp") UInt64 timestamp, - @JsonProperty("extraData") Bytes extraData, - @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, - @JsonProperty("blockHash") Bytes32 blockHash, - @JsonProperty("transactions") List transactions, - @JsonProperty("withdrawals") List withdrawals, - @JsonProperty("blobGasUsed") UInt64 blobGasUsed, - @JsonProperty("excessBlobGas") UInt64 excessBlobGas, - @JsonProperty("depositReceipts") List depositReceipts, - @JsonProperty("withdrawalRequests") List withdrawalRequests) { + final @JsonProperty("parentHash") Bytes32 parentHash, + final @JsonProperty("feeRecipient") Bytes20 feeRecipient, + final @JsonProperty("stateRoot") Bytes32 stateRoot, + final @JsonProperty("receiptsRoot") Bytes32 receiptsRoot, + final @JsonProperty("logsBloom") Bytes logsBloom, + final @JsonProperty("prevRandao") Bytes32 prevRandao, + final @JsonProperty("blockNumber") UInt64 blockNumber, + final @JsonProperty("gasLimit") UInt64 gasLimit, + final @JsonProperty("gasUsed") UInt64 gasUsed, + final @JsonProperty("timestamp") UInt64 timestamp, + final @JsonProperty("extraData") Bytes extraData, + final @JsonProperty("baseFeePerGas") UInt256 baseFeePerGas, + final @JsonProperty("blockHash") Bytes32 blockHash, + final @JsonProperty("transactions") List transactions, + final @JsonProperty("withdrawals") List withdrawals, + final @JsonProperty("blobGasUsed") UInt64 blobGasUsed, + final @JsonProperty("excessBlobGas") UInt64 excessBlobGas, + final @JsonProperty("depositReceipts") List depositReceipts, + final @JsonProperty("withdrawalRequests") List withdrawalRequests) { super( parentHash, feeRecipient, diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ForkChoiceStateV1.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ForkChoiceStateV1.java index 3375d67efd3..10c783e6b9a 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ForkChoiceStateV1.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ForkChoiceStateV1.java @@ -39,9 +39,9 @@ public class ForkChoiceStateV1 { private final Bytes32 finalizedBlockHash; public ForkChoiceStateV1( - @JsonProperty("headBlockHash") Bytes32 headBlockHash, - @JsonProperty("safeBlockHash") Bytes32 safeBlockHash, - @JsonProperty("finalizedBlockHash") Bytes32 finalizedBlockHash) { + final @JsonProperty("headBlockHash") Bytes32 headBlockHash, + final @JsonProperty("safeBlockHash") Bytes32 safeBlockHash, + final @JsonProperty("finalizedBlockHash") Bytes32 finalizedBlockHash) { checkNotNull(headBlockHash, "headBlockHash"); checkNotNull(safeBlockHash, "safeBlockHash"); checkNotNull(finalizedBlockHash, "finalizedBlockHash"); @@ -50,7 +50,8 @@ public ForkChoiceStateV1( this.finalizedBlockHash = finalizedBlockHash; } - public static ForkChoiceStateV1 fromInternalForkChoiceState(ForkChoiceState forkChoiceState) { + public static ForkChoiceStateV1 fromInternalForkChoiceState( + final ForkChoiceState forkChoiceState) { return new ForkChoiceStateV1( forkChoiceState.getHeadExecutionBlockHash(), forkChoiceState.getSafeExecutionBlockHash(), diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ForkChoiceUpdatedResult.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ForkChoiceUpdatedResult.java index 7ebf12140d3..40bb6ed6492 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ForkChoiceUpdatedResult.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/ForkChoiceUpdatedResult.java @@ -30,8 +30,8 @@ public class ForkChoiceUpdatedResult { private final Bytes8 payloadId; public ForkChoiceUpdatedResult( - @JsonProperty("payloadStatus") PayloadStatusV1 payloadStatus, - @JsonProperty("payloadId") Bytes8 payloadId) { + final @JsonProperty("payloadStatus") PayloadStatusV1 payloadStatus, + final @JsonProperty("payloadId") Bytes8 payloadId) { checkNotNull(payloadStatus, "payloadStatus cannot be null"); this.payloadStatus = payloadStatus; this.payloadId = payloadId; diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV1.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV1.java index 2e9c9179c49..05337dd6feb 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV1.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV1.java @@ -46,9 +46,9 @@ public class PayloadAttributesV1 { public final Bytes20 suggestedFeeRecipient; public PayloadAttributesV1( - @JsonProperty("timestamp") UInt64 timestamp, - @JsonProperty("prevRandao") Bytes32 prevRandao, - @JsonProperty("suggestedFeeRecipient") Bytes20 suggestedFeeRecipient) { + final @JsonProperty("timestamp") UInt64 timestamp, + final @JsonProperty("prevRandao") Bytes32 prevRandao, + final @JsonProperty("suggestedFeeRecipient") Bytes20 suggestedFeeRecipient) { checkNotNull(timestamp, "timestamp"); checkNotNull(prevRandao, "prevRandao"); checkNotNull(suggestedFeeRecipient, "suggestedFeeRecipient"); @@ -58,7 +58,7 @@ public PayloadAttributesV1( } public static Optional fromInternalPayloadBuildingAttributes( - Optional payloadBuildingAttributes) { + final Optional payloadBuildingAttributes) { return payloadBuildingAttributes.map( (payloadAttributes) -> new PayloadAttributesV1( diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV2.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV2.java index 0c935089eff..3eab9397a00 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV2.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV2.java @@ -28,16 +28,16 @@ public class PayloadAttributesV2 extends PayloadAttributesV1 { public final List withdrawals; public PayloadAttributesV2( - @JsonProperty("timestamp") UInt64 timestamp, - @JsonProperty("prevRandao") Bytes32 prevRandao, - @JsonProperty("suggestedFeeRecipient") Bytes20 suggestedFeeRecipient, - @JsonProperty("withdrawals") final List withdrawals) { + final @JsonProperty("timestamp") UInt64 timestamp, + final @JsonProperty("prevRandao") Bytes32 prevRandao, + final @JsonProperty("suggestedFeeRecipient") Bytes20 suggestedFeeRecipient, + final @JsonProperty("withdrawals") List withdrawals) { super(timestamp, prevRandao, suggestedFeeRecipient); this.withdrawals = withdrawals; } public static Optional fromInternalPayloadBuildingAttributesV2( - Optional payloadBuildingAttributes) { + final Optional payloadBuildingAttributes) { return payloadBuildingAttributes.map( (payloadAttributes) -> new PayloadAttributesV2( diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV3.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV3.java index 7d62f80d8ec..e81a85c89f3 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV3.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV3.java @@ -32,17 +32,17 @@ public class PayloadAttributesV3 extends PayloadAttributesV2 { public final Bytes32 parentBeaconBlockRoot; public PayloadAttributesV3( - @JsonProperty("timestamp") UInt64 timestamp, - @JsonProperty("prevRandao") Bytes32 prevRandao, - @JsonProperty("suggestedFeeRecipient") Bytes20 suggestedFeeRecipient, - @JsonProperty("withdrawals") List withdrawals, + final @JsonProperty("timestamp") UInt64 timestamp, + final @JsonProperty("prevRandao") Bytes32 prevRandao, + final @JsonProperty("suggestedFeeRecipient") Bytes20 suggestedFeeRecipient, + final @JsonProperty("withdrawals") List withdrawals, @JsonProperty("parentBeaconBlockRoot") final Bytes32 parentBeaconBlockRoot) { super(timestamp, prevRandao, suggestedFeeRecipient, withdrawals); this.parentBeaconBlockRoot = parentBeaconBlockRoot; } public static Optional fromInternalPayloadBuildingAttributesV3( - Optional payloadBuildingAttributes) { + final Optional payloadBuildingAttributes) { return payloadBuildingAttributes.map( (payloadAttributes) -> new PayloadAttributesV3( diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadStatusV1.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadStatusV1.java index c48bca98e6c..b60e3365f2e 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadStatusV1.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadStatusV1.java @@ -34,9 +34,9 @@ public class PayloadStatusV1 { private final String validationError; public PayloadStatusV1( - @JsonProperty("status") ExecutionPayloadStatus status, - @JsonProperty("latestValidHash") Bytes32 latestValidHash, - @JsonProperty("validationError") String validationError) { + final @JsonProperty("status") ExecutionPayloadStatus status, + final @JsonProperty("latestValidHash") Bytes32 latestValidHash, + final @JsonProperty("validationError") String validationError) { checkNotNull(status, "status cannot be null"); this.status = status; this.latestValidHash = latestValidHash; diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/Response.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/Response.java index 8ea4fd261cd..c7075594e29 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/Response.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/Response.java @@ -112,7 +112,7 @@ public boolean isFailure() { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes20Deserializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes20Deserializer.java index cfaea7a9cc1..9aee57b4caf 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes20Deserializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes20Deserializer.java @@ -22,7 +22,8 @@ public class Bytes20Deserializer extends JsonDeserializer { @Override - public Bytes20 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public Bytes20 deserialize(final JsonParser p, final DeserializationContext ctxt) + throws IOException { return Bytes20.fromHexString(p.getValueAsString()); } } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes20Serializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes20Serializer.java index a84f03e49e4..4ca39eadff0 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes20Serializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes20Serializer.java @@ -22,7 +22,8 @@ public class Bytes20Serializer extends JsonSerializer { @Override - public void serialize(Bytes20 value, JsonGenerator gen, SerializerProvider serializers) + public void serialize( + final Bytes20 value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException { gen.writeString(value.toHexString().toLowerCase(Locale.ROOT)); } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes32Deserializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes32Deserializer.java index f636a9ed3e9..ca9b5037a03 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes32Deserializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes32Deserializer.java @@ -22,7 +22,8 @@ public class Bytes32Deserializer extends JsonDeserializer { @Override - public Bytes32 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public Bytes32 deserialize(final JsonParser p, final DeserializationContext ctxt) + throws IOException { return Bytes32.fromHexStringStrict(p.getValueAsString()); } } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes8Deserializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes8Deserializer.java index e08542c8609..41f31a15f3b 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes8Deserializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/Bytes8Deserializer.java @@ -22,7 +22,8 @@ public class Bytes8Deserializer extends JsonDeserializer { @Override - public Bytes8 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public Bytes8 deserialize(final JsonParser p, final DeserializationContext ctxt) + throws IOException { return Bytes8.fromHexString(p.getValueAsString()); } } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/BytesDeserializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/BytesDeserializer.java index ed8c206a5c9..6c1e38cc22b 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/BytesDeserializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/BytesDeserializer.java @@ -22,7 +22,8 @@ public class BytesDeserializer extends JsonDeserializer { @Override - public Bytes deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public Bytes deserialize(final JsonParser p, final DeserializationContext ctxt) + throws IOException { return Bytes.fromHexString(p.getValueAsString()); } } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/BytesSerializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/BytesSerializer.java index a911448e375..6d5beff0691 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/BytesSerializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/BytesSerializer.java @@ -22,7 +22,8 @@ public class BytesSerializer extends JsonSerializer { @Override - public void serialize(Bytes value, JsonGenerator gen, SerializerProvider provider) + public void serialize( + final Bytes value, final JsonGenerator gen, final SerializerProvider provider) throws IOException { gen.writeString(value.toHexString().toLowerCase(Locale.ROOT)); } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt256AsHexDeserializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt256AsHexDeserializer.java index e030eeb4e66..a41bac0ba71 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt256AsHexDeserializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt256AsHexDeserializer.java @@ -22,7 +22,8 @@ public class UInt256AsHexDeserializer extends JsonDeserializer { @Override - public UInt256 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public UInt256 deserialize(final JsonParser p, final DeserializationContext ctxt) + throws IOException { final String hexValue = p.getValueAsString(); QuantityChecker.check(hexValue); return UInt256.fromHexString(hexValue); diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt256AsHexSerializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt256AsHexSerializer.java index efb076b66fd..40ff68176f0 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt256AsHexSerializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt256AsHexSerializer.java @@ -21,7 +21,8 @@ public class UInt256AsHexSerializer extends JsonSerializer { @Override - public void serialize(UInt256 value, JsonGenerator gen, SerializerProvider serializers) + public void serialize( + final UInt256 value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException { gen.writeString(value.toMinimalBytes().toQuantityHexString()); } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt64AsHexDeserializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt64AsHexDeserializer.java index 33c854e5698..b8fa45c8ea2 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt64AsHexDeserializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt64AsHexDeserializer.java @@ -22,7 +22,8 @@ public class UInt64AsHexDeserializer extends JsonDeserializer { @Override - public UInt64 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public UInt64 deserialize(final JsonParser p, final DeserializationContext ctxt) + throws IOException { final String hexValue = p.getValueAsString(); QuantityChecker.check(hexValue); return UInt64.valueOf(Bytes.fromHexStringLenient(hexValue).toUnsignedBigInteger()); diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt64AsHexSerializer.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt64AsHexSerializer.java index 6162a81bff5..ff6c11185d5 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt64AsHexSerializer.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/serialization/UInt64AsHexSerializer.java @@ -22,12 +22,13 @@ public class UInt64AsHexSerializer extends JsonSerializer { @Override - public void serialize(UInt64 value, JsonGenerator gen, SerializerProvider serializers) + public void serialize( + final UInt64 value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException { gen.writeString(toHexString(value)); } - public static String toHexString(UInt64 value) { + public static String toHexString(final UInt64 value) { return Bytes.ofUnsignedLong(value.longValue()).toQuantityHexString(); } } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3JClient.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3JClient.java index dd2cf18775d..b8cf68f6729 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3JClient.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3JClient.java @@ -77,7 +77,7 @@ private void throwIfNotInitialized() { } public SafeFuture> doRequest( - Request> web3jRequest, + final Request> web3jRequest, final Duration timeout) { throwIfNotInitialized(); return SafeFuture.of(web3jRequest.sendAsync()) @@ -101,7 +101,7 @@ public SafeFuture> doRequest( }); } - private boolean isCriticalRequest(Request request) { + private boolean isCriticalRequest(final Request request) { return !nonCriticalMethods.contains(request.getMethod()); } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3JExecutionEngineClient.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3JExecutionEngineClient.java index d27e5307b04..f5550f60b1e 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3JExecutionEngineClient.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3JExecutionEngineClient.java @@ -60,7 +60,7 @@ public Web3JExecutionEngineClient(final Web3JClient web3JClient) { } @Override - public SafeFuture getPowBlock(Bytes32 blockHash) { + public SafeFuture getPowBlock(final Bytes32 blockHash) { return web3JClient .doRequest( web3JClient.getEth1Web3j().ethGetBlockByHash(blockHash.toHexString(), false), @@ -79,7 +79,7 @@ public SafeFuture getPowChainHead() { .thenApply(Web3JExecutionEngineClient::eth1BlockToPowBlock); } - private static PowBlock eth1BlockToPowBlock(EthBlock.Block eth1Block) { + private static PowBlock eth1BlockToPowBlock(final EthBlock.Block eth1Block) { return eth1Block == null ? null : new PowBlock( @@ -90,7 +90,7 @@ private static PowBlock eth1BlockToPowBlock(EthBlock.Block eth1Block) { } @Override - public SafeFuture> getPayloadV1(Bytes8 payloadId) { + public SafeFuture> getPayloadV1(final Bytes8 payloadId) { final Request web3jRequest = new Request<>( "engine_getPayloadV1", @@ -134,7 +134,8 @@ public SafeFuture> getPayloadV4(final Bytes8 payl } @Override - public SafeFuture> newPayloadV1(ExecutionPayloadV1 executionPayload) { + public SafeFuture> newPayloadV1( + final ExecutionPayloadV1 executionPayload) { final Request web3jRequest = new Request<>( "engine_newPayloadV1", @@ -192,7 +193,8 @@ public SafeFuture> newPayloadV4( @Override public SafeFuture> forkChoiceUpdatedV1( - ForkChoiceStateV1 forkChoiceState, Optional payloadAttributes) { + final ForkChoiceStateV1 forkChoiceState, + final Optional payloadAttributes) { final Request web3jRequest = new Request<>( "engine_forkchoiceUpdatedV1", diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3jClientBuilder.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3jClientBuilder.java index 4e276dabe4a..db8fb53fa84 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3jClientBuilder.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3jClientBuilder.java @@ -37,12 +37,12 @@ public class Web3jClientBuilder { private ExecutionClientEventsChannel executionClientEventsPublisher; private final Collection nonCriticalMethods = new HashSet<>(); - public Web3jClientBuilder endpoint(String endpoint) { + public Web3jClientBuilder endpoint(final String endpoint) { this.endpoint = parseEndpoint(endpoint); return this; } - public Web3jClientBuilder timeout(Duration timeout) { + public Web3jClientBuilder timeout(final Duration timeout) { this.timeout = timeout; return this; } @@ -58,12 +58,12 @@ private URI parseEndpoint(final String endpoint) { return endpointUri; } - public Web3jClientBuilder jwtConfigOpt(Optional jwtConfig) { + public Web3jClientBuilder jwtConfigOpt(final Optional jwtConfig) { this.jwtConfigOpt = jwtConfig; return this; } - public Web3jClientBuilder timeProvider(TimeProvider timeProvider) { + public Web3jClientBuilder timeProvider(final TimeProvider timeProvider) { this.timeProvider = timeProvider; return this; } @@ -74,7 +74,7 @@ public Web3jClientBuilder executionClientEventsPublisher( return this; } - public Web3jClientBuilder nonCriticalMethods(String... methods) { + public Web3jClientBuilder nonCriticalMethods(final String... methods) { nonCriticalMethods.addAll(Arrays.asList(methods)); return this; } diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3jWebsocketClient.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3jWebsocketClient.java index e2bc682cf12..2285cce0c1c 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3jWebsocketClient.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/web3j/Web3jWebsocketClient.java @@ -76,7 +76,7 @@ private Optional tryToConnect() { @Override public SafeFuture> doRequest( - Request> web3jRequest, + final Request> web3jRequest, final Duration timeout) { return tryToConnect() .>>map(SafeFuture::failedFuture) diff --git a/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerStub.java b/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerStub.java index c553aef9390..65e221e22cc 100644 --- a/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerStub.java +++ b/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerStub.java @@ -46,7 +46,7 @@ public ExecutionLayerManagerStub( } @Override - public void onSlot(UInt64 slot) { + public void onSlot(final UInt64 slot) { // NOOP } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/GetGenesisApiDataBuilder.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/GetGenesisApiDataBuilder.java index f954031104e..66187e92d5b 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/GetGenesisApiDataBuilder.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/GetGenesisApiDataBuilder.java @@ -52,17 +52,17 @@ public class GetGenesisApiDataBuilder { private Bytes32 genesisValidatorsRoot; private Bytes4 genesisForkVersion; - public GetGenesisApiDataBuilder genesisTime(UInt64 genesisTime) { + public GetGenesisApiDataBuilder genesisTime(final UInt64 genesisTime) { this.genesisTime = genesisTime; return this; } - public GetGenesisApiDataBuilder genesisValidatorsRoot(Bytes32 genesisValidatorsRoot) { + public GetGenesisApiDataBuilder genesisValidatorsRoot(final Bytes32 genesisValidatorsRoot) { this.genesisValidatorsRoot = genesisValidatorsRoot; return this; } - public GetGenesisApiDataBuilder genesisForkVersion(Bytes4 genesisForkVersion) { + public GetGenesisApiDataBuilder genesisForkVersion(final Bytes4 genesisForkVersion) { this.genesisForkVersion = genesisForkVersion; return this; } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/StateValidatorData.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/StateValidatorData.java index ce36f35bde1..8dc0305a035 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/StateValidatorData.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/StateValidatorData.java @@ -84,7 +84,7 @@ public BLSPublicKey getPublicKey() { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/StateValidatorDataBuilder.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/StateValidatorDataBuilder.java index f787a524ca8..459b3f942ad 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/StateValidatorDataBuilder.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/beacon/StateValidatorDataBuilder.java @@ -85,22 +85,22 @@ public class StateValidatorDataBuilder { private ValidatorStatus status; private Validator validator; - public StateValidatorDataBuilder index(UInt64 index) { + public StateValidatorDataBuilder index(final UInt64 index) { this.index = index; return this; } - public StateValidatorDataBuilder balance(UInt64 balance) { + public StateValidatorDataBuilder balance(final UInt64 balance) { this.balance = balance; return this; } - public StateValidatorDataBuilder status(ValidatorStatus status) { + public StateValidatorDataBuilder status(final ValidatorStatus status) { this.status = status; return this; } - public StateValidatorDataBuilder validator(Validator validator) { + public StateValidatorDataBuilder validator(final Validator validator) { this.validator = validator; return this; } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/AttesterDutiesBuilder.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/AttesterDutiesBuilder.java index 4e4d678a300..ac73dbb31cf 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/AttesterDutiesBuilder.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/AttesterDutiesBuilder.java @@ -49,17 +49,17 @@ public class AttesterDutiesBuilder { private Bytes32 dependentRoot; private List duties; - public AttesterDutiesBuilder executionOptimistic(boolean executionOptimistic) { + public AttesterDutiesBuilder executionOptimistic(final boolean executionOptimistic) { this.executionOptimistic = executionOptimistic; return this; } - public AttesterDutiesBuilder dependentRoot(Bytes32 dependentRoot) { + public AttesterDutiesBuilder dependentRoot(final Bytes32 dependentRoot) { this.dependentRoot = dependentRoot; return this; } - public AttesterDutiesBuilder duties(List duties) { + public AttesterDutiesBuilder duties(final List duties) { this.duties = duties; return this; } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/AttesterDutyBuilder.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/AttesterDutyBuilder.java index 0ced8c31ab6..eef5197d9ca 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/AttesterDutyBuilder.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/AttesterDutyBuilder.java @@ -65,37 +65,37 @@ public class AttesterDutyBuilder { private int validatorCommitteeIndex; private UInt64 slot; - public AttesterDutyBuilder publicKey(BLSPublicKey publicKey) { + public AttesterDutyBuilder publicKey(final BLSPublicKey publicKey) { this.publicKey = publicKey; return this; } - public AttesterDutyBuilder validatorIndex(int validatorIndex) { + public AttesterDutyBuilder validatorIndex(final int validatorIndex) { this.validatorIndex = validatorIndex; return this; } - public AttesterDutyBuilder committeeLength(int committeeLength) { + public AttesterDutyBuilder committeeLength(final int committeeLength) { this.committeeLength = committeeLength; return this; } - public AttesterDutyBuilder committeeIndex(int committeeIndex) { + public AttesterDutyBuilder committeeIndex(final int committeeIndex) { this.committeeIndex = committeeIndex; return this; } - public AttesterDutyBuilder committeesAtSlot(int committeesAtSlot) { + public AttesterDutyBuilder committeesAtSlot(final int committeesAtSlot) { this.committeesAtSlot = committeesAtSlot; return this; } - public AttesterDutyBuilder validatorCommitteeIndex(int validatorCommitteeIndex) { + public AttesterDutyBuilder validatorCommitteeIndex(final int validatorCommitteeIndex) { this.validatorCommitteeIndex = validatorCommitteeIndex; return this; } - public AttesterDutyBuilder slot(UInt64 slot) { + public AttesterDutyBuilder slot(final UInt64 slot) { this.slot = slot; return this; } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/ProposerDutiesBuilder.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/ProposerDutiesBuilder.java index 479387d0816..f7eae2df78e 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/ProposerDutiesBuilder.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/ProposerDutiesBuilder.java @@ -50,17 +50,17 @@ public class ProposerDutiesBuilder { private boolean executionOptimistic; private List duties; - public ProposerDutiesBuilder dependentRoot(Bytes32 dependentRoot) { + public ProposerDutiesBuilder dependentRoot(final Bytes32 dependentRoot) { this.dependentRoot = dependentRoot; return this; } - public ProposerDutiesBuilder executionOptimistic(boolean executionOptimistic) { + public ProposerDutiesBuilder executionOptimistic(final boolean executionOptimistic) { this.executionOptimistic = executionOptimistic; return this; } - public ProposerDutiesBuilder duties(List duties) { + public ProposerDutiesBuilder duties(final List duties) { this.duties = duties; return this; } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/ProposerDutyBuilder.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/ProposerDutyBuilder.java index fa7d6413e80..322f1f2eaa6 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/ProposerDutyBuilder.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/ProposerDutyBuilder.java @@ -40,17 +40,17 @@ public class ProposerDutyBuilder { private int validatorIndex; private UInt64 slot; - public ProposerDutyBuilder publicKey(BLSPublicKey publicKey) { + public ProposerDutyBuilder publicKey(final BLSPublicKey publicKey) { this.publicKey = publicKey; return this; } - public ProposerDutyBuilder validatorIndex(int validatorIndex) { + public ProposerDutyBuilder validatorIndex(final int validatorIndex) { this.validatorIndex = validatorIndex; return this; } - public ProposerDutyBuilder slot(UInt64 slot) { + public ProposerDutyBuilder slot(final UInt64 slot) { this.slot = slot; return this; } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/SyncCommitteeDutiesBuilder.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/SyncCommitteeDutiesBuilder.java index 61e31ce89f2..aceab5a8566 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/SyncCommitteeDutiesBuilder.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/SyncCommitteeDutiesBuilder.java @@ -43,12 +43,12 @@ public class SyncCommitteeDutiesBuilder { private boolean executionOptimistic; private List duties; - public SyncCommitteeDutiesBuilder executionOptimistic(boolean executionOptimistic) { + public SyncCommitteeDutiesBuilder executionOptimistic(final boolean executionOptimistic) { this.executionOptimistic = executionOptimistic; return this; } - public SyncCommitteeDutiesBuilder duties(List duties) { + public SyncCommitteeDutiesBuilder duties(final List duties) { this.duties = duties; return this; } diff --git a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/SyncCommitteeDutyBuilder.java b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/SyncCommitteeDutyBuilder.java index d33314f89e3..6d61eb3e58b 100644 --- a/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/SyncCommitteeDutyBuilder.java +++ b/ethereum/json-types/src/main/java/tech/pegasys/teku/ethereum/json/types/validator/SyncCommitteeDutyBuilder.java @@ -51,18 +51,18 @@ public class SyncCommitteeDutyBuilder { private int validatorIndex; private IntSet validatorSyncCommitteeIndices; - public SyncCommitteeDutyBuilder publicKey(BLSPublicKey publicKey) { + public SyncCommitteeDutyBuilder publicKey(final BLSPublicKey publicKey) { this.publicKey = publicKey; return this; } - public SyncCommitteeDutyBuilder validatorIndex(int validatorIndex) { + public SyncCommitteeDutyBuilder validatorIndex(final int validatorIndex) { this.validatorIndex = validatorIndex; return this; } public SyncCommitteeDutyBuilder validatorSyncCommitteeIndices( - IntSet validatorSyncCommitteeIndices) { + final IntSet validatorSyncCommitteeIndices) { this.validatorSyncCommitteeIndices = validatorSyncCommitteeIndices; return this; } diff --git a/ethereum/networks/src/main/java/tech/pegasys/teku/networks/Eth2NetworkConfiguration.java b/ethereum/networks/src/main/java/tech/pegasys/teku/networks/Eth2NetworkConfiguration.java index 80cae793083..6571ce15b9a 100644 --- a/ethereum/networks/src/main/java/tech/pegasys/teku/networks/Eth2NetworkConfiguration.java +++ b/ethereum/networks/src/main/java/tech/pegasys/teku/networks/Eth2NetworkConfiguration.java @@ -374,7 +374,7 @@ public static class Builder { private boolean forkChoiceUpdatedAlwaysSendPayloadAttributes = DEFAULT_FORK_CHOICE_UPDATED_ALWAYS_SEND_PAYLOAD_ATTRIBUTES; - public void spec(Spec spec) { + public void spec(final Spec spec) { this.spec = spec; } @@ -537,7 +537,7 @@ public Builder customGenesisState(final String genesisState) { } public Builder ignoreWeakSubjectivityPeriodEnabled( - boolean ignoreWeakSubjectivityPeriodEnabled) { + final boolean ignoreWeakSubjectivityPeriodEnabled) { this.allowSyncOutsideWeakSubjectivityPeriod = ignoreWeakSubjectivityPeriodEnabled; return this; } @@ -547,7 +547,7 @@ public Builder asyncP2pMaxThreads(final int asyncP2pMaxThreads) { return this; } - public Builder asyncP2pMaxQueue(Integer asyncP2pMaxQueue) { + public Builder asyncP2pMaxQueue(final Integer asyncP2pMaxQueue) { this.asyncP2pMaxQueue = asyncP2pMaxQueue; return this; } @@ -926,13 +926,13 @@ private Optional validateAndParseEpochsStoreBlobs(final String epochsSt return Optional.of(epochsStoreBlobsInt); } - public Builder forkChoiceLateBlockReorgEnabled(boolean forkChoiceLateBlockReorgEnabled) { + public Builder forkChoiceLateBlockReorgEnabled(final boolean forkChoiceLateBlockReorgEnabled) { this.forkChoiceLateBlockReorgEnabled = forkChoiceLateBlockReorgEnabled; return this; } public Builder forkChoiceUpdatedAlwaysSendPayloadAttributes( - boolean forkChoiceUpdatedAlwaysSendPayloadAttributes) { + final boolean forkChoiceUpdatedAlwaysSendPayloadAttributes) { this.forkChoiceUpdatedAlwaysSendPayloadAttributes = forkChoiceUpdatedAlwaysSendPayloadAttributes; return this; diff --git a/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/Deposit.java b/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/Deposit.java index bd1689fcb47..249182aaaab 100644 --- a/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/Deposit.java +++ b/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/Deposit.java @@ -30,11 +30,11 @@ public class Deposit { private final UInt64 merkle_tree_index; public Deposit( - BLSPublicKey pubkey, - Bytes32 withdrawal_credentials, - BLSSignature signature, - UInt64 amount, - UInt64 merkle_tree_index) { + final BLSPublicKey pubkey, + final Bytes32 withdrawal_credentials, + final BLSSignature signature, + final UInt64 amount, + final UInt64 merkle_tree_index) { this.pubkey = pubkey; this.withdrawal_credentials = withdrawal_credentials; this.signature = signature; diff --git a/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/Eth1EventsChannel.java b/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/Eth1EventsChannel.java index cf8e72e430f..509c8774da4 100644 --- a/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/Eth1EventsChannel.java +++ b/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/Eth1EventsChannel.java @@ -22,7 +22,8 @@ public interface Eth1EventsChannel extends VoidReturningChannelInterface { void onMinGenesisTimeBlock(MinGenesisTimeBlockEvent event); - default void onEth1Block(UInt64 blockHeight, Bytes32 blockHash, UInt64 blockTimestamp) {} + default void onEth1Block( + final UInt64 blockHeight, final Bytes32 blockHash, final UInt64 blockTimestamp) {} - default void onInitialDepositTreeSnapshot(DepositTreeSnapshot depositTreeSnapshot) {} + default void onInitialDepositTreeSnapshot(final DepositTreeSnapshot depositTreeSnapshot) {} } diff --git a/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/MinGenesisTimeBlockEvent.java b/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/MinGenesisTimeBlockEvent.java index 3f431a5e3e6..a86c60a7136 100644 --- a/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/MinGenesisTimeBlockEvent.java +++ b/ethereum/pow/api/src/main/java/tech/pegasys/teku/ethereum/pow/api/MinGenesisTimeBlockEvent.java @@ -23,7 +23,8 @@ public class MinGenesisTimeBlockEvent { private final UInt64 blockNumber; private final Bytes32 blockHash; - public MinGenesisTimeBlockEvent(UInt64 timestamp, UInt64 blockNumber, Bytes32 blockHash) { + public MinGenesisTimeBlockEvent( + final UInt64 timestamp, final UInt64 blockNumber, final Bytes32 blockHash) { this.timestamp = timestamp; this.blockNumber = blockNumber; this.blockHash = blockHash; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java index 2638f8b21f7..b15169394bc 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java @@ -106,7 +106,8 @@ public class Spec { private final ForkSchedule forkSchedule; private final StateTransition stateTransition; - private Spec(Map specVersions, final ForkSchedule forkSchedule) { + private Spec( + final Map specVersions, final ForkSchedule forkSchedule) { Preconditions.checkArgument(specVersions != null && specVersions.size() > 0); Preconditions.checkArgument(forkSchedule != null); this.specVersions = specVersions; @@ -501,9 +502,9 @@ public Bytes32 getRandaoMix(final BeaconState state, final UInt64 epoch) { } public boolean verifyProposerSlashingSignature( - BeaconState state, - ProposerSlashing proposerSlashing, - BLSSignatureVerifier signatureVerifier) { + final BeaconState state, + final ProposerSlashing proposerSlashing, + final BLSSignatureVerifier signatureVerifier) { final UInt64 epoch = getProposerSlashingEpoch(proposerSlashing); return atEpoch(epoch) .operationSignatureVerifier() @@ -512,18 +513,20 @@ public boolean verifyProposerSlashingSignature( } public boolean verifyVoluntaryExitSignature( - BeaconState state, SignedVoluntaryExit signedExit, BLSSignatureVerifier signatureVerifier) { + final BeaconState state, + final SignedVoluntaryExit signedExit, + final BLSSignatureVerifier signatureVerifier) { final UInt64 epoch = signedExit.getMessage().getEpoch(); return atEpoch(epoch) .operationSignatureVerifier() .verifyVoluntaryExitSignature(state, signedExit, signatureVerifier); } - public Bytes32 getPreviousDutyDependentRoot(BeaconState state) { + public Bytes32 getPreviousDutyDependentRoot(final BeaconState state) { return atState(state).getBeaconStateUtil().getPreviousDutyDependentRoot(state); } - public Bytes32 getCurrentDutyDependentRoot(BeaconState state) { + public Bytes32 getCurrentDutyDependentRoot(final BeaconState state) { return atState(state).getBeaconStateUtil().getCurrentDutyDependentRoot(state); } @@ -549,13 +552,14 @@ public UInt64 getEarliestQueryableSlotForBeaconCommitteeInTargetEpoch(final UInt } // ForkChoice utils - public UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime) { + public UInt64 getCurrentSlot(final UInt64 currentTime, final UInt64 genesisTime) { return atTime(genesisTime, currentTime) .getForkChoiceUtil() .getCurrentSlot(currentTime, genesisTime); } - public UInt64 getCurrentSlotForMillis(UInt64 currentTimeMillis, UInt64 genesisTimeMillis) { + public UInt64 getCurrentSlotForMillis( + final UInt64 currentTimeMillis, final UInt64 genesisTimeMillis) { return atTimeMillis(genesisTimeMillis, currentTimeMillis) .getForkChoiceUtil() .getCurrentSlotForMillis(currentTimeMillis, genesisTimeMillis); @@ -690,7 +694,7 @@ public boolean blockDescendsFromLatestFinalizedBlock( blockSlot, blockParentRoot, store, forkChoiceStrategy); } - public BeaconState processSlots(BeaconState preState, UInt64 slot) + public BeaconState processSlots(final BeaconState preState, final UInt64 slot) throws SlotProcessingException, EpochProcessingException { return stateTransition.processSlots(preState, slot); } @@ -812,7 +816,7 @@ public UInt64 getSyncCommitteeParticipantReward(final BeaconState state) { } public boolean isEnoughVotesToUpdateEth1Data( - BeaconState state, Eth1Data eth1Data, final int additionalVotes) { + final BeaconState state, final Eth1Data eth1Data, final int additionalVotes) { final BlockProcessor blockProcessor = atState(state).getBlockProcessor(); final long existingVotes = blockProcessor.getVoteCount(state, eth1Data); return blockProcessor.isEnoughVotesToUpdateEth1Data(existingVotes + additionalVotes); @@ -826,11 +830,11 @@ public IntList getActiveValidatorIndices(final BeaconState state, final UInt64 e return atEpoch(epoch).beaconStateAccessors().getActiveValidatorIndices(state, epoch); } - public UInt64 getTotalActiveBalance(BeaconState state) { + public UInt64 getTotalActiveBalance(final BeaconState state) { return atState(state).beaconStateAccessors().getTotalActiveBalance(state); } - public UInt64 getProposerBoostAmount(BeaconState state) { + public UInt64 getProposerBoostAmount(final BeaconState state) { return atState(state).beaconStateAccessors().getProposerBoostAmount(state); } @@ -838,7 +842,8 @@ public int getPreviousEpochAttestationCapacity(final BeaconState state) { return atState(state).beaconStateAccessors().getPreviousEpochAttestationCapacity(state); } - public IntList getBeaconCommittee(BeaconState state, UInt64 slot, UInt64 index) { + public IntList getBeaconCommittee( + final BeaconState state, final UInt64 slot, final UInt64 index) { return atState(state).beaconStateAccessors().getBeaconCommittee(state, slot, index); } @@ -858,7 +863,7 @@ public Optional getValidatorIndex( } public Optional getCommitteeAssignment( - BeaconState state, UInt64 epoch, int validatorIndex) { + final BeaconState state, final UInt64 epoch, final int validatorIndex) { return atEpoch(epoch).getValidatorsUtil().getCommitteeAssignment(state, epoch, validatorIndex); } @@ -885,9 +890,9 @@ public AttestationData getGenericAttestationData( } public SafeFuture isValidIndexedAttestation( - BeaconState state, - ValidatableAttestation attestation, - AsyncBLSSignatureVerifier blsSignatureVerifier) { + final BeaconState state, + final ValidatableAttestation attestation, + final AsyncBLSSignatureVerifier blsSignatureVerifier) { final UInt64 slot = attestation.getData().getSlot(); return atSlot(slot) .getAttestationUtil() @@ -938,7 +943,7 @@ public Optional computeFirstSlotWithBlobSupport() { } // Electra Utils - public boolean isFormerDepositMechanismDisabled(BeaconState state) { + public boolean isFormerDepositMechanismDisabled(final BeaconState state) { return atState(state).miscHelpers().isFormerDepositMechanismDisabled(state); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java index 0ee2b79d022..4c06267bcab 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java @@ -34,7 +34,7 @@ public class SpecFactory { - public static Spec create(String configName) { + public static Spec create(final String configName) { return create(configName, __ -> {}); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigAltair.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigAltair.java index 9d9e17627b7..d336d069a50 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigAltair.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigAltair.java @@ -19,7 +19,7 @@ public interface SpecConfigAltair extends SpecConfig { - static SpecConfigAltair required(SpecConfig specConfig) { + static SpecConfigAltair required(final SpecConfig specConfig) { return specConfig .toVersionAltair() .orElseThrow( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigBellatrix.java index bc550da19ce..f011a07137e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigBellatrix.java @@ -21,7 +21,7 @@ public interface SpecConfigBellatrix extends SpecConfigAltair { - static SpecConfigBellatrix required(SpecConfig specConfig) { + static SpecConfigBellatrix required(final SpecConfig specConfig) { return specConfig .toVersionBellatrix() .orElseThrow( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigCapella.java index 1f0553ee6b0..a4cac7dbb89 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigCapella.java @@ -19,7 +19,7 @@ public interface SpecConfigCapella extends SpecConfigBellatrix { - static SpecConfigCapella required(SpecConfig specConfig) { + static SpecConfigCapella required(final SpecConfig specConfig) { return specConfig .toVersionCapella() .orElseThrow( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigReader.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigReader.java index 01fe04b5102..c930330833b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigReader.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigReader.java @@ -114,7 +114,7 @@ public SpecConfig build() { return configBuilder.build(); } - public SpecConfig build(Consumer modifier) { + public SpecConfig build(final Consumer modifier) { modifier.accept(configBuilder); return build(); } @@ -244,7 +244,7 @@ public Map readValues(final InputStream source) throws IOExcepti } } - private Stream streamConfigSetters(Class builderClass) { + private Stream streamConfigSetters(final Class builderClass) { // Ignore any setters that aren't for individual config entries final Set ignoredSetters = Set.of("rawConfig"); @@ -325,7 +325,7 @@ private Function fromString(final Function function) { } private interface BuilderSupplier { - static BuilderSupplier fromBuilder(T builder) { + static BuilderSupplier fromBuilder(final T builder) { return (consumer) -> consumer.accept(builder); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/constants/ParticipationFlags.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/constants/ParticipationFlags.java index 4e3570e2b31..1adb0d1f226 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/constants/ParticipationFlags.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/constants/ParticipationFlags.java @@ -25,11 +25,11 @@ public class ParticipationFlags { private static final int ALL_FLAGS = combineFlags(TIMELY_HEAD_FLAG, TIMELY_SOURCE_FLAG, TIMELY_TARGET_FLAG); - public static boolean isTimelyTarget(int value) { + public static boolean isTimelyTarget(final int value) { return checkIfAnyFlagIsSet(value, TIMELY_TARGET_FLAG); } - public static boolean isAnyFlagSet(int value) { + public static boolean isAnyFlagSet(final int value) { return checkIfAnyFlagIsSet(value, ALL_FLAGS); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/attestation/ValidatableAttestation.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/attestation/ValidatableAttestation.java index 5b8fe4467b6..0b87b00632f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/attestation/ValidatableAttestation.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/attestation/ValidatableAttestation.java @@ -195,7 +195,7 @@ public Bytes32 hashTreeRoot() { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/BlobSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/BlobSchema.java index 8769d94f7ac..a1fe76bf2ec 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/BlobSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/BlobSchema.java @@ -34,7 +34,7 @@ public Blob create(final Bytes bytes) { } @Override - public Blob createFromBackingNode(TreeNode node) { + public Blob createFromBackingNode(final TreeNode node) { return new Blob(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/BlobSidecarSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/BlobSidecarSchema.java index c75d7b1a6a0..a28d8f4cc20 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/BlobSidecarSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/BlobSidecarSchema.java @@ -143,7 +143,7 @@ public static BlobSidecarSchema create( } @Override - public BlobSidecar createFromBackingNode(TreeNode node) { + public BlobSidecar createFromBackingNode(final TreeNode node) { return new BlobSidecar(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlock.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlock.java index 72786f776f9..6dd1281383f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlock.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlock.java @@ -29,17 +29,17 @@ public class BeaconBlock extends Container5 implements BeaconBlockSummary, BlockContainer { - BeaconBlock(final BeaconBlockSchema type, TreeNode backingNode) { + BeaconBlock(final BeaconBlockSchema type, final TreeNode backingNode) { super(type, backingNode); } public BeaconBlock( - BeaconBlockSchema type, - UInt64 slot, - UInt64 proposerIndex, - Bytes32 parentRoot, - Bytes32 stateRoot, - BeaconBlockBody body) { + final BeaconBlockSchema type, + final UInt64 slot, + final UInt64 proposerIndex, + final Bytes32 parentRoot, + final Bytes32 stateRoot, + final BeaconBlockBody body) { super( type, SszUInt64.of(slot), @@ -64,7 +64,7 @@ public static BeaconBlock fromGenesisState( genesisSchema.getBeaconBlockBodySchema().createEmpty()); } - public BeaconBlock withStateRoot(Bytes32 stateRoot) { + public BeaconBlock withStateRoot(final Bytes32 stateRoot) { return new BeaconBlock( this.getSchema(), getSlot(), getProposerIndex(), getParentRoot(), stateRoot, getBody()); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlockHeader.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlockHeader.java index c481cbd4115..83d15057327 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlockHeader.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlockHeader.java @@ -42,19 +42,23 @@ public BeaconBlockHeaderSchema() { } @Override - public BeaconBlockHeader createFromBackingNode(TreeNode node) { + public BeaconBlockHeader createFromBackingNode(final TreeNode node) { return new BeaconBlockHeader(this, node); } } public static final BeaconBlockHeaderSchema SSZ_SCHEMA = new BeaconBlockHeaderSchema(); - private BeaconBlockHeader(BeaconBlockHeaderSchema type, TreeNode backingNode) { + private BeaconBlockHeader(final BeaconBlockHeaderSchema type, final TreeNode backingNode) { super(type, backingNode); } public BeaconBlockHeader( - UInt64 slot, UInt64 proposerIndex, Bytes32 parentRoot, Bytes32 stateRoot, Bytes32 bodyRoot) { + final UInt64 slot, + final UInt64 proposerIndex, + final Bytes32 parentRoot, + final Bytes32 stateRoot, + final Bytes32 bodyRoot) { super( SSZ_SCHEMA, SszUInt64.of(slot), @@ -64,7 +68,7 @@ public BeaconBlockHeader( SszBytes32.of(bodyRoot)); } - public BeaconBlockHeader(BeaconBlockHeader header) { + public BeaconBlockHeader(final BeaconBlockHeader header) { super(SSZ_SCHEMA, header.getBackingNode()); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlockSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlockSchema.java index 3dd31cc6a36..7bfed57a8de 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlockSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/BeaconBlockSchema.java @@ -43,7 +43,7 @@ public BeaconBlockSchema( } @Override - public BeaconBlock createFromBackingNode(TreeNode node) { + public BeaconBlock createFromBackingNode(final TreeNode node) { return new BeaconBlock(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/Eth1Data.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/Eth1Data.java index 411b94595e2..f4b6e666aa9 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/Eth1Data.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/Eth1Data.java @@ -36,7 +36,7 @@ public Eth1DataSchema() { } @Override - public Eth1Data createFromBackingNode(TreeNode node) { + public Eth1Data createFromBackingNode(final TreeNode node) { return new Eth1Data(this, node); } } @@ -49,11 +49,11 @@ public Eth1Data createFromBackingNode(TreeNode node) { public static final Bytes32 EMPTY_DEPOSIT_ROOT = Bytes32.fromHexString("0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e"); - private Eth1Data(Eth1DataSchema type, TreeNode backingNode) { + private Eth1Data(final Eth1DataSchema type, final TreeNode backingNode) { super(type, backingNode); } - public Eth1Data(Bytes32 depositRoot, UInt64 depositCount, Bytes32 blockHash) { + public Eth1Data(final Bytes32 depositRoot, final UInt64 depositCount, final Bytes32 blockHash) { super( SSZ_SCHEMA, SszBytes32.of(depositRoot), diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/NodeSlot.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/NodeSlot.java index dfc8628a281..7c16ae78858 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/NodeSlot.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/NodeSlot.java @@ -18,7 +18,7 @@ public class NodeSlot { private volatile UInt64 value; - public NodeSlot(UInt64 value) { + public NodeSlot(final UInt64 value) { this.value = value; } @@ -31,7 +31,7 @@ public UInt64 inc() { return value; } - public void setValue(UInt64 value) { + public void setValue(final UInt64 value) { this.value = value; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlock.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlock.java index 2dd065d1287..7c814014906 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlock.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlock.java @@ -34,7 +34,7 @@ public class SignedBeaconBlock extends Container2 implements BeaconBlockSummary, SignedBlockContainer { - SignedBeaconBlock(SignedBeaconBlockSchema type, TreeNode backingNode) { + SignedBeaconBlock(final SignedBeaconBlockSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockHeader.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockHeader.java index 6516bcfd560..56dac0c8fe1 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockHeader.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockHeader.java @@ -24,7 +24,7 @@ public class SignedBeaconBlockHeader public static final SignedBeaconBlockHeaderSchema SSZ_SCHEMA = new SignedBeaconBlockHeaderSchema(); - SignedBeaconBlockHeader(SignedBeaconBlockHeaderSchema type, TreeNode backingNode) { + SignedBeaconBlockHeader(final SignedBeaconBlockHeaderSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockHeaderSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockHeaderSchema.java index fa911dfc78e..c248f252741 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockHeaderSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockHeaderSchema.java @@ -29,7 +29,7 @@ public SignedBeaconBlockHeaderSchema() { } @Override - public SignedBeaconBlockHeader createFromBackingNode(TreeNode node) { + public SignedBeaconBlockHeader createFromBackingNode(final TreeNode node) { return new SignedBeaconBlockHeader(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockSchema.java index 38336a9650c..553e27f8e86 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SignedBeaconBlockSchema.java @@ -38,7 +38,7 @@ public SignedBeaconBlock create(final BeaconBlock message, final BLSSignature si } @Override - public SignedBeaconBlock createFromBackingNode(TreeNode node) { + public SignedBeaconBlock createFromBackingNode(final TreeNode node) { return new SignedBeaconBlock(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SlotAndBlockRoot.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SlotAndBlockRoot.java index 0e327ceaf70..a23a2a4585f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SlotAndBlockRoot.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/SlotAndBlockRoot.java @@ -55,7 +55,7 @@ public boolean equals(final Object o) { } @Override - public int compareTo(@NotNull SlotAndBlockRoot o) { + public int compareTo(final @NotNull SlotAndBlockRoot o) { return Comparator.comparing(SlotAndBlockRoot::getSlot) .thenComparing(SlotAndBlockRoot::getBlockRoot) .compare(this, o); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/common/AbstractSignedBeaconBlockBlinder.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/common/AbstractSignedBeaconBlockBlinder.java index 33308e24f9e..0f278e7d694 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/common/AbstractSignedBeaconBlockBlinder.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/common/AbstractSignedBeaconBlockBlinder.java @@ -27,7 +27,7 @@ public AbstractSignedBeaconBlockBlinder(final SchemaDefinitions schemaDefinition } @Override - public SignedBeaconBlock blind(SignedBeaconBlock signedUnblindedBlock) { + public SignedBeaconBlock blind(final SignedBeaconBlock signedUnblindedBlock) { final SignedBeaconBlock blindedSignedBeaconBlock = signedUnblindedBlock.blind(schemaDefinitions); checkState( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodyAltairImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodyAltairImpl.java index a6f5ace04ec..04dbf0b9f91 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodyAltairImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodyAltairImpl.java @@ -43,25 +43,26 @@ public class BeaconBlockBodyAltairImpl SyncAggregate> implements BeaconBlockBodyAltair { - BeaconBlockBodyAltairImpl(BeaconBlockBodySchemaAltairImpl type) { + BeaconBlockBodyAltairImpl(final BeaconBlockBodySchemaAltairImpl type) { super(type); } - BeaconBlockBodyAltairImpl(BeaconBlockBodySchemaAltairImpl type, TreeNode backingNode) { + BeaconBlockBodyAltairImpl( + final BeaconBlockBodySchemaAltairImpl type, final TreeNode backingNode) { super(type, backingNode); } BeaconBlockBodyAltairImpl( - BeaconBlockBodySchemaAltairImpl type, - SszSignature randaoReveal, - Eth1Data eth1Data, - SszBytes32 graffiti, - SszList proposerSlashings, - SszList attesterSlashings, - SszList attestations, - SszList deposits, - SszList voluntaryExits, - SyncAggregate syncAggregate) { + final BeaconBlockBodySchemaAltairImpl type, + final SszSignature randaoReveal, + final Eth1Data eth1Data, + final SszBytes32 graffiti, + final SszList proposerSlashings, + final SszList attesterSlashings, + final SszList attestations, + final SszList deposits, + final SszList voluntaryExits, + final SyncAggregate syncAggregate) { super( type, randaoReveal, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodySchemaAltairImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodySchemaAltairImpl.java index 30b608c90a5..8ca040d8403 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodySchemaAltairImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/altair/BeaconBlockBodySchemaAltairImpl.java @@ -53,15 +53,15 @@ public class BeaconBlockBodySchemaAltairImpl private BeaconBlockBodySchemaAltairImpl( final String containerName, - NamedSchema randaoRevealSchema, - NamedSchema eth1DataSchema, - NamedSchema graffitiSchema, - NamedSchema> proposerSlashingsSchema, - NamedSchema> attesterSlashingsSchema, - NamedSchema> attestationsSchema, - NamedSchema> depositsSchema, - NamedSchema> voluntaryExitsSchema, - NamedSchema syncAggregateSchema) { + final NamedSchema randaoRevealSchema, + final NamedSchema eth1DataSchema, + final NamedSchema graffitiSchema, + final NamedSchema> proposerSlashingsSchema, + final NamedSchema> attesterSlashingsSchema, + final NamedSchema> attestationsSchema, + final NamedSchema> depositsSchema, + final NamedSchema> voluntaryExitsSchema, + final NamedSchema syncAggregateSchema) { super( containerName, randaoRevealSchema, @@ -161,7 +161,7 @@ public SyncAggregateSchema getSyncAggregateSchema() { } @Override - public BeaconBlockBodyAltairImpl createFromBackingNode(TreeNode node) { + public BeaconBlockBodyAltairImpl createFromBackingNode(final TreeNode node) { return new BeaconBlockBodyAltairImpl(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodyBellatrixImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodyBellatrixImpl.java index 1dc5aa1ae65..b5317d636bb 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodyBellatrixImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodyBellatrixImpl.java @@ -49,26 +49,27 @@ class BeaconBlockBodyBellatrixImpl ExecutionPayloadBellatrix> implements BeaconBlockBodyBellatrix { - BeaconBlockBodyBellatrixImpl(BeaconBlockBodySchemaBellatrixImpl type) { + BeaconBlockBodyBellatrixImpl(final BeaconBlockBodySchemaBellatrixImpl type) { super(type); } - BeaconBlockBodyBellatrixImpl(BeaconBlockBodySchemaBellatrixImpl type, TreeNode backingNode) { + BeaconBlockBodyBellatrixImpl( + final BeaconBlockBodySchemaBellatrixImpl type, final TreeNode backingNode) { super(type, backingNode); } BeaconBlockBodyBellatrixImpl( - BeaconBlockBodySchemaBellatrixImpl type, - SszSignature randaoReveal, - Eth1Data eth1Data, - SszBytes32 graffiti, - SszList proposerSlashings, - SszList attesterSlashings, - SszList attestations, - SszList deposits, - SszList voluntaryExits, - SyncAggregate syncAggregate, - ExecutionPayloadBellatrix executionPayload) { + final BeaconBlockBodySchemaBellatrixImpl type, + final SszSignature randaoReveal, + final Eth1Data eth1Data, + final SszBytes32 graffiti, + final SszList proposerSlashings, + final SszList attesterSlashings, + final SszList attestations, + final SszList deposits, + final SszList voluntaryExits, + final SyncAggregate syncAggregate, + final ExecutionPayloadBellatrix executionPayload) { super( type, randaoReveal, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodySchemaBellatrixImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodySchemaBellatrixImpl.java index e9bc678e1cb..db77a7bb8af 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodySchemaBellatrixImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BeaconBlockBodySchemaBellatrixImpl.java @@ -60,16 +60,16 @@ public class BeaconBlockBodySchemaBellatrixImpl private BeaconBlockBodySchemaBellatrixImpl( final String containerName, - NamedSchema randaoRevealSchema, - NamedSchema eth1DataSchema, - NamedSchema graffitiSchema, - NamedSchema> proposerSlashingsSchema, - NamedSchema> attesterSlashingsSchema, - NamedSchema> attestationsSchema, - NamedSchema> depositsSchema, - NamedSchema> voluntaryExitsSchema, - NamedSchema syncAggregateSchema, - NamedSchema executionPayloadSchema) { + final NamedSchema randaoRevealSchema, + final NamedSchema eth1DataSchema, + final NamedSchema graffitiSchema, + final NamedSchema> proposerSlashingsSchema, + final NamedSchema> attesterSlashingsSchema, + final NamedSchema> attestationsSchema, + final NamedSchema> depositsSchema, + final NamedSchema> voluntaryExitsSchema, + final NamedSchema syncAggregateSchema, + final NamedSchema executionPayloadSchema) { super( containerName, randaoRevealSchema, @@ -167,7 +167,7 @@ public SyncAggregateSchema getSyncAggregateSchema() { } @Override - public BeaconBlockBodyBellatrixImpl createFromBackingNode(TreeNode node) { + public BeaconBlockBodyBellatrixImpl createFromBackingNode(final TreeNode node) { return new BeaconBlockBodyBellatrixImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodyBellatrixImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodyBellatrixImpl.java index c6c86ffb6bb..7da09fe4064 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodyBellatrixImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodyBellatrixImpl.java @@ -49,27 +49,27 @@ class BlindedBeaconBlockBodyBellatrixImpl ExecutionPayloadHeaderBellatrix> implements BlindedBeaconBlockBodyBellatrix { - BlindedBeaconBlockBodyBellatrixImpl(BlindedBeaconBlockBodySchemaBellatrixImpl type) { + BlindedBeaconBlockBodyBellatrixImpl(final BlindedBeaconBlockBodySchemaBellatrixImpl type) { super(type); } BlindedBeaconBlockBodyBellatrixImpl( - BlindedBeaconBlockBodySchemaBellatrixImpl type, TreeNode backingNode) { + final BlindedBeaconBlockBodySchemaBellatrixImpl type, final TreeNode backingNode) { super(type, backingNode); } BlindedBeaconBlockBodyBellatrixImpl( - BlindedBeaconBlockBodySchemaBellatrixImpl type, - SszSignature randaoReveal, - Eth1Data eth1Data, - SszBytes32 graffiti, - SszList proposerSlashings, - SszList attesterSlashings, - SszList attestations, - SszList deposits, - SszList voluntaryExits, - SyncAggregate syncAggregate, - ExecutionPayloadHeaderBellatrix executionPayloadHeader) { + final BlindedBeaconBlockBodySchemaBellatrixImpl type, + final SszSignature randaoReveal, + final Eth1Data eth1Data, + final SszBytes32 graffiti, + final SszList proposerSlashings, + final SszList attesterSlashings, + final SszList attestations, + final SszList deposits, + final SszList voluntaryExits, + final SyncAggregate syncAggregate, + final ExecutionPayloadHeaderBellatrix executionPayloadHeader) { super( type, randaoReveal, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodySchemaBellatrixImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodySchemaBellatrixImpl.java index 58d72b33fd2..f3e643a7982 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodySchemaBellatrixImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/BlindedBeaconBlockBodySchemaBellatrixImpl.java @@ -59,16 +59,16 @@ public class BlindedBeaconBlockBodySchemaBellatrixImpl private BlindedBeaconBlockBodySchemaBellatrixImpl( final String containerName, - NamedSchema randaoRevealSchema, - NamedSchema eth1DataSchema, - NamedSchema graffitiSchema, - NamedSchema> proposerSlashingsSchema, - NamedSchema> attesterSlashingsSchema, - NamedSchema> attestationsSchema, - NamedSchema> depositsSchema, - NamedSchema> voluntaryExitsSchema, - NamedSchema syncAggregateSchema, - NamedSchema executionPayloadHeaderSchema) { + final NamedSchema randaoRevealSchema, + final NamedSchema eth1DataSchema, + final NamedSchema graffitiSchema, + final NamedSchema> proposerSlashingsSchema, + final NamedSchema> attesterSlashingsSchema, + final NamedSchema> attestationsSchema, + final NamedSchema> depositsSchema, + final NamedSchema> voluntaryExitsSchema, + final NamedSchema syncAggregateSchema, + final NamedSchema executionPayloadHeaderSchema) { super( containerName, randaoRevealSchema, @@ -165,7 +165,7 @@ public SyncAggregateSchema getSyncAggregateSchema() { } @Override - public BlindedBeaconBlockBodyBellatrixImpl createFromBackingNode(TreeNode node) { + public BlindedBeaconBlockBodyBellatrixImpl createFromBackingNode(final TreeNode node) { return new BlindedBeaconBlockBodyBellatrixImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/SignedBeaconBlockUnblinderBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/SignedBeaconBlockUnblinderBellatrix.java index b1f147c6b37..41dfb389e80 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/SignedBeaconBlockUnblinderBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/bellatrix/SignedBeaconBlockUnblinderBellatrix.java @@ -34,7 +34,7 @@ public SignedBeaconBlockUnblinderBellatrix( @Override public void setExecutionPayloadSupplier( - Supplier> executionPayloadSupplier) { + final Supplier> executionPayloadSupplier) { this.executionPayloadFuture = executionPayloadSupplier.get(); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodyCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodyCapellaImpl.java index 9af1dc313bf..2062748cd9e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodyCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodyCapellaImpl.java @@ -48,18 +48,18 @@ public class BeaconBlockBodyCapellaImpl implements BeaconBlockBodyCapella { BeaconBlockBodyCapellaImpl( - BeaconBlockBodySchemaCapellaImpl type, - SszSignature randaoReveal, - Eth1Data eth1Data, - SszBytes32 graffiti, - SszList proposerSlashings, - SszList attesterSlashings, - SszList attestations, - SszList deposits, - SszList voluntaryExits, - SyncAggregate syncAggregate, - ExecutionPayloadCapellaImpl executionPayload, - SszList blsToExecutionChanges) { + final BeaconBlockBodySchemaCapellaImpl type, + final SszSignature randaoReveal, + final Eth1Data eth1Data, + final SszBytes32 graffiti, + final SszList proposerSlashings, + final SszList attesterSlashings, + final SszList attestations, + final SszList deposits, + final SszList voluntaryExits, + final SyncAggregate syncAggregate, + final ExecutionPayloadCapellaImpl executionPayload, + final SszList blsToExecutionChanges) { super( type, randaoReveal, @@ -75,11 +75,12 @@ public class BeaconBlockBodyCapellaImpl blsToExecutionChanges); } - BeaconBlockBodyCapellaImpl(BeaconBlockBodySchemaCapellaImpl type) { + BeaconBlockBodyCapellaImpl(final BeaconBlockBodySchemaCapellaImpl type) { super(type); } - BeaconBlockBodyCapellaImpl(BeaconBlockBodySchemaCapellaImpl type, TreeNode backingNode) { + BeaconBlockBodyCapellaImpl( + final BeaconBlockBodySchemaCapellaImpl type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodySchemaCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodySchemaCapellaImpl.java index 16081288231..4bd9fa103d5 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodySchemaCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BeaconBlockBodySchemaCapellaImpl.java @@ -176,7 +176,7 @@ public SyncAggregateSchema getSyncAggregateSchema() { } @Override - public BeaconBlockBodyCapellaImpl createFromBackingNode(TreeNode node) { + public BeaconBlockBodyCapellaImpl createFromBackingNode(final TreeNode node) { return new BeaconBlockBodyCapellaImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodyCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodyCapellaImpl.java index ee42e7e530b..6bfc79fd536 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodyCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodyCapellaImpl.java @@ -50,12 +50,12 @@ class BlindedBeaconBlockBodyCapellaImpl SszList> implements BlindedBeaconBlockBodyCapella { - BlindedBeaconBlockBodyCapellaImpl(BlindedBeaconBlockBodySchemaCapellaImpl type) { + BlindedBeaconBlockBodyCapellaImpl(final BlindedBeaconBlockBodySchemaCapellaImpl type) { super(type); } BlindedBeaconBlockBodyCapellaImpl( - BlindedBeaconBlockBodySchemaCapellaImpl type, TreeNode backingNode) { + final BlindedBeaconBlockBodySchemaCapellaImpl type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodySchemaCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodySchemaCapellaImpl.java index 1b8e2e39ac4..e18ae7045c4 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodySchemaCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/capella/BlindedBeaconBlockBodySchemaCapellaImpl.java @@ -62,17 +62,17 @@ public class BlindedBeaconBlockBodySchemaCapellaImpl private BlindedBeaconBlockBodySchemaCapellaImpl( final String containerName, - NamedSchema randaoReveal, - NamedSchema eth1Data, - NamedSchema graffiti, - NamedSchema> proposerSlashings, - NamedSchema> attesterSlashings, - NamedSchema> attestations, - NamedSchema> deposits, - NamedSchema> voluntaryExits, - NamedSchema syncAggregate, - NamedSchema executionPayloadHeader, - NamedSchema> blsToExecutionChanges) { + final NamedSchema randaoReveal, + final NamedSchema eth1Data, + final NamedSchema graffiti, + final NamedSchema> proposerSlashings, + final NamedSchema> attesterSlashings, + final NamedSchema> attestations, + final NamedSchema> deposits, + final NamedSchema> voluntaryExits, + final NamedSchema syncAggregate, + final NamedSchema executionPayloadHeader, + final NamedSchema> blsToExecutionChanges) { super( containerName, randaoReveal, @@ -176,7 +176,7 @@ public SyncAggregateSchema getSyncAggregateSchema() { } @Override - public BlindedBeaconBlockBodyCapellaImpl createFromBackingNode(TreeNode node) { + public BlindedBeaconBlockBodyCapellaImpl createFromBackingNode(final TreeNode node) { return new BlindedBeaconBlockBodyCapellaImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BeaconBlockBodyDenebImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BeaconBlockBodyDenebImpl.java index ce17e0a101c..b17f645edac 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BeaconBlockBodyDenebImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/deneb/BeaconBlockBodyDenebImpl.java @@ -53,19 +53,19 @@ public class BeaconBlockBodyDenebImpl implements BeaconBlockBodyDeneb { BeaconBlockBodyDenebImpl( - BeaconBlockBodySchemaDenebImpl type, - SszSignature randaoReveal, - Eth1Data eth1Data, - SszBytes32 graffiti, - SszList proposerSlashings, - SszList attesterSlashings, - SszList attestations, - SszList deposits, - SszList voluntaryExits, - SyncAggregate syncAggregate, - ExecutionPayloadDenebImpl executionPayload, - SszList blsToExecutionChanges, - SszList blobKzgCommitments) { + final BeaconBlockBodySchemaDenebImpl type, + final SszSignature randaoReveal, + final Eth1Data eth1Data, + final SszBytes32 graffiti, + final SszList proposerSlashings, + final SszList attesterSlashings, + final SszList attestations, + final SszList deposits, + final SszList voluntaryExits, + final SyncAggregate syncAggregate, + final ExecutionPayloadDenebImpl executionPayload, + final SszList blsToExecutionChanges, + final SszList blobKzgCommitments) { super( type, randaoReveal, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodyPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodyPhase0.java index d83699beaf9..a5351c50768 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodyPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodyPhase0.java @@ -42,24 +42,24 @@ public class BeaconBlockBodyPhase0 SszList> implements BeaconBlockBody { - BeaconBlockBodyPhase0(BeaconBlockBodySchemaPhase0 type) { + BeaconBlockBodyPhase0(final BeaconBlockBodySchemaPhase0 type) { super(type); } - BeaconBlockBodyPhase0(BeaconBlockBodySchemaPhase0 type, TreeNode backingNode) { + BeaconBlockBodyPhase0(final BeaconBlockBodySchemaPhase0 type, final TreeNode backingNode) { super(type, backingNode); } BeaconBlockBodyPhase0( - BeaconBlockBodySchemaPhase0 type, - SszSignature randaoReveal, - Eth1Data eth1Data, - SszBytes32 graffiti, - SszList proposerSlashings, - SszList attesterSlashings, - SszList attestations, - SszList deposits, - SszList voluntaryExits) { + final BeaconBlockBodySchemaPhase0 type, + final SszSignature randaoReveal, + final Eth1Data eth1Data, + final SszBytes32 graffiti, + final SszList proposerSlashings, + final SszList attesterSlashings, + final SszList attestations, + final SszList deposits, + final SszList voluntaryExits) { super( type, randaoReveal, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0.java index 0106ad71053..aac3aca0417 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/phase0/BeaconBlockBodySchemaPhase0.java @@ -53,14 +53,14 @@ public class BeaconBlockBodySchemaPhase0 private BeaconBlockBodySchemaPhase0( final String containerName, - NamedSchema randaoRevealSchema, - NamedSchema eth1DataSchema, - NamedSchema graffitiSchema, - NamedSchema> proposerSlashingsSchema, - NamedSchema> attesterSlashingsSchema, - NamedSchema> attestationsSchema, - NamedSchema> depositsSchema, - NamedSchema> voluntaryExitsSchema) { + final NamedSchema randaoRevealSchema, + final NamedSchema eth1DataSchema, + final NamedSchema graffitiSchema, + final NamedSchema> proposerSlashingsSchema, + final NamedSchema> attesterSlashingsSchema, + final NamedSchema> attestationsSchema, + final NamedSchema> depositsSchema, + final NamedSchema> voluntaryExitsSchema) { super( containerName, randaoRevealSchema, @@ -150,7 +150,7 @@ public LongList getBlindedNodeGeneralizedIndices() { } @Override - public BeaconBlockBodyPhase0 createFromBackingNode(TreeNode node) { + public BeaconBlockBodyPhase0 createFromBackingNode(final TreeNode node) { return new BeaconBlockBodyPhase0(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedBuilderBid.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedBuilderBid.java index d19c6d196b7..af1b35383ab 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedBuilderBid.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedBuilderBid.java @@ -22,7 +22,7 @@ public class SignedBuilderBid extends Container2 implements SszContainer { - SignedBuilderBid(SignedBuilderBidSchema type, TreeNode backingNode) { + SignedBuilderBid(final SignedBuilderBidSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedBuilderBidSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedBuilderBidSchema.java index c41d1405187..ac17c5b6054 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedBuilderBidSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedBuilderBidSchema.java @@ -38,7 +38,7 @@ public SignedBuilderBid create(final BuilderBid message, final BLSSignature sign } @Override - public SignedBuilderBid createFromBackingNode(TreeNode node) { + public SignedBuilderBid createFromBackingNode(final TreeNode node) { return new SignedBuilderBid(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistration.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistration.java index d3eb0a5ff82..ae385e80bd2 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistration.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistration.java @@ -21,7 +21,8 @@ public class SignedValidatorRegistration extends Container2 { - SignedValidatorRegistration(SignedValidatorRegistrationSchema type, TreeNode backingNode) { + SignedValidatorRegistration( + final SignedValidatorRegistrationSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistrationSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistrationSchema.java index 70419684f93..44e1cac72b4 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistrationSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistrationSchema.java @@ -36,7 +36,7 @@ public SignedValidatorRegistration create( } @Override - public SignedValidatorRegistration createFromBackingNode(TreeNode node) { + public SignedValidatorRegistration createFromBackingNode(final TreeNode node) { return new SignedValidatorRegistration(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistrationsSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistrationsSchema.java index a42326486a6..dccc303f455 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistrationsSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/SignedValidatorRegistrationsSchema.java @@ -23,12 +23,13 @@ public class SignedValidatorRegistrationsSchema SignedValidatorRegistration, SszList> { public SignedValidatorRegistrationsSchema( - SignedValidatorRegistrationSchema signedValidatorRegistrationSchema, long maxLength) { + final SignedValidatorRegistrationSchema signedValidatorRegistrationSchema, + final long maxLength) { super(signedValidatorRegistrationSchema, maxLength); } @Override - public SszList createFromBackingNode(TreeNode node) { + public SszList createFromBackingNode(final TreeNode node) { return new SszListImpl<>(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/ValidatorRegistration.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/ValidatorRegistration.java index 60c758c7ca5..4a7b0802196 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/ValidatorRegistration.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/ValidatorRegistration.java @@ -25,16 +25,17 @@ public class ValidatorRegistration extends Container4 { - protected ValidatorRegistration(ValidatorRegistrationSchema schema, TreeNode backingNode) { + protected ValidatorRegistration( + final ValidatorRegistrationSchema schema, final TreeNode backingNode) { super(schema, backingNode); } protected ValidatorRegistration( - ValidatorRegistrationSchema schema, - SszByteVector feeRecipient, - SszUInt64 gasLimit, - SszUInt64 timestamp, - SszPublicKey publicKey) { + final ValidatorRegistrationSchema schema, + final SszByteVector feeRecipient, + final SszUInt64 gasLimit, + final SszUInt64 timestamp, + final SszPublicKey publicKey) { super(schema, feeRecipient, gasLimit, timestamp, publicKey); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/ValidatorRegistrationSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/ValidatorRegistrationSchema.java index b58bf3a9797..527c56df90d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/ValidatorRegistrationSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/ValidatorRegistrationSchema.java @@ -51,7 +51,7 @@ public ValidatorRegistration create( } @Override - public ValidatorRegistration createFromBackingNode(TreeNode node) { + public ValidatorRegistration createFromBackingNode(final TreeNode node) { return new ValidatorRegistration(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/versions/bellatrix/BuilderBidSchemaBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/versions/bellatrix/BuilderBidSchemaBellatrix.java index 5b0794521c0..69047fb5ebd 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/versions/bellatrix/BuilderBidSchemaBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/versions/bellatrix/BuilderBidSchemaBellatrix.java @@ -43,7 +43,7 @@ public BuilderBidSchemaBellatrix( } @Override - public BuilderBidBellatrix createFromBackingNode(TreeNode node) { + public BuilderBidBellatrix createFromBackingNode(final TreeNode node) { return new BuilderBidBellatrix(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/PowBlock.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/PowBlock.java index 145b0699a31..cdeebd85868 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/PowBlock.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/PowBlock.java @@ -26,7 +26,10 @@ public class PowBlock { private final UInt64 blockTimestamp; public PowBlock( - Bytes32 blockHash, Bytes32 parentHash, UInt256 totalDifficulty, UInt64 blockTimestamp) { + final Bytes32 blockHash, + final Bytes32 parentHash, + final UInt256 totalDifficulty, + final UInt64 blockTimestamp) { this.blockHash = blockHash; this.parentHash = parentHash; this.totalDifficulty = totalDifficulty; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/Transaction.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/Transaction.java index 4a0175d9059..2fd6a1a7630 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/Transaction.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/Transaction.java @@ -18,7 +18,7 @@ public class Transaction extends SszByteListImpl { - Transaction(TransactionSchema schema, TreeNode backingNode) { + Transaction(final TransactionSchema schema, final TreeNode backingNode) { super(schema, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/TransactionSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/TransactionSchema.java index 56635079c6d..53b2b50ce14 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/TransactionSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/TransactionSchema.java @@ -25,7 +25,7 @@ public TransactionSchema(final SpecConfigBellatrix specConfig) { } @Override - public Transaction createFromBackingNode(TreeNode node) { + public Transaction createFromBackingNode(final TreeNode node) { return new Transaction(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadBellatrix.java index 2c9b27d839b..59aebb9c566 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadBellatrix.java @@ -53,7 +53,7 @@ public class ExecutionPayloadBellatrix implements ExecutionPayload { public ExecutionPayloadBellatrix( - ContainerSchema14< + final ContainerSchema14< ExecutionPayloadBellatrix, SszBytes32, SszByteVector, @@ -70,26 +70,26 @@ public ExecutionPayloadBellatrix( SszBytes32, SszList> type, - TreeNode backingNode) { + final TreeNode backingNode) { super(type, backingNode); } public ExecutionPayloadBellatrix( - ExecutionPayloadSchemaBellatrix schema, - SszBytes32 parentHash, - SszByteVector feeRecipient, - SszBytes32 stateRoot, - SszBytes32 receiptsRoot, - SszByteVector logsBloom, - SszBytes32 prevRandao, - SszUInt64 blockNumber, - SszUInt64 gasLimit, - SszUInt64 gasUsed, - SszUInt64 timestamp, - SszByteList extraData, - SszUInt256 baseFeePerGas, - SszBytes32 blockHash, - SszList transactions) { + final ExecutionPayloadSchemaBellatrix schema, + final SszBytes32 parentHash, + final SszByteVector feeRecipient, + final SszBytes32 stateRoot, + final SszBytes32 receiptsRoot, + final SszByteVector logsBloom, + final SszBytes32 prevRandao, + final SszUInt64 blockNumber, + final SszUInt64 gasLimit, + final SszUInt64 gasUsed, + final SszUInt64 timestamp, + final SszByteList extraData, + final SszUInt256 baseFeePerGas, + final SszBytes32 blockHash, + final SszList transactions) { super( schema, parentHash, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderBellatrix.java index a96a4b15a14..1d7c64ba916 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderBellatrix.java @@ -49,7 +49,7 @@ public class ExecutionPayloadHeaderBellatrix implements ExecutionPayloadHeader { public ExecutionPayloadHeaderBellatrix( - ContainerSchema14< + final ContainerSchema14< ExecutionPayloadHeaderBellatrix, SszBytes32, SszByteVector, @@ -66,26 +66,26 @@ public ExecutionPayloadHeaderBellatrix( SszBytes32, SszBytes32> type, - TreeNode backingNode) { + final TreeNode backingNode) { super(type, backingNode); } public ExecutionPayloadHeaderBellatrix( - ExecutionPayloadHeaderSchemaBellatrix schema, - SszBytes32 parentHash, - SszByteVector feeRecipient, - SszBytes32 stateRoot, - SszBytes32 receiptsRoot, - SszByteVector logsBloom, - SszBytes32 prevRandao, - SszUInt64 blockNumber, - SszUInt64 gasLimit, - SszUInt64 gasUsed, - SszUInt64 timestamp, - SszByteList extraData, - SszUInt256 baseFeePerGas, - SszBytes32 blockHash, - SszBytes32 transactionsRoot) { + final ExecutionPayloadHeaderSchemaBellatrix schema, + final SszBytes32 parentHash, + final SszByteVector feeRecipient, + final SszBytes32 stateRoot, + final SszBytes32 receiptsRoot, + final SszByteVector logsBloom, + final SszBytes32 prevRandao, + final SszUInt64 blockNumber, + final SszUInt64 gasLimit, + final SszUInt64 gasUsed, + final SszUInt64 timestamp, + final SszByteList extraData, + final SszUInt256 baseFeePerGas, + final SszBytes32 blockHash, + final SszBytes32 transactionsRoot) { super( schema, parentHash, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderSchemaBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderSchemaBellatrix.java index 6808fcab5ec..8e3a1c1482c 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderSchemaBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadHeaderSchemaBellatrix.java @@ -128,7 +128,7 @@ public ExecutionPayloadHeaderBellatrix getHeaderOfDefaultPayload() { } @Override - public ExecutionPayloadHeaderBellatrix createFromBackingNode(TreeNode node) { + public ExecutionPayloadHeaderBellatrix createFromBackingNode(final TreeNode node) { return new ExecutionPayloadHeaderBellatrix(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadSchemaBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadSchemaBellatrix.java index 657df96b4b0..a71de64349e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadSchemaBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/bellatrix/ExecutionPayloadSchemaBellatrix.java @@ -161,7 +161,7 @@ public ExecutionPayloadBellatrix getDefault() { } @Override - public ExecutionPayloadBellatrix createFromBackingNode(TreeNode node) { + public ExecutionPayloadBellatrix createFromBackingNode(final TreeNode node) { return new ExecutionPayloadBellatrix(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadCapellaImpl.java index 1d6c09f8d32..9b4eacf5ec4 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadCapellaImpl.java @@ -52,7 +52,7 @@ public class ExecutionPayloadCapellaImpl implements ExecutionPayloadCapella { public ExecutionPayloadCapellaImpl( - ContainerSchema15< + final ContainerSchema15< ExecutionPayloadCapellaImpl, SszBytes32, SszByteVector, @@ -70,27 +70,27 @@ public ExecutionPayloadCapellaImpl( SszList, SszList> schema, - TreeNode backingNode) { + final TreeNode backingNode) { super(schema, backingNode); } public ExecutionPayloadCapellaImpl( - ExecutionPayloadSchemaCapella schema, - SszBytes32 parentHash, - SszByteVector feeRecipient, - SszBytes32 stateRoot, - SszBytes32 receiptsRoot, - SszByteVector logsBloom, - SszBytes32 prevRandao, - SszUInt64 blockNumber, - SszUInt64 gasLimit, - SszUInt64 gasUsed, - SszUInt64 timestamp, - SszByteList extraData, - SszUInt256 baseFeePerGas, - SszBytes32 blockHash, - SszList transactions, - SszList withdrawals) { + final ExecutionPayloadSchemaCapella schema, + final SszBytes32 parentHash, + final SszByteVector feeRecipient, + final SszBytes32 stateRoot, + final SszBytes32 receiptsRoot, + final SszByteVector logsBloom, + final SszBytes32 prevRandao, + final SszUInt64 blockNumber, + final SszUInt64 gasLimit, + final SszUInt64 gasUsed, + final SszUInt64 timestamp, + final SszByteList extraData, + final SszUInt256 baseFeePerGas, + final SszBytes32 blockHash, + final SszList transactions, + final SszList withdrawals) { super( schema, parentHash, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderCapellaImpl.java index 425cf9089e7..1ca05a31419 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderCapellaImpl.java @@ -48,7 +48,7 @@ public class ExecutionPayloadHeaderCapellaImpl implements ExecutionPayloadHeaderCapella { protected ExecutionPayloadHeaderCapellaImpl( - ContainerSchema15< + final ContainerSchema15< ExecutionPayloadHeaderCapellaImpl, SszBytes32, SszByteVector, @@ -66,27 +66,27 @@ protected ExecutionPayloadHeaderCapellaImpl( SszBytes32, SszBytes32> schema, - TreeNode backingTree) { + final TreeNode backingTree) { super(schema, backingTree); } public ExecutionPayloadHeaderCapellaImpl( - ExecutionPayloadHeaderSchemaCapella schema, - SszBytes32 parentHash, - SszByteVector feeRecipient, - SszBytes32 stateRoot, - SszBytes32 receiptsRoot, - SszByteVector logsBloom, - SszBytes32 prevRandao, - SszUInt64 blockNumber, - SszUInt64 gasLimit, - SszUInt64 gasUsed, - SszUInt64 timestamp, - SszByteList extraData, - SszUInt256 baseFeePerGas, - SszBytes32 blockHash, - SszBytes32 transactionsRoot, - SszBytes32 withdrawalsRoot) { + final ExecutionPayloadHeaderSchemaCapella schema, + final SszBytes32 parentHash, + final SszByteVector feeRecipient, + final SszBytes32 stateRoot, + final SszBytes32 receiptsRoot, + final SszByteVector logsBloom, + final SszBytes32 prevRandao, + final SszUInt64 blockNumber, + final SszUInt64 gasLimit, + final SszUInt64 gasUsed, + final SszUInt64 timestamp, + final SszByteList extraData, + final SszUInt256 baseFeePerGas, + final SszBytes32 blockHash, + final SszBytes32 transactionsRoot, + final SszBytes32 withdrawalsRoot) { super( schema, parentHash, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderSchemaCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderSchemaCapella.java index 153e7f4f28c..e754b78109d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderSchemaCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadHeaderSchemaCapella.java @@ -152,7 +152,7 @@ public ExecutionPayloadHeaderCapella getHeaderOfDefaultPayload() { } @Override - public ExecutionPayloadHeaderCapellaImpl createFromBackingNode(TreeNode node) { + public ExecutionPayloadHeaderCapellaImpl createFromBackingNode(final TreeNode node) { return new ExecutionPayloadHeaderCapellaImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadSchemaCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadSchemaCapella.java index 78e5e0001ea..4f1bc2540d0 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadSchemaCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/capella/ExecutionPayloadSchemaCapella.java @@ -169,7 +169,7 @@ public ExecutionPayload createExecutionPayload( } @Override - public ExecutionPayloadCapellaImpl createFromBackingNode(TreeNode node) { + public ExecutionPayloadCapellaImpl createFromBackingNode(final TreeNode node) { return new ExecutionPayloadCapellaImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadDenebImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadDenebImpl.java index a85a82754b4..7150f97583f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadDenebImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadDenebImpl.java @@ -55,7 +55,7 @@ public class ExecutionPayloadDenebImpl implements ExecutionPayloadDeneb { public ExecutionPayloadDenebImpl( - ContainerSchema17< + final ContainerSchema17< ExecutionPayloadDenebImpl, SszBytes32, SszByteVector, @@ -75,29 +75,29 @@ public ExecutionPayloadDenebImpl( SszUInt64, SszUInt64> schema, - TreeNode backingNode) { + final TreeNode backingNode) { super(schema, backingNode); } public ExecutionPayloadDenebImpl( - ExecutionPayloadSchemaDeneb schema, - SszBytes32 parentHash, - SszByteVector feeRecipient, - SszBytes32 stateRoot, - SszBytes32 receiptsRoot, - SszByteVector logsBloom, - SszBytes32 prevRandao, - SszUInt64 blockNumber, - SszUInt64 gasLimit, - SszUInt64 gasUsed, - SszUInt64 timestamp, - SszByteList extraData, - SszUInt256 baseFeePerGas, - SszBytes32 blockHash, - SszList transactions, - SszList withdrawals, - SszUInt64 blobGasUsed, - SszUInt64 excessBlobGas) { + final ExecutionPayloadSchemaDeneb schema, + final SszBytes32 parentHash, + final SszByteVector feeRecipient, + final SszBytes32 stateRoot, + final SszBytes32 receiptsRoot, + final SszByteVector logsBloom, + final SszBytes32 prevRandao, + final SszUInt64 blockNumber, + final SszUInt64 gasLimit, + final SszUInt64 gasUsed, + final SszUInt64 timestamp, + final SszByteList extraData, + final SszUInt256 baseFeePerGas, + final SszBytes32 blockHash, + final SszList transactions, + final SszList withdrawals, + final SszUInt64 blobGasUsed, + final SszUInt64 excessBlobGas) { super( schema, parentHash, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadHeaderDenebImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadHeaderDenebImpl.java index 5394769e9bf..797197945a2 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadHeaderDenebImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/deneb/ExecutionPayloadHeaderDenebImpl.java @@ -50,7 +50,7 @@ public class ExecutionPayloadHeaderDenebImpl implements ExecutionPayloadHeaderDeneb { protected ExecutionPayloadHeaderDenebImpl( - ContainerSchema17< + final ContainerSchema17< ExecutionPayloadHeaderDenebImpl, SszBytes32, SszByteVector, @@ -70,29 +70,29 @@ protected ExecutionPayloadHeaderDenebImpl( SszUInt64, SszUInt64> schema, - TreeNode backingTree) { + final TreeNode backingTree) { super(schema, backingTree); } public ExecutionPayloadHeaderDenebImpl( - ExecutionPayloadHeaderSchemaDeneb schema, - SszBytes32 parentHash, - SszByteVector feeRecipient, - SszBytes32 stateRoot, - SszBytes32 receiptsRoot, - SszByteVector logsBloom, - SszBytes32 prevRandao, - SszUInt64 blockNumber, - SszUInt64 gasLimit, - SszUInt64 gasUsed, - SszUInt64 timestamp, - SszByteList extraData, - SszUInt256 baseFeePerGas, - SszBytes32 blockHash, - SszBytes32 transactionsRoot, - SszBytes32 withdrawalsRoot, - SszUInt64 blobGasUsed, - SszUInt64 excessBlobGas) { + final ExecutionPayloadHeaderSchemaDeneb schema, + final SszBytes32 parentHash, + final SszByteVector feeRecipient, + final SszBytes32 stateRoot, + final SszBytes32 receiptsRoot, + final SszByteVector logsBloom, + final SszBytes32 prevRandao, + final SszUInt64 blockNumber, + final SszUInt64 gasLimit, + final SszUInt64 gasUsed, + final SszUInt64 timestamp, + final SszByteList extraData, + final SszUInt256 baseFeePerGas, + final SszBytes32 blockHash, + final SszBytes32 transactionsRoot, + final SszBytes32 withdrawalsRoot, + final SszUInt64 blobGasUsed, + final SszUInt64 excessBlobGas) { super( schema, parentHash, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionPayloadElectraImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionPayloadElectraImpl.java index 766d9e1f8b4..84086836783 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionPayloadElectraImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionPayloadElectraImpl.java @@ -57,7 +57,7 @@ public class ExecutionPayloadElectraImpl implements ExecutionPayloadElectra { public ExecutionPayloadElectraImpl( - ContainerSchema19< + final ContainerSchema19< ExecutionPayloadElectraImpl, SszBytes32, SszByteVector, @@ -79,31 +79,31 @@ public ExecutionPayloadElectraImpl( SszList, SszList> schema, - TreeNode backingNode) { + final TreeNode backingNode) { super(schema, backingNode); } public ExecutionPayloadElectraImpl( - ExecutionPayloadSchemaElectra schema, - SszBytes32 parentHash, - SszByteVector feeRecipient, - SszBytes32 stateRoot, - SszBytes32 receiptsRoot, - SszByteVector logsBloom, - SszBytes32 prevRandao, - SszUInt64 blockNumber, - SszUInt64 gasLimit, - SszUInt64 gasUsed, - SszUInt64 timestamp, - SszByteList extraData, - SszUInt256 baseFeePerGas, - SszBytes32 blockHash, - SszList transactions, - SszList withdrawals, - SszUInt64 blobGasUsed, - SszUInt64 excessBlobGas, - SszList depositReceipts, - SszList exits) { + final ExecutionPayloadSchemaElectra schema, + final SszBytes32 parentHash, + final SszByteVector feeRecipient, + final SszBytes32 stateRoot, + final SszBytes32 receiptsRoot, + final SszByteVector logsBloom, + final SszBytes32 prevRandao, + final SszUInt64 blockNumber, + final SszUInt64 gasLimit, + final SszUInt64 gasUsed, + final SszUInt64 timestamp, + final SszByteList extraData, + final SszUInt256 baseFeePerGas, + final SszBytes32 blockHash, + final SszList transactions, + final SszList withdrawals, + final SszUInt64 blobGasUsed, + final SszUInt64 excessBlobGas, + final SszList depositReceipts, + final SszList exits) { super( schema, parentHash, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionPayloadHeaderElectraImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionPayloadHeaderElectraImpl.java index 10961fa0e89..0bd08efc582 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionPayloadHeaderElectraImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionPayloadHeaderElectraImpl.java @@ -52,7 +52,7 @@ public class ExecutionPayloadHeaderElectraImpl implements ExecutionPayloadHeaderElectra { protected ExecutionPayloadHeaderElectraImpl( - ContainerSchema19< + final ContainerSchema19< ExecutionPayloadHeaderElectraImpl, SszBytes32, SszByteVector, @@ -74,31 +74,31 @@ protected ExecutionPayloadHeaderElectraImpl( SszBytes32, SszBytes32> schema, - TreeNode backingTree) { + final TreeNode backingTree) { super(schema, backingTree); } public ExecutionPayloadHeaderElectraImpl( - ExecutionPayloadHeaderSchemaElectra schema, - SszBytes32 parentHash, - SszByteVector feeRecipient, - SszBytes32 stateRoot, - SszBytes32 receiptsRoot, - SszByteVector logsBloom, - SszBytes32 prevRandao, - SszUInt64 blockNumber, - SszUInt64 gasLimit, - SszUInt64 gasUsed, - SszUInt64 timestamp, - SszByteList extraData, - SszUInt256 baseFeePerGas, - SszBytes32 blockHash, - SszBytes32 transactionsRoot, - SszBytes32 withdrawalsRoot, - SszUInt64 blobGasUsed, - SszUInt64 excessBlobGas, - SszBytes32 depositReceiptsRoot, - SszBytes32 withdrawalRequestsRoot) { + final ExecutionPayloadHeaderSchemaElectra schema, + final SszBytes32 parentHash, + final SszByteVector feeRecipient, + final SszBytes32 stateRoot, + final SszBytes32 receiptsRoot, + final SszByteVector logsBloom, + final SszBytes32 prevRandao, + final SszUInt64 blockNumber, + final SszUInt64 gasLimit, + final SszUInt64 gasUsed, + final SszUInt64 timestamp, + final SszByteList extraData, + final SszUInt256 baseFeePerGas, + final SszBytes32 blockHash, + final SszBytes32 transactionsRoot, + final SszBytes32 withdrawalsRoot, + final SszUInt64 blobGasUsed, + final SszUInt64 excessBlobGas, + final SszBytes32 depositReceiptsRoot, + final SszBytes32 withdrawalRequestsRoot) { super( schema, parentHash, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/ReadOnlyStore.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/ReadOnlyStore.java index de4524c27d3..6c101680b7e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/ReadOnlyStore.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/ReadOnlyStore.java @@ -106,7 +106,7 @@ default UInt64 getGenesisTimeMillis() { Optional> getBlobSidecarsIfAvailable(SlotAndBlockRoot slotAndBlockRoot); - default SafeFuture> retrieveBlock(Bytes32 blockRoot) { + default SafeFuture> retrieveBlock(final Bytes32 blockRoot) { return retrieveSignedBlock(blockRoot).thenApply(res -> res.map(SignedBeaconBlock::getMessage)); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/VoteTracker.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/VoteTracker.java index 3ddc18f0a3c..90c6344b7ab 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/VoteTracker.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/forkchoice/VoteTracker.java @@ -34,11 +34,11 @@ public VoteTracker(final Bytes32 currentRoot, final Bytes32 nextRoot, final UInt } public VoteTracker( - Bytes32 currentRoot, - Bytes32 nextRoot, - UInt64 nextEpoch, - boolean nextEquivocating, - boolean currentEquivocating) { + final Bytes32 currentRoot, + final Bytes32 nextRoot, + final UInt64 nextEpoch, + final boolean nextEquivocating, + final boolean currentEquivocating) { this.currentRoot = currentRoot; this.nextRoot = nextRoot; this.nextEpoch = nextEpoch; @@ -75,7 +75,7 @@ public VoteTracker createNextEquivocating() { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/HashTree.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/HashTree.java index 3f45285c83f..0d0b89746a8 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/HashTree.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/HashTree.java @@ -94,7 +94,7 @@ public Set getAllRoots() { * @param head The root defining the head of the chain to process * @param processor The callback to invoke for each child-parent pair */ - public void processHashesInChain(final Bytes32 head, NodeProcessor processor) { + public void processHashesInChain(final Bytes32 head, final NodeProcessor processor) { processHashesInChainWhile(head, HaltableNodeProcessor.fromNodeProcessor(processor)); } @@ -107,7 +107,7 @@ public void processHashesInChain(final Bytes32 head, NodeProcessor processor) { * @return A list of roots in ascending order belonging to the chain defined by {@code head} */ public List collectChainRoots( - final Bytes32 head, Function shouldContinue) { + final Bytes32 head, final Function shouldContinue) { final Deque chain = new ArrayDeque<>(); processHashesInChainWhile( head, @@ -126,7 +126,8 @@ public List collectChainRoots( * @param nodeProcessor The callback receiving hashes and determining whether to continue * processing */ - public void processHashesInChainWhile(final Bytes32 head, HaltableNodeProcessor nodeProcessor) { + public void processHashesInChainWhile( + final Bytes32 head, final HaltableNodeProcessor nodeProcessor) { checkArgument(contains(head), "Unknown root supplied: " + head); Optional currentRoot = Optional.of(head); @@ -182,7 +183,7 @@ private Stream createBreadthFirstStream(final Bytes32 rootNodeHash) { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (o == this) { return true; } @@ -242,7 +243,7 @@ public Builder rootHash(final Bytes32 rootBlockHash) { return this; } - public Builder childAndParentRoots(Map childToParentMap) { + public Builder childAndParentRoots(final Map childToParentMap) { checkNotNull(childToParentMap); this.childToParentMap.putAll(childToParentMap); return this; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/BreadthFirstTraversalTreeIterator.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/BreadthFirstTraversalTreeIterator.java index 7cd532e6348..a77695b6b46 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/BreadthFirstTraversalTreeIterator.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/BreadthFirstTraversalTreeIterator.java @@ -23,12 +23,12 @@ class BreadthFirstTraversalTreeIterator implements Iterator { private final Deque remainingNodes = new ArrayDeque<>(); private final ChildLookup childLookup; - private BreadthFirstTraversalTreeIterator(final Bytes32 rootHash, ChildLookup childLookup) { + private BreadthFirstTraversalTreeIterator(final Bytes32 rootHash, final ChildLookup childLookup) { this.childLookup = childLookup; remainingNodes.push(rootHash); } - public static Iterator create(final Bytes32 rootNode, ChildLookup childLookup) { + public static Iterator create(final Bytes32 rootNode, final ChildLookup childLookup) { return new BreadthFirstTraversalTreeIterator(rootNode, childLookup); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/OrderedTreeStream.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/OrderedTreeStream.java index 33f8addedeb..160589aa74b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/OrderedTreeStream.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/OrderedTreeStream.java @@ -22,18 +22,18 @@ public class OrderedTreeStream { public static Stream createPreOrderTraversalStream( - final Bytes32 rootHash, ChildLookup childLookup) { + final Bytes32 rootHash, final ChildLookup childLookup) { Iterator iterator = PreOrderTraversalTreeIterator.create(rootHash, childLookup); return iteratorToStream(iterator); } public static Stream createBreadthFirstStream( - final Bytes32 rootHash, ChildLookup childLookup) { + final Bytes32 rootHash, final ChildLookup childLookup) { Iterator iterator = BreadthFirstTraversalTreeIterator.create(rootHash, childLookup); return iteratorToStream(iterator); } - private static Stream iteratorToStream(Iterator iterator) { + private static Stream iteratorToStream(final Iterator iterator) { final Spliterator split = Spliterators.spliteratorUnknownSize( iterator, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/PreOrderTraversalTreeIterator.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/PreOrderTraversalTreeIterator.java index cc06887ea61..55c90d87aeb 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/PreOrderTraversalTreeIterator.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/hashtree/traversal/PreOrderTraversalTreeIterator.java @@ -23,12 +23,12 @@ class PreOrderTraversalTreeIterator implements Iterator { private final Deque remainingNodes = new ArrayDeque<>(); private final ChildLookup childLookup; - private PreOrderTraversalTreeIterator(final Bytes32 rootHash, ChildLookup childLookup) { + private PreOrderTraversalTreeIterator(final Bytes32 rootHash, final ChildLookup childLookup) { this.childLookup = childLookup; remainingNodes.push(rootHash); } - public static Iterator create(final Bytes32 rootNode, ChildLookup childLookup) { + public static Iterator create(final Bytes32 rootNode, final ChildLookup childLookup) { return new PreOrderTraversalTreeIterator(rootNode, childLookup); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientBootstrapSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientBootstrapSchema.java index 603c332b339..72ffbc1d29a 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientBootstrapSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientBootstrapSchema.java @@ -36,9 +36,9 @@ public LightClientBootstrapSchema(final SpecConfigAltair specConfigAltair) { } public LightClientBootstrap create( - LightClientHeader lightClientHeader, - SyncCommittee syncCommittee, - SszBytes32Vector syncCommitteeBranch) { + final LightClientHeader lightClientHeader, + final SyncCommittee syncCommittee, + final SszBytes32Vector syncCommitteeBranch) { return new LightClientBootstrap(this, lightClientHeader, syncCommittee, syncCommitteeBranch); } @@ -48,7 +48,7 @@ public SszBytes32VectorSchema getSyncCommitteeBranchSchema() { } @Override - public LightClientBootstrap createFromBackingNode(TreeNode node) { + public LightClientBootstrap createFromBackingNode(final TreeNode node) { return new LightClientBootstrap(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientHeaderSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientHeaderSchema.java index 3b8ae7a2aa2..3726020af82 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientHeaderSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientHeaderSchema.java @@ -24,12 +24,12 @@ public LightClientHeaderSchema() { super("LightClientHeader", namedSchema("beacon", BeaconBlockHeader.SSZ_SCHEMA)); } - public LightClientHeader create(BeaconBlockHeader beaconBlockHeader) { + public LightClientHeader create(final BeaconBlockHeader beaconBlockHeader) { return new LightClientHeader(this, beaconBlockHeader); } @Override - public LightClientHeader createFromBackingNode(TreeNode node) { + public LightClientHeader createFromBackingNode(final TreeNode node) { return new LightClientHeader(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientUpdateResponseSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientUpdateResponseSchema.java index 41885b26e0e..71036720f29 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientUpdateResponseSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientUpdateResponseSchema.java @@ -32,12 +32,12 @@ public LightClientUpdateResponseSchema(final SpecConfigAltair specConfigAltair) } public LightClientUpdateResponse create( - SszUInt64 responseChunkLen, SszBytes4 context, LightClientUpdate payload) { + final SszUInt64 responseChunkLen, final SszBytes4 context, final LightClientUpdate payload) { return new LightClientUpdateResponse(this, responseChunkLen, context, payload); } @Override - public LightClientUpdateResponse createFromBackingNode(TreeNode node) { + public LightClientUpdateResponse createFromBackingNode(final TreeNode node) { return new LightClientUpdateResponse(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientUpdateSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientUpdateSchema.java index 8013371403f..d9516525926 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientUpdateSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/lightclient/LightClientUpdateSchema.java @@ -53,13 +53,13 @@ public LightClientUpdateSchema(final SpecConfigAltair specConfigAltair) { } public LightClientUpdate create( - LightClientHeader attestedHeader, - SyncCommittee nextSyncCommittee, - SszBytes32Vector nextSyncCommitteeBranch, - LightClientHeader finalizedHeader, - SszBytes32Vector finalityBranch, - SyncAggregate syncAggregate, - SszUInt64 signatureSlot) { + final LightClientHeader attestedHeader, + final SyncCommittee nextSyncCommittee, + final SszBytes32Vector nextSyncCommitteeBranch, + final LightClientHeader finalizedHeader, + final SszBytes32Vector finalityBranch, + final SyncAggregate syncAggregate, + final SszUInt64 signatureSlot) { return new LightClientUpdate( this, attestedHeader, @@ -72,7 +72,7 @@ public LightClientUpdate create( } @Override - public LightClientUpdate createFromBackingNode(TreeNode node) { + public LightClientUpdate createFromBackingNode(final TreeNode node) { return new LightClientUpdate(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/metadata/ObjectAndMetaDataBuilder.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/metadata/ObjectAndMetaDataBuilder.java index fd24c550f16..adadac23ede 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/metadata/ObjectAndMetaDataBuilder.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/metadata/ObjectAndMetaDataBuilder.java @@ -22,27 +22,27 @@ public class ObjectAndMetaDataBuilder { private boolean canonical; private boolean finalized; - public ObjectAndMetaDataBuilder data(T data) { + public ObjectAndMetaDataBuilder data(final T data) { this.data = data; return this; } - public ObjectAndMetaDataBuilder milestone(SpecMilestone milestone) { + public ObjectAndMetaDataBuilder milestone(final SpecMilestone milestone) { this.milestone = milestone; return this; } - public ObjectAndMetaDataBuilder executionOptimistic(boolean executionOptimistic) { + public ObjectAndMetaDataBuilder executionOptimistic(final boolean executionOptimistic) { this.executionOptimistic = executionOptimistic; return this; } - public ObjectAndMetaDataBuilder canonical(boolean canonical) { + public ObjectAndMetaDataBuilder canonical(final boolean canonical) { this.canonical = canonical; return this; } - public ObjectAndMetaDataBuilder finalized(boolean finalized) { + public ObjectAndMetaDataBuilder finalized(final boolean finalized) { this.finalized = finalized; return this; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BeaconBlocksByRangeRequestMessage.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BeaconBlocksByRangeRequestMessage.java index 36edd39f17d..c665ad561f6 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BeaconBlocksByRangeRequestMessage.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BeaconBlocksByRangeRequestMessage.java @@ -36,7 +36,7 @@ public BeaconBlocksByRangeRequestMessageSchema() { } @Override - public BeaconBlocksByRangeRequestMessage createFromBackingNode(TreeNode node) { + public BeaconBlocksByRangeRequestMessage createFromBackingNode(final TreeNode node) { return new BeaconBlocksByRangeRequestMessage(this, node); } } @@ -45,7 +45,7 @@ public BeaconBlocksByRangeRequestMessage createFromBackingNode(TreeNode node) { new BeaconBlocksByRangeRequestMessageSchema(); private BeaconBlocksByRangeRequestMessage( - BeaconBlocksByRangeRequestMessageSchema type, TreeNode backingNode) { + final BeaconBlocksByRangeRequestMessageSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BeaconBlocksByRootRequestMessage.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BeaconBlocksByRootRequestMessage.java index b34c39067ed..08ddbfe6c2e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BeaconBlocksByRootRequestMessage.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BeaconBlocksByRootRequestMessage.java @@ -35,18 +35,18 @@ public BeaconBlocksByRootRequestMessageSchema(final SpecConfig specConfig) { } @Override - public BeaconBlocksByRootRequestMessage createFromBackingNode(TreeNode node) { + public BeaconBlocksByRootRequestMessage createFromBackingNode(final TreeNode node) { return new BeaconBlocksByRootRequestMessage(this, node); } } public BeaconBlocksByRootRequestMessage( - final BeaconBlocksByRootRequestMessageSchema schema, List roots) { + final BeaconBlocksByRootRequestMessageSchema schema, final List roots) { super(schema, schema.createTreeFromElements(roots.stream().map(SszBytes32::of).toList())); } private BeaconBlocksByRootRequestMessage( - BeaconBlocksByRootRequestMessageSchema schema, TreeNode node) { + final BeaconBlocksByRootRequestMessageSchema schema, final TreeNode node) { super(schema, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/EmptyMessage.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/EmptyMessage.java index c57256102c5..a34fb52d644 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/EmptyMessage.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/EmptyMessage.java @@ -27,7 +27,7 @@ private EmptyMessageSchema() { } @Override - public EmptyMessage createFromBackingNode(TreeNode node) { + public EmptyMessage createFromBackingNode(final TreeNode node) { return EMPTY_MESSAGE; } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/EnrForkId.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/EnrForkId.java index 22c7b10cbd1..cf8a51c1ec3 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/EnrForkId.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/EnrForkId.java @@ -36,14 +36,14 @@ public EnrForkIdSchema() { } @Override - public EnrForkId createFromBackingNode(TreeNode node) { + public EnrForkId createFromBackingNode(final TreeNode node) { return new EnrForkId(this, node); } } public static final EnrForkIdSchema SSZ_SCHEMA = new EnrForkIdSchema(); - private EnrForkId(EnrForkIdSchema type, TreeNode backingNode) { + private EnrForkId(final EnrForkIdSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/GoodbyeMessage.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/GoodbyeMessage.java index 3a0bce63ca5..ff635f0463b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/GoodbyeMessage.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/GoodbyeMessage.java @@ -32,7 +32,7 @@ public GoodbyeMessageSchema() { } @Override - public GoodbyeMessage createFromBackingNode(TreeNode node) { + public GoodbyeMessage createFromBackingNode(final TreeNode node) { return new GoodbyeMessage(this, node); } } @@ -49,11 +49,11 @@ public GoodbyeMessage createFromBackingNode(TreeNode node) { public static final UInt64 REASON_TOO_MANY_PEERS = UInt64.valueOf(129); public static final UInt64 REASON_RATE_LIMITING = UInt64.valueOf(130); - private GoodbyeMessage(GoodbyeMessageSchema type, TreeNode backingNode) { + private GoodbyeMessage(final GoodbyeMessageSchema type, final TreeNode backingNode) { super(type, backingNode); } - public GoodbyeMessage(UInt64 reason) { + public GoodbyeMessage(final UInt64 reason) { super(SSZ_SCHEMA, SszUInt64.of(reason)); checkArgument( REASON_CLIENT_SHUT_DOWN.equals(reason) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/PingMessage.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/PingMessage.java index 3662e5a9603..8821627ccbe 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/PingMessage.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/PingMessage.java @@ -33,18 +33,18 @@ public PingMessageSchema() { } @Override - public PingMessage createFromBackingNode(TreeNode node) { + public PingMessage createFromBackingNode(final TreeNode node) { return new PingMessage(this, node); } } public static final PingMessageSchema SSZ_SCHEMA = new PingMessageSchema(); - public PingMessage(PingMessageSchema type, TreeNode backingNode) { + public PingMessage(final PingMessageSchema type, final TreeNode backingNode) { super(type, backingNode); } - public PingMessage(UInt64 seqNumber) { + public PingMessage(final UInt64 seqNumber) { super(SSZ_SCHEMA, SszUInt64.of(seqNumber)); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/RpcErrorMessage.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/RpcErrorMessage.java index 339e342d0b6..7d5b850cd6b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/RpcErrorMessage.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/RpcErrorMessage.java @@ -36,18 +36,18 @@ private RpcErrorMessageSchema() { } @Override - public RpcErrorMessage createFromBackingNode(TreeNode node) { + public RpcErrorMessage createFromBackingNode(final TreeNode node) { return new RpcErrorMessage(node); } } public static final RpcErrorMessageSchema SSZ_SCHEMA = new RpcErrorMessageSchema(); - public RpcErrorMessage(Bytes bytes) { + public RpcErrorMessage(final Bytes bytes) { super(SSZ_SCHEMA, SszUtils.toSszByteList(SSZ_SCHEMA, bytes).getBackingNode()); } - private RpcErrorMessage(TreeNode node) { + private RpcErrorMessage(final TreeNode node) { super(SSZ_SCHEMA, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/StatusMessage.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/StatusMessage.java index b39aafe7fdd..83ccd29b91d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/StatusMessage.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/StatusMessage.java @@ -45,23 +45,23 @@ public StatusMessageSchema() { } @Override - public StatusMessage createFromBackingNode(TreeNode node) { + public StatusMessage createFromBackingNode(final TreeNode node) { return new StatusMessage(this, node); } } public static final StatusMessageSchema SSZ_SCHEMA = new StatusMessageSchema(); - private StatusMessage(StatusMessageSchema type, TreeNode backingNode) { + private StatusMessage(final StatusMessageSchema type, final TreeNode backingNode) { super(type, backingNode); } public StatusMessage( - Bytes4 forkDigest, - Bytes32 finalizedRoot, - UInt64 finalizedEpoch, - Bytes32 headRoot, - UInt64 headSlot) { + final Bytes4 forkDigest, + final Bytes32 finalizedRoot, + final UInt64 finalizedEpoch, + final Bytes32 headRoot, + final UInt64 headSlot) { super( SSZ_SCHEMA, SszBytes4.of(forkDigest), diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/metadata/versions/phase0/MetadataMessagePhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/metadata/versions/phase0/MetadataMessagePhase0.java index 4da0a3c2f73..888df0907ba 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/metadata/versions/phase0/MetadataMessagePhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/metadata/versions/phase0/MetadataMessagePhase0.java @@ -26,16 +26,18 @@ public class MetadataMessagePhase0 extends Container2 implements MetadataMessage { - MetadataMessagePhase0(MetadataMessageSchemaPhase0 type, TreeNode backingNode) { + MetadataMessagePhase0(final MetadataMessageSchemaPhase0 type, final TreeNode backingNode) { super(type, backingNode); } - MetadataMessagePhase0(MetadataMessageSchemaPhase0 type) { + MetadataMessagePhase0(final MetadataMessageSchemaPhase0 type) { super(type); } MetadataMessagePhase0( - MetadataMessageSchemaPhase0 schema, UInt64 seqNumber, SszBitvector attnets) { + final MetadataMessageSchemaPhase0 schema, + final UInt64 seqNumber, + final SszBitvector attnets) { super(schema, SszUInt64.of(seqNumber), attnets); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/metadata/versions/phase0/MetadataMessageSchemaPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/metadata/versions/phase0/MetadataMessageSchemaPhase0.java index a7298c56645..fddbddcf785 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/metadata/versions/phase0/MetadataMessageSchemaPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/metadata/versions/phase0/MetadataMessageSchemaPhase0.java @@ -37,7 +37,7 @@ public MetadataMessageSchemaPhase0(final NetworkingSpecConfig networkingSpecConf } @Override - public MetadataMessagePhase0 createFromBackingNode(TreeNode node) { + public MetadataMessagePhase0 createFromBackingNode(final TreeNode node) { return new MetadataMessagePhase0(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AggregateAndProof.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AggregateAndProof.java index 85ff610d89a..796f19b816e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AggregateAndProof.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AggregateAndProof.java @@ -44,7 +44,7 @@ public AttestationSchema getAttestationSchema() { } @Override - public AggregateAndProof createFromBackingNode(TreeNode node) { + public AggregateAndProof createFromBackingNode(final TreeNode node) { return new AggregateAndProof(this, node); } @@ -54,15 +54,15 @@ public AggregateAndProof create( } } - private AggregateAndProof(AggregateAndProofSchema type, TreeNode backingNode) { + private AggregateAndProof(final AggregateAndProofSchema type, final TreeNode backingNode) { super(type, backingNode); } private AggregateAndProof( - AggregateAndProofSchema schema, - UInt64 index, - Attestation aggregate, - BLSSignature selectionProof) { + final AggregateAndProofSchema schema, + final UInt64 index, + final Attestation aggregate, + final BLSSignature selectionProof) { super(schema, SszUInt64.of(index), aggregate, new SszSignature(selectionProof)); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/Attestation.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/Attestation.java index f0ee74a4fdc..4f85ef39b8a 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/Attestation.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/Attestation.java @@ -49,7 +49,7 @@ public SszBitlistSchema getAggregationBitsSchema() { } @Override - public Attestation createFromBackingNode(TreeNode node) { + public Attestation createFromBackingNode(final TreeNode node) { return new Attestation(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttestationData.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttestationData.java index 2caf81bc9cb..fac336790a6 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttestationData.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttestationData.java @@ -43,19 +43,23 @@ public AttestationDataSchema() { } @Override - public AttestationData createFromBackingNode(TreeNode node) { + public AttestationData createFromBackingNode(final TreeNode node) { return new AttestationData(this, node); } } public static final AttestationDataSchema SSZ_SCHEMA = new AttestationDataSchema(); - private AttestationData(AttestationDataSchema type, TreeNode backingNode) { + private AttestationData(final AttestationDataSchema type, final TreeNode backingNode) { super(type, backingNode); } public AttestationData( - UInt64 slot, UInt64 index, Bytes32 beaconBlockRoot, Checkpoint source, Checkpoint target) { + final UInt64 slot, + final UInt64 index, + final Bytes32 beaconBlockRoot, + final Checkpoint source, + final Checkpoint target) { super( SSZ_SCHEMA, SszUInt64.of(slot), @@ -65,7 +69,7 @@ public AttestationData( target); } - public AttestationData(UInt64 slot, AttestationData data) { + public AttestationData(final UInt64 slot, final AttestationData data) { this(slot, data.getIndex(), data.getBeaconBlockRoot(), data.getSource(), data.getTarget()); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttesterSlashing.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttesterSlashing.java index 897f1ec29ab..67bc2a36242 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttesterSlashing.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttesterSlashing.java @@ -39,7 +39,7 @@ public AttesterSlashingSchema(final IndexedAttestationSchema indexedAttestationS } @Override - public AttesterSlashing createFromBackingNode(TreeNode node) { + public AttesterSlashing createFromBackingNode(final TreeNode node) { return new AttesterSlashing(this, node); } @@ -59,7 +59,7 @@ public AttesterSlashing create( .asListUnboxed()), // TreeSet as must be sorted new HashSet<>(getAttestation2().getAttestingIndices().asListUnboxed()))); - private AttesterSlashing(AttesterSlashingSchema type, TreeNode backingNode) { + private AttesterSlashing(final AttesterSlashingSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/Deposit.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/Deposit.java index a290fe38298..7efedb8251d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/Deposit.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/Deposit.java @@ -38,7 +38,7 @@ public SszBytes32VectorSchema getProofSchema() { } @Override - public Deposit createFromBackingNode(TreeNode node) { + public Deposit createFromBackingNode(final TreeNode node) { return new Deposit(this, node); } } @@ -47,15 +47,15 @@ public Deposit createFromBackingNode(TreeNode node) { private static final SszBytes32Vector EMPTY_PROOF = SSZ_SCHEMA.getProofSchema().getDefault(); - private Deposit(DepositSchema type, TreeNode backingNode) { + private Deposit(final DepositSchema type, final TreeNode backingNode) { super(type, backingNode); } - public Deposit(DepositData data) { + public Deposit(final DepositData data) { this(EMPTY_PROOF, data); } - public Deposit(SszBytes32Vector proof, DepositData data) { + public Deposit(final SszBytes32Vector proof, final DepositData data) { super(SSZ_SCHEMA, proof, data); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositData.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositData.java index 1f95d8c3e20..704544307d4 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositData.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositData.java @@ -44,19 +44,22 @@ public DepositDataSchema() { } @Override - public DepositData createFromBackingNode(TreeNode node) { + public DepositData createFromBackingNode(final TreeNode node) { return new DepositData(this, node); } } public static final DepositDataSchema SSZ_SCHEMA = new DepositDataSchema(); - private DepositData(DepositDataSchema type, TreeNode backingNode) { + private DepositData(final DepositDataSchema type, final TreeNode backingNode) { super(type, backingNode); } public DepositData( - BLSPublicKey pubkey, Bytes32 withdrawalCredentials, UInt64 amount, BLSSignature signature) { + final BLSPublicKey pubkey, + final Bytes32 withdrawalCredentials, + final UInt64 amount, + final BLSSignature signature) { super( SSZ_SCHEMA, new SszPublicKey(pubkey), diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositMessage.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositMessage.java index 3b8fc6742b6..53a4ba89da4 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositMessage.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositMessage.java @@ -40,14 +40,14 @@ public DepositMessageSchema() { } @Override - public DepositMessage createFromBackingNode(TreeNode node) { + public DepositMessage createFromBackingNode(final TreeNode node) { return new DepositMessage(this, node); } } public static final DepositMessageSchema SSZ_SCHEMA = new DepositMessageSchema(); - private DepositMessage(DepositMessageSchema type, TreeNode backingNode) { + private DepositMessage(final DepositMessageSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositWithIndex.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositWithIndex.java index 5b03cd79c59..7f39f520e65 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositWithIndex.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/DepositWithIndex.java @@ -22,12 +22,13 @@ public class DepositWithIndex extends Deposit implements Comparable getAttestingIndicesSchema() { } @Override - public IndexedAttestation createFromBackingNode(TreeNode node) { + public IndexedAttestation createFromBackingNode(final TreeNode node) { return new IndexedAttestation(this, node); } @@ -56,7 +56,7 @@ public IndexedAttestation create( } } - private IndexedAttestation(IndexedAttestationSchema type, TreeNode backingNode) { + private IndexedAttestation(final IndexedAttestationSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/ProposerSlashing.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/ProposerSlashing.java index edca1680dc6..71b73bce823 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/ProposerSlashing.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/ProposerSlashing.java @@ -32,18 +32,19 @@ public ProposerSlashingSchema() { } @Override - public ProposerSlashing createFromBackingNode(TreeNode node) { + public ProposerSlashing createFromBackingNode(final TreeNode node) { return new ProposerSlashing(this, node); } } public static final ProposerSlashingSchema SSZ_SCHEMA = new ProposerSlashingSchema(); - private ProposerSlashing(ProposerSlashingSchema type, TreeNode backingNode) { + private ProposerSlashing(final ProposerSlashingSchema type, final TreeNode backingNode) { super(type, backingNode); } - public ProposerSlashing(SignedBeaconBlockHeader header1, SignedBeaconBlockHeader header2) { + public ProposerSlashing( + final SignedBeaconBlockHeader header1, final SignedBeaconBlockHeader header2) { super(SSZ_SCHEMA, header1, header2); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/SignedAggregateAndProof.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/SignedAggregateAndProof.java index 6f6569889d6..8a2f6930a34 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/SignedAggregateAndProof.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/SignedAggregateAndProof.java @@ -40,16 +40,18 @@ public AggregateAndProofSchema getAggregateAndProofSchema() { } @Override - public SignedAggregateAndProof createFromBackingNode(TreeNode node) { + public SignedAggregateAndProof createFromBackingNode(final TreeNode node) { return new SignedAggregateAndProof(this, node); } - public SignedAggregateAndProof create(final AggregateAndProof message, BLSSignature signature) { + public SignedAggregateAndProof create( + final AggregateAndProof message, final BLSSignature signature) { return new SignedAggregateAndProof(this, message, signature); } } - private SignedAggregateAndProof(SignedAggregateAndProofSchema type, TreeNode backingNode) { + private SignedAggregateAndProof( + final SignedAggregateAndProofSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/SignedVoluntaryExit.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/SignedVoluntaryExit.java index 1badae5f717..c82db5faf55 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/SignedVoluntaryExit.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/SignedVoluntaryExit.java @@ -36,14 +36,14 @@ public SignedVoluntaryExitSchema() { } @Override - public SignedVoluntaryExit createFromBackingNode(TreeNode node) { + public SignedVoluntaryExit createFromBackingNode(final TreeNode node) { return new SignedVoluntaryExit(this, node); } } public static final SignedVoluntaryExitSchema SSZ_SCHEMA = new SignedVoluntaryExitSchema(); - private SignedVoluntaryExit(SignedVoluntaryExitSchema type, TreeNode backingNode) { + private SignedVoluntaryExit(final SignedVoluntaryExitSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/VoluntaryExit.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/VoluntaryExit.java index e51b94b5712..049f87ad334 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/VoluntaryExit.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/VoluntaryExit.java @@ -33,18 +33,18 @@ public VoluntaryExitSchema() { } @Override - public VoluntaryExit createFromBackingNode(TreeNode node) { + public VoluntaryExit createFromBackingNode(final TreeNode node) { return new VoluntaryExit(this, node); } } public static final VoluntaryExitSchema SSZ_SCHEMA = new VoluntaryExitSchema(); - private VoluntaryExit(VoluntaryExitSchema type, TreeNode backingNode) { + private VoluntaryExit(final VoluntaryExitSchema type, final TreeNode backingNode) { super(type, backingNode); } - public VoluntaryExit(UInt64 epoch, UInt64 validatorIndex) { + public VoluntaryExit(final UInt64 epoch, final UInt64 validatorIndex) { super(SSZ_SCHEMA, SszUInt64.of(epoch), SszUInt64.of(validatorIndex)); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/versions/bellatrix/BeaconPreparableProposer.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/versions/bellatrix/BeaconPreparableProposer.java index 8528344b5b8..b8f6b0c5e9a 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/versions/bellatrix/BeaconPreparableProposer.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/versions/bellatrix/BeaconPreparableProposer.java @@ -22,7 +22,7 @@ public class BeaconPreparableProposer { private final UInt64 validatorIndex; private final Eth1Address feeRecipient; - public BeaconPreparableProposer(UInt64 validatorIndex, Eth1Address feeRecipient) { + public BeaconPreparableProposer(final UInt64 validatorIndex, final Eth1Address feeRecipient) { this.validatorIndex = validatorIndex; this.feeRecipient = feeRecipient; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/AnchorPoint.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/AnchorPoint.java index 69046334b66..97ab43e0244 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/AnchorPoint.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/AnchorPoint.java @@ -58,21 +58,24 @@ private AnchorPoint( public static AnchorPoint create( final Spec spec, - Checkpoint checkpoint, - BeaconState state, - Optional block) { + final Checkpoint checkpoint, + final BeaconState state, + final Optional block) { final BeaconBlockSummary blockSummary = block.map(a -> a).orElseGet(() -> BeaconBlockHeader.fromState(state)); return new AnchorPoint(spec, checkpoint, state, blockSummary); } public static AnchorPoint create( - final Spec spec, Checkpoint checkpoint, SignedBeaconBlock block, BeaconState state) { + final Spec spec, + final Checkpoint checkpoint, + final SignedBeaconBlock block, + final BeaconState state) { return new AnchorPoint(spec, checkpoint, state, block); } public static AnchorPoint create( - final Spec spec, Checkpoint checkpoint, SignedBlockAndState blockAndState) { + final Spec spec, final Checkpoint checkpoint, final SignedBlockAndState blockAndState) { return new AnchorPoint(spec, checkpoint, blockAndState.getState(), blockAndState.getBlock()); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Checkpoint.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Checkpoint.java index ec673c97364..bc692dba672 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Checkpoint.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Checkpoint.java @@ -36,18 +36,18 @@ public CheckpointSchema() { } @Override - public Checkpoint createFromBackingNode(TreeNode node) { + public Checkpoint createFromBackingNode(final TreeNode node) { return new Checkpoint(this, node); } } public static final CheckpointSchema SSZ_SCHEMA = new CheckpointSchema(); - private Checkpoint(CheckpointSchema type, TreeNode backingNode) { + private Checkpoint(final CheckpointSchema type, final TreeNode backingNode) { super(type, backingNode); } - public Checkpoint(UInt64 epoch, Bytes32 root) { + public Checkpoint(final UInt64 epoch, final Bytes32 root) { super(SSZ_SCHEMA, SszUInt64.of(epoch), SszBytes32.of(root)); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/CommitteeAssignment.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/CommitteeAssignment.java index df0271bce65..f1f08938744 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/CommitteeAssignment.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/CommitteeAssignment.java @@ -23,7 +23,8 @@ public class CommitteeAssignment { private UInt64 committeeIndex; private UInt64 slot; - public CommitteeAssignment(IntList committee, UInt64 committeeIndex, UInt64 slot) { + public CommitteeAssignment( + final IntList committee, final UInt64 committeeIndex, final UInt64 slot) { this.committee = committee; this.committeeIndex = committeeIndex; this.slot = slot; @@ -54,7 +55,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Fork.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Fork.java index 47b444a3b6f..f025904d8a1 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Fork.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Fork.java @@ -36,18 +36,18 @@ public ForkSchema() { } @Override - public Fork createFromBackingNode(TreeNode node) { + public Fork createFromBackingNode(final TreeNode node) { return new Fork(this, node); } } public static final ForkSchema SSZ_SCHEMA = new ForkSchema(); - private Fork(ForkSchema type, TreeNode backingNode) { + private Fork(final ForkSchema type, final TreeNode backingNode) { super(type, backingNode); } - public Fork(Bytes4 previousVersion, Bytes4 currentVersion, UInt64 epoch) { + public Fork(final Bytes4 previousVersion, final Bytes4 currentVersion, final UInt64 epoch) { super( SSZ_SCHEMA, SszBytes4.of(previousVersion), diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/ForkData.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/ForkData.java index de378af5165..43dbb15889e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/ForkData.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/ForkData.java @@ -34,14 +34,14 @@ public ForkDataSchema() { } @Override - public ForkData createFromBackingNode(TreeNode node) { + public ForkData createFromBackingNode(final TreeNode node) { return new ForkData(this, node); } } public static final ForkDataSchema SSZ_SCHEMA = new ForkDataSchema(); - private ForkData(ForkDataSchema type, TreeNode backingNode) { + private ForkData(final ForkDataSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/HistoricalBatch.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/HistoricalBatch.java index 4ab7cb039bc..cc79f2446c7 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/HistoricalBatch.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/HistoricalBatch.java @@ -33,11 +33,12 @@ public HistoricalBatchSchema(final int slotsPerHistoricalRoot) { } @Override - public HistoricalBatch createFromBackingNode(TreeNode node) { + public HistoricalBatch createFromBackingNode(final TreeNode node) { return new HistoricalBatch(this, node); } - public HistoricalBatch create(SszBytes32Vector blockRoots, SszBytes32Vector stateRoots) { + public HistoricalBatch create( + final SszBytes32Vector blockRoots, final SszBytes32Vector stateRoots) { return new HistoricalBatch(this, blockRoots, stateRoots); } @@ -50,12 +51,14 @@ public SszBytes32VectorSchema getStateRootsSchema() { } } - private HistoricalBatch(HistoricalBatchSchema type, TreeNode backingNode) { + private HistoricalBatch(final HistoricalBatchSchema type, final TreeNode backingNode) { super(type, backingNode); } private HistoricalBatch( - HistoricalBatchSchema type, SszBytes32Vector blockRoots, SszBytes32Vector stateRoots) { + final HistoricalBatchSchema type, + final SszBytes32Vector blockRoots, + final SszBytes32Vector stateRoots) { super(type, blockRoots, stateRoots); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/PendingAttestation.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/PendingAttestation.java index a293bf22bd3..e26b8811f79 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/PendingAttestation.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/PendingAttestation.java @@ -56,12 +56,12 @@ public SszBitlistSchema getAggregationBitfieldSchema() { } @Override - public PendingAttestation createFromBackingNode(TreeNode node) { + public PendingAttestation createFromBackingNode(final TreeNode node) { return new PendingAttestation(this, node); } } - private PendingAttestation(PendingAttestationSchema type, TreeNode backingNode) { + private PendingAttestation(final PendingAttestationSchema type, final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/SigningData.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/SigningData.java index 64986a2bfc3..f7186b205ce 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/SigningData.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/SigningData.java @@ -33,18 +33,18 @@ public SigningDataSchema() { } @Override - public SigningData createFromBackingNode(TreeNode node) { + public SigningData createFromBackingNode(final TreeNode node) { return new SigningData(this, node); } } public static final SigningDataSchema SSZ_SCHEMA = new SigningDataSchema(); - private SigningData(SigningDataSchema type, TreeNode backingNode) { + private SigningData(final SigningDataSchema type, final TreeNode backingNode) { super(type, backingNode); } - public SigningData(Bytes32 objectRoot, Bytes32 domain) { + public SigningData(final Bytes32 objectRoot, final Bytes32 domain) { super(SSZ_SCHEMA, SszBytes32.of(objectRoot), SszBytes32.of(domain)); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/SyncCommittee.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/SyncCommittee.java index e06aa9a46e1..7e9e59b4bb2 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/SyncCommittee.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/SyncCommittee.java @@ -40,7 +40,7 @@ public SyncCommitteeSchema(final SpecConfigAltair specConfigAltair) { } @Override - public SyncCommittee createFromBackingNode(TreeNode node) { + public SyncCommittee createFromBackingNode(final TreeNode node) { return new SyncCommittee(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Validator.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Validator.java index c27b73be63d..5d990c055ae 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Validator.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/Validator.java @@ -67,26 +67,26 @@ public ValidatorSchema() { } @Override - public Validator createFromBackingNode(TreeNode node) { + public Validator createFromBackingNode(final TreeNode node) { return new Validator(this, node); } } public static final ValidatorSchema SSZ_SCHEMA = new ValidatorSchema(); - private Validator(ValidatorSchema type, TreeNode backingNode) { + private Validator(final ValidatorSchema type, final TreeNode backingNode) { super(type, backingNode); } public Validator( - BLSPublicKey pubkey, - Bytes32 withdrawalCredentials, - UInt64 effectiveBalance, - boolean slashed, - UInt64 activationEligibilityEpoch, - UInt64 activationEpoch, - UInt64 exitEpoch, - UInt64 withdrawableEpoch) { + final BLSPublicKey pubkey, + final Bytes32 withdrawalCredentials, + final UInt64 effectiveBalance, + final boolean slashed, + final UInt64 activationEligibilityEpoch, + final UInt64 activationEpoch, + final UInt64 exitEpoch, + final UInt64 withdrawableEpoch) { super( SSZ_SCHEMA, new SszPublicKey(pubkey), @@ -100,14 +100,14 @@ public Validator( } public Validator( - Bytes48 pubkey, - Bytes32 withdrawalCredentials, - UInt64 effectiveBalance, - boolean slashed, - UInt64 activationEligibilityEpoch, - UInt64 activationEpoch, - UInt64 exitEpoch, - UInt64 withdrawableEpoch) { + final Bytes48 pubkey, + final Bytes32 withdrawalCredentials, + final UInt64 effectiveBalance, + final boolean slashed, + final UInt64 activationEligibilityEpoch, + final UInt64 activationEpoch, + final UInt64 exitEpoch, + final UInt64 withdrawableEpoch) { super( SSZ_SCHEMA, new SszPublicKey(pubkey), @@ -164,7 +164,7 @@ public UInt64 getWithdrawableEpoch() { return getField7().get(); } - public Validator withEffectiveBalance(UInt64 effectiveBalance) { + public Validator withEffectiveBalance(final UInt64 effectiveBalance) { return new Validator( getPubkeyBytes(), getWithdrawalCredentials(), @@ -176,7 +176,7 @@ public Validator withEffectiveBalance(UInt64 effectiveBalance) { getWithdrawableEpoch()); } - public Validator withSlashed(boolean slashed) { + public Validator withSlashed(final boolean slashed) { return new Validator( getPubkeyBytes(), getWithdrawalCredentials(), @@ -188,7 +188,7 @@ public Validator withSlashed(boolean slashed) { getWithdrawableEpoch()); } - public Validator withActivationEligibilityEpoch(UInt64 activationEligibilityEpoch) { + public Validator withActivationEligibilityEpoch(final UInt64 activationEligibilityEpoch) { return new Validator( getPubkeyBytes(), getWithdrawalCredentials(), @@ -200,7 +200,7 @@ public Validator withActivationEligibilityEpoch(UInt64 activationEligibilityEpoc getWithdrawableEpoch()); } - public Validator withActivationEpoch(UInt64 activationEpoch) { + public Validator withActivationEpoch(final UInt64 activationEpoch) { return new Validator( getPubkeyBytes(), getWithdrawalCredentials(), @@ -212,7 +212,7 @@ public Validator withActivationEpoch(UInt64 activationEpoch) { getWithdrawableEpoch()); } - public Validator withExitEpoch(UInt64 exitEpoch) { + public Validator withExitEpoch(final UInt64 exitEpoch) { return new Validator( getPubkeyBytes(), getWithdrawalCredentials(), @@ -224,7 +224,7 @@ public Validator withExitEpoch(UInt64 exitEpoch) { getWithdrawableEpoch()); } - public Validator withWithdrawableEpoch(UInt64 withdrawableEpoch) { + public Validator withWithdrawableEpoch(final UInt64 withdrawableEpoch) { return new Validator( getPubkeyBytes(), getWithdrawalCredentials(), diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/BeaconStateCache.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/BeaconStateCache.java index f05901a7f3c..90cefbdcb1a 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/BeaconStateCache.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/BeaconStateCache.java @@ -18,13 +18,13 @@ public interface BeaconStateCache { - static TransitionCaches getTransitionCaches(BeaconState state) { + static TransitionCaches getTransitionCaches(final BeaconState state) { return state instanceof BeaconStateCache ? ((BeaconStateCache) state).getTransitionCaches() : TransitionCaches.getNoOp(); } - static SlotCaches getSlotCaches(BeaconState state) { + static SlotCaches getSlotCaches(final BeaconState state) { return state instanceof BeaconStateCache ? ((BeaconStateCache) state).getSlotCaches() : SlotCaches.getNoOp(); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/MutableBeaconState.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/MutableBeaconState.java index 890cbee18ec..f8168fafe37 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/MutableBeaconState.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/MutableBeaconState.java @@ -47,28 +47,28 @@ public interface MutableBeaconState extends BeaconState, SszMutableRefContainer // Versioning - default void setGenesisTime(UInt64 genesisTime) { + default void setGenesisTime(final UInt64 genesisTime) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.GENESIS_TIME); set(fieldIndex, SszUInt64.of(genesisTime)); } - default void setGenesisValidatorsRoot(Bytes32 genesisValidatorsRoot) { + default void setGenesisValidatorsRoot(final Bytes32 genesisValidatorsRoot) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.GENESIS_VALIDATORS_ROOT); set(fieldIndex, SszBytes32.of(genesisValidatorsRoot)); } - default void setSlot(UInt64 slot) { + default void setSlot(final UInt64 slot) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.SLOT); set(fieldIndex, SszUInt64.of(slot)); } - default void setFork(Fork fork) { + default void setFork(final Fork fork) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.FORK); set(fieldIndex, fork); } // History - default void setLatestBlockHeader(BeaconBlockHeader latestBlockHeader) { + default void setLatestBlockHeader(final BeaconBlockHeader latestBlockHeader) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.LATEST_BLOCK_HEADER); set(fieldIndex, latestBlockHeader); } @@ -79,7 +79,7 @@ default SszMutableBytes32Vector getBlockRoots() { return getAnyByRef(fieldIndex); } - default void setBlockRoots(SszBytes32Vector blockRoots) { + default void setBlockRoots(final SszBytes32Vector blockRoots) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.BLOCK_ROOTS); set(fieldIndex, blockRoots); } @@ -90,7 +90,7 @@ default SszMutableBytes32Vector getStateRoots() { return getAnyByRef(fieldIndex); } - default void setStateRoots(SszBytes32Vector stateRoots) { + default void setStateRoots(final SszBytes32Vector stateRoots) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.STATE_ROOTS); set(fieldIndex, stateRoots); } @@ -101,13 +101,13 @@ default SszMutablePrimitiveList getHistoricalRoots() { return getAnyByRef(fieldIndex); } - default void setHistoricalRoots(SszPrimitiveList historicalRoots) { + default void setHistoricalRoots(final SszPrimitiveList historicalRoots) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.HISTORICAL_ROOTS); set(fieldIndex, historicalRoots); } // Eth1 - default void setEth1Data(Eth1Data eth1Data) { + default void setEth1Data(final Eth1Data eth1Data) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.ETH1_DATA); set(fieldIndex, eth1Data); } @@ -118,12 +118,12 @@ default SszMutableList getEth1DataVotes() { return getAnyByRef(fieldIndex); } - default void setEth1DataVotes(SszList eth1DataList) { + default void setEth1DataVotes(final SszList eth1DataList) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.ETH1_DATA_VOTES); set(fieldIndex, eth1DataList); } - default void setEth1DepositIndex(UInt64 eth1DepositIndex) { + default void setEth1DepositIndex(final UInt64 eth1DepositIndex) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.ETH1_DEPOSIT_INDEX); set(fieldIndex, SszUInt64.of(eth1DepositIndex)); } @@ -135,7 +135,7 @@ default SszMutableList getValidators() { return getAnyByRef(fieldIndex); } - default void setValidators(SszList validators) { + default void setValidators(final SszList validators) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.VALIDATORS); set(fieldIndex, validators); } @@ -146,7 +146,7 @@ default SszMutableUInt64List getBalances() { return getAnyByRef(fieldIndex); } - default void setBalances(SszUInt64List balances) { + default void setBalances(final SszUInt64List balances) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.BALANCES); set(fieldIndex, balances); } @@ -157,7 +157,7 @@ default SszMutableBytes32Vector getRandaoMixes() { return getAnyByRef(fieldIndex); } - default void setRandaoMixes(SszBytes32Vector randaoMixes) { + default void setRandaoMixes(final SszBytes32Vector randaoMixes) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.RANDAO_MIXES); set(fieldIndex, randaoMixes); } @@ -169,30 +169,30 @@ default SszMutablePrimitiveVector getSlashings() { return getAnyByRef(fieldIndex); } - default void setSlashings(SszPrimitiveVector slashings) { + default void setSlashings(final SszPrimitiveVector slashings) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.SLASHINGS); set(fieldIndex, slashings); } // Finality - default void setJustificationBits(SszBitvector justificationBits) { + default void setJustificationBits(final SszBitvector justificationBits) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.JUSTIFICATION_BITS); set(fieldIndex, justificationBits); } - default void setPreviousJustifiedCheckpoint(Checkpoint previousJustifiedCheckpoint) { + default void setPreviousJustifiedCheckpoint(final Checkpoint previousJustifiedCheckpoint) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.PREVIOUS_JUSTIFIED_CHECKPOINT); set(fieldIndex, previousJustifiedCheckpoint); } - default void setCurrentJustifiedCheckpoint(Checkpoint currentJustifiedCheckpoint) { + default void setCurrentJustifiedCheckpoint(final Checkpoint currentJustifiedCheckpoint) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.CURRENT_JUSTIFIED_CHECKPOINT); set(fieldIndex, currentJustifiedCheckpoint); } - default void setFinalizedCheckpoint(Checkpoint finalizedCheckpoint) { + default void setFinalizedCheckpoint(final Checkpoint finalizedCheckpoint) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.FINALIZED_CHECKPOINT); set(fieldIndex, finalizedCheckpoint); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractBeaconState.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractBeaconState.java index 67e3ebffc82..4dc22b8813b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractBeaconState.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractBeaconState.java @@ -51,7 +51,7 @@ protected AbstractBeaconState( } protected AbstractBeaconState( - AbstractSszContainerSchema type, TreeNode backingNode) { + final AbstractSszContainerSchema type, final TreeNode backingNode) { super(type, backingNode); this.transitionCaches = TransitionCaches.createNewEmpty(); this.slotCaches = SlotCaches.createNewEmpty(); @@ -64,7 +64,7 @@ protected AbstractBeaconState( @Override public BeaconState updated( - Mutator mutator) throws E1, E2, E3 { + final Mutator mutator) throws E1, E2, E3 { MutableBeaconState writableCopy = createWritableCopy(); mutator.mutate(writableCopy); return writableCopy.commitChanges(); @@ -76,7 +76,7 @@ public int hashCode() { } @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { return BeaconStateInvariants.equals(this, obj); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractBeaconStateSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractBeaconStateSchema.java index 47fb39138da..9cde4448638 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractBeaconStateSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractBeaconStateSchema.java @@ -39,7 +39,8 @@ protected AbstractBeaconStateSchema( this(name, combineFields(BeaconStateFields.getCommonFields(specConfig), uniqueFields)); } - private static List combineFields(List fieldsA, List fieldsB) { + private static List combineFields( + final List fieldsA, final List fieldsB) { return Stream.concat(fieldsA.stream(), fieldsB.stream()) .sorted(Comparator.comparing(SszField::getIndex)) .toList(); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractMutableBeaconState.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractMutableBeaconState.java index 8b0b6be52f2..d806ffb4208 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractMutableBeaconState.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/AbstractMutableBeaconState.java @@ -33,11 +33,11 @@ public abstract class AbstractMutableBeaconState< private final SlotCaches slotCaches; private final boolean builder; - protected AbstractMutableBeaconState(T backingImmutableView) { + protected AbstractMutableBeaconState(final T backingImmutableView) { this(backingImmutableView, false); } - protected AbstractMutableBeaconState(T backingImmutableView, boolean builder) { + protected AbstractMutableBeaconState(final T backingImmutableView, final boolean builder) { super(backingImmutableView); this.transitionCaches = builder ? TransitionCaches.getNoOp() : backingImmutableView.getTransitionCaches().copy(); @@ -51,7 +51,8 @@ protected AbstractMutableBeaconState(T backingImmutableView, boolean builder) { } @Override - protected T createImmutableSszComposite(TreeNode backingNode, IntCache viewCache) { + protected T createImmutableSszComposite( + final TreeNode backingNode, final IntCache viewCache) { return createImmutableBeaconState( backingNode, viewCache, @@ -92,7 +93,7 @@ public MutableBeaconState createWritableCopy() { @Override public BeaconState updated( - Mutator mutator) { + final Mutator mutator) { throw new UnsupportedOperationException(); } @@ -102,7 +103,7 @@ public int hashCode() { } @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { return BeaconStateInvariants.equals(this, obj); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/BeaconStateInvariants.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/BeaconStateInvariants.java index a7bf2f4e5f3..241c9be5e47 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/BeaconStateInvariants.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/BeaconStateInvariants.java @@ -73,7 +73,7 @@ public static UInt64 extractSlot(final Bytes bytes) { } @SuppressWarnings("ReferenceComparison") - static boolean equals(BeaconState state, Object obj) { + static boolean equals(final BeaconState state, final Object obj) { if (Objects.isNull(obj)) { return false; } @@ -90,11 +90,11 @@ static boolean equals(BeaconState state, Object obj) { return state.hashTreeRoot().equals(other.hashTreeRoot()); } - static int hashCode(BeaconState state) { + static int hashCode(final BeaconState state) { return state.hashTreeRoot().slice(0, 4).toInt(); } - static String toString(BeaconState state, final Consumer modifier) { + static String toString(final BeaconState state, final Consumer modifier) { final ToStringHelper builder = MoreObjects.toStringHelper(state) .add("genesis_time", state.getGenesisTime()) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/TransitionCaches.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/TransitionCaches.java index 8ccb2a63cd2..f557f550443 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/TransitionCaches.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/TransitionCaches.java @@ -103,18 +103,18 @@ private TransitionCaches() { } private TransitionCaches( - Cache activeValidators, - Cache beaconProposerIndex, - Cache, IntList> beaconCommittee, - Cache attestersTotalBalance, - Cache totalActiveBalance, - Cache validatorsPubKeys, - ValidatorIndexCache validatorIndexCache, - Cache committeeShuffle, - Cache> effectiveBalances, - Cache> syncCommitteeCache, - Cache baseRewardPerIncrement, - ProgressiveTotalBalancesUpdates progressiveTotalBalances) { + final Cache activeValidators, + final Cache beaconProposerIndex, + final Cache, IntList> beaconCommittee, + final Cache attestersTotalBalance, + final Cache totalActiveBalance, + final Cache validatorsPubKeys, + final ValidatorIndexCache validatorIndexCache, + final Cache committeeShuffle, + final Cache> effectiveBalances, + final Cache> syncCommitteeCache, + final Cache baseRewardPerIncrement, + final ProgressiveTotalBalancesUpdates progressiveTotalBalances) { this.activeValidators = activeValidators; this.beaconProposerIndex = beaconProposerIndex; this.beaconCommittee = beaconCommittee; @@ -129,7 +129,7 @@ private TransitionCaches( this.progressiveTotalBalances = progressiveTotalBalances; } - public void setLatestTotalBalances(TotalBalances totalBalances) { + public void setLatestTotalBalances(final TotalBalances totalBalances) { this.latestTotalBalances = Optional.of(totalBalances); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/analysis/ValidatorStats.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/analysis/ValidatorStats.java index abe0d82e8c4..813211b3859 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/analysis/ValidatorStats.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/common/analysis/ValidatorStats.java @@ -24,7 +24,8 @@ class CorrectAndLiveValidators { private final int numberOfCorrectValidators; private final int numberOfLiveValidators; - public CorrectAndLiveValidators(int numberOfCorrectValidators, int numberOfLiveValidators) { + public CorrectAndLiveValidators( + final int numberOfCorrectValidators, final int numberOfLiveValidators) { this.numberOfCorrectValidators = numberOfCorrectValidators; this.numberOfLiveValidators = numberOfLiveValidators; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateAltair.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateAltair.java index 687a528feba..7ead36a73e6 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateAltair.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateAltair.java @@ -86,7 +86,7 @@ default Optional toVersionAltair() { MutableBeaconStateAltair createWritableCopy(); default - BeaconStateAltair updatedAltair(Mutator mutator) + BeaconStateAltair updatedAltair(final Mutator mutator) throws E1, E2, E3 { MutableBeaconStateAltair writableCopy = createWritableCopy(); mutator.mutate(writableCopy); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateAltairImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateAltairImpl.java index 1b201a21a02..cb94de57ab7 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateAltairImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateAltairImpl.java @@ -35,16 +35,16 @@ class BeaconStateAltairImpl extends AbstractBeaconState type, - TreeNode backingNode, - IntCache cache, - TransitionCaches transitionCaches, - SlotCaches slotCaches) { + final SszCompositeSchema type, + final TreeNode backingNode, + final IntCache cache, + final TransitionCaches transitionCaches, + final SlotCaches slotCaches) { super(type, backingNode, cache, transitionCaches, slotCaches); } BeaconStateAltairImpl( - AbstractSszContainerSchema type, TreeNode backingNode) { + final AbstractSszContainerSchema type, final TreeNode backingNode) { super(type, backingNode); } @@ -59,11 +59,12 @@ public MutableBeaconStateAltair createWritableCopy() { } @Override - protected void describeCustomFields(ToStringHelper stringBuilder) { + protected void describeCustomFields(final ToStringHelper stringBuilder) { describeCustomFields(stringBuilder, this); } - static void describeCustomFields(ToStringHelper stringBuilder, final BeaconStateAltair state) { + static void describeCustomFields( + final ToStringHelper stringBuilder, final BeaconStateAltair state) { stringBuilder .add("previous_epoch_participation", state.getPreviousEpochParticipation()) .add("current_epoch_participation", state.getCurrentEpochParticipation()) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateSchemaAltair.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateSchemaAltair.java index 7ea4a766d99..0a7a229b393 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateSchemaAltair.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/BeaconStateSchemaAltair.java @@ -119,7 +119,7 @@ public SyncCommitteeSchema getCurrentSyncCommitteeSchema() { } @Override - public BeaconStateAltair createFromBackingNode(TreeNode node) { + public BeaconStateAltair createFromBackingNode(final TreeNode node) { return new BeaconStateAltairImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/MutableBeaconStateAltair.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/MutableBeaconStateAltair.java index c9f097bfb99..75fd42c36d4 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/MutableBeaconStateAltair.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/MutableBeaconStateAltair.java @@ -64,17 +64,17 @@ default SszMutableUInt64List getInactivityScores() { return getAnyByRef(fieldIndex); } - default void setInactivityScores(SszUInt64List newValue) { + default void setInactivityScores(final SszUInt64List newValue) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.INACTIVITY_SCORES); set(fieldIndex, newValue); } - default void setCurrentSyncCommittee(SyncCommittee currentSyncCommittee) { + default void setCurrentSyncCommittee(final SyncCommittee currentSyncCommittee) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.CURRENT_SYNC_COMMITTEE); set(fieldIndex, currentSyncCommittee); } - default void setNextSyncCommittee(SyncCommittee nextSyncCommittee) { + default void setNextSyncCommittee(final SyncCommittee nextSyncCommittee) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.NEXT_SYNC_COMMITTEE); set(fieldIndex, nextSyncCommittee); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/MutableBeaconStateAltairImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/MutableBeaconStateAltairImpl.java index 23944be2e51..e83fdb03ebb 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/MutableBeaconStateAltairImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/altair/MutableBeaconStateAltairImpl.java @@ -25,11 +25,12 @@ class MutableBeaconStateAltairImpl extends AbstractMutableBeaconState implements MutableBeaconStateAltair, BeaconStateCache, ValidatorStatsAltair { - MutableBeaconStateAltairImpl(BeaconStateAltairImpl backingImmutableView) { + MutableBeaconStateAltairImpl(final BeaconStateAltairImpl backingImmutableView) { super(backingImmutableView); } - MutableBeaconStateAltairImpl(BeaconStateAltairImpl backingImmutableView, boolean builder) { + MutableBeaconStateAltairImpl( + final BeaconStateAltairImpl backingImmutableView, final boolean builder) { super(backingImmutableView, builder); } @@ -40,10 +41,10 @@ public BeaconStateSchemaAltair getBeaconStateSchema() { @Override protected BeaconStateAltairImpl createImmutableBeaconState( - TreeNode backingNode, - IntCache viewCache, - TransitionCaches transitionCaches, - SlotCaches slotCaches) { + final TreeNode backingNode, + final IntCache viewCache, + final TransitionCaches transitionCaches, + final SlotCaches slotCaches) { return new BeaconStateAltairImpl( getSchema(), backingNode, viewCache, transitionCaches, slotCaches); } @@ -54,7 +55,7 @@ public BeaconStateAltair commitChanges() { } @Override - protected void addCustomFields(ToStringHelper stringBuilder) { + protected void addCustomFields(final ToStringHelper stringBuilder) { BeaconStateAltairImpl.describeCustomFields(stringBuilder, this); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateBellatrix.java index 17b1eefb9f8..1ceb2a0b026 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateBellatrix.java @@ -47,14 +47,14 @@ default Optional toVersionBellatrix() { default BeaconStateBellatrix updatedBellatrix( - Mutator mutator) throws E1, E2, E3 { + final Mutator mutator) throws E1, E2, E3 { MutableBeaconStateBellatrix writableCopy = createWritableCopy(); mutator.mutate(writableCopy); return writableCopy.commitChanges(); } static void describeCustomBellatrixFields( - MoreObjects.ToStringHelper stringBuilder, final BeaconStateBellatrix state) { + final MoreObjects.ToStringHelper stringBuilder, final BeaconStateBellatrix state) { stringBuilder.add("execution_payload_header", state.getLatestExecutionPayloadHeader()); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateBellatrixImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateBellatrixImpl.java index 365d62f6a45..4388b3461c6 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateBellatrixImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateBellatrixImpl.java @@ -36,16 +36,16 @@ class BeaconStateBellatrixImpl extends AbstractBeaconState type, - TreeNode backingNode, - IntCache cache, - TransitionCaches transitionCaches, - SlotCaches slotCaches) { + final SszCompositeSchema type, + final TreeNode backingNode, + final IntCache cache, + final TransitionCaches transitionCaches, + final SlotCaches slotCaches) { super(type, backingNode, cache, transitionCaches, slotCaches); } BeaconStateBellatrixImpl( - AbstractSszContainerSchema type, TreeNode backingNode) { + final AbstractSszContainerSchema type, final TreeNode backingNode) { super(type, backingNode); } @@ -60,7 +60,7 @@ public MutableBeaconStateBellatrix createWritableCopy() { } @Override - protected void describeCustomFields(ToStringHelper stringBuilder) { + protected void describeCustomFields(final ToStringHelper stringBuilder) { BeaconStateBellatrix.describeCustomBellatrixFields(stringBuilder, this); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateSchemaBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateSchemaBellatrix.java index 81588b14952..f848034befb 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateSchemaBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/BeaconStateSchemaBellatrix.java @@ -101,7 +101,7 @@ public ExecutionPayloadHeaderSchemaBellatrix getLastExecutionPayloadHeaderSchema } @Override - public BeaconStateBellatrix createFromBackingNode(TreeNode node) { + public BeaconStateBellatrix createFromBackingNode(final TreeNode node) { return new BeaconStateBellatrixImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/MutableBeaconStateBellatrix.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/MutableBeaconStateBellatrix.java index 2e3a569cf71..b81b6e0b284 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/MutableBeaconStateBellatrix.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/MutableBeaconStateBellatrix.java @@ -31,7 +31,8 @@ static MutableBeaconStateBellatrix required(final MutableBeaconState state) { "Expected a bellatrix state but got: " + state.getClass().getSimpleName())); } - default void setLatestExecutionPayloadHeader(ExecutionPayloadHeader executionPayloadHeader) { + default void setLatestExecutionPayloadHeader( + final ExecutionPayloadHeader executionPayloadHeader) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.LATEST_EXECUTION_PAYLOAD_HEADER); set(fieldIndex, executionPayloadHeader); @@ -48,7 +49,7 @@ default Optional toMutableVersionBellatrix() { @Override default BeaconStateBellatrix updatedBellatrix( - Mutator mutator) throws E1, E2, E3 { + final Mutator mutator) throws E1, E2, E3 { throw new UnsupportedOperationException(); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/MutableBeaconStateBellatrixImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/MutableBeaconStateBellatrixImpl.java index 3652518f0bc..713b316e859 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/MutableBeaconStateBellatrixImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/bellatrix/MutableBeaconStateBellatrixImpl.java @@ -28,11 +28,12 @@ class MutableBeaconStateBellatrixImpl extends AbstractMutableBeaconState implements MutableBeaconStateBellatrix, BeaconStateCache, ValidatorStatsAltair { - MutableBeaconStateBellatrixImpl(BeaconStateBellatrixImpl backingImmutableView) { + MutableBeaconStateBellatrixImpl(final BeaconStateBellatrixImpl backingImmutableView) { super(backingImmutableView); } - MutableBeaconStateBellatrixImpl(BeaconStateBellatrixImpl backingImmutableView, boolean builder) { + MutableBeaconStateBellatrixImpl( + final BeaconStateBellatrixImpl backingImmutableView, final boolean builder) { super(backingImmutableView, builder); } @@ -43,10 +44,10 @@ public BeaconStateSchemaBellatrix getBeaconStateSchema() { @Override protected BeaconStateBellatrixImpl createImmutableBeaconState( - TreeNode backingNode, - IntCache viewCache, - TransitionCaches transitionCaches, - SlotCaches slotCaches) { + final TreeNode backingNode, + final IntCache viewCache, + final TransitionCaches transitionCaches, + final SlotCaches slotCaches) { return new BeaconStateBellatrixImpl( getSchema(), backingNode, viewCache, transitionCaches, slotCaches); } @@ -58,12 +59,12 @@ public BeaconStateBellatrix commitChanges() { @Override public BeaconState updated( - Mutator mutator) { + final Mutator mutator) { throw new UnsupportedOperationException(); } @Override - protected void addCustomFields(ToStringHelper stringBuilder) { + protected void addCustomFields(final ToStringHelper stringBuilder) { BeaconStateBellatrix.describeCustomBellatrixFields(stringBuilder, this); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateCapella.java index c69ec60bbd4..9b4681c3821 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateCapella.java @@ -37,7 +37,7 @@ static BeaconStateCapella required(final BeaconState state) { } static void describeCustomCapellaFields( - MoreObjects.ToStringHelper stringBuilder, BeaconStateCapella state) { + final MoreObjects.ToStringHelper stringBuilder, final BeaconStateCapella state) { BeaconStateBellatrix.describeCustomBellatrixFields(stringBuilder, state); stringBuilder.add("next_withdrawal_index", state.getNextWithdrawalIndex()); stringBuilder.add("next_withdrawal_validator_index", state.getNextWithdrawalValidatorIndex()); @@ -48,8 +48,8 @@ static void describeCustomCapellaFields( MutableBeaconStateCapella createWritableCopy(); default - BeaconStateCapella updatedCapella(Mutator mutator) - throws E1, E2, E3 { + BeaconStateCapella updatedCapella( + final Mutator mutator) throws E1, E2, E3 { MutableBeaconStateCapella writableCopy = createWritableCopy(); mutator.mutate(writableCopy); return writableCopy.commitChanges(); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateCapellaImpl.java index 94f8d8ec2dc..f4d78bfff52 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateCapellaImpl.java @@ -36,16 +36,16 @@ public class BeaconStateCapellaImpl extends AbstractBeaconState type, - TreeNode backingNode, - IntCache cache, - TransitionCaches transitionCaches, - SlotCaches slotCaches) { + final SszCompositeSchema type, + final TreeNode backingNode, + final IntCache cache, + final TransitionCaches transitionCaches, + final SlotCaches slotCaches) { super(type, backingNode, cache, transitionCaches, slotCaches); } BeaconStateCapellaImpl( - AbstractSszContainerSchema type, TreeNode backingNode) { + final AbstractSszContainerSchema type, final TreeNode backingNode) { super(type, backingNode); } @@ -60,7 +60,7 @@ public MutableBeaconStateCapella createWritableCopy() { } @Override - protected void describeCustomFields(MoreObjects.ToStringHelper stringBuilder) { + protected void describeCustomFields(final MoreObjects.ToStringHelper stringBuilder) { BeaconStateCapella.describeCustomCapellaFields(stringBuilder, this); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateSchemaCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateSchemaCapella.java index f8dcb0e0d54..31d7dd899fa 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateSchemaCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/BeaconStateSchemaCapella.java @@ -143,7 +143,7 @@ private BeaconStateCapellaImpl createEmptyBeaconStateImpl() { } @Override - public BeaconStateCapella createFromBackingNode(TreeNode node) { + public BeaconStateCapella createFromBackingNode(final TreeNode node) { return new BeaconStateCapellaImpl(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/MutableBeaconStateCapella.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/MutableBeaconStateCapella.java index b45d91a994e..1c36a0c84e8 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/MutableBeaconStateCapella.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/MutableBeaconStateCapella.java @@ -36,12 +36,12 @@ static MutableBeaconStateCapella required(final MutableBeaconState state) { @Override BeaconStateCapella commitChanges(); - default void setNextWithdrawalIndex(UInt64 nextWithdrawalIndex) { + default void setNextWithdrawalIndex(final UInt64 nextWithdrawalIndex) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.NEXT_WITHDRAWAL_INDEX); set(fieldIndex, SszUInt64.of(nextWithdrawalIndex)); } - default void setNextWithdrawalValidatorIndex(UInt64 nextWithdrawalValidatorIndex) { + default void setNextWithdrawalValidatorIndex(final UInt64 nextWithdrawalValidatorIndex) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.NEXT_WITHDRAWAL_VALIDATOR_INDEX); set(fieldIndex, SszUInt64.of(nextWithdrawalValidatorIndex)); @@ -53,7 +53,7 @@ default SszMutableList getHistoricalSummaries() { return getAnyByRef(fieldIndex); } - default void setHistoricalSummaries(SszList historicalsummaries) { + default void setHistoricalSummaries(final SszList historicalsummaries) { final int fieldIndex = getSchema().getFieldIndex(BeaconStateFields.HISTORICAL_SUMMARIES); set(fieldIndex, historicalsummaries); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/MutableBeaconStateCapellaImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/MutableBeaconStateCapellaImpl.java index b61a10c114f..ccb05936356 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/MutableBeaconStateCapellaImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/capella/MutableBeaconStateCapellaImpl.java @@ -27,11 +27,12 @@ public class MutableBeaconStateCapellaImpl extends AbstractMutableBeaconState implements MutableBeaconStateCapella, BeaconStateCache, ValidatorStatsAltair { - MutableBeaconStateCapellaImpl(BeaconStateCapellaImpl backingImmutableView) { + MutableBeaconStateCapellaImpl(final BeaconStateCapellaImpl backingImmutableView) { super(backingImmutableView); } - MutableBeaconStateCapellaImpl(BeaconStateCapellaImpl backingImmutableView, boolean builder) { + MutableBeaconStateCapellaImpl( + final BeaconStateCapellaImpl backingImmutableView, final boolean builder) { super(backingImmutableView, builder); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/deneb/BeaconStateDeneb.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/deneb/BeaconStateDeneb.java index ea135073b5f..e5bfb81ab42 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/deneb/BeaconStateDeneb.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/deneb/BeaconStateDeneb.java @@ -29,7 +29,7 @@ static BeaconStateDeneb required(final BeaconState state) { } static void describeCustomDenebFields( - MoreObjects.ToStringHelper stringBuilder, BeaconStateCapella state) { + final MoreObjects.ToStringHelper stringBuilder, final BeaconStateCapella state) { BeaconStateCapella.describeCustomCapellaFields(stringBuilder, state); // no new fields } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/deneb/BeaconStateSchemaDeneb.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/deneb/BeaconStateSchemaDeneb.java index c1b15a97450..51d7642b7ff 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/deneb/BeaconStateSchemaDeneb.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/deneb/BeaconStateSchemaDeneb.java @@ -143,7 +143,7 @@ private BeaconStateDenebImpl createEmptyBeaconStateImpl() { } @Override - public BeaconStateDeneb createFromBackingNode(TreeNode node) { + public BeaconStateDeneb createFromBackingNode(final TreeNode node) { return new BeaconStateDenebImpl(this, node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateElectra.java index 77f19625d08..ccbc435a8e6 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateElectra.java @@ -45,7 +45,7 @@ static BeaconStateElectra required(final BeaconState state) { } static void describeCustomElectraFields( - MoreObjects.ToStringHelper stringBuilder, BeaconStateDeneb state) { + final MoreObjects.ToStringHelper stringBuilder, final BeaconStateDeneb state) { BeaconStateDeneb.describeCustomDenebFields(stringBuilder, state); stringBuilder.add("deposit_receipts_start_index", state.getNextWithdrawalIndex()); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateSchemaElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateSchemaElectra.java index d09f52f863a..1ae441ac6ab 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateSchemaElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateSchemaElectra.java @@ -224,7 +224,7 @@ private BeaconStateElectraImpl createEmptyBeaconStateImpl() { } @Override - public BeaconStateElectraImpl createFromBackingNode(TreeNode node) { + public BeaconStateElectraImpl createFromBackingNode(final TreeNode node) { return new BeaconStateElectraImpl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/BeaconStatePhase0Impl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/BeaconStatePhase0Impl.java index 9fa62ce6954..13d463355fa 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/BeaconStatePhase0Impl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/BeaconStatePhase0Impl.java @@ -35,16 +35,16 @@ class BeaconStatePhase0Impl extends AbstractBeaconState type, - TreeNode backingNode, - IntCache cache, - TransitionCaches transitionCaches, - SlotCaches slotCaches) { + final SszCompositeSchema type, + final TreeNode backingNode, + final IntCache cache, + final TransitionCaches transitionCaches, + final SlotCaches slotCaches) { super(type, backingNode, cache, transitionCaches, slotCaches); } BeaconStatePhase0Impl( - AbstractSszContainerSchema type, TreeNode backingNode) { + final AbstractSszContainerSchema type, final TreeNode backingNode) { super(type, backingNode); } @@ -55,7 +55,7 @@ public BeaconStateSchemaPhase0 getBeaconStateSchema() { @Override public - BeaconStatePhase0 updatedPhase0(Mutator mutator) + BeaconStatePhase0 updatedPhase0(final Mutator mutator) throws E1, E2, E3 { MutableBeaconStatePhase0 writableCopy = createWritableCopy(); mutator.mutate(writableCopy); @@ -68,11 +68,12 @@ public MutableBeaconStatePhase0 createWritableCopy() { } @Override - protected void describeCustomFields(ToStringHelper stringBuilder) { + protected void describeCustomFields(final ToStringHelper stringBuilder) { describeCustomFields(stringBuilder, this); } - static void describeCustomFields(ToStringHelper stringBuilder, final BeaconStatePhase0 state) { + static void describeCustomFields( + final ToStringHelper stringBuilder, final BeaconStatePhase0 state) { stringBuilder .add("previous_epoch_attestations", state.getPreviousEpochAttestations()) .add("current_epoch_attestations", state.getCurrentEpochAttestations()); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/BeaconStateSchemaPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/BeaconStateSchemaPhase0.java index e035237d392..4a24a9f0be9 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/BeaconStateSchemaPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/BeaconStateSchemaPhase0.java @@ -88,7 +88,7 @@ public PendingAttestationSchema getPendingAttestationSchema() { } @Override - public BeaconStatePhase0 createFromBackingNode(TreeNode node) { + public BeaconStatePhase0 createFromBackingNode(final TreeNode node) { return new BeaconStatePhase0Impl(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/MutableBeaconStatePhase0Impl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/MutableBeaconStatePhase0Impl.java index 2239cded74c..8ec71f3b779 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/MutableBeaconStatePhase0Impl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/phase0/MutableBeaconStatePhase0Impl.java @@ -27,11 +27,12 @@ class MutableBeaconStatePhase0Impl extends AbstractMutableBeaconState implements MutableBeaconStatePhase0, BeaconStateCache, ValidatorStatsPhase0 { - MutableBeaconStatePhase0Impl(BeaconStatePhase0Impl backingImmutableView) { + MutableBeaconStatePhase0Impl(final BeaconStatePhase0Impl backingImmutableView) { super(backingImmutableView); } - MutableBeaconStatePhase0Impl(BeaconStatePhase0Impl backingImmutableView, boolean builder) { + MutableBeaconStatePhase0Impl( + final BeaconStatePhase0Impl backingImmutableView, final boolean builder) { super(backingImmutableView, builder); } @@ -42,10 +43,10 @@ public BeaconStateSchemaPhase0 getBeaconStateSchema() { @Override protected BeaconStatePhase0Impl createImmutableBeaconState( - TreeNode backingNode, - IntCache viewCache, - TransitionCaches transitionCaches, - SlotCaches slotCaches) { + final TreeNode backingNode, + final IntCache viewCache, + final TransitionCaches transitionCaches, + final SlotCaches slotCaches) { return new BeaconStatePhase0Impl( getSchema(), backingNode, viewCache, transitionCaches, slotCaches); } @@ -57,19 +58,19 @@ public BeaconStatePhase0 commitChanges() { @Override public BeaconState updated( - Mutator mutator) { + final Mutator mutator) { throw new UnsupportedOperationException(); } @Override public - BeaconStatePhase0 updatedPhase0(Mutator mutator) + BeaconStatePhase0 updatedPhase0(final Mutator mutator) throws E1, E2, E3 { throw new UnsupportedOperationException(); } @Override - protected void addCustomFields(ToStringHelper stringBuilder) { + protected void addCustomFields(final ToStringHelper stringBuilder) { BeaconStatePhase0Impl.describeCustomFields(stringBuilder, this); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/capella/HistoricalSummary.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/capella/HistoricalSummary.java index e367f051843..d1dfb2f6fab 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/capella/HistoricalSummary.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/capella/HistoricalSummary.java @@ -31,11 +31,12 @@ public HistoricalSummarySchema() { } @Override - public HistoricalSummary createFromBackingNode(TreeNode node) { + public HistoricalSummary createFromBackingNode(final TreeNode node) { return new HistoricalSummary(this, node); } - public HistoricalSummary create(SszBytes32 blockSummaryRoot, SszBytes32 stateSummaryRoot) { + public HistoricalSummary create( + final SszBytes32 blockSummaryRoot, final SszBytes32 stateSummaryRoot) { return new HistoricalSummary(this, blockSummaryRoot, stateSummaryRoot); } @@ -48,12 +49,14 @@ public SszBytes32 getStateSummaryRootSchema() { } } - private HistoricalSummary(HistoricalSummarySchema type, TreeNode backingNode) { + private HistoricalSummary(final HistoricalSummarySchema type, final TreeNode backingNode) { super(type, backingNode); } private HistoricalSummary( - HistoricalSummarySchema type, SszBytes32 blockSummaryRoot, SszBytes32 stateSummaryRoot) { + final HistoricalSummarySchema type, + final SszBytes32 blockSummaryRoot, + final SszBytes32 stateSummaryRoot) { super(type, blockSummaryRoot, stateSummaryRoot); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingBalanceDeposit.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingBalanceDeposit.java index 6973406b8d8..5add848267c 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingBalanceDeposit.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingBalanceDeposit.java @@ -55,7 +55,7 @@ private PendingBalanceDeposit( } private PendingBalanceDeposit( - PendingBalanceDepositSchema type, final SszUInt64 index, final SszUInt64 amount) { + final PendingBalanceDepositSchema type, final SszUInt64 index, final SszUInt64 amount) { super(type, index, amount); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingConsolidation.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingConsolidation.java index f67b4a2329e..77d53c0cfb7 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingConsolidation.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingConsolidation.java @@ -21,7 +21,7 @@ public class PendingConsolidation extends Container2 { protected PendingConsolidation( - ContainerSchema2 schema) { + final ContainerSchema2 schema) { super(schema); } @@ -42,7 +42,7 @@ public PendingConsolidationSchema() { } @Override - public PendingConsolidation createFromBackingNode(TreeNode node) { + public PendingConsolidation createFromBackingNode(final TreeNode node) { return new PendingConsolidation(this, node); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingPartialWithdrawal.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingPartialWithdrawal.java index cebf4492d19..a7b00bd0e2d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingPartialWithdrawal.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra/PendingPartialWithdrawal.java @@ -23,7 +23,7 @@ public class PendingPartialWithdrawal extends Container3 { protected PendingPartialWithdrawal( - ContainerSchema3 schema) { + final ContainerSchema3 schema) { super(schema); } @@ -63,13 +63,14 @@ public SszUInt64 getWithdrawableEpochSchema() { } @Override - public PendingPartialWithdrawal createFromBackingNode(TreeNode node) { + public PendingPartialWithdrawal createFromBackingNode(final TreeNode node) { return new PendingPartialWithdrawal(this, node); } } private PendingPartialWithdrawal( - PendingPartialWithdrawal.PendingPartialWithdrawalSchema type, final TreeNode backingNode) { + final PendingPartialWithdrawal.PendingPartialWithdrawalSchema type, + final TreeNode backingNode) { super(type, backingNode); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszPublicKey.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszPublicKey.java index 32df9fbda2b..bb4d81fd5aa 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszPublicKey.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszPublicKey.java @@ -24,17 +24,17 @@ public class SszPublicKey extends SszByteVectorImpl { private final Supplier publicKey; - public SszPublicKey(Bytes48 publicKeyBytes) { + public SszPublicKey(final Bytes48 publicKeyBytes) { super(SszPublicKeySchema.INSTANCE, publicKeyBytes); this.publicKey = Suppliers.memoize(this::createBLSPublicKey); } - public SszPublicKey(BLSPublicKey publicKey) { + public SszPublicKey(final BLSPublicKey publicKey) { super(SszPublicKeySchema.INSTANCE, publicKey.toBytesCompressed()); this.publicKey = () -> publicKey; } - SszPublicKey(TreeNode backingNode) { + SszPublicKey(final TreeNode backingNode) { super(SszPublicKeySchema.INSTANCE, backingNode); this.publicKey = Suppliers.memoize(this::createBLSPublicKey); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszPublicKeySchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszPublicKeySchema.java index 518da0f5897..89792d15a80 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszPublicKeySchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszPublicKeySchema.java @@ -34,7 +34,7 @@ protected DeserializableTypeDefinition createTypeDefinition() { } @Override - public SszPublicKey createFromBackingNode(TreeNode node) { + public SszPublicKey createFromBackingNode(final TreeNode node) { return new SszPublicKey(node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszSignature.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszSignature.java index a9fecf7412c..113e70bf207 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszSignature.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszSignature.java @@ -23,12 +23,12 @@ public class SszSignature extends SszByteVectorImpl { private final Supplier signature; - public SszSignature(BLSSignature signature) { + public SszSignature(final BLSSignature signature) { super(SszSignatureSchema.INSTANCE, signature.toBytesCompressed()); this.signature = () -> signature; } - SszSignature(TreeNode backingNode) { + SszSignature(final TreeNode backingNode) { super(SszSignatureSchema.INSTANCE, backingNode); signature = Suppliers.memoize(this::createBLSSignature); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszSignatureSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszSignatureSchema.java index d0928a5e6de..3886cb5ad9b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszSignatureSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/type/SszSignatureSchema.java @@ -27,7 +27,7 @@ private SszSignatureSchema() { } @Override - public SszSignature createFromBackingNode(TreeNode node) { + public SszSignature createFromBackingNode(final TreeNode node) { return new SszSignature(node); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/util/DepositUtil.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/util/DepositUtil.java index 7223ee0f60e..e4daa1f620f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/util/DepositUtil.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/util/DepositUtil.java @@ -27,7 +27,7 @@ public DepositUtil(final Spec spec) { this.spec = spec; } - public DepositWithIndex convertDepositEventToOperationDeposit(Deposit event) { + public DepositWithIndex convertDepositEventToOperationDeposit(final Deposit event) { checkArgument( event.getAmount().isGreaterThanOrEqualTo(spec.getGenesisSpecConfig().getMinDepositAmount()), "Deposit amount too low"); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/util/SlotAndBlockRootAndBlobIndex.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/util/SlotAndBlockRootAndBlobIndex.java index cf3f7a748b5..07ce0a33e03 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/util/SlotAndBlockRootAndBlobIndex.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/util/SlotAndBlockRootAndBlobIndex.java @@ -66,7 +66,7 @@ public boolean equals(final Object o) { } @Override - public int compareTo(@NotNull SlotAndBlockRootAndBlobIndex o) { + public int compareTo(final @NotNull SlotAndBlockRootAndBlobIndex o) { return Comparator.comparing(SlotAndBlockRootAndBlobIndex::getSlot) .thenComparing(SlotAndBlockRootAndBlobIndex::getBlockRoot) .thenComparing(SlotAndBlockRootAndBlobIndex::getBlobIndex) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/validator/SubnetSubscription.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/validator/SubnetSubscription.java index 9197b8cfa31..b3a246c66cf 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/validator/SubnetSubscription.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/validator/SubnetSubscription.java @@ -24,7 +24,7 @@ public class SubnetSubscription implements Comparable { private final int subnetId; private final UInt64 unsubscriptionSlot; - public SubnetSubscription(int subnetId, UInt64 unsubscriptionSlot) { + public SubnetSubscription(final int subnetId, final UInt64 unsubscriptionSlot) { this.subnetId = subnetId; this.unsubscriptionSlot = unsubscriptionSlot; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannelStub.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannelStub.java index 275f269d9f7..b64db32c648 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannelStub.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannelStub.java @@ -482,7 +482,7 @@ public SafeFuture builderGetPayload( return SafeFuture.completedFuture(BuilderPayloadOrFallbackData.create(builderPayload)); } - public void setPayloadStatus(PayloadStatus payloadStatus) { + public void setPayloadStatus(final PayloadStatus payloadStatus) { this.payloadStatus = payloadStatus; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ForkChoiceUpdatedResult.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ForkChoiceUpdatedResult.java index 27dc02b779a..a3b3d65e350 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ForkChoiceUpdatedResult.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ForkChoiceUpdatedResult.java @@ -22,7 +22,8 @@ public class ForkChoiceUpdatedResult { private final PayloadStatus payloadStatus; private final Optional payloadId; - public ForkChoiceUpdatedResult(PayloadStatus payloadStatus, Optional payloadId) { + public ForkChoiceUpdatedResult( + final PayloadStatus payloadStatus, final Optional payloadId) { this.payloadStatus = payloadStatus; this.payloadId = payloadId; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/PayloadStatus.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/PayloadStatus.java index d1fab3a526a..133aefa4d30 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/PayloadStatus.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/PayloadStatus.java @@ -44,7 +44,7 @@ public static PayloadStatus failedExecution(final Throwable cause) { } public static PayloadStatus invalid( - Optional latestValidHash, Optional validationError) { + final Optional latestValidHash, final Optional validationError) { return new PayloadStatus( Optional.of(ExecutionPayloadStatus.INVALID), latestValidHash, @@ -53,7 +53,7 @@ public static PayloadStatus invalid( } public static PayloadStatus valid( - Optional latestValidHash, Optional validationError) { + final Optional latestValidHash, final Optional validationError) { return new PayloadStatus( Optional.of(ExecutionPayloadStatus.VALID), latestValidHash, @@ -62,9 +62,9 @@ public static PayloadStatus valid( } public static PayloadStatus create( - ExecutionPayloadStatus status, - Optional latestValidHash, - Optional validationError) { + final ExecutionPayloadStatus status, + final Optional latestValidHash, + final Optional validationError) { return new PayloadStatus( Optional.of(status), latestValidHash, validationError, Optional.empty()); } @@ -75,10 +75,10 @@ public static PayloadStatus create( private final Optional failureCause; private PayloadStatus( - Optional status, - Optional latestValidHash, - Optional validationError, - Optional failureCause) { + final Optional status, + final Optional latestValidHash, + final Optional validationError, + final Optional failureCause) { this.status = status; this.latestValidHash = latestValidHash; this.validationError = validationError; @@ -97,7 +97,7 @@ public Optional getStatus() { return status; } - public boolean hasStatus(ExecutionPayloadStatus status) { + public boolean hasStatus(final ExecutionPayloadStatus status) { return this.status.map(s -> s == status).orElse(false); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/genesis/GenesisGenerator.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/genesis/GenesisGenerator.java index e49e7fb7ce1..3dcee037f29 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/genesis/GenesisGenerator.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/genesis/GenesisGenerator.java @@ -72,14 +72,16 @@ public GenesisGenerator(final SpecVersion genesisSpec, final Fork genesisFork) { .createWritableCopy(); } - public void updateExecutionPayloadHeader(ExecutionPayloadHeader payloadHeader) { + public void updateExecutionPayloadHeader(final ExecutionPayloadHeader payloadHeader) { state .toMutableVersionBellatrix() .ifPresent(stateBellatrix -> stateBellatrix.setLatestExecutionPayloadHeader(payloadHeader)); } public void updateCandidateState( - Bytes32 eth1BlockHash, UInt64 eth1Timestamp, List deposits) { + final Bytes32 eth1BlockHash, + final UInt64 eth1Timestamp, + final List deposits) { updateGenesisTime(eth1Timestamp); state.setEth1Data( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/StateTransition.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/StateTransition.java index 5170e4c129f..9341a28161c 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/StateTransition.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/StateTransition.java @@ -36,7 +36,7 @@ public StateTransition(final SpecProvider specProvider) { this.specProvider = specProvider; } - public BeaconState processSlots(BeaconState preState, UInt64 slot) + public BeaconState processSlots(final BeaconState preState, final UInt64 slot) throws SlotProcessingException, EpochProcessingException { try { checkArgument( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/block/AbstractBlockProcessor.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/block/AbstractBlockProcessor.java index 88df8fcc518..ab3477ef2c2 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/block/AbstractBlockProcessor.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/block/AbstractBlockProcessor.java @@ -341,7 +341,8 @@ protected void processBlock( } @Override - public void processBlockHeader(MutableBeaconState state, BeaconBlockSummary blockHeader) + public void processBlockHeader( + final MutableBeaconState state, final BeaconBlockSummary blockHeader) throws BlockProcessingException { safelyProcess( () -> { @@ -375,8 +376,8 @@ public void processBlockHeader(MutableBeaconState state, BeaconBlockSummary bloc }); } - protected void processRandaoNoValidation(MutableBeaconState state, BeaconBlockBody body) - throws BlockProcessingException { + protected void processRandaoNoValidation( + final MutableBeaconState state, final BeaconBlockBody body) throws BlockProcessingException { safelyProcess( () -> { UInt64 epoch = beaconStateAccessors.getCurrentEpoch(state); @@ -578,9 +579,9 @@ public void processAttestations( } protected void processAttestationsNoVerification( - MutableBeaconState state, - SszList attestations, - IndexedAttestationCache indexedAttestationCache) + final MutableBeaconState state, + final SszList attestations, + final IndexedAttestationCache indexedAttestationCache) throws BlockProcessingException { final IndexedAttestationProvider indexedAttestationProvider = createIndexedAttestationProvider(state, indexedAttestationCache); @@ -595,7 +596,7 @@ protected void processAttestationsNoVerification( } public IndexedAttestationProvider createIndexedAttestationProvider( - BeaconState state, IndexedAttestationCache indexedAttestationCache) { + final BeaconState state, final IndexedAttestationCache indexedAttestationCache) { return (attestation) -> indexedAttestationCache.computeIfAbsent( attestation, () -> attestationUtil.getIndexedAttestation(state, attestation)); @@ -618,10 +619,10 @@ protected abstract void processAttestation( @CheckReturnValue protected BlockValidationResult verifyAttestationSignatures( - BeaconState state, - SszList attestations, - BLSSignatureVerifier signatureVerifier, - IndexedAttestationCache indexedAttestationCache) { + final BeaconState state, + final SszList attestations, + final BLSSignatureVerifier signatureVerifier, + final IndexedAttestationCache indexedAttestationCache) { return verifyAttestationSignatures( state, attestations, @@ -631,10 +632,10 @@ protected BlockValidationResult verifyAttestationSignatures( @CheckReturnValue protected BlockValidationResult verifyAttestationSignatures( - BeaconState state, - SszList attestations, - BLSSignatureVerifier signatureVerifier, - IndexedAttestationProvider indexedAttestationProvider) { + final BeaconState state, + final SszList attestations, + final BLSSignatureVerifier signatureVerifier, + final IndexedAttestationProvider indexedAttestationProvider) { Optional processResult = attestations.stream() @@ -654,7 +655,8 @@ protected BlockValidationResult verifyAttestationSignatures( } @Override - public void processDeposits(MutableBeaconState state, SszList deposits) + public void processDeposits( + final MutableBeaconState state, final SszList deposits) throws BlockProcessingException { safelyProcess( () -> { @@ -863,9 +865,9 @@ protected void processVoluntaryExitsNoValidation( } protected BlockValidationResult verifyVoluntaryExits( - BeaconState state, - SszList exits, - BLSSignatureVerifier signatureVerifier) { + final BeaconState state, + final SszList exits, + final BLSSignatureVerifier signatureVerifier) { for (SignedVoluntaryExit signedExit : exits) { boolean exitSignatureValid = operationSignatureVerifier.verifyVoluntaryExitSignature( @@ -902,7 +904,7 @@ public void processExecutionLayerWithdrawalRequests( } // Catch generic errors and wrap them in a BlockProcessingException - protected void safelyProcess(BlockProcessingAction action) throws BlockProcessingException { + protected void safelyProcess(final BlockProcessingAction action) throws BlockProcessingException { try { action.run(); } catch (ArithmeticException | IllegalArgumentException | IndexOutOfBoundsException e) { diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/BeaconStateAccessors.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/BeaconStateAccessors.java index d37edf0327b..3da2603c051 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/BeaconStateAccessors.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/BeaconStateAccessors.java @@ -49,11 +49,11 @@ protected BeaconStateAccessors( this.miscHelpers = miscHelpers; } - public UInt64 getCurrentEpoch(BeaconState state) { + public UInt64 getCurrentEpoch(final BeaconState state) { return miscHelpers.computeEpochAtSlot(state.getSlot()); } - public UInt64 getPreviousEpoch(BeaconState state) { + public UInt64 getPreviousEpoch(final BeaconState state) { UInt64 currentEpoch = getCurrentEpoch(state); return currentEpoch.equals(GENESIS_EPOCH) ? GENESIS_EPOCH : currentEpoch.minus(UInt64.ONE); } @@ -73,7 +73,8 @@ public UInt64 getValidatorActivationChurnLimit(final BeaconState state) { return getValidatorChurnLimit(state); } - public Optional getValidatorPubKey(BeaconState state, UInt64 validatorIndex) { + public Optional getValidatorPubKey( + final BeaconState state, final UInt64 validatorIndex) { if (state.getValidators().size() <= validatorIndex.longValue() || validatorIndex.longValue() < 0) { return Optional.empty(); @@ -101,7 +102,7 @@ public Optional getValidatorPubKey(BeaconState state, UInt64 valid * @param epoch - The epoch under consideration. * @return A list of indices representing the active validators for the given epoch. */ - public IntList getActiveValidatorIndices(BeaconState state, UInt64 epoch) { + public IntList getActiveValidatorIndices(final BeaconState state, final UInt64 epoch) { final UInt64 stateEpoch = getCurrentEpoch(state); final UInt64 maxLookaheadEpoch = getMaxLookaheadEpoch(stateEpoch); checkArgument( @@ -130,7 +131,7 @@ private UInt64 getMaxLookaheadEpoch(final UInt64 stateEpoch) { return stateEpoch.plus(config.getMaxSeedLookahead()); } - public UInt64 getTotalBalance(BeaconState state, Collection indices) { + public UInt64 getTotalBalance(final BeaconState state, final Collection indices) { UInt64 sum = UInt64.ZERO; SszList validatorRegistry = state.getValidators(); for (Integer index : indices) { @@ -139,7 +140,7 @@ public UInt64 getTotalBalance(BeaconState state, Collection indices) { return sum.max(config.getEffectiveBalanceIncrement()); } - public UInt64 getTotalActiveBalance(BeaconState state) { + public UInt64 getTotalActiveBalance(final BeaconState state) { return BeaconStateCache.getTransitionCaches(state) .getTotalActiveBalance() .get( @@ -153,7 +154,7 @@ public UInt64 getProposerBoostAmount(final BeaconState state) { return committeeWeight.times(config.getProposerScoreBoost()).dividedBy(100); } - public Bytes32 getSeed(BeaconState state, UInt64 epoch, Bytes4 domainType) + public Bytes32 getSeed(final BeaconState state, final UInt64 epoch, final Bytes4 domainType) throws IllegalArgumentException { UInt64 randaoIndex = epoch.plus(config.getEpochsPerHistoricalVector() - config.getMinSeedLookahead() - 1); @@ -183,7 +184,7 @@ public UInt64 calculateCommitteeFraction( * @param epoch * @return */ - public UInt64 getCommitteeCountPerSlot(BeaconState state, UInt64 epoch) { + public UInt64 getCommitteeCountPerSlot(final BeaconState state, final UInt64 epoch) { IntList activeValidatorIndices = getActiveValidatorIndices(state, epoch); return getCommitteeCountPerSlot(activeValidatorIndices.size()); } @@ -199,16 +200,16 @@ public UInt64 getCommitteeCountPerSlot(final long activeValidatorCount) { config.getTargetCommitteeSize())))); } - public Bytes32 getRandaoMix(BeaconState state, UInt64 epoch) { + public Bytes32 getRandaoMix(final BeaconState state, final UInt64 epoch) { int index = epoch.mod(config.getEpochsPerHistoricalVector()).intValue(); return state.getRandaoMixes().getElement(index); } - public int getBeaconProposerIndex(BeaconState state) { + public int getBeaconProposerIndex(final BeaconState state) { return getBeaconProposerIndex(state, state.getSlot()); } - public int getBeaconProposerIndex(BeaconState state, UInt64 requestedSlot) { + public int getBeaconProposerIndex(final BeaconState state, final UInt64 requestedSlot) { validateStateCanCalculateProposerIndexAtSlot(state, requestedSlot); return BeaconStateCache.getTransitionCaches(state) .getBeaconProposerIndex() @@ -248,7 +249,7 @@ private void validateStateCanCalculateProposerIndexAtSlot( stateEpoch); } - public Bytes32 getBlockRootAtSlot(BeaconState state, UInt64 slot) + public Bytes32 getBlockRootAtSlot(final BeaconState state, final UInt64 slot) throws IllegalArgumentException { checkArgument( isBlockRootAvailableFromState(state, slot), @@ -259,11 +260,12 @@ public Bytes32 getBlockRootAtSlot(BeaconState state, UInt64 slot) return state.getBlockRoots().getElement(latestBlockRootIndex); } - public Bytes32 getBlockRoot(BeaconState state, UInt64 epoch) throws IllegalArgumentException { + public Bytes32 getBlockRoot(final BeaconState state, final UInt64 epoch) + throws IllegalArgumentException { return getBlockRootAtSlot(state, miscHelpers.computeStartSlotAtEpoch(epoch)); } - private boolean isBlockRootAvailableFromState(BeaconState state, UInt64 slot) { + private boolean isBlockRootAvailableFromState(final BeaconState state, final UInt64 slot) { UInt64 slotPlusHistoricalRoot = slot.plus(config.getSlotsPerHistoricalRoot()); return slot.isLessThan(state.getSlot()) && state.getSlot().isLessThanOrEqualTo(slotPlusHistoricalRoot); @@ -284,7 +286,8 @@ public int getPreviousEpochAttestationCapacity(final BeaconState state) { return Integer.MAX_VALUE; } - public IntList getBeaconCommittee(BeaconState state, UInt64 slot, UInt64 index) { + public IntList getBeaconCommittee( + final BeaconState state, final UInt64 slot, final UInt64 index) { // Make sure state is within range of the slot being queried validateStateForCommitteeQuery(state, slot); @@ -310,7 +313,7 @@ public IntList getBeaconCommittee(BeaconState state, UInt64 slot, UInt64 index) }); } - public void validateStateForCommitteeQuery(BeaconState state, UInt64 slot) { + public void validateStateForCommitteeQuery(final BeaconState state, final UInt64 slot) { final UInt64 oldestQueryableSlot = miscHelpers.getEarliestQueryableSlotForBeaconCommitteeAtTargetSlot(slot); checkArgument( diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/BeaconStateMutators.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/BeaconStateMutators.java index 5ceb228bf6a..eb9d9592db2 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/BeaconStateMutators.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/BeaconStateMutators.java @@ -48,7 +48,8 @@ public BeaconStateMutators( * @param proposerIndex * @param delta */ - public void increaseProposerBalance(MutableBeaconState state, int proposerIndex, UInt64 delta) { + public void increaseProposerBalance( + final MutableBeaconState state, final int proposerIndex, final UInt64 delta) { increaseBalance(state, proposerIndex, delta); BeaconStateCache.getSlotCaches(state).increaseBlockProposerRewards(delta); } @@ -62,7 +63,7 @@ public void increaseProposerBalance(MutableBeaconState state, int proposerIndex, * @see * https://github.com/ethereum/consensus-specs/blob/v0.8.0/specs/core/0_beacon-chain.md#increase_balance */ - public void increaseBalance(MutableBeaconState state, int index, UInt64 delta) { + public void increaseBalance(final MutableBeaconState state, final int index, final UInt64 delta) { state.getBalances().setElement(index, state.getBalances().getElement(index).plus(delta)); } @@ -75,7 +76,7 @@ public void increaseBalance(MutableBeaconState state, int index, UInt64 delta) { * @see * https://github.com/ethereum/consensus-specs/blob/v0.8.0/specs/core/0_beacon-chain.md#decrease_balance */ - public void decreaseBalance(MutableBeaconState state, int index, UInt64 delta) { + public void decreaseBalance(final MutableBeaconState state, final int index, final UInt64 delta) { state .getBalances() .setElement(index, state.getBalances().getElement(index).minusMinZero(delta)); @@ -226,7 +227,7 @@ public void slashValidator( private void slashValidator( final MutableBeaconState state, final int slashedIndex, - int whistleblowerIndex, + final int whistleblowerIndex, final Supplier validatorExitContextSupplier) { final UInt64 epoch = beaconStateAccessors.getCurrentEpoch(state); initiateValidatorExit(state, slashedIndex, validatorExitContextSupplier); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/MiscHelpers.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/MiscHelpers.java index d12d44af3ec..3d6df9eee96 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/MiscHelpers.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/MiscHelpers.java @@ -61,7 +61,7 @@ public MiscHelpers(final SpecConfig specConfig) { this.specConfig = specConfig; } - public int computeShuffledIndex(int index, int indexCount, Bytes32 seed) { + public int computeShuffledIndex(final int index, final int indexCount, final Bytes32 seed) { checkArgument(index < indexCount, "CommitteeUtil.computeShuffledIndex1"); final Sha256 sha256 = getSha256Instance(); @@ -149,7 +149,7 @@ public boolean isSlotAtNthEpochBoundary( return blockEpoch.dividedBy(n).isGreaterThan(parentEpoch.dividedBy(n)); } - public UInt64 computeActivationExitEpoch(UInt64 epoch) { + public UInt64 computeActivationExitEpoch(final UInt64 epoch) { return epoch.plus(UInt64.ONE).plus(specConfig.getMaxSeedLookahead()); } @@ -247,13 +247,13 @@ public UInt64 calculateNodeSubnetUnsubscriptionSlot( return computeStartSlotAtEpoch(nextPeriodEpoch); } - IntList shuffleList(IntList input, Bytes32 seed) { + IntList shuffleList(final IntList input, final Bytes32 seed) { final int[] indices = input.toIntArray(); shuffleList(indices, seed); return IntList.of(indices); } - public void shuffleList(int[] input, Bytes32 seed) { + public void shuffleList(final int[] input, final Bytes32 seed) { int listSize = input.length; if (listSize == 0) { @@ -300,26 +300,27 @@ public void shuffleList(int[] input, Bytes32 seed) { } } - public Bytes computeSigningRoot(Merkleizable object, Bytes32 domain) { + public Bytes computeSigningRoot(final Merkleizable object, final Bytes32 domain) { return new SigningData(object.hashTreeRoot(), domain).hashTreeRoot(); } - public Bytes computeSigningRoot(UInt64 number, Bytes32 domain) { + public Bytes computeSigningRoot(final UInt64 number, final Bytes32 domain) { SigningData domainWrappedObject = new SigningData(SszUInt64.of(number).hashTreeRoot(), domain); return domainWrappedObject.hashTreeRoot(); } - public Bytes32 computeSigningRoot(Bytes bytes, Bytes32 domain) { + public Bytes32 computeSigningRoot(final Bytes bytes, final Bytes32 domain) { SigningData domainWrappedObject = new SigningData(SszByteVector.computeHashTreeRoot(bytes), domain); return domainWrappedObject.hashTreeRoot(); } - public Bytes4 computeForkDigest(Bytes4 currentVersion, Bytes32 genesisValidatorsRoot) { + public Bytes4 computeForkDigest( + final Bytes4 currentVersion, final Bytes32 genesisValidatorsRoot) { return new Bytes4(computeForkDataRoot(currentVersion, genesisValidatorsRoot).slice(0, 4)); } - public Bytes32 computeDomain(Bytes4 domainType) { + public Bytes32 computeDomain(final Bytes4 domainType) { return computeDomain(domainType, specConfig.getGenesisForkVersion(), Bytes32.ZERO); } @@ -328,12 +329,13 @@ public Bytes32 computeDomain(final Bytes4 domainType, final Bytes32 genesisValid } public Bytes32 computeDomain( - Bytes4 domainType, Bytes4 forkVersion, Bytes32 genesisValidatorsRoot) { + final Bytes4 domainType, final Bytes4 forkVersion, final Bytes32 genesisValidatorsRoot) { final Bytes32 forkDataRoot = computeForkDataRoot(forkVersion, genesisValidatorsRoot); return Bytes32.wrap(Bytes.concatenate(domainType.getWrappedBytes(), forkDataRoot.slice(0, 28))); } - private Bytes32 computeForkDataRoot(Bytes4 currentVersion, Bytes32 genesisValidatorsRoot) { + private Bytes32 computeForkDataRoot( + final Bytes4 currentVersion, final Bytes32 genesisValidatorsRoot) { return new ForkData(currentVersion, genesisValidatorsRoot).hashTreeRoot(); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/Predicates.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/Predicates.java index 90b1343a7cb..44d42e7df98 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/Predicates.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/Predicates.java @@ -42,11 +42,12 @@ public Predicates(final SpecConfig specConfig) { * @see is_active_validator */ - public boolean isActiveValidator(Validator validator, UInt64 epoch) { + public boolean isActiveValidator(final Validator validator, final UInt64 epoch) { return isActiveValidator(validator.getActivationEpoch(), validator.getExitEpoch(), epoch); } - public boolean isActiveValidator(UInt64 activationEpoch, UInt64 exitEpoch, UInt64 epoch) { + public boolean isActiveValidator( + final UInt64 activationEpoch, final UInt64 exitEpoch, final UInt64 epoch) { return activationEpoch.compareTo(epoch) <= 0 && epoch.compareTo(exitEpoch) < 0; } @@ -54,10 +55,11 @@ public boolean isValidMerkleBranch( final Bytes32 leaf, final SszBytes32Vector branch, final int depth, - int index, + final int startingIndex, final Bytes32 root) { final Sha256 sha256 = getSha256Instance(); Bytes32 value = leaf; + int index = startingIndex; for (int i = 0; i < depth; i++) { if ((index & 1) == 1) { value = sha256.wrappedDigest(branch.getElement(i), value); @@ -75,7 +77,7 @@ public boolean isValidMerkleBranch( * @see is_slashable_validator */ - public boolean isSlashableValidator(Validator validator, UInt64 epoch) { + public boolean isSlashableValidator(final Validator validator, final UInt64 epoch) { return !validator.isSlashed() && (validator.getActivationEpoch().compareTo(epoch) <= 0 && epoch.compareTo(validator.getWithdrawableEpoch()) < 0); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/operations/OperationSignatureVerifier.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/operations/OperationSignatureVerifier.java index f195b34f096..633782194fe 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/operations/OperationSignatureVerifier.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/operations/OperationSignatureVerifier.java @@ -49,10 +49,10 @@ public OperationSignatureVerifier( } public boolean verifyProposerSlashingSignature( - Fork fork, - BeaconState state, - ProposerSlashing proposerSlashing, - BLSSignatureVerifier signatureVerifier) { + final Fork fork, + final BeaconState state, + final ProposerSlashing proposerSlashing, + final BLSSignatureVerifier signatureVerifier) { final BeaconBlockHeader header1 = proposerSlashing.getHeader1().getMessage(); final BeaconBlockHeader header2 = proposerSlashing.getHeader2().getMessage(); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/blockvalidator/BatchSignatureVerifier.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/blockvalidator/BatchSignatureVerifier.java index 0080d7d587e..b1dd09cb74b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/blockvalidator/BatchSignatureVerifier.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/blockvalidator/BatchSignatureVerifier.java @@ -43,7 +43,11 @@ private static class Job { final Bytes message; final BLSSignature signature; - public Job(int idx, List publicKeys, Bytes message, BLSSignature signature) { + public Job( + final int idx, + final List publicKeys, + final Bytes message, + final BLSSignature signature) { this.idx = idx; this.publicKeys = publicKeys; this.message = message; @@ -56,7 +60,7 @@ public Job(int idx, List publicKeys, Bytes message, BLSSignature s @Override public synchronized boolean verify( - List publicKeys, Bytes message, BLSSignature signature) { + final List publicKeys, final Bytes message, final BLSSignature signature) { if (complete) { throw new IllegalStateException("Reuse of disposable instance"); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/blockvalidator/BlockValidationResult.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/blockvalidator/BlockValidationResult.java index eb3e4511d37..60e5c269f15 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/blockvalidator/BlockValidationResult.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/blockvalidator/BlockValidationResult.java @@ -22,12 +22,12 @@ public class BlockValidationResult { private final boolean isValid; private final String failureReason; - private BlockValidationResult(String failureReason) { + private BlockValidationResult(final String failureReason) { this.failureReason = failureReason; this.isValid = false; } - private BlockValidationResult(boolean isValid) { + private BlockValidationResult(final boolean isValid) { this.isValid = isValid; failureReason = null; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java index 86be39e2355..4bfb6807a48 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java @@ -170,7 +170,8 @@ public BlockCheckpoints calculateBlockCheckpoints(final BeaconState preState) { /** Processes justification and finalization */ @Override public void processJustificationAndFinalization( - MutableBeaconState state, TotalBalances totalBalances) throws EpochProcessingException { + final MutableBeaconState state, final TotalBalances totalBalances) + throws EpochProcessingException { try { UInt64 currentEpoch = beaconStateAccessors.getCurrentEpoch(state); if (currentEpoch.isLessThanOrEqualTo(SpecConfig.GENESIS_EPOCH.plus(1))) { @@ -271,7 +272,7 @@ public void processInactivityUpdates( @Override public void processRewardsAndPenalties( - MutableBeaconState state, ValidatorStatuses validatorStatuses) + final MutableBeaconState state, final ValidatorStatuses validatorStatuses) throws EpochProcessingException { try { if (beaconStateAccessors.getCurrentEpoch(state).equals(SpecConfig.GENESIS_EPOCH)) { @@ -393,7 +394,7 @@ protected boolean isEligibleForActivationQueue(final ValidatorStatus status) { /** Processes slashings */ @Override public void processSlashings( - MutableBeaconState state, final ValidatorStatuses validatorStatuses) { + final MutableBeaconState state, final ValidatorStatuses validatorStatuses) { final UInt64 totalBalance = validatorStatuses.getTotalBalances().getCurrentEpochActiveValidators(); final UInt64 epoch = beaconStateAccessors.getCurrentEpoch(state); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/EpochProcessor.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/EpochProcessor.java index 0cd9eb11076..db8f3190b34 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/EpochProcessor.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/EpochProcessor.java @@ -38,7 +38,7 @@ public interface EpochProcessor { * @see tech.pegasys.teku.spec.logic.common.statetransition.epoch.RewardsAndPenaltiesCalculator */ default RewardAndPenaltyDeltas getRewardAndPenaltyDeltas( - BeaconState state, ValidatorStatuses validatorStatuses) { + final BeaconState state, final ValidatorStatuses validatorStatuses) { return getRewardAndPenaltyDeltas( state, validatorStatuses, RewardsAndPenaltiesCalculator::getDeltas); } @@ -67,7 +67,7 @@ RewardAndPenaltyDeltas getRewardAndPenaltyDeltas( BeaconState processEpoch(BeaconState preState) throws EpochProcessingException; default void initProgressiveTotalBalancesIfRequired( - BeaconState state, TotalBalances totalBalances) {} + final BeaconState state, final TotalBalances totalBalances) {} BlockCheckpoints calculateBlockCheckpoints(BeaconState state); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/BlockProcessingException.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/BlockProcessingException.java index 4f2ba850db7..f1b977958b6 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/BlockProcessingException.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/BlockProcessingException.java @@ -14,15 +14,15 @@ package tech.pegasys.teku.spec.logic.common.statetransition.exceptions; public final class BlockProcessingException extends Exception { - public BlockProcessingException(String message, Exception cause) { + public BlockProcessingException(final String message, final Exception cause) { super(message, cause); } - public BlockProcessingException(String err) { + public BlockProcessingException(final String err) { super(err); } - public BlockProcessingException(Exception e) { + public BlockProcessingException(final Exception e) { super(e); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/EpochProcessingException.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/EpochProcessingException.java index 1f608aae111..871e5cb91bd 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/EpochProcessingException.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/EpochProcessingException.java @@ -14,11 +14,11 @@ package tech.pegasys.teku.spec.logic.common.statetransition.exceptions; public final class EpochProcessingException extends Exception { - public EpochProcessingException(String err) { + public EpochProcessingException(final String err) { super(err); } - public EpochProcessingException(RuntimeException e) { + public EpochProcessingException(final RuntimeException e) { super(e); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/SlotProcessingException.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/SlotProcessingException.java index ec3a12e6b0e..a471e978ae2 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/SlotProcessingException.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/SlotProcessingException.java @@ -14,11 +14,11 @@ package tech.pegasys.teku.spec.logic.common.statetransition.exceptions; public final class SlotProcessingException extends Exception { - public SlotProcessingException(String err) { + public SlotProcessingException(final String err) { super(err); } - public SlotProcessingException(Exception e) { + public SlotProcessingException(final Exception e) { super(e); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/StateTransitionException.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/StateTransitionException.java index c6d9d386f90..f6731d7f95c 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/StateTransitionException.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/exceptions/StateTransitionException.java @@ -17,11 +17,11 @@ public class StateTransitionException extends Exception { public StateTransitionException() {} - public StateTransitionException(String message) { + public StateTransitionException(final String message) { super(message); } - public StateTransitionException(Throwable e) { + public StateTransitionException(final Throwable e) { super(e); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/results/OptimisticSuccessfulBlockImportResult.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/results/OptimisticSuccessfulBlockImportResult.java index dba6271323e..b323a8f9e03 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/results/OptimisticSuccessfulBlockImportResult.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/results/OptimisticSuccessfulBlockImportResult.java @@ -17,7 +17,7 @@ public class OptimisticSuccessfulBlockImportResult extends SuccessfulBlockImportResult { - public OptimisticSuccessfulBlockImportResult(SignedBeaconBlock block) { + public OptimisticSuccessfulBlockImportResult(final SignedBeaconBlock block) { super(block); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/AsyncBLSSignatureVerifier.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/AsyncBLSSignatureVerifier.java index 5528ecef448..ff7c505c66f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/AsyncBLSSignatureVerifier.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/AsyncBLSSignatureVerifier.java @@ -22,7 +22,7 @@ import tech.pegasys.teku.infrastructure.async.SafeFuture; public interface AsyncBLSSignatureVerifier { - static AsyncBLSSignatureVerifier wrap(BLSSignatureVerifier syncVerifier) { + static AsyncBLSSignatureVerifier wrap(final BLSSignatureVerifier syncVerifier) { return new AsyncBLSSignatureVerifier() { @Override public SafeFuture verify( @@ -55,7 +55,7 @@ public SafeFuture verify( /** Shortcut to {@link #verify(List, Bytes, BLSSignature)} for non-aggregate case */ default SafeFuture verify( - BLSPublicKey publicKey, Bytes message, BLSSignature signature) { + final BLSPublicKey publicKey, final Bytes message, final BLSSignature signature) { return verify(Collections.singletonList(publicKey), message, signature); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BeaconStateUtil.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BeaconStateUtil.java index 901dcf47f05..9c5f9b15117 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BeaconStateUtil.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BeaconStateUtil.java @@ -60,12 +60,12 @@ public BeaconStateUtil( this.beaconStateAccessors = beaconStateAccessors; } - public boolean isValidGenesisState(UInt64 genesisTime, int activeValidatorCount) { + public boolean isValidGenesisState(final UInt64 genesisTime, final int activeValidatorCount) { return isItMinGenesisTimeYet(genesisTime) && isThereEnoughNumberOfValidators(activeValidatorCount); } - private boolean isThereEnoughNumberOfValidators(int activeValidatorCount) { + private boolean isThereEnoughNumberOfValidators(final int activeValidatorCount) { return activeValidatorCount >= specConfig.getMinGenesisActiveValidatorCount(); } @@ -80,11 +80,11 @@ public UInt64 computeNextEpochBoundary(final UInt64 slot) { : currentEpoch.plus(1); } - public Bytes32 getPreviousDutyDependentRoot(BeaconState state) { + public Bytes32 getPreviousDutyDependentRoot(final BeaconState state) { return getDutyDependentRoot(state, beaconStateAccessors.getPreviousEpoch(state)); } - public Bytes32 getCurrentDutyDependentRoot(BeaconState state) { + public Bytes32 getCurrentDutyDependentRoot(final BeaconState state) { return getDutyDependentRoot(state, beaconStateAccessors.getCurrentEpoch(state)); } @@ -150,7 +150,7 @@ public List getEffectiveActiveUnslashedBalances(final BeaconState state) .toList()); } - public boolean all(SszBitvector bitvector, int start, int end) { + public boolean all(final SszBitvector bitvector, final int start, final int end) { for (int i = start; i < end; i++) { if (!bitvector.getBit(i)) { return false; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BlockRewardCalculatorUtil.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BlockRewardCalculatorUtil.java index fb75e0a97d8..c1e229ddb26 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BlockRewardCalculatorUtil.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/BlockRewardCalculatorUtil.java @@ -48,7 +48,7 @@ public class BlockRewardCalculatorUtil { private final Spec spec; private static final Logger LOG = LogManager.getLogger(); - public BlockRewardCalculatorUtil(Spec spec) { + public BlockRewardCalculatorUtil(final Spec spec) { this.spec = spec; } @@ -123,7 +123,8 @@ long calculateAttesterSlashingsRewards( } @VisibleForTesting - long calculateProposerSyncAggregateBlockRewards(long proposerReward, SyncAggregate aggregate) { + long calculateProposerSyncAggregateBlockRewards( + final long proposerReward, final SyncAggregate aggregate) { final SszBitvector syncCommitteeBits = aggregate.getSyncCommitteeBits(); return proposerReward * syncCommitteeBits.getBitCount(); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/EpochAttestationSchedule.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/EpochAttestationSchedule.java index 4b30f39f39b..e5ebf1185e6 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/EpochAttestationSchedule.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/EpochAttestationSchedule.java @@ -29,7 +29,7 @@ public static Builder builder() { return new Builder(); } - public SlotAttestationSchedule atSlot(UInt64 assignedSlot) { + public SlotAttestationSchedule atSlot(final UInt64 assignedSlot) { return slotSchedule.get(assignedSlot); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ForkChoiceUtil.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ForkChoiceUtil.java index 2593ad0c86d..87648b2e7e8 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ForkChoiceUtil.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ForkChoiceUtil.java @@ -67,20 +67,21 @@ public ForkChoiceUtil( this.miscHelpers = miscHelpers; } - public UInt64 getSlotsSinceGenesis(ReadOnlyStore store, boolean useUnixTime) { + public UInt64 getSlotsSinceGenesis(final ReadOnlyStore store, final boolean useUnixTime) { UInt64 time = useUnixTime ? UInt64.valueOf(Instant.now().getEpochSecond()) : store.getTimeSeconds(); return getCurrentSlot(time, store.getGenesisTime()); } - public UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime) { + public UInt64 getCurrentSlot(final UInt64 currentTime, final UInt64 genesisTime) { if (currentTime.isLessThan(genesisTime)) { return UInt64.ZERO; } return currentTime.minus(genesisTime).dividedBy(specConfig.getSecondsPerSlot()); } - public UInt64 getCurrentSlotForMillis(UInt64 currentTimeMillis, UInt64 genesisTimeMillis) { + public UInt64 getCurrentSlotForMillis( + final UInt64 currentTimeMillis, final UInt64 genesisTimeMillis) { if (currentTimeMillis.isLessThan(genesisTimeMillis)) { return UInt64.ZERO; } @@ -89,24 +90,24 @@ public UInt64 getCurrentSlotForMillis(UInt64 currentTimeMillis, UInt64 genesisTi .dividedBy(specConfig.getSecondsPerSlot() * MILLIS_PER_SECOND.longValue()); } - public UInt64 getSlotStartTime(UInt64 slotNumber, UInt64 genesisTime) { + public UInt64 getSlotStartTime(final UInt64 slotNumber, final UInt64 genesisTime) { return genesisTime.plus(slotNumber.times(specConfig.getSecondsPerSlot())); } - public UInt64 getSlotStartTimeMillis(UInt64 slotNumber, UInt64 genesisTimeMillis) { + public UInt64 getSlotStartTimeMillis(final UInt64 slotNumber, final UInt64 genesisTimeMillis) { return genesisTimeMillis.plus( slotNumber.times(specConfig.getSecondsPerSlot() * MILLIS_PER_SECOND.longValue())); } - public UInt64 getCurrentSlot(ReadOnlyStore store, boolean useUnixTime) { + public UInt64 getCurrentSlot(final ReadOnlyStore store, final boolean useUnixTime) { return SpecConfig.GENESIS_SLOT.plus(getSlotsSinceGenesis(store, useUnixTime)); } - public UInt64 getCurrentSlot(ReadOnlyStore store) { + public UInt64 getCurrentSlot(final ReadOnlyStore store) { return getCurrentSlot(store, false); } - public UInt64 computeSlotsSinceEpochStart(UInt64 slot) { + public UInt64 computeSlotsSinceEpochStart(final UInt64 slot) { final UInt64 epoch = miscHelpers.computeEpochAtSlot(slot); final UInt64 epochStartSlot = miscHelpers.computeStartSlotAtEpoch(epoch); return slot.minus(epochStartSlot); @@ -123,16 +124,16 @@ public UInt64 computeSlotsSinceEpochStart(UInt64 slot) { * https://github.com/ethereum/consensus-specs/blob/v0.10.1/specs/phase0/fork-choice.md#get_ancestor */ public Optional getAncestor( - ReadOnlyForkChoiceStrategy forkChoiceStrategy, Bytes32 root, UInt64 slot) { + final ReadOnlyForkChoiceStrategy forkChoiceStrategy, final Bytes32 root, final UInt64 slot) { return forkChoiceStrategy.getAncestor(root, slot); } public NavigableMap getAncestors( - ReadOnlyForkChoiceStrategy forkChoiceStrategy, - Bytes32 root, - UInt64 startSlot, - UInt64 step, - UInt64 count) { + final ReadOnlyForkChoiceStrategy forkChoiceStrategy, + final Bytes32 root, + final UInt64 startSlot, + final UInt64 step, + final UInt64 count) { final NavigableMap roots = new TreeMap<>(); // minus(ONE) because the start block is included final UInt64 endSlot = startSlot.plus(step.times(count)).minus(UInt64.ONE); @@ -155,7 +156,9 @@ public NavigableMap getAncestors( * backwards */ public NavigableMap getAncestorsOnFork( - ReadOnlyForkChoiceStrategy forkChoiceStrategy, Bytes32 root, UInt64 startSlot) { + final ReadOnlyForkChoiceStrategy forkChoiceStrategy, + final Bytes32 root, + final UInt64 startSlot) { final NavigableMap roots = new TreeMap<>(); Bytes32 parentRoot = root; Optional parentSlot = forkChoiceStrategy.blockSlot(parentRoot); @@ -366,7 +369,7 @@ public AttestationProcessingResult validateOnAttestation( } private AttestationProcessingResult checkIfAttestationShouldBeSavedForFuture( - ReadOnlyStore store, Attestation attestation) { + final ReadOnlyStore store, final Attestation attestation) { // Attestations can only affect the fork choice of subsequent slots. // Delay consideration in the fork choice until their slot is in the past. @@ -460,7 +463,7 @@ public BlockImportResult checkOnBlockConditions( return BlockImportResult.successful(block); } - private boolean blockIsFromFuture(ReadOnlyStore store, final UInt64 blockSlot) { + private boolean blockIsFromFuture(final ReadOnlyStore store, final UInt64 blockSlot) { return getCurrentSlot(store).compareTo(blockSlot) < 0; } @@ -487,10 +490,10 @@ private boolean blockIsAfterLatestFinalizedSlot( } private boolean hasAncestorAtSlot( - ReadOnlyForkChoiceStrategy forkChoiceStrategy, - Bytes32 root, - UInt64 slot, - Bytes32 ancestorRoot) { + final ReadOnlyForkChoiceStrategy forkChoiceStrategy, + final Bytes32 root, + final UInt64 slot, + final Bytes32 ancestorRoot) { return getAncestor(forkChoiceStrategy, root, slot) .map(ancestorAtSlot -> ancestorAtSlot.equals(ancestorRoot)) .orElse(false); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ValidatorsUtil.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ValidatorsUtil.java index 56b1bba3bc1..63241c6da29 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ValidatorsUtil.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/util/ValidatorsUtil.java @@ -53,7 +53,8 @@ public boolean isEligibleForActivation(final UInt64 finalizedEpoch, final Valida && validator.getActivationEpoch().equals(SpecConfig.FAR_FUTURE_EPOCH); } - public Optional getValidatorIndex(BeaconState state, BLSPublicKey publicKey) { + public Optional getValidatorIndex( + final BeaconState state, final BLSPublicKey publicKey) { return BeaconStateCache.getTransitionCaches(state) .getValidatorIndexCache() .getValidatorIndex(state, publicKey); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/block/BlockProcessorAltair.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/block/BlockProcessorAltair.java index 8fab58322b4..0b910f049b9 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/block/BlockProcessorAltair.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/block/BlockProcessorAltair.java @@ -282,7 +282,7 @@ public void processSyncAggregate( } @Override - public UInt64 computeParticipantReward(BeaconStateAltair state) { + public UInt64 computeParticipantReward(final BeaconStateAltair state) { final UInt64 totalActiveIncrements = beaconStateAccessors .getTotalActiveBalance(state) @@ -357,9 +357,9 @@ public Optional> getExpectedWithdrawals(final BeaconState preSt public static boolean eth2FastAggregateVerify( final BLSSignatureVerifier signatureVerifier, - List pubkeys, - Bytes32 message, - BLSSignature signature) { + final List pubkeys, + final Bytes32 message, + final BLSSignature signature) { // BLS verify logic would throw if we pass in an empty list of public keys, // so if the keys list is empty, return the isInfinity of the signature. // this is equivalent to the spec, and removes the possibility of an empty list diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/statetransition/epoch/RewardsAndPenaltiesCalculatorAltair.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/statetransition/epoch/RewardsAndPenaltiesCalculatorAltair.java index 0632b99526e..d768cb946dc 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/statetransition/epoch/RewardsAndPenaltiesCalculatorAltair.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/statetransition/epoch/RewardsAndPenaltiesCalculatorAltair.java @@ -129,17 +129,13 @@ public void processFlagIndexDeltas(final RewardAndPenaltyDeltas deltas, final in } } - private RewardComponent getComponentForParticipationFlagIndex(int index) { - switch (index) { - case 0: - return RewardComponent.SOURCE; - case 1: - return RewardComponent.TARGET; - case 2: - return RewardComponent.HEAD; - } - - throw new IllegalArgumentException("Invalid participation flag index " + index); + private RewardComponent getComponentForParticipationFlagIndex(final int index) { + return switch (index) { + case 0 -> RewardComponent.SOURCE; + case 1 -> RewardComponent.TARGET; + case 2 -> RewardComponent.HEAD; + default -> throw new IllegalArgumentException("Invalid participation flag index " + index); + }; } /** diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/deneb/types/VersionedHash.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/deneb/types/VersionedHash.java index 46902f579fe..868807639c1 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/deneb/types/VersionedHash.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/deneb/types/VersionedHash.java @@ -26,7 +26,7 @@ public class VersionedHash { final Bytes version; final Bytes value; - private VersionedHash(Bytes version, Bytes value) { + private VersionedHash(final Bytes version, final Bytes value) { this.version = version; this.value = value; } @@ -58,7 +58,7 @@ public String toHexString() { } @Override - public boolean equals(Object o) { + public boolean equals(final Object o) { if (this == o) { return true; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/helpers/PredicatesElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/helpers/PredicatesElectra.java index bb0e2340e02..e803261783e 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/helpers/PredicatesElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/helpers/PredicatesElectra.java @@ -26,7 +26,7 @@ public class PredicatesElectra extends Predicates { private final SpecConfigElectra configElectra; - public PredicatesElectra(SpecConfig specConfig) { + public PredicatesElectra(final SpecConfig specConfig) { super(specConfig); this.configElectra = SpecConfigElectra.required(specConfig); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/block/BlockProcessorPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/block/BlockProcessorPhase0.java index 89448be0760..ff440f43269 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/block/BlockProcessorPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/block/BlockProcessorPhase0.java @@ -107,7 +107,7 @@ public void processSyncAggregate( } @Override - public UInt64 computeParticipantReward(BeaconStateAltair state) { + public UInt64 computeParticipantReward(final BeaconStateAltair state) { return UInt64.ZERO; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/operations/validation/OperationValidatorPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/operations/validation/OperationValidatorPhase0.java index 50e471ae9ec..552849b4aab 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/operations/validation/OperationValidatorPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/operations/validation/OperationValidatorPhase0.java @@ -69,7 +69,7 @@ public Optional validateAttesterSlashing( final Fork fork, final BeaconState state, final AttesterSlashing attesterSlashing, - SlashedIndicesCaptor slashedIndicesCaptor) { + final SlashedIndicesCaptor slashedIndicesCaptor) { return attesterSlashingValidator.validate(fork, state, attesterSlashing, slashedIndicesCaptor); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/operations/validation/VoluntaryExitValidator.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/operations/validation/VoluntaryExitValidator.java index 050a70210e0..7933e43658b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/operations/validation/VoluntaryExitValidator.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/operations/validation/VoluntaryExitValidator.java @@ -80,7 +80,7 @@ public Optional validate( }); } - private Validator getValidator(BeaconState state, VoluntaryExit exit) { + private Validator getValidator(final BeaconState state, final VoluntaryExit exit) { return state.getValidators().get(exit.getValidatorIndex().intValue()); } @@ -102,7 +102,7 @@ public static OperationInvalidReason submittedTooEarly() { return () -> "Specified exit epoch is still in the future"; } - public static OperationInvalidReason validatorTooYoung(UInt64 exitEpoch) { + public static OperationInvalidReason validatorTooYoung(final UInt64 exitEpoch) { return () -> "Validator cannot exit until epoch " + exitEpoch; } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/statetransition/epoch/EpochProcessorPhase0.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/statetransition/epoch/EpochProcessorPhase0.java index 25aeacead77..149ea10da98 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/statetransition/epoch/EpochProcessorPhase0.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/phase0/statetransition/epoch/EpochProcessorPhase0.java @@ -65,7 +65,7 @@ public RewardAndPenaltyDeltas getRewardAndPenaltyDeltas( } @Override - public void processParticipationUpdates(MutableBeaconState genericState) { + public void processParticipationUpdates(final MutableBeaconState genericState) { // Rotate current/previous epoch attestations final MutableBeaconStatePhase0 state = MutableBeaconStatePhase0.required(genericState); state.getPreviousEpochAttestations().setAll(state.getCurrentEpochAttestations()); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/DeletableSigner.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/DeletableSigner.java index d37a75a8382..30bc8d78f54 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/DeletableSigner.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/DeletableSigner.java @@ -115,7 +115,8 @@ public Optional getSigningServiceUrl() { return delegate.getSigningServiceUrl(); } - private SafeFuture sign(ExceptionThrowingFutureSupplier supplier) { + private SafeFuture sign( + final ExceptionThrowingFutureSupplier supplier) { readLock.lock(); final SafeFuture future = deleted ? SafeFuture.failedFuture(new SignerNotActiveException()) : SafeFuture.of(supplier); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/LocalSlashingProtectionRecord.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/LocalSlashingProtectionRecord.java index ddfa0131c9e..ab373978fb5 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/LocalSlashingProtectionRecord.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/LocalSlashingProtectionRecord.java @@ -68,12 +68,13 @@ boolean writeSigningRecord( return true; } - Optional maySignBlock(Bytes32 genesisValidatorsRoot, UInt64 slot) { + Optional maySignBlock( + final Bytes32 genesisValidatorsRoot, final UInt64 slot) { return signingRecord.maySignBlock(genesisValidatorsRoot, slot); } Optional maySignAttestation( - Bytes32 genesisValidatorsRoot, UInt64 sourceEpoch, UInt64 targetEpoch) { + final Bytes32 genesisValidatorsRoot, final UInt64 sourceEpoch, final UInt64 targetEpoch) { return signingRecord.maySignAttestation(genesisValidatorsRoot, sourceEpoch, targetEpoch); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/RejectingSlashingProtector.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/RejectingSlashingProtector.java index 42be295319b..0cc4ca285c3 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/RejectingSlashingProtector.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/RejectingSlashingProtector.java @@ -37,7 +37,7 @@ public SafeFuture maySignAttestation( } @Override - public Optional getSigningRecord(BLSPublicKey validator) { + public Optional getSigningRecord(final BLSPublicKey validator) { return Optional.empty(); } } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/SigningRootUtil.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/SigningRootUtil.java index 2f31b262822..4923887d55f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/SigningRootUtil.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/signatures/SigningRootUtil.java @@ -53,7 +53,7 @@ public Bytes signingRootForSignBlockHeader( blockHeader, getDomainForSignBlock(blockHeader.getSlot(), forkInfo)); } - private Bytes32 getDomainForSignBlock(UInt64 slot, ForkInfo forkInfo) { + private Bytes32 getDomainForSignBlock(final UInt64 slot, final ForkInfo forkInfo) { return spec.getDomain( Domain.BEACON_PROPOSER, spec.computeEpochAtSlot(slot), diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/MappedOperationPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/MappedOperationPool.java index fa2149d31a7..27f9df86004 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/MappedOperationPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/MappedOperationPool.java @@ -109,7 +109,7 @@ public MappedOperationPool( this::updateLocalSubmissionsErrorHandler); } - private void updateLocalSubmissionsErrorHandler(Throwable throwable) { + private void updateLocalSubmissionsErrorHandler(final Throwable throwable) { LOG.debug("Failed to update " + metricType, throwable); } @@ -152,7 +152,7 @@ private void updateLocalSubmissions() { } private static InternalValidationResult rejectForDuplicatedMessage( - String metricType, final int validatorIndex) { + final String metricType, final int validatorIndex) { final String logMessage = String.format( "Cannot add to %s as validator %s is already in this pool.", @@ -264,7 +264,7 @@ public int size() { return operations.size(); } - private SafeFuture add(T item, boolean fromNetwork) { + private SafeFuture add(final T item, final boolean fromNetwork) { final int validatorIndex = item.getValidatorId(); return operationValidator .validateForGossip(item) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/OperationPoolEntry.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/OperationPoolEntry.java index 131a50e900f..837b51f1097 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/OperationPoolEntry.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/OperationPoolEntry.java @@ -25,7 +25,7 @@ public class OperationPoolEntry private UInt64 timeSubmitted; - public OperationPoolEntry(T message, boolean isLocal, final UInt64 timeSubmitted) { + public OperationPoolEntry(final T message, final boolean isLocal, final UInt64 timeSubmitted) { this.message = message; this.isLocal = isLocal; this.timeSubmitted = timeSubmitted; @@ -48,7 +48,7 @@ public void setTimeSubmitted(final UInt64 timeSubmitted) { } @Override - public int compareTo(@NotNull OperationPoolEntry o) { + public int compareTo(final @NotNull OperationPoolEntry o) { if (isLocal && !o.isLocal) { return -1; } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/SimpleOperationPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/SimpleOperationPool.java index 4253eda5a3a..6b35f3ec99c 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/SimpleOperationPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/SimpleOperationPool.java @@ -188,7 +188,7 @@ public Set getAll() { return Collections.unmodifiableSet(operations); } - private SafeFuture add(T item, boolean fromNetwork) { + private SafeFuture add(final T item, final boolean fromNetwork) { return operationValidator .validateForGossip(item) .thenApply( diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AttestationForkChecker.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AttestationForkChecker.java index fb421a7fca1..5dd28b92cee 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AttestationForkChecker.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AttestationForkChecker.java @@ -25,7 +25,7 @@ public class AttestationForkChecker { private final Set validCommitteeShufflingSeeds = new HashSet<>(); - public AttestationForkChecker(final Spec spec, BeaconState state) { + public AttestationForkChecker(final Spec spec, final BeaconState state) { UInt64 epoch = spec.computeEpochAtSlot(state.getSlot()); Bytes32 currentEpochSeed = spec.getSeed(state, epoch, Domain.BEACON_ATTESTER); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AttestationManager.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AttestationManager.java index 736d7ae3e09..950311468fc 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AttestationManager.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AttestationManager.java @@ -102,20 +102,20 @@ public static AttestationManager create( activeValidatorChannel); } - public void subscribeToAllValidAttestations(ProcessedAttestationListener listener) { + public void subscribeToAllValidAttestations(final ProcessedAttestationListener listener) { allValidAttestationsSubscribers.subscribe(listener); } - private void notifyAllValidAttestationsSubscribers(ValidatableAttestation attestation) { + private void notifyAllValidAttestationsSubscribers(final ValidatableAttestation attestation) { allValidAttestationsSubscribers.forEach(s -> s.accept(attestation)); } public void subscribeToAttestationsToSend( - ProcessedAttestationListener attestationsToSendListener) { + final ProcessedAttestationListener attestationsToSendListener) { attestationsToSendSubscribers.subscribe(attestationsToSendListener); } - private void validateForGossipAndNotifySendSubscribers(ValidatableAttestation attestation) { + private void validateForGossipAndNotifySendSubscribers(final ValidatableAttestation attestation) { if (attestation.isAggregate() && !attestation.isAcceptedAsGossip()) { // We know the Attestation is valid, but need to validate the SignedAggregateAndProof wrapper aggregateValidator @@ -265,7 +265,7 @@ public SafeFuture onAttestation( }); } - private void sendToSubscribersIfProducedLocally(ValidatableAttestation attestation) { + private void sendToSubscribersIfProducedLocally(final ValidatableAttestation attestation) { if (!attestation.isProducedLocally()) { return; } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/block/BlockImportChannel.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/block/BlockImportChannel.java index 1aafbde63c2..bc6aac7d415 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/block/BlockImportChannel.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/block/BlockImportChannel.java @@ -31,7 +31,7 @@ SafeFuture importBlock( Optional origin); default SafeFuture importBlock( - SignedBeaconBlock block, BroadcastValidationLevel broadcastValidationLevel) { + final SignedBeaconBlock block, final BroadcastValidationLevel broadcastValidationLevel) { return importBlock(block, broadcastValidationLevel, Optional.empty()); } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/block/BlockImporter.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/block/BlockImporter.java index ae1b8b794fa..d9e8e812088 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/block/BlockImporter.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/block/BlockImporter.java @@ -186,7 +186,7 @@ SafeFuture getLatestCheckpointState() { Objects.equals(curVal, finalizedCheckpoint) ? updatedCheckpoint : curVal)); } - private void notifyBlockOperationSubscribers(SignedBeaconBlock block) { + private void notifyBlockOperationSubscribers(final SignedBeaconBlock block) { final BeaconBlockBody blockBody = block.getMessage().getBody(); attestationSubscribers.forEach( @@ -206,27 +206,30 @@ private void notifyBlockOperationSubscribers(SignedBeaconBlock block) { } public void subscribeToVerifiedBlockAttestations( - VerifiedBlockAttestationListener verifiedBlockAttestationsListener) { + final VerifiedBlockAttestationListener verifiedBlockAttestationsListener) { attestationSubscribers.subscribe(verifiedBlockAttestationsListener); } public void subscribeToVerifiedBlockAttesterSlashings( - VerifiedBlockOperationsListener verifiedBlockAttesterSlashingsListener) { + final VerifiedBlockOperationsListener + verifiedBlockAttesterSlashingsListener) { attesterSlashingSubscribers.subscribe(verifiedBlockAttesterSlashingsListener); } public void subscribeToVerifiedBlockProposerSlashings( - VerifiedBlockOperationsListener verifiedBlockProposerSlashingsListener) { + final VerifiedBlockOperationsListener + verifiedBlockProposerSlashingsListener) { proposerSlashingSubscribers.subscribe(verifiedBlockProposerSlashingsListener); } public void subscribeToVerifiedBlockVoluntaryExits( - VerifiedBlockOperationsListener verifiedBlockVoluntaryExitsListener) { + final VerifiedBlockOperationsListener + verifiedBlockVoluntaryExitsListener) { voluntaryExitSubscribers.subscribe(verifiedBlockVoluntaryExitsListener); } public void subscribeToVerifiedBlockBlsToExecutionChanges( - VerifiedBlockOperationsListener + final VerifiedBlockOperationsListener verifiedBlockBlsToExecutionChangeListener) { blsToExecutionChangeSubscribers.subscribe(verifiedBlockBlsToExecutionChangeListener); } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/events/attestation/ProcessedAggregateEvent.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/events/attestation/ProcessedAggregateEvent.java index 8cdd0380b88..bf313cb9f56 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/events/attestation/ProcessedAggregateEvent.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/events/attestation/ProcessedAggregateEvent.java @@ -21,7 +21,7 @@ public class ProcessedAggregateEvent { private final Attestation attestation; - public ProcessedAggregateEvent(Attestation attestation) { + public ProcessedAggregateEvent(final Attestation attestation) { this.attestation = attestation; } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/events/attestation/ProcessedAttestationEvent.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/events/attestation/ProcessedAttestationEvent.java index 51a73112be7..808cf51d066 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/events/attestation/ProcessedAttestationEvent.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/events/attestation/ProcessedAttestationEvent.java @@ -21,7 +21,7 @@ public class ProcessedAttestationEvent { private final Attestation attestation; - public ProcessedAttestationEvent(Attestation attestation) { + public ProcessedAttestationEvent(final Attestation attestation) { this.attestation = attestation; } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ExpiringInfo.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ExpiringInfo.java index 319eb33786d..e466299827c 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ExpiringInfo.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ExpiringInfo.java @@ -18,7 +18,7 @@ public abstract class ExpiringInfo { private final UInt64 expirySlot; - ExpiringInfo(UInt64 expirySlot) { + ExpiringInfo(final UInt64 expirySlot) { this.expirySlot = expirySlot; } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java index 74b3d53de06..6ff0def8ac9 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java @@ -282,8 +282,8 @@ public void applyIndexedAttestations(final List attestat public void onAttesterSlashing( final AttesterSlashing slashing, - InternalValidationResult validationStatus, - boolean fromNetwork) { + final InternalValidationResult validationStatus, + final boolean fromNetwork) { if (!validationStatus.isAccept()) { return; } @@ -296,7 +296,7 @@ public void onAttesterSlashing( .ifExceptionGetsHereRaiseABug(); } - public void subscribeToOptimisticHeadChangesAndUpdate(OptimisticHeadSubscriber subscriber) { + public void subscribeToOptimisticHeadChangesAndUpdate(final OptimisticHeadSubscriber subscriber) { optimisticSyncSubscribers.subscribe(subscriber); getOptimisticSyncing().ifPresent(subscriber::onOptimisticHeadChanged); } @@ -682,7 +682,7 @@ private Optional computeEarliestBlobSidecarsSlot( earliestAvailabilityWindowSlotBeforeBlock.max(earliestAffectedSlot)); } - private UInt64 getMillisIntoSlot(StoreTransaction transaction, UInt64 millisPerSlot) { + private UInt64 getMillisIntoSlot(final StoreTransaction transaction, final UInt64 millisPerSlot) { return transaction .getTimeInMillis() .minus(secondsToMillis(transaction.getGenesisTime())) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceNotifierImpl.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceNotifierImpl.java index 717ab0e3e99..4a31423efa7 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceNotifierImpl.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceNotifierImpl.java @@ -66,7 +66,8 @@ public ForkChoiceNotifierImpl( } @Override - public void subscribeToForkChoiceUpdatedResult(ForkChoiceUpdatedResultSubscriber subscriber) { + public void subscribeToForkChoiceUpdatedResult( + final ForkChoiceUpdatedResultSubscriber subscriber) { forkChoiceUpdatedSubscribers.subscribe(subscriber); } @@ -96,16 +97,16 @@ public SafeFuture> getPayloadId( } @Override - public void onTerminalBlockReached(Bytes32 executionBlockHash) { + public void onTerminalBlockReached(final Bytes32 executionBlockHash) { eventThread.execute(() -> internalTerminalBlockReached(executionBlockHash)); } @Override - public boolean validatorIsConnected(UInt64 validatorIndex, UInt64 currentSlot) { + public boolean validatorIsConnected(final UInt64 validatorIndex, final UInt64 currentSlot) { return proposersDataManager.validatorIsConnected(validatorIndex, currentSlot); } - private void internalTerminalBlockReached(Bytes32 executionBlockHash) { + private void internalTerminalBlockReached(final Bytes32 executionBlockHash) { eventThread.checkOnEventThread(); LOG.debug("internalTerminalBlockReached executionBlockHash {}", executionBlockHash); forkChoiceUpdateData = forkChoiceUpdateData.withTerminalBlockHash(executionBlockHash); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceStateProvider.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceStateProvider.java index 431c422fcc7..ab4b7b1e81d 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceStateProvider.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceStateProvider.java @@ -22,7 +22,8 @@ public class ForkChoiceStateProvider { private final EventThread forkChoiceExecutor; private final RecentChainData recentChainData; - public ForkChoiceStateProvider(EventThread forkChoiceExecutor, RecentChainData recentChainData) { + public ForkChoiceStateProvider( + final EventThread forkChoiceExecutor, final RecentChainData recentChainData) { this.forkChoiceExecutor = forkChoiceExecutor; this.recentChainData = recentChainData; } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceUpdateData.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceUpdateData.java index d25dd739c0e..e43afda6f19 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceUpdateData.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoiceUpdateData.java @@ -196,7 +196,7 @@ public Optional> send( return Optional.of(forkChoiceUpdatedResult); } - private void logSendForkChoiceUpdatedComplete(Optional payloadId) { + private void logSendForkChoiceUpdatedComplete(final Optional payloadId) { if (LOG.isDebugEnabled()) { LOG.debug( "send - forkChoiceUpdated returned payload id {} for {}, {}", diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/PreparedProposerInfo.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/PreparedProposerInfo.java index d34899dcddc..53a59203ed2 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/PreparedProposerInfo.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/PreparedProposerInfo.java @@ -19,7 +19,7 @@ public class PreparedProposerInfo extends ExpiringInfo { private final Eth1Address feeRecipient; - public PreparedProposerInfo(UInt64 expirySlot, Eth1Address feeRecipient) { + public PreparedProposerInfo(final UInt64 expirySlot, final Eth1Address feeRecipient) { super(expirySlot); this.feeRecipient = feeRecipient; } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ProposersDataManager.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ProposersDataManager.java index 9459df281a8..d85651a2c5f 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ProposersDataManager.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ProposersDataManager.java @@ -85,7 +85,7 @@ public ProposersDataManager( } @Override - public void onSlot(UInt64 slot) { + public void onSlot(final UInt64 slot) { // do clean up in the middle of the epoch final int slotsPerEpoch = spec.getSlotsPerEpoch(slot); final UInt64 slotInCurrentEpoch = slot.mod(slotsPerEpoch).plus(UInt64.ONE); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/TerminalPowBlockMonitor.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/TerminalPowBlockMonitor.java index e7b81b8e170..952a1362cc5 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/TerminalPowBlockMonitor.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/TerminalPowBlockMonitor.java @@ -356,13 +356,13 @@ private synchronized void checkTtdEta(final PowBlock currentHead) { eventLogger.terminalPowBlockTtdEta(latestBlock.getTotalDifficulty(), eta, etaInstant); } - private void onTerminalPowBlockFound(Bytes32 blockHash) { + private void onTerminalPowBlockFound(final Bytes32 blockHash) { foundTerminalBlockHash = Optional.of(blockHash); forkChoiceNotifier.onTerminalBlockReached(blockHash); eventLogger.terminalPowBlockDetected(blockHash); } - private boolean notYetFound(Bytes32 blockHash) { + private boolean notYetFound(final Bytes32 blockHash) { return !foundTerminalBlockHash.map(blockHash::equals).orElse(false); } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/genesis/GenesisHandler.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/genesis/GenesisHandler.java index 115c58e61ff..61ff007fefe 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/genesis/GenesisHandler.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/genesis/GenesisHandler.java @@ -68,7 +68,7 @@ public void onDepositsFromBlock(final DepositsFromBlockEvent event) { } @Override - public void onMinGenesisTimeBlock(MinGenesisTimeBlockEvent event) { + public void onMinGenesisTimeBlock(final MinGenesisTimeBlockEvent event) { if (!recentChainData.isPreGenesis()) { return; } @@ -77,7 +77,7 @@ public void onMinGenesisTimeBlock(MinGenesisTimeBlockEvent event) { } private void processNewData( - Bytes32 blockHash, UInt64 timestamp, List deposits) { + final Bytes32 blockHash, final UInt64 timestamp, final List deposits) { validateDeposits(deposits); final int previousValidatorRequirementPercent = roundPercent(genesisGenerator.getActiveValidatorCount()); @@ -107,13 +107,13 @@ private void validateDeposits(final List deposits) { } } - private int roundPercent(int activeValidatorCount) { + private int roundPercent(final int activeValidatorCount) { return activeValidatorCount * 100 / spec.getGenesisSpecConfig().getMinGenesisActiveValidatorCount(); } - private void eth2Genesis(BeaconState genesisState) { + private void eth2Genesis(final BeaconState genesisState) { recentChainData.initializeFromGenesis(genesisState, timeProvider.getTimeInSeconds()); Bytes32 genesisBlockRoot = recentChainData.getBestBlockRoot().orElseThrow(); EVENT_LOG.genesisEvent( diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SignedContributionAndProofValidator.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SignedContributionAndProofValidator.java index 289be508adb..6864e2f8aa7 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SignedContributionAndProofValidator.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SignedContributionAndProofValidator.java @@ -153,7 +153,7 @@ public SafeFuture validate(final SignedContributionAnd @FormatMethod private SafeFuture futureFailureResult( - final String message, Object... args) { + final String message, final Object... args) { return SafeFuture.completedFuture(reject(message, args)); } @@ -311,7 +311,8 @@ private boolean isInSyncSubcommittee( } private SourceUniquenessKey getUniquenessKey( - final ContributionAndProof contributionAndProof, SyncCommitteeContribution contribution) { + final ContributionAndProof contributionAndProof, + final SyncCommitteeContribution contribution) { return new SourceUniquenessKey( contributionAndProof.getAggregatorIndex(), contribution.getSlot(), diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SyncCommitteeContributionPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SyncCommitteeContributionPool.java index 3e75d4ce48e..1e91d2e371d 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SyncCommitteeContributionPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SyncCommitteeContributionPool.java @@ -51,7 +51,7 @@ public SyncCommitteeContributionPool( } public void subscribeOperationAdded( - OperationAddedSubscriber subscriber) { + final OperationAddedSubscriber subscriber) { subscribers.subscribe(subscriber); } @@ -94,7 +94,7 @@ private synchronized void doAdd(final SyncCommitteeContribution contribution) { } private SyncCommitteeContribution betterContribution( - final SyncCommitteeContribution a, SyncCommitteeContribution b) { + final SyncCommitteeContribution a, final SyncCommitteeContribution b) { if (a == null) { return b; } else if (b == null) { diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SyncCommitteeMessagePool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SyncCommitteeMessagePool.java index eb5970aeb6a..4bf91997c44 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SyncCommitteeMessagePool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/synccommittee/SyncCommitteeMessagePool.java @@ -64,7 +64,7 @@ public SyncCommitteeMessagePool(final Spec spec, final SyncCommitteeMessageValid } public void subscribeOperationAdded( - OperationAddedSubscriber subscriber) { + final OperationAddedSubscriber subscriber) { subscribers.subscribe(subscriber); } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/PendingPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/PendingPool.java index b6dc6a8ac58..663238fac87 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/PendingPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/PendingPool.java @@ -80,7 +80,7 @@ public class PendingPool extends AbstractIgnoringFutureHistoricalSlot { sizeGauge.set(0, itemType); // Init the label so it appears in metrics immediately } - public synchronized void add(T item) { + public synchronized void add(final T item) { if (shouldIgnoreItemAtSlot(targetSlotFunction.apply(item))) { // Ignore items outside of the range we care about return; @@ -128,7 +128,7 @@ public synchronized void add(T item) { orderedPendingItems.add(toSlotAndRoot(item)); } - public synchronized void remove(T item) { + public synchronized void remove(final T item) { final SlotAndRoot itemSlotAndRoot = toSlotAndRoot(item); orderedPendingItems.remove(itemSlotAndRoot); pendingItems.remove(itemSlotAndRoot.getRoot()); @@ -183,7 +183,8 @@ public synchronized Set getAllRequiredBlockRoots() { * {@code includeIndirectDependents} is {@code false}, only item A is returned. * @return The list of items which depend on the given block root. */ - public List getItemsDependingOn(final Bytes32 blockRoot, boolean includeIndirectDependents) { + public List getItemsDependingOn( + final Bytes32 blockRoot, final boolean includeIndirectDependents) { if (includeIndirectDependents) { return getAllItemsDependingOn(blockRoot); } else { diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttestationStateSelector.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttestationStateSelector.java index 1304931c687..624c42bc142 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttestationStateSelector.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttestationStateSelector.java @@ -42,7 +42,7 @@ public class AttestationStateSelector { private final LabelledMetric appliedSelectorRule; public AttestationStateSelector( - final Spec spec, final RecentChainData recentChainData, MetricsSystem metricsSystem) { + final Spec spec, final RecentChainData recentChainData, final MetricsSystem metricsSystem) { this.spec = spec; this.recentChainData = recentChainData; diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttesterSlashingValidator.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttesterSlashingValidator.java index c61db084fd7..711c0340b7e 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttesterSlashingValidator.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/AttesterSlashingValidator.java @@ -36,13 +36,13 @@ public class AttesterSlashingValidator implements OperationValidator seenIndices = LimitedSet.createSynchronized(VALID_VALIDATOR_SET_SIZE); private final Spec spec; - public AttesterSlashingValidator(RecentChainData recentChainData, final Spec spec) { + public AttesterSlashingValidator(final RecentChainData recentChainData, final Spec spec) { this.recentChainData = recentChainData; this.spec = spec; } @Override - public SafeFuture validateForGossip(AttesterSlashing slashing) { + public SafeFuture validateForGossip(final AttesterSlashing slashing) { if (!includesUnseenIndexToSlash(slashing.getIntersectingValidatorIndices())) { LOG.trace("AttesterSlashingValidator: Slashing is not the first one for any validator."); return SafeFuture.completedFuture(InternalValidationResult.IGNORE); @@ -75,7 +75,7 @@ public Optional validateForBlockInclusion( return spec.validateAttesterSlashing(stateAtBlockSlot, slashing); } - private boolean includesUnseenIndexToSlash(Set intersectingIndices) { + private boolean includesUnseenIndexToSlash(final Set intersectingIndices) { return !seenIndices.containsAll(intersectingIndices); } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/GossipValidationHelper.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/GossipValidationHelper.java index a7d0aff4981..f124c925264 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/GossipValidationHelper.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/GossipValidationHelper.java @@ -32,7 +32,7 @@ public class GossipValidationHelper { private final RecentChainData recentChainData; private final UInt64 maxOffsetTimeInSeconds; - public GossipValidationHelper(final Spec spec, RecentChainData recentChainData) { + public GossipValidationHelper(final Spec spec, final RecentChainData recentChainData) { this.spec = spec; this.recentChainData = recentChainData; this.maxOffsetTimeInSeconds = diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/ProposerSlashingValidator.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/ProposerSlashingValidator.java index f07f91f5cbe..abc5e32836b 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/ProposerSlashingValidator.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/ProposerSlashingValidator.java @@ -38,13 +38,13 @@ public class ProposerSlashingValidator implements OperationValidator receivedValidSlashingForProposerSet = LimitedSet.createSynchronized(VALID_VALIDATOR_SET_SIZE); - public ProposerSlashingValidator(final Spec spec, RecentChainData recentChainData) { + public ProposerSlashingValidator(final Spec spec, final RecentChainData recentChainData) { this.spec = spec; this.recentChainData = recentChainData; } @Override - public SafeFuture validateForGossip(ProposerSlashing slashing) { + public SafeFuture validateForGossip(final ProposerSlashing slashing) { if (!isFirstValidSlashingForValidator(slashing)) { LOG.trace( "ProposerSlashingValidator: Slashing is not the first one for the given validator."); @@ -83,7 +83,7 @@ public Optional validateForBlockInclusion( } private SafeFuture> passesProcessProposerSlashingConditions( - ProposerSlashing slashing) { + final ProposerSlashing slashing) { return getState() .thenApply( state -> { @@ -105,7 +105,7 @@ private Optional verifySignature( return Optional.empty(); } - private boolean isFirstValidSlashingForValidator(ProposerSlashing slashing) { + private boolean isFirstValidSlashingForValidator(final ProposerSlashing slashing) { return !receivedValidSlashingForProposerSet.contains( slashing.getHeader1().getMessage().getProposerIndex()); } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/SignedBlsToExecutionChangeValidator.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/SignedBlsToExecutionChangeValidator.java index 05b3e84837d..12c2065da58 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/SignedBlsToExecutionChangeValidator.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/SignedBlsToExecutionChangeValidator.java @@ -110,7 +110,7 @@ private InternalValidationResult processValidationResults( @SuppressWarnings("FormatStringAnnotation") private SafeFuture validateBlsMessage( - BeaconState state, BlsToExecutionChange operation) { + final BeaconState state, final BlsToExecutionChange operation) { return spec.validateBlsToExecutionChange(state, timeProvider.getTimeInSeconds(), operation) .map(reason -> reject(reason.describe())) .map(SafeFuture::completedFuture) @@ -118,7 +118,7 @@ private SafeFuture validateBlsMessage( } private SafeFuture validateBlsMessageSignature( - BeaconState state, SignedBlsToExecutionChange operation) { + final BeaconState state, final SignedBlsToExecutionChange operation) { return spec.atSlot(state.getSlot()) .operationSignatureVerifier() .verifyBlsToExecutionChangeSignatureAsync(state, operation, blsSignatureVerifier) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/VoluntaryExitValidator.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/VoluntaryExitValidator.java index c5bb1fafb99..1119b32251b 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/VoluntaryExitValidator.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/VoluntaryExitValidator.java @@ -40,13 +40,13 @@ public class VoluntaryExitValidator implements OperationValidator receivedValidExitSet = LimitedSet.createSynchronized(VALID_VALIDATOR_SET_SIZE); - public VoluntaryExitValidator(final Spec spec, RecentChainData recentChainData) { + public VoluntaryExitValidator(final Spec spec, final RecentChainData recentChainData) { this.spec = spec; this.recentChainData = recentChainData; } @Override - public SafeFuture validateForGossip(SignedVoluntaryExit exit) { + public SafeFuture validateForGossip(final SignedVoluntaryExit exit) { if (!isFirstValidExitForValidator(exit)) { LOG.trace( "VoluntaryExitValidator: Exit is not the first one for validator {}.", @@ -89,7 +89,8 @@ public Optional validateForBlockInclusion( return getFailureReason(stateAtBlockSlot, exit); } - private SafeFuture> getFailureReason(SignedVoluntaryExit exit) { + private SafeFuture> getFailureReason( + final SignedVoluntaryExit exit) { return getState().thenApply(state -> getFailureReason(state, exit)); } @@ -106,7 +107,7 @@ private Optional getFailureReason( return Optional.empty(); } - private boolean isFirstValidExitForValidator(SignedVoluntaryExit exit) { + private boolean isFirstValidExitForValidator(final SignedVoluntaryExit exit) { return !receivedValidExitSet.contains(exit.getMessage().getValidatorIndex()); } diff --git a/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/WeakSubjectivityValidator.java b/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/WeakSubjectivityValidator.java index 83e566abc6d..93387834aab 100644 --- a/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/WeakSubjectivityValidator.java +++ b/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/WeakSubjectivityValidator.java @@ -48,8 +48,8 @@ public class WeakSubjectivityValidator { WeakSubjectivityValidator( final WeakSubjectivityConfig config, - WeakSubjectivityCalculator calculator, - WeakSubjectivityViolationPolicy violationPolicy) { + final WeakSubjectivityCalculator calculator, + final WeakSubjectivityViolationPolicy violationPolicy) { this.spec = config.getSpec(); this.calculator = calculator; this.violationPolicy = violationPolicy; @@ -93,7 +93,7 @@ public Optional getWSCheckpoint() { /** Check whether the chain matches any configured weak subjectivity checkpoint or state */ public SafeFuture validateChainIsConsistentWithWSCheckpoint( - CombinedChainDataClient chainData) { + final CombinedChainDataClient chainData) { if (config.getWeakSubjectivityCheckpoint().isEmpty()) { // Nothing to validate against return SafeFuture.COMPLETE; @@ -175,7 +175,7 @@ public void validateLatestFinalizedCheckpoint( } public boolean isBlockValid( - final SignedBeaconBlock block, ReadOnlyForkChoiceStrategy forkChoiceStrategy) { + final SignedBeaconBlock block, final ReadOnlyForkChoiceStrategy forkChoiceStrategy) { if (config.getWeakSubjectivityCheckpoint().isEmpty()) { return true; } @@ -208,7 +208,7 @@ public boolean isBlockValid( * @param message An error message * @param error The error encountered */ - public void handleValidationFailure(final String message, Throwable error) { + public void handleValidationFailure(final String message, final Throwable error) { violationPolicy.onFailedToPerformValidation(message, error); } @@ -257,7 +257,7 @@ Optional getSuppressWSPeriodChecksUntilEpoch(final UInt64 currentSlot) { return suppressWSPeriodErrorsUntilEpoch; } - public boolean isWithinWSPeriod(CheckpointState checkpointState, UInt64 currentSlot) { + public boolean isWithinWSPeriod(final CheckpointState checkpointState, final UInt64 currentSlot) { return calculator.isWithinWeakSubjectivityPeriod(checkpointState, currentSlot); } diff --git a/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/config/WeakSubjectivityConfig.java b/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/config/WeakSubjectivityConfig.java index 8b23014a26d..9aae7f90eeb 100644 --- a/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/config/WeakSubjectivityConfig.java +++ b/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/config/WeakSubjectivityConfig.java @@ -32,8 +32,8 @@ public class WeakSubjectivityConfig { private final Optional suppressWSPeriodChecksUntilEpoch; private WeakSubjectivityConfig( - Spec spec, - UInt64 safetyDecay, + final Spec spec, + final UInt64 safetyDecay, final Optional weakSubjectivityCheckpoint, final Optional suppressWSPeriodChecksUntilEpoch) { this.spec = spec; @@ -135,11 +135,12 @@ public Builder specProvider(final Spec spec) { return this; } - public Builder weakSubjectivityCheckpoint(Checkpoint weakSubjectivityCheckpoint) { + public Builder weakSubjectivityCheckpoint(final Checkpoint weakSubjectivityCheckpoint) { return weakSubjectivityCheckpoint(Optional.of(weakSubjectivityCheckpoint)); } - public Builder weakSubjectivityCheckpoint(Optional weakSubjectivityCheckpoint) { + public Builder weakSubjectivityCheckpoint( + final Optional weakSubjectivityCheckpoint) { checkNotNull(weakSubjectivityCheckpoint); this.weakSubjectivityCheckpoint = weakSubjectivityCheckpoint; return this; @@ -157,7 +158,7 @@ public Builder suppressWSPeriodChecksUntilEpoch( return this; } - public Builder safetyDecay(UInt64 safetyDecay) { + public Builder safetyDecay(final UInt64 safetyDecay) { this.safetyDecay = safetyDecay; return this; } diff --git a/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/policies/ExitingWeakSubjectivityViolationPolicy.java b/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/policies/ExitingWeakSubjectivityViolationPolicy.java index fbd9b157ee4..8aa82b956c8 100644 --- a/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/policies/ExitingWeakSubjectivityViolationPolicy.java +++ b/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/policies/ExitingWeakSubjectivityViolationPolicy.java @@ -24,13 +24,15 @@ class ExitingWeakSubjectivityViolationPolicy implements WeakSubjectivityViolatio @Override public void onFinalizedCheckpointOutsideOfWeakSubjectivityPeriod( - UInt64 currentEpoch, CheckpointState latestFinalizedCheckpoint, final UInt64 wsPeriod) { + final UInt64 currentEpoch, + final CheckpointState latestFinalizedCheckpoint, + final UInt64 wsPeriod) { exitClient(); } @Override public void onChainInconsistentWithWeakSubjectivityCheckpoint( - Checkpoint wsCheckpoint, Bytes32 blockRoot, final UInt64 blockSlot) { + final Checkpoint wsCheckpoint, final Bytes32 blockRoot, final UInt64 blockSlot) { exitClient(); } diff --git a/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/policies/LoggingWeakSubjectivityViolationPolicy.java b/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/policies/LoggingWeakSubjectivityViolationPolicy.java index 88a52813f4a..24b0144a94d 100644 --- a/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/policies/LoggingWeakSubjectivityViolationPolicy.java +++ b/ethereum/weaksubjectivity/src/main/java/tech/pegasys/teku/weaksubjectivity/policies/LoggingWeakSubjectivityViolationPolicy.java @@ -29,7 +29,7 @@ class LoggingWeakSubjectivityViolationPolicy implements WeakSubjectivityViolatio private final WeakSubjectivityLogger wsLogger; public LoggingWeakSubjectivityViolationPolicy( - final WeakSubjectivityLogger wsLogger, Level level) { + final WeakSubjectivityLogger wsLogger, final Level level) { this.level = level; this.wsLogger = wsLogger; } @@ -51,7 +51,7 @@ public void onFinalizedCheckpointOutsideOfWeakSubjectivityPeriod( @Override public void onChainInconsistentWithWeakSubjectivityCheckpoint( - Checkpoint wsCheckpoint, Bytes32 blockRoot, final UInt64 blockSlot) { + final Checkpoint wsCheckpoint, final Bytes32 blockRoot, final UInt64 blockSlot) { wsLogger.chainInconsistentWithWeakSubjectivityCheckpoint( level, blockRoot, blockSlot, wsCheckpoint.getRoot(), wsCheckpoint.getEpoch()); }