From fbe989865343a352b392607504d047b76ea9e0e7 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Wed, 10 Apr 2024 15:35:49 -0600 Subject: [PATCH 01/59] Refactor Gas Calculator Create methods (#6905) Preparatory for EOF. Refactor the gas calculation logic so that it does not depend on specific stack entries, and break out the pieces of the calculation for readability. Signed-off-by: Danno Ferrin Co-authored-by: Justin Florentine Co-authored-by: Danno Ferrin --- .../mainnet/MainnetTransactionProcessor.java | 2 +- .../privacy/PrivateTransactionProcessor.java | 2 +- .../java/org/hyperledger/besu/evm/EVM.java | 20 ++++-- .../ConstantinopleGasCalculator.java | 25 +++++-- .../gascalculator/FrontierGasCalculator.java | 71 ++++++++++++++----- .../besu/evm/gascalculator/GasCalculator.java | 31 ++++++++ .../gascalculator/ShanghaiGasCalculator.java | 17 ++--- .../hyperledger/besu/evm/internal/Words.java | 40 ++++++++++- .../operation/AbstractCreateOperation.java | 27 +++++-- .../besu/evm/operation/Create2Operation.java | 34 +++++++-- .../besu/evm/operation/CreateOperation.java | 32 ++++++++- .../processor/AbstractMessageProcessor.java | 13 +++- .../besu/evm/internal/WordsTest.java | 58 ++++++++++++++- .../AbstractCreateOperationTest.java | 25 ++++++- .../evm/operations/Create2OperationTest.java | 18 +++-- 15 files changed, 339 insertions(+), 76 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java index 3b802785ba6..9f849bd9a2b 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java @@ -400,7 +400,7 @@ public TransactionProcessingResult processTransaction( .address(contractAddress) .contract(contractAddress) .inputData(Bytes.EMPTY) - .code(contractCreationProcessor.getCodeFromEVM(null, initCodeBytes)) + .code(contractCreationProcessor.getCodeFromEVMUncached(initCodeBytes)) .build(); } else { @SuppressWarnings("OptionalGetWithoutIsPresent") // isContractCall tests isPresent diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionProcessor.java index 9c85fb39fb3..5fbadd06538 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionProcessor.java @@ -144,7 +144,7 @@ public TransactionProcessingResult processTransaction( .address(privateContractAddress) .contract(privateContractAddress) .inputData(Bytes.EMPTY) - .code(contractCreationProcessor.getCodeFromEVM(null, initCodeBytes)) + .code(contractCreationProcessor.getCodeFromEVMUncached(initCodeBytes)) .build(); } else { final Address to = transaction.getTo().get(); diff --git a/evm/src/main/java/org/hyperledger/besu/evm/EVM.java b/evm/src/main/java/org/hyperledger/besu/evm/EVM.java index 38501ebf29f..ea490d9ff50 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/EVM.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/EVM.java @@ -14,6 +14,7 @@ */ package org.hyperledger.besu.evm; +import static com.google.common.base.Preconditions.checkNotNull; import static org.hyperledger.besu.evm.operation.PushOperation.PUSH_BASE; import static org.hyperledger.besu.evm.operation.SwapOperation.SWAP_BASE; @@ -348,13 +349,22 @@ public Operation[] getOperationsUnsafe() { * @return the code */ public Code getCode(final Hash codeHash, final Bytes codeBytes) { - Code result = codeHash == null ? null : codeCache.getIfPresent(codeHash); + checkNotNull(codeHash); + Code result = codeCache.getIfPresent(codeHash); if (result == null) { - result = CodeFactory.createCode(codeBytes, evmSpecVersion.getMaxEofVersion(), false); - if (codeHash != null) { - codeCache.put(codeHash, result); - } + result = getCodeUncached(codeBytes); + codeCache.put(codeHash, result); } return result; } + + /** + * Gets code skipping the code cache. + * + * @param codeBytes the code bytes + * @return the code + */ + public Code getCodeUncached(final Bytes codeBytes) { + return CodeFactory.createCode(codeBytes, evmSpecVersion.getMaxEofVersion(), false); + } } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ConstantinopleGasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ConstantinopleGasCalculator.java index 0284269c4db..c252d7ed433 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ConstantinopleGasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ConstantinopleGasCalculator.java @@ -15,14 +15,12 @@ package org.hyperledger.besu.evm.gascalculator; import static org.hyperledger.besu.evm.internal.Words.clampedAdd; -import static org.hyperledger.besu.evm.internal.Words.clampedMultiply; -import static org.hyperledger.besu.evm.internal.Words.clampedToLong; +import static org.hyperledger.besu.evm.internal.Words.clampedToInt; import org.hyperledger.besu.evm.frame.MessageFrame; import java.util.function.Supplier; -import org.apache.tuweni.bytes.Bytes32; import org.apache.tuweni.units.bigints.UInt256; /** The Constantinople gas calculator. */ @@ -39,12 +37,25 @@ public class ConstantinopleGasCalculator extends ByzantiumGasCalculator { private static final long EXTCODE_HASH_COST = 400L; + /** + * Returns the amount of gas the CREATE2 operation will consume. + * + * @param frame The current frame + * @return the amount of gas the CREATE2 operation will consume + * @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link + * #memoryExpansionGasCost(MessageFrame, long, long)}, {@link #createKeccakCost(int)}, and + * {@link #initcodeCost(int)}. As done in {@link + * org.hyperledger.besu.evm.operation.Create2Operation#cost(MessageFrame, Supplier)} + */ + @SuppressWarnings("removal") @Override + @Deprecated(since = "24.4.1", forRemoval = true) public long create2OperationGasCost(final MessageFrame frame) { - final long initCodeLength = clampedToLong(frame.getStackItem(2)); - final long numWords = clampedAdd(initCodeLength, 31) / Bytes32.SIZE; - final long initCodeHashCost = clampedMultiply(KECCAK256_OPERATION_WORD_GAS_COST, numWords); - return clampedAdd(createOperationGasCost(frame), initCodeHashCost); + final int inputOffset = clampedToInt(frame.getStackItem(1)); + final int inputSize = clampedToInt(frame.getStackItem(2)); + return clampedAdd( + clampedAdd(txCreateCost(), memoryExpansionGasCost(frame, inputOffset, inputSize)), + clampedAdd(createKeccakCost(inputSize), initcodeCost(inputSize))); } @Override diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/FrontierGasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/FrontierGasCalculator.java index 5401394d050..09ea7c29e18 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/FrontierGasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/FrontierGasCalculator.java @@ -16,13 +16,14 @@ import static org.hyperledger.besu.evm.internal.Words.clampedAdd; import static org.hyperledger.besu.evm.internal.Words.clampedMultiply; +import static org.hyperledger.besu.evm.internal.Words.clampedToInt; import static org.hyperledger.besu.evm.internal.Words.clampedToLong; +import static org.hyperledger.besu.evm.internal.Words.numWords; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.evm.account.Account; import org.hyperledger.besu.evm.frame.MessageFrame; -import org.hyperledger.besu.evm.internal.Words; import org.hyperledger.besu.evm.operation.ExpOperation; import java.util.function.Supplier; @@ -150,7 +151,7 @@ public long codeDepositGasCost(final int codeSize) { @Override public long idPrecompiledContractGasCost(final Bytes input) { - return ID_PRECOMPILED_WORD_GAS_COST * Words.numWords(input) + ID_PRECOMPILED_BASE_GAS_COST; + return ID_PRECOMPILED_WORD_GAS_COST * numWords(input) + ID_PRECOMPILED_BASE_GAS_COST; } @Override @@ -160,13 +161,12 @@ public long getEcrecPrecompiledContractGasCost() { @Override public long sha256PrecompiledContractGasCost(final Bytes input) { - return SHA256_PRECOMPILED_WORD_GAS_COST * Words.numWords(input) - + SHA256_PRECOMPILED_BASE_GAS_COST; + return SHA256_PRECOMPILED_WORD_GAS_COST * numWords(input) + SHA256_PRECOMPILED_BASE_GAS_COST; } @Override public long ripemd160PrecompiledContractGasCost(final Bytes input) { - return RIPEMD160_PRECOMPILED_WORD_GAS_COST * Words.numWords(input) + return RIPEMD160_PRECOMPILED_WORD_GAS_COST * numWords(input) + RIPEMD160_PRECOMPILED_BASE_GAS_COST; } @@ -305,13 +305,57 @@ public long gasAvailableForChildCall( } } + /** + * Returns the amount of gas the CREATE operation will consume. + * + * @param frame The current frame + * @return the amount of gas the CREATE operation will consume + * @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link + * #memoryExpansionGasCost(MessageFrame, long, long)}, and {@link #initcodeCost(int)} As done + * in {@link org.hyperledger.besu.evm.operation.CreateOperation#cost(MessageFrame, Supplier)} + */ + @SuppressWarnings("removal") @Override + @Deprecated(since = "24.4.1", forRemoval = true) public long createOperationGasCost(final MessageFrame frame) { final long initCodeOffset = clampedToLong(frame.getStackItem(1)); - final long initCodeLength = clampedToLong(frame.getStackItem(2)); + final int initCodeLength = clampedToInt(frame.getStackItem(2)); - final long memoryGasCost = memoryExpansionGasCost(frame, initCodeOffset, initCodeLength); - return clampedAdd(CREATE_OPERATION_GAS_COST, memoryGasCost); + return clampedAdd( + clampedAdd(txCreateCost(), memoryExpansionGasCost(frame, initCodeOffset, initCodeLength)), + initcodeCost(initCodeLength)); + } + + /** + * Returns the amount of gas the CREATE2 operation will consume. + * + * @param frame The current frame + * @return the amount of gas the CREATE2 operation will consume + * @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link + * #memoryExpansionGasCost(MessageFrame, long, long)}, {@link #createKeccakCost(int)}, and + * {@link #initcodeCost(int)} + */ + @SuppressWarnings("removal") + @Override + @Deprecated(since = "24.4.1", forRemoval = true) + public long create2OperationGasCost(final MessageFrame frame) { + throw new UnsupportedOperationException( + "CREATE2 operation not supported by " + getClass().getSimpleName()); + } + + @Override + public long txCreateCost() { + return CREATE_OPERATION_GAS_COST; + } + + @Override + public long createKeccakCost(final int initCodeLength) { + return clampedMultiply(KECCAK256_OPERATION_WORD_GAS_COST, numWords(initCodeLength)); + } + + @Override + public long initcodeCost(final int initCodeLength) { + return 0; } @Override @@ -437,12 +481,6 @@ public long keccak256OperationGasCost( length); } - @Override - public long create2OperationGasCost(final MessageFrame frame) { - throw new UnsupportedOperationException( - "CREATE2 operation not supported by " + getClass().getSimpleName()); - } - @Override public long getSloadOperationGasCost() { return SLOAD_OPERATION_GAS_COST; @@ -487,9 +525,8 @@ protected long copyWordsToMemoryGasCost( final long wordGasCost, final long offset, final long length) { - final long numWords = length / 32 + (length % 32 == 0 ? 0 : 1); - - final long copyCost = clampedAdd(clampedMultiply(wordGasCost, numWords), baseGasCost); + final long copyCost = + clampedAdd(clampedMultiply(wordGasCost, numWords(clampedToInt(length))), baseGasCost); final long memoryCost = memoryExpansionGasCost(frame, offset, length); return clampedAdd(copyCost, memoryCost); diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/GasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/GasCalculator.java index 5efcf0785fb..11489056812 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/GasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/GasCalculator.java @@ -232,7 +232,10 @@ long callOperationGasCost( * * @param frame The current frame * @return the amount of gas the CREATE operation will consume + * @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link + * #memoryExpansionGasCost(MessageFrame, long, long)}, and {@link #initcodeCost(int)} */ + @Deprecated(since = "24.4.1", forRemoval = true) long createOperationGasCost(MessageFrame frame); /** @@ -240,9 +243,37 @@ long callOperationGasCost( * * @param frame The current frame * @return the amount of gas the CREATE2 operation will consume + * @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link + * #memoryExpansionGasCost(MessageFrame, long, long)}, {@link #createKeccakCost(int)}, and + * {@link #initcodeCost(int)} */ + @Deprecated(since = "24.4.1", forRemoval = true) long create2OperationGasCost(MessageFrame frame); + /** + * Returns the base create cost, or TX_CREATE_COST as defined in the execution specs + * + * @return the TX_CREATE value for this gas schedule + */ + long txCreateCost(); + + /** + * For Creates that need to hash the initcode, this is the gas cost for such hashing + * + * @param initCodeLength length of the init code, in bytes + * @return gas cost to charge for hashing + */ + long createKeccakCost(int initCodeLength); + + /** + * The cost of a create operation's initcode charge. This is just the initcode cost, separate from + * the operation base cost and initcode hashing cost. + * + * @param initCodeLength Number of bytes in the initcode + * @return the gas cost for the create initcode + */ + long initcodeCost(final int initCodeLength); + /** * Returns the amount of gas parent will provide its child CREATE. * diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ShanghaiGasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ShanghaiGasCalculator.java index 68a0415eb0e..c4bc5ad743d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ShanghaiGasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ShanghaiGasCalculator.java @@ -14,10 +14,9 @@ * * SPDX-License-Identifier: Apache-2.0 */ -import static org.hyperledger.besu.evm.internal.Words.clampedAdd; -import static org.hyperledger.besu.evm.internal.Words.clampedToLong; -import org.hyperledger.besu.evm.frame.MessageFrame; +import static org.hyperledger.besu.evm.internal.Words.clampedAdd; +import static org.hyperledger.besu.evm.internal.Words.numWords; import org.apache.tuweni.bytes.Bytes; @@ -44,20 +43,14 @@ public ShanghaiGasCalculator() { public long transactionIntrinsicGasCost(final Bytes payload, final boolean isContractCreation) { long intrinsicGasCost = super.transactionIntrinsicGasCost(payload, isContractCreation); if (isContractCreation) { - return clampedAdd(intrinsicGasCost, calculateInitGasCost(payload.size())); + return clampedAdd(intrinsicGasCost, initcodeCost(payload.size())); } else { return intrinsicGasCost; } } @Override - public long createOperationGasCost(final MessageFrame frame) { - final long initCodeLength = clampedToLong(frame.getStackItem(2)); - return clampedAdd(super.createOperationGasCost(frame), calculateInitGasCost(initCodeLength)); - } - - private static long calculateInitGasCost(final long initCodeLength) { - final int dataLength = (int) Math.ceil(initCodeLength / 32.0); - return dataLength * INIT_CODE_COST; + public long initcodeCost(final int initCodeLength) { + return numWords(initCodeLength) * INIT_CODE_COST; } } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java index 20afb2bcbb4..1f53c4ba2d3 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java @@ -72,7 +72,20 @@ static int numWords(final Bytes input) { } /** - * The value of the bytes as though it was representing an unsigned integer, however if the value + * The number of words corresponding to the provided length. + * + *

In other words, this computes {@code input.size() / 32} but rounded up. + * + * @param length the byte length to check + * @return the number of (32 bytes) words that {@code input} spans. + */ + static int numWords(final int length) { + // m/n round up == (m + n - 1)/n: http://www.cs.nott.ac.uk/~psarb2/G51MPC/slides/NumberLogic.pdf + return (length + Bytes32.SIZE - 1) / Bytes32.SIZE; + } + + /** + * The value of the bytes as though it was representing an unsigned long, however if the value * exceeds Long.MAX_VALUE then Long.MAX_VALUE will be returned. * * @param uint the unsigned integer @@ -94,6 +107,29 @@ static long clampedToLong(final Bytes uint) { } } + /** + * The value of the bytes as though it was representing an unsigned integer, however if the value + * exceeds Integer.MAX_VALUE then Integer.MAX_VALUE will be returned. + * + * @param uint the unsigned integer + * @return the least of the integer value or Integer.MAX_VALUE + */ + static int clampedToInt(final Bytes uint) { + if (uint.size() <= 4) { + final int result = uint.toInt(); + return result < 0 ? Integer.MAX_VALUE : result; + } + + final Bytes trimmed = uint.trimLeadingZeros(); + if (trimmed.size() <= 4) { + final int result = trimmed.toInt(); + return result < 0 ? Integer.MAX_VALUE : result; + } else { + // clamp to the largest int. + return Integer.MAX_VALUE; + } + } + /** * The value of the long as though it was representing an unsigned integer, however if the value * is out of range it will return the number at the end of the range. @@ -170,7 +206,7 @@ static int readBigEndianU16(final int index, final byte[] array) { if (index + 1 >= array.length) { throw new IndexOutOfBoundsException(); } - return ((array[index] & 0xff) << 8) | (array[index + 1] & 0xff); + return ((array[index] << 8) & 0xff00) | (array[index + 1] & 0xff); } /** diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java index e4fec2dbfb8..f18461e2c09 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java @@ -29,6 +29,7 @@ import org.hyperledger.besu.evm.internal.Words; import java.util.Optional; +import java.util.function.Supplier; import org.apache.tuweni.bytes.Bytes; @@ -70,7 +71,9 @@ public OperationResult execute(final MessageFrame frame, final EVM evm) { return UNDERFLOW_RESPONSE; } - final long cost = cost(frame); + Supplier codeSupplier = () -> getInitCode(frame, evm); + + final long cost = cost(frame, codeSupplier); if (frame.isStatic()) { return new OperationResult(cost, ExceptionalHaltReason.ILLEGAL_STATE_CHANGE); } else if (frame.getRemainingGas() < cost) { @@ -91,7 +94,8 @@ public OperationResult execute(final MessageFrame frame, final EVM evm) { if (value.compareTo(account.getBalance()) > 0 || frame.getDepth() >= 1024 - || account.getNonce() == -1) { + || account.getNonce() == -1 + || codeSupplier.get() == null) { fail(frame); } else { account.incrementNonce(); @@ -99,7 +103,7 @@ public OperationResult execute(final MessageFrame frame, final EVM evm) { final Bytes inputData = frame.readMemory(inputOffset, inputSize); // Never cache CREATEx initcode. The amount of reuse is very low, and caching mostly // addresses disk loading delay, and we already have the code. - Code code = evm.getCode(null, inputData); + Code code = evm.getCodeUncached(inputData); if (code.isValid() && frame.getCode().getEofVersion() <= code.getEofVersion()) { frame.decrementRemainingGas(cost); @@ -117,17 +121,28 @@ public OperationResult execute(final MessageFrame frame, final EVM evm) { * Cost operation. * * @param frame the frame + * @param codeSupplier a supplier for the initcode, if needed for costing * @return the long */ - protected abstract long cost(final MessageFrame frame); + protected abstract long cost(final MessageFrame frame, Supplier codeSupplier); /** * Target contract address. * * @param frame the frame + * @param initcode the initcode for the new contract. * @return the address */ - protected abstract Address targetContractAddress(MessageFrame frame); + protected abstract Address targetContractAddress(MessageFrame frame, Code initcode); + + /** + * Gets the initcode that will be run. + * + * @param frame The message frame the operation executed in + * @param evm the EVM executing the message frame + * @return the initcode, raw bytes, unparsed and unvalidated + */ + protected abstract Code getInitCode(MessageFrame frame, EVM evm); private void fail(final MessageFrame frame) { final long inputOffset = clampedToLong(frame.getStackItem(1)); @@ -140,7 +155,7 @@ private void fail(final MessageFrame frame) { private void spawnChildMessage(final MessageFrame parent, final Code code, final EVM evm) { final Wei value = Wei.wrap(parent.getStackItem(0)); - final Address contractAddress = targetContractAddress(parent); + final Address contractAddress = targetContractAddress(parent, code); final long childGasStipend = gasCalculator().gasAvailableForChildCreate(parent.getRemainingGas()); diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/Create2Operation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/Create2Operation.java index 8d4fd36250f..bdf7172f363 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/Create2Operation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/Create2Operation.java @@ -15,12 +15,18 @@ package org.hyperledger.besu.evm.operation; import static org.hyperledger.besu.crypto.Hash.keccak256; +import static org.hyperledger.besu.evm.internal.Words.clampedAdd; +import static org.hyperledger.besu.evm.internal.Words.clampedToInt; import static org.hyperledger.besu.evm.internal.Words.clampedToLong; import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.evm.Code; +import org.hyperledger.besu.evm.EVM; import org.hyperledger.besu.evm.frame.MessageFrame; import org.hyperledger.besu.evm.gascalculator.GasCalculator; +import java.util.function.Supplier; + import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; @@ -40,20 +46,34 @@ public Create2Operation(final GasCalculator gasCalculator, final int maxInitcode } @Override - public Address targetContractAddress(final MessageFrame frame) { + public long cost(final MessageFrame frame, final Supplier unused) { + final int inputOffset = clampedToInt(frame.getStackItem(1)); + final int inputSize = clampedToInt(frame.getStackItem(2)); + return clampedAdd( + clampedAdd( + gasCalculator().txCreateCost(), + gasCalculator().memoryExpansionGasCost(frame, inputOffset, inputSize)), + clampedAdd( + gasCalculator().createKeccakCost(inputSize), gasCalculator().initcodeCost(inputSize))); + } + + @Override + public Address targetContractAddress(final MessageFrame frame, final Code initcode) { final Address sender = frame.getRecipientAddress(); - final long offset = clampedToLong(frame.getStackItem(1)); - final long length = clampedToLong(frame.getStackItem(2)); final Bytes32 salt = Bytes32.leftPad(frame.getStackItem(3)); - final Bytes initCode = frame.readMutableMemory(offset, length); - final Bytes32 hash = keccak256(Bytes.concatenate(PREFIX, sender, salt, keccak256(initCode))); + final Bytes32 hash = keccak256(Bytes.concatenate(PREFIX, sender, salt, initcode.getCodeHash())); final Address address = Address.extract(hash); frame.warmUpAddress(address); return address; } @Override - public long cost(final MessageFrame frame) { - return gasCalculator().create2OperationGasCost(frame); + protected Code getInitCode(final MessageFrame frame, final EVM evm) { + final long inputOffset = clampedToLong(frame.getStackItem(1)); + final long inputSize = clampedToLong(frame.getStackItem(2)); + final Bytes inputData = frame.readMemory(inputOffset, inputSize); + // Never cache CREATEx initcode. The amount of reuse is very low, and caching mostly + // addresses disk loading delay, and we already have the code. + return evm.getCodeUncached(inputData); } } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CreateOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CreateOperation.java index d5d311e337c..c0332f378c6 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CreateOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CreateOperation.java @@ -14,11 +14,21 @@ */ package org.hyperledger.besu.evm.operation; +import static org.hyperledger.besu.evm.internal.Words.clampedAdd; +import static org.hyperledger.besu.evm.internal.Words.clampedToInt; +import static org.hyperledger.besu.evm.internal.Words.clampedToLong; + import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.evm.Code; +import org.hyperledger.besu.evm.EVM; import org.hyperledger.besu.evm.account.Account; import org.hyperledger.besu.evm.frame.MessageFrame; import org.hyperledger.besu.evm.gascalculator.GasCalculator; +import java.util.function.Supplier; + +import org.apache.tuweni.bytes.Bytes; + /** The Create operation. */ public class CreateOperation extends AbstractCreateOperation { @@ -33,12 +43,18 @@ public CreateOperation(final GasCalculator gasCalculator, final int maxInitcodeS } @Override - public long cost(final MessageFrame frame) { - return gasCalculator().createOperationGasCost(frame); + public long cost(final MessageFrame frame, final Supplier unused) { + final int inputOffset = clampedToInt(frame.getStackItem(1)); + final int inputSize = clampedToInt(frame.getStackItem(2)); + return clampedAdd( + clampedAdd( + gasCalculator().txCreateCost(), + gasCalculator().memoryExpansionGasCost(frame, inputOffset, inputSize)), + gasCalculator().initcodeCost(inputSize)); } @Override - protected Address targetContractAddress(final MessageFrame frame) { + protected Address targetContractAddress(final MessageFrame frame, final Code initcode) { final Account sender = frame.getWorldUpdater().get(frame.getRecipientAddress()); // Decrement nonce by 1 to normalize the effect of transaction execution final Address address = @@ -46,4 +62,14 @@ protected Address targetContractAddress(final MessageFrame frame) { frame.warmUpAddress(address); return address; } + + @Override + protected Code getInitCode(final MessageFrame frame, final EVM evm) { + final long inputOffset = clampedToLong(frame.getStackItem(1)); + final long inputSize = clampedToLong(frame.getStackItem(2)); + final Bytes inputData = frame.readMemory(inputOffset, inputSize); + // Never cache CREATEx initcode. The amount of reuse is very low, and caching mostly + // addresses disk loading delay, and we already have the code. + return evm.getCodeUncached(inputData); + } } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/processor/AbstractMessageProcessor.java b/evm/src/main/java/org/hyperledger/besu/evm/processor/AbstractMessageProcessor.java index 2bc98b58efc..7116229c48c 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/processor/AbstractMessageProcessor.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/processor/AbstractMessageProcessor.java @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.stream.Collectors; +import javax.annotation.Nonnull; import org.apache.tuweni.bytes.Bytes; @@ -237,7 +238,17 @@ public void process(final MessageFrame frame, final OperationTracer operationTra * @param codeBytes the code bytes * @return the code from evm */ - public Code getCodeFromEVM(final Hash codeHash, final Bytes codeBytes) { + public Code getCodeFromEVM(@Nonnull final Hash codeHash, final Bytes codeBytes) { return evm.getCode(codeHash, codeBytes); } + + /** + * Gets code from evm, skipping the code cache + * + * @param codeBytes the code bytes + * @return the code from evm + */ + public Code getCodeFromEVMUncached(final Bytes codeBytes) { + return evm.getCodeUncached(codeBytes); + } } diff --git a/evm/src/test/java/org/hyperledger/besu/evm/internal/WordsTest.java b/evm/src/test/java/org/hyperledger/besu/evm/internal/WordsTest.java index 40eb0a0b898..3b5e8a97fe9 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/internal/WordsTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/internal/WordsTest.java @@ -17,11 +17,13 @@ package org.hyperledger.besu.evm.internal; import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.evm.internal.Words.clampedToInt; import static org.hyperledger.besu.evm.internal.Words.unsignedMin; import java.util.Arrays; import java.util.Collection; +import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.TestInstance.Lifecycle; import org.junit.jupiter.params.ParameterizedTest; @@ -46,7 +48,61 @@ Collection unsignedMinLongTestVector() { @ParameterizedTest @MethodSource("unsignedMinLongTestVector") - void unsugnedMinLongTest(final long a, final long b, final long min) { + void unsignedMinLongTest(final long a, final long b, final long min) { assertThat(unsignedMin(a, b)).isEqualTo(min); } + + Collection clampedToLongTestVector() { + return Arrays.asList( + new Object[][] { + {Bytes.fromHexStringLenient("0x0"), 0x0}, + {Bytes.fromHexStringLenient("0x1"), 0x1}, + {Bytes.fromHexString("0x10"), 0x10}, + {Bytes.fromHexStringLenient("0x100"), 0x100}, + {Bytes.fromHexString("0x1000"), 0x1000}, + {Bytes.fromHexStringLenient("0x10000"), 0x10000}, + {Bytes.fromHexString("0x100000"), 0x100000}, + {Bytes.fromHexStringLenient("0x1000000"), 0x1000000}, + {Bytes.fromHexString("0x10000000"), 0x10000000}, + {Bytes.fromHexString("0x20000000"), 0x20000000}, + {Bytes.fromHexString("0x40000000"), 0x40000000}, + {Bytes.fromHexString("0x0040000000"), 0x40000000}, + {Bytes.fromHexString("0x7fffffff"), Integer.MAX_VALUE}, + {Bytes.fromHexString("0x80000000"), Integer.MAX_VALUE}, + {Bytes.fromHexString("0x80000001"), Integer.MAX_VALUE}, + {Bytes.fromHexString("0x1000000000000000"), Integer.MAX_VALUE}, + {Bytes.fromHexString("0x10000000000000000000000000000000"), Integer.MAX_VALUE}, + { + Bytes.fromHexString( + "0x1000000000000000000000000000000000000000000000000000000000000000"), + Integer.MAX_VALUE + }, + { + Bytes.fromHexString( + "0x0000000000000000000000000000000000000000000000000000000040000000"), + 0x40000000 + }, + { + Bytes.fromHexString( + "0x000000000000000000000000000000000000000000000000000000007fffffff"), + Integer.MAX_VALUE + }, + { + Bytes.fromHexString( + "0x0000000000000000000000000000000000000000000000000000000080000000"), + Integer.MAX_VALUE + }, + { + Bytes.fromHexString( + "0x0000000000000000000000000000000000000000000000000000000080000001"), + Integer.MAX_VALUE + }, + }); + } + + @ParameterizedTest + @MethodSource("clampedToLongTestVector") + void clampedToIntTest(final Bytes theBytes, final int theExpectedInt) { + assertThat(clampedToInt(theBytes)).isEqualTo(theExpectedInt); + } } diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operation/AbstractCreateOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operation/AbstractCreateOperationTest.java index 1a703f489d7..a471c45b010 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operation/AbstractCreateOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operation/AbstractCreateOperationTest.java @@ -16,6 +16,9 @@ package org.hyperledger.besu.evm.operation; import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.evm.internal.Words.clampedAdd; +import static org.hyperledger.besu.evm.internal.Words.clampedToInt; +import static org.hyperledger.besu.evm.internal.Words.clampedToLong; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -23,6 +26,7 @@ import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.evm.Code; import org.hyperledger.besu.evm.EVM; import org.hyperledger.besu.evm.MainnetEVMs; import org.hyperledger.besu.evm.account.Account; @@ -43,6 +47,7 @@ import java.util.Deque; import java.util.List; import java.util.Optional; +import java.util.function.Supplier; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.units.bigints.UInt256; @@ -104,12 +109,18 @@ public FakeCreateOperation(final GasCalculator gasCalculator, final int maxInitc } @Override - public long cost(final MessageFrame frame) { - return gasCalculator().createOperationGasCost(frame); + public long cost(final MessageFrame frame, final Supplier unused) { + final int inputOffset = clampedToInt(frame.getStackItem(1)); + final int inputSize = clampedToInt(frame.getStackItem(2)); + return clampedAdd( + clampedAdd( + gasCalculator().txCreateCost(), + gasCalculator().memoryExpansionGasCost(frame, inputOffset, inputSize)), + gasCalculator().initcodeCost(inputSize)); } @Override - protected Address targetContractAddress(final MessageFrame frame) { + protected Address targetContractAddress(final MessageFrame frame, final Code initcode) { final Account sender = frame.getWorldUpdater().get(frame.getRecipientAddress()); // Decrement nonce by 1 to normalize the effect of transaction execution final Address address = @@ -118,6 +129,14 @@ protected Address targetContractAddress(final MessageFrame frame) { return address; } + @Override + protected Code getInitCode(final MessageFrame frame, final EVM evm) { + final long inputOffset = clampedToLong(frame.getStackItem(1)); + final long inputSize = clampedToLong(frame.getStackItem(2)); + final Bytes inputData = frame.readMemory(inputOffset, inputSize); + return evm.getCodeUncached(inputData); + } + @Override protected void onSuccess(final MessageFrame frame, final Address createdAddress) { successFrame = frame; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/Create2OperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/Create2OperationTest.java index bde8bba846d..ab840629ced 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/Create2OperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/Create2OperationTest.java @@ -186,7 +186,9 @@ void shouldCalculateAddress( final String expectedAddress, final int ignoredExpectedGas) { setUp(sender, salt, code); - final Address targetContractAddress = operation.targetContractAddress(messageFrame); + final Address targetContractAddress = + operation.targetContractAddress( + messageFrame, CodeFactory.createCode(Bytes.fromHexString(code), 0, true)); assertThat(targetContractAddress).isEqualTo(Address.fromHexString(expectedAddress)); } @@ -208,7 +210,7 @@ void shouldCalculateGasPrice( void shanghaiMaxInitCodeSizeCreate() { final UInt256 memoryOffset = UInt256.fromHexString("0xFF"); final UInt256 memoryLength = UInt256.fromHexString("0xc000"); - final MessageFrame messageFrame = testMemoryFrame(memoryOffset, memoryLength, UInt256.ZERO, 1); + final MessageFrame messageFrame = testMemoryFrame(memoryOffset, memoryLength); when(account.getNonce()).thenReturn(55L); when(account.getBalance()).thenReturn(Wei.ZERO); @@ -236,7 +238,7 @@ void shanghaiMaxInitCodeSizeCreate() { void shanghaiMaxInitCodeSizePlus1Create() { final UInt256 memoryOffset = UInt256.fromHexString("0xFF"); final UInt256 memoryLength = UInt256.fromHexString("0xc001"); - final MessageFrame messageFrame = testMemoryFrame(memoryOffset, memoryLength, UInt256.ZERO, 1); + final MessageFrame messageFrame = testMemoryFrame(memoryOffset, memoryLength); when(account.getNonce()).thenReturn(55L); when(account.getBalance()).thenReturn(Wei.ZERO); @@ -253,11 +255,7 @@ void shanghaiMaxInitCodeSizePlus1Create() { } @Nonnull - private MessageFrame testMemoryFrame( - final UInt256 memoryOffset, - final UInt256 memoryLength, - final UInt256 value, - final int depth) { + private MessageFrame testMemoryFrame(final UInt256 memoryOffset, final UInt256 memoryLength) { final MessageFrame messageFrame = MessageFrame.builder() .type(MessageFrame.Type.CONTRACT_CREATION) @@ -280,12 +278,12 @@ private MessageFrame testMemoryFrame( messageFrame.pushStackItem(Bytes.EMPTY); messageFrame.pushStackItem(memoryLength); messageFrame.pushStackItem(memoryOffset); - messageFrame.pushStackItem(value); + messageFrame.pushStackItem(UInt256.ZERO); messageFrame.expandMemory(0, 500); messageFrame.writeMemory( memoryOffset.trimLeadingZeros().toInt(), SIMPLE_CREATE.size(), SIMPLE_CREATE); final Deque messageFrameStack = messageFrame.getMessageFrameStack(); - while (messageFrameStack.size() < depth) { + if (messageFrameStack.isEmpty()) { messageFrameStack.push(messageFrame); } return messageFrame; From 627e0a994e5d36381762e340331f06ebc7afe3d0 Mon Sep 17 00:00:00 2001 From: Brindrajsinh Chauhan <91854080+Brindrajsinh-Chauhan@users.noreply.github.com> Date: Wed, 10 Apr 2024 18:59:35 -0400 Subject: [PATCH 02/59] add rlp decode subcommand (#6895) * add rlp decode subcommand Signed-off-by: Brindrajsinh-Chauhan --------- Signed-off-by: Brindrajsinh-Chauhan Co-authored-by: Sally MacFarlane --- CHANGELOG.md | 1 + .../rlp/IbftExtraDataCLIAdapter.java | 10 ++ .../besu/cli/subcommands/rlp/JSONToRLP.java | 11 ++ .../rlp/QbftExtraDataCLIAdapter.java | 10 ++ .../cli/subcommands/rlp/RLPSubCommand.java | 129 ++++++++++++++- .../subcommands/rlp/RLPSubCommandTest.java | 152 ++++++++++++++++++ 6 files changed, 312 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d7fdc02931..045968989cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - Expose transaction count by type metrics for the layered txpool [#6903](https://github.com/hyperledger/besu/pull/6903) - Expose bad block events via the BesuEvents plugin API [#6848](https://github.com/hyperledger/besu/pull/6848) - Add RPC errors metric [#6919](https://github.com/hyperledger/besu/pull/6919/) +- Add `rlp decode` subcommand to decode IBFT/QBFT extraData to validator list [#6895](https://github.com/hyperledger/besu/pull/6895) ### Bug fixes - Fix txpool dump/restore race condition [#6665](https://github.com/hyperledger/besu/pull/6665) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/IbftExtraDataCLIAdapter.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/IbftExtraDataCLIAdapter.java index 68d88478df2..c136d0f8da4 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/IbftExtraDataCLIAdapter.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/IbftExtraDataCLIAdapter.java @@ -14,6 +14,7 @@ */ package org.hyperledger.besu.cli.subcommands.rlp; +import org.hyperledger.besu.consensus.common.bft.BftExtraData; import org.hyperledger.besu.consensus.ibft.IbftExtraDataCodec; import org.hyperledger.besu.datatypes.Address; @@ -43,4 +44,13 @@ private Bytes fromJsonAddresses(final String jsonAddresses) throws IOException { return IbftExtraDataCodec.encodeFromAddresses( validatorAddresses.stream().map(Address::fromHexString).collect(Collectors.toList())); } + + @Override + public BftExtraData decode(final String rlpInput) throws IOException { + return fromRLPInput(rlpInput); + } + + private BftExtraData fromRLPInput(final String rlpInput) throws IOException { + return new IbftExtraDataCodec().decodeRaw(Bytes.fromHexString(rlpInput)); + } } diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/JSONToRLP.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/JSONToRLP.java index 101b442e8cf..ebf05cb24c4 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/JSONToRLP.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/JSONToRLP.java @@ -14,6 +14,8 @@ */ package org.hyperledger.besu.cli.subcommands.rlp; +import org.hyperledger.besu.consensus.common.bft.BftExtraData; + import java.io.IOException; import org.apache.tuweni.bytes.Bytes; @@ -29,4 +31,13 @@ interface JSONToRLP { * @throws IOException if an error occurs while reading data */ Bytes encode(String json) throws IOException; + + /** + * Decodes the input RLP value into a validators list Object. + * + * @param inputData the RLP hex string to convert to validators list + * @return the decoded BFT ExtraData object. + * @throws IOException if an error occurs while reading data + */ + BftExtraData decode(String inputData) throws IOException; } diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/QbftExtraDataCLIAdapter.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/QbftExtraDataCLIAdapter.java index 9caea69d936..cf02819b2b9 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/QbftExtraDataCLIAdapter.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/QbftExtraDataCLIAdapter.java @@ -14,6 +14,7 @@ */ package org.hyperledger.besu.cli.subcommands.rlp; +import org.hyperledger.besu.consensus.common.bft.BftExtraData; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; import org.hyperledger.besu.datatypes.Address; @@ -40,4 +41,13 @@ private Bytes fromJsonAddresses(final String jsonAddresses) throws IOException { return QbftExtraDataCodec.encodeFromAddresses( validatorAddresses.stream().map(Address::fromHexString).collect(Collectors.toList())); } + + @Override + public BftExtraData decode(final String rlpInput) throws IOException { + return fromRLPInput(rlpInput); + } + + private BftExtraData fromRLPInput(final String rlpInput) throws IOException { + return new QbftExtraDataCodec().decodeRaw(Bytes.fromHexString(rlpInput)); + } } diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommand.java index 834e238987b..774b94f9c9b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommand.java @@ -19,8 +19,10 @@ import org.hyperledger.besu.cli.BesuCommand; import org.hyperledger.besu.cli.DefaultCommandValues; +import org.hyperledger.besu.cli.subcommands.rlp.RLPSubCommand.DecodeSubCommand; import org.hyperledger.besu.cli.subcommands.rlp.RLPSubCommand.EncodeSubCommand; import org.hyperledger.besu.cli.util.VersionProvider; +import org.hyperledger.besu.consensus.common.bft.BftExtraData; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -30,6 +32,7 @@ import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Path; +import java.util.NoSuchElementException; import java.util.Scanner; import com.fasterxml.jackson.databind.exc.MismatchedInputException; @@ -48,7 +51,7 @@ description = "This command provides RLP data related actions.", mixinStandardHelpOptions = true, versionProvider = VersionProvider.class, - subcommands = {EncodeSubCommand.class}) + subcommands = {EncodeSubCommand.class, DecodeSubCommand.class}) public class RLPSubCommand implements Runnable { /** The constant COMMAND_NAME. */ @@ -207,4 +210,128 @@ private void writeOutput(final Bytes rlpEncodedOutput) { } } } + + /** + * RLP decode sub-command + * + *

Decode a RLP hex string into a validator list. + */ + @Command( + name = "decode", + description = "This command decodes a JSON typed RLP hex string into validator list.", + mixinStandardHelpOptions = true, + versionProvider = VersionProvider.class) + static class DecodeSubCommand implements Runnable { + + @SuppressWarnings("unused") + @ParentCommand + private RLPSubCommand parentCommand; // Picocli injects reference to parent command + + @SuppressWarnings("unused") + @Spec + private CommandSpec spec; + + @Option( + names = "--type", + description = + "Type of the RLP data to Decode, possible values are ${COMPLETION-CANDIDATES}. (default: ${DEFAULT-VALUE})", + arity = "1..1") + private final RLPType type = RLPType.IBFT_EXTRA_DATA; + + @Option( + names = "--from", + paramLabel = DefaultCommandValues.MANDATORY_FILE_FORMAT_HELP, + description = "File containing JSON object to decode", + arity = "1..1") + private final File jsonSourceFile = null; + + @Option( + names = "--to", + paramLabel = DefaultCommandValues.MANDATORY_FILE_FORMAT_HELP, + description = "File to write decoded RLP string to.", + arity = "1..1") + private final File rlpTargetFile = null; + + @Override + public void run() { + checkNotNull(parentCommand); + readInput(); + } + + /** + * Reads the stdin or from a file if one is specified by {@link #jsonSourceFile} then goes to + * {@link #decode(String)} this data + */ + private void readInput() { + // if we have an output file defined, print to it + // otherwise print to defined output, usually standard output. + final String inputData; + + if (jsonSourceFile != null) { + try { + BufferedReader reader = Files.newBufferedReader(jsonSourceFile.toPath(), UTF_8); + + // Read only the first line if there are many lines + inputData = reader.readLine(); + } catch (IOException e) { + throw new ExecutionException(spec.commandLine(), "Unable to read input file."); + } + } else { + // get data from standard input + try (Scanner scanner = new Scanner(parentCommand.in, UTF_8.name())) { + inputData = scanner.nextLine(); + } catch (NoSuchElementException e) { + throw new ParameterException(spec.commandLine(), "Unable to read input data." + e); + } + } + + decode(inputData); + } + + /** + * Decodes the string input into an validator data based on the {@link #type} then goes to + * {@link #writeOutput(BftExtraData)} this data to file or stdout + * + * @param inputData the string data to decode + */ + private void decode(final String inputData) { + if (inputData == null || inputData.isEmpty()) { + throw new ParameterException( + spec.commandLine(), "An error occurred while trying to read the input data."); + } else { + try { + // decode and write the value + writeOutput(type.getAdapter().decode(inputData)); + } catch (MismatchedInputException e) { + throw new ParameterException( + spec.commandLine(), + "Unable to map the input data with selected type. Please check input format. " + e); + } catch (IOException e) { + throw new ParameterException( + spec.commandLine(), "Unable to load the input data. Please check input format. " + e); + } + } + } + + /** + * write the decoded result to stdout or a file if the option is specified + * + * @param bftExtraDataOutput the BFT extra data output to write to file or stdout + */ + private void writeOutput(final BftExtraData bftExtraDataOutput) { + if (rlpTargetFile != null) { + final Path targetPath = rlpTargetFile.toPath(); + + try (final BufferedWriter fileWriter = Files.newBufferedWriter(targetPath, UTF_8)) { + fileWriter.write(bftExtraDataOutput.getValidators().toString()); + } catch (final IOException e) { + throw new ParameterException( + spec.commandLine(), + "An error occurred while trying to write the validator list. " + e.getMessage()); + } + } else { + parentCommand.out.println(bftExtraDataOutput.getValidators().toString()); + } + } + } } diff --git a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommandTest.java index 8c9b9aad932..27dcdc16f63 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommandTest.java @@ -68,6 +68,7 @@ public class RLPSubCommandTest extends CommandTestAbstract { private static final String RLP_SUBCOMMAND_NAME = "rlp"; private static final String RLP_ENCODE_SUBCOMMAND_NAME = "encode"; + private static final String RLP_DECODE_SUBCOMMAND_NAME = "decode"; private static final String RLP_QBFT_TYPE = "QBFT_EXTRA_DATA"; // RLP sub-command @@ -259,6 +260,157 @@ public void encodeWithEmptyStdInputMustRaiseAnError() throws Exception { .startsWith("An error occurred while trying to read the JSON data."); } + @Test + public void decodeWithoutPathMustWriteToStandardOutput() { + + final String inputData = + "0xf853a00000000000000000000000000000000000000000000000000000000000000000ea94be068f726a13c8d" + + "46c44be6ce9d275600e1735a4945ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193808400000000c0"; + + // set stdin + final ByteArrayInputStream stdIn = new ByteArrayInputStream(inputData.getBytes(UTF_8)); + + parseCommand(stdIn, RLP_SUBCOMMAND_NAME, RLP_DECODE_SUBCOMMAND_NAME); + + final String expectedValidatorString = + "[0xbe068f726a13c8d46c44be6ce9d275600e1735a4, 0x5ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193]"; + assertThat(commandOutput.toString(UTF_8)).contains(expectedValidatorString); + assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); + } + + @Test + public void decodeQBFTWithoutPathMustWriteToStandardOutput() { + + final String inputData = + "0xf84fa00000000000000000000000000000000000000000000000000000000000000000ea94241f804efb46f71acaa" + + "5be94a62f7798e89c3724946cdf72da457453063ea92e7fa5ac30afbcec28cdc080c0"; + + // set stdin + final ByteArrayInputStream stdIn = new ByteArrayInputStream(inputData.getBytes(UTF_8)); + + parseCommand(stdIn, RLP_SUBCOMMAND_NAME, RLP_DECODE_SUBCOMMAND_NAME, "--type", RLP_QBFT_TYPE); + + final String expectedValidatorString = + "[0x241f804efb46f71acaa5be94a62f7798e89c3724, 0x6cdf72da457453063ea92e7fa5ac30afbcec28cd]"; + assertThat(commandOutput.toString(UTF_8)).contains(expectedValidatorString); + assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); + } + + @Test + public void decodeWithOutputFileMustWriteInThisFile() throws Exception { + + final File file = File.createTempFile("ibftValidators", "rlp"); + + final String inputData = + "0xf853a00000000000000000000000000000000000000000000000000000000000000000ea94be068f726a13c8d" + + "46c44be6ce9d275600e1735a4945ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193808400000000c0"; + + // set stdin + final ByteArrayInputStream stdIn = new ByteArrayInputStream(inputData.getBytes(UTF_8)); + + parseCommand(stdIn, RLP_SUBCOMMAND_NAME, RLP_DECODE_SUBCOMMAND_NAME, "--to", file.getPath()); + + final String expectedValidatorString = + "[0xbe068f726a13c8d46c44be6ce9d275600e1735a4, 0x5ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193]"; + + assertThat(contentOf(file)).contains(expectedValidatorString); + + assertThat(commandOutput.toString(UTF_8)).isEmpty(); + assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); + } + + @Test + public void decodeWithInputFilePathMustReadFromThisFile(final @TempDir Path dir) + throws Exception { + final Path tempJsonFile = Files.createTempFile(dir, "input", "json"); + try (final BufferedWriter fileWriter = Files.newBufferedWriter(tempJsonFile, UTF_8)) { + + fileWriter.write( + "0xf853a00000000000000000000000000000000000000000000000000000000000000000ea94be068f726a13c8d46c44be6ce9d275600e1735a4945ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193808400000000c0"); + + fileWriter.flush(); + + parseCommand( + RLP_SUBCOMMAND_NAME, + RLP_DECODE_SUBCOMMAND_NAME, + "--from", + tempJsonFile.toFile().getAbsolutePath()); + + final String expectedValidatorString = + "[0xbe068f726a13c8d46c44be6ce9d275600e1735a4, 0x5ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193]"; + + assertThat(commandOutput.toString(UTF_8)).contains(expectedValidatorString); + assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); + } + } + + @Test + public void decodeWithInputFilePathToOutputFile(final @TempDir Path dir) throws Exception { + final Path tempInputFile = Files.createTempFile(dir, "input", "json"); + final File tempOutputFile = File.createTempFile("ibftValidators", "rlp"); + try (final BufferedWriter fileWriter = Files.newBufferedWriter(tempInputFile, UTF_8)) { + + fileWriter.write( + "0xf853a00000000000000000000000000000000000000000000000000000000000000000ea94be068f726a13c8d46c44be6ce9d275600e1735a4945ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193808400000000c0"); + + fileWriter.flush(); + + parseCommand( + RLP_SUBCOMMAND_NAME, + RLP_DECODE_SUBCOMMAND_NAME, + "--from", + tempInputFile.toFile().getAbsolutePath(), + "--to", + tempOutputFile.getPath()); + + final String expectedValidatorString = + "[0xbe068f726a13c8d46c44be6ce9d275600e1735a4, 0x5ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193]"; + + assertThat(contentOf(tempOutputFile)).contains(expectedValidatorString); + assertThat(commandOutput.toString(UTF_8)).isEmpty(); + assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); + } + } + + @Test + public void decodeWithEmptyStdInputMustRaiseAnError() throws Exception { + + // set empty stdin + final String jsonInput = ""; + final ByteArrayInputStream stdIn = new ByteArrayInputStream(jsonInput.getBytes(UTF_8)); + + parseCommand(stdIn, RLP_SUBCOMMAND_NAME, RLP_DECODE_SUBCOMMAND_NAME); + + assertThat(commandOutput.toString(UTF_8)).isEmpty(); + assertThat(commandErrorOutput.toString(UTF_8)).startsWith("Unable to read input data."); + } + + @Test + public void decodeWithInputFilePathMustThrowErrorFileNotExist(final @TempDir Path dir) + throws Exception { + + final String nonExistingFileName = "/incorrectPath/wrongFile.json"; + + parseCommand(RLP_SUBCOMMAND_NAME, RLP_DECODE_SUBCOMMAND_NAME, "--from", nonExistingFileName); + + assertThat(commandOutput.toString(UTF_8)).isEmpty(); + assertThat(commandErrorOutput.toString(UTF_8)).contains("Unable to read input file"); + } + + @Test + public void decodeWithEmptyInputMustRaiseAnError(final @TempDir Path dir) throws Exception { + final Path emptyFile = Files.createTempFile(dir, "empty", "json"); + parseCommand( + RLP_SUBCOMMAND_NAME, + RLP_DECODE_SUBCOMMAND_NAME, + "--from", + emptyFile.toFile().getAbsolutePath()); + + assertThat(commandOutput.toString(UTF_8)).isEmpty(); + assertThat(commandErrorOutput.toString(UTF_8)) + .startsWith("An error occurred while trying to read the input data."); + } + @AfterEach public void restoreStdin() { System.setIn(System.in); From 909b6ca355660bc0afdd890f2b083d7a1d867e74 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Thu, 11 Apr 2024 19:09:34 +1000 Subject: [PATCH 03/59] added an else and extra logging (#6931) Signed-off-by: Sally MacFarlane --- .../besu/ethereum/eth/manager/EthPeers.java | 12 ++++++++++++ .../ethereum/eth/manager/EthProtocolManager.java | 12 ++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java index 67e012b9de1..2ad1101f531 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java @@ -364,16 +364,28 @@ public Stream getAllConnections() { public boolean shouldConnect(final Peer peer, final boolean inbound) { final Bytes id = peer.getId(); if (peerCount() >= peerUpperBound && !canExceedPeerLimits(id)) { + LOG.atTrace() + .setMessage("not connecting to peer {} - too many peers") + .addArgument(peer.getLoggableId()) + .log(); return false; } final EthPeer ethPeer = completeConnections.get(id); if (ethPeer != null && !ethPeer.isDisconnected()) { + LOG.atTrace() + .setMessage("not connecting to peer {} - already disconnected") + .addArgument(ethPeer.getLoggableId()) + .log(); return false; } final List incompleteConnections = getIncompleteConnections(id); if (!incompleteConnections.isEmpty()) { if (incompleteConnections.stream() .anyMatch(c -> !c.isDisconnected() && (!inbound || (inbound && c.inboundInitiated())))) { + LOG.atTrace() + .setMessage("not connecting to peer {} - new connection already in process") + .addArgument(ethPeer.getLoggableId()) + .log(); return false; } } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java index d28023e70e1..364b2925224 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java @@ -408,11 +408,15 @@ public boolean shouldConnect(final Peer peer, final boolean incoming) { if (ethPeers.shouldConnect(peer, incoming)) { return true; } + } else { + LOG.atDebug() + .setMessage("ForkId check failed for peer {} our fork id {} theirs {}") + .addArgument(peer::getLoggableId) + .addArgument(forkIdManager.getForkIdForChainHead()) + .addArgument(peer.getForkId()) + .log(); + return false; } - LOG.atDebug() - .setMessage("ForkId check failed for peer {}") - .addArgument(peer::getLoggableId) - .log(); return false; } From 5858a8b70764cec551d80ca3eceaf7bb250e894b Mon Sep 17 00:00:00 2001 From: Simon Dudley Date: Fri, 12 Apr 2024 08:13:17 +1000 Subject: [PATCH 04/59] Fix permissions publish and gradle issue for publishArtifactory (#6930) Signed-off-by: Simon Dudley Co-authored-by: Sally MacFarlane --- .github/workflows/artifacts.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 26beeed9cd0..b2848aaf381 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -74,6 +74,8 @@ jobs: publish: runs-on: ubuntu-22.04 needs: testWindows + permissions: + contents: write steps: - name: Download archives uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe @@ -91,10 +93,21 @@ jobs: body: | ${{steps.hashes.outputs.tarSha}} ${{steps.hashes.outputs.zipSha}} - arifactoryPublish: + artifactoryPublish: runs-on: ubuntu-22.04 needs: artifacts steps: + - name: checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Set up JDK 17 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 + with: + distribution: 'temurin' + java-version: '17' + - name: setup gradle + uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: Artifactory Publish env: ARTIFACTORY_USER: ${{ secrets.BESU_ARTIFACTORY_USER }} From 3c54da63dd60991fdb6bed428bbee0ca76eaae3e Mon Sep 17 00:00:00 2001 From: Gabriel Fukushima Date: Fri, 12 Apr 2024 10:14:39 +1000 Subject: [PATCH 05/59] fix npe on trace msg (#6934) Signed-off-by: Gabriel Fukushima --- .../org/hyperledger/besu/ethereum/eth/manager/EthPeers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java index 2ad1101f531..2a4469220e0 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java @@ -384,7 +384,7 @@ public boolean shouldConnect(final Peer peer, final boolean inbound) { .anyMatch(c -> !c.isDisconnected() && (!inbound || (inbound && c.inboundInitiated())))) { LOG.atTrace() .setMessage("not connecting to peer {} - new connection already in process") - .addArgument(ethPeer.getLoggableId()) + .addArgument(peer.getLoggableId()) .log(); return false; } From 05eb920f8d4a6c020231f806844c2248d694046a Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Fri, 12 Apr 2024 00:14:49 -0600 Subject: [PATCH 06/59] Add Paris Support to tests (#6933) Execution-spec-tests and reference tests have migrated Merge to Paris. Support both. Signed-off-by: Danno Ferrin --- .../referencetests/ReferenceTestProtocolSchedules.java | 1 + .../besu/ethereum/vm/BlockchainReferenceTestTools.java | 4 ++-- .../besu/ethereum/vm/GeneralStateReferenceTestTools.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java index 0a137c4ea82..2f3c2c2c347 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java @@ -76,6 +76,7 @@ public static ReferenceTestProtocolSchedules create(final StubGenesisConfigOptio builder.put("ArrowGlacier", createSchedule(genesisStub.clone().arrowGlacierBlock(0))); builder.put("GrayGlacier", createSchedule(genesisStub.clone().grayGlacierBlock(0))); builder.put("Merge", createSchedule(genesisStub.clone().mergeNetSplitBlock(0))); + builder.put("Paris", createSchedule(genesisStub.clone().mergeNetSplitBlock(0))); builder.put("Shanghai", createSchedule(genesisStub.clone().shanghaiTime(0))); builder.put( "ShanghaiToCancunAtTime15k", diff --git a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java index fea3d8671da..69b3a300205 100644 --- a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java +++ b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java @@ -55,7 +55,7 @@ public class BlockchainReferenceTestTools { "test.ethereum.blockchain.eips", "FrontierToHomesteadAt5,HomesteadToEIP150At5,HomesteadToDaoAt5,EIP158ToByzantiumAt5," + "Frontier,Homestead,EIP150,EIP158,Byzantium,Constantinople,ConstantinopleFix,Istanbul,Berlin," - + "London,Merge,Shanghai,Cancun,Prague,Osaka,Bogota"); + + "London,Merge,Paris,Shanghai,Cancun,Prague,Osaka,Bogota"); NETWORKS_TO_RUN = Arrays.asList(networks.split(",")); } @@ -87,7 +87,7 @@ public class BlockchainReferenceTestTools { // Inconclusive fork choice rule, since in merge CL should be choosing forks and setting the // chain head. // Perfectly valid test pre-merge. - params.ignore("UncleFromSideChain_(Merge|Shanghai|Cancun|Prague|Osaka|Bogota)"); + params.ignore("UncleFromSideChain_(Merge|Paris|Shanghai|Cancun|Prague|Osaka|Bogota)"); // EOF tests are written against an older version of the spec params.ignore("/stEOF/"); diff --git a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java index 5314ff5cc81..7d1915b9106 100644 --- a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java +++ b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java @@ -71,7 +71,7 @@ private static ProtocolSpec protocolSpec(final String name) { System.getProperty( "test.ethereum.state.eips", "Frontier,Homestead,EIP150,EIP158,Byzantium,Constantinople,ConstantinopleFix,Istanbul,Berlin," - + "London,Merge,Shanghai,Cancun,Prague,Osaka,Bogota"); + + "London,Merge,Paris,Shanghai,Cancun,Prague,Osaka,Bogota"); EIPS_TO_RUN = Arrays.asList(eips.split(",")); } From bc0475128499627f976493b15d318ad390565533 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Sat, 13 Apr 2024 00:24:16 +1000 Subject: [PATCH 07/59] Fix Flaky test permv2 (#6936) * verify Signed-off-by: Sally MacFarlane --------- Signed-off-by: Sally MacFarlane --- .../NodeSmartContractPermissioningV2AcceptanceTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java index 396b2b4c73c..4e2cb9a8778 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java @@ -116,6 +116,8 @@ public void onchainPermissioningAllowlistShouldPersistAcrossRestarts() { permissionedCluster.stop(); permissionedCluster.start(bootnode, forbiddenNode, allowedNode, permissionedNode); + verifyAllNodesAreInSyncWithMiner(); + permissionedNode.verify(connectionIsAllowed(allowedNode)); permissionedNode.verify(connectionIsAllowed(bootnode)); permissionedNode.verify(connectionIsAllowed(permissionedNode)); From 27ade870ea47b63b5a3300e07289adf22052bd91 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Fri, 12 Apr 2024 12:32:20 -0600 Subject: [PATCH 08/59] Consistent nonce handling (#6941) Make handling of absurdly large nonces more consistent across txpool and EVM. Signed-off-by: Danno Ferrin --- .../besu/ethereum/mainnet/MainnetTransactionValidator.java | 2 +- .../besu/ethereum/privacy/PrivateTransactionValidator.java | 2 +- .../ethereum/mainnet/MainnetTransactionValidatorTest.java | 1 + .../layered/AbstractSequentialTransactionsLayer.java | 2 +- .../transactions/layered/LayeredPendingTransactions.java | 4 +++- .../eth/transactions/layered/SparseTransactions.java | 6 ++++-- .../transactions/sorter/PendingTransactionsForSender.java | 2 +- .../java/org/hyperledger/besu/evmtool/EvmToolCommand.java | 2 +- .../main/java/org/hyperledger/besu/evmtool/T8nExecutor.java | 2 +- .../besu/evm/processor/ContractCreationProcessor.java | 2 +- 10 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java index b23b056692d..8b1ae6ff6af 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java @@ -233,7 +233,7 @@ public ValidationResult validateForSender( upfrontCost.toQuantityHexString(), senderBalance.toQuantityHexString())); } - if (transaction.getNonce() < senderNonce) { + if (Long.compareUnsigned(transaction.getNonce(), senderNonce) < 0) { return ValidationResult.invalid( TransactionInvalidReason.NONCE_TOO_LOW, String.format( diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionValidator.java index 9bbfa6194be..11fe74d02e6 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionValidator.java @@ -61,7 +61,7 @@ public ValidationResult validate( LOG.debug("Validating actual nonce {}, with expected nonce {}", transactionNonce, accountNonce); - if (accountNonce > transactionNonce) { + if (Long.compareUnsigned(accountNonce, transactionNonce) > 0) { final String errorMessage = String.format( "Private Transaction nonce %s, is lower than sender account nonce %s.", diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java index 6ec75e0e645..92a353319bc 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java @@ -81,6 +81,7 @@ public class MainnetTransactionValidatorTest { private final Transaction basicTransaction = new TransactionTestFixture() + .nonce(30) .chainId(Optional.of(BigInteger.ONE)) .createTransaction(senderKeys); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractSequentialTransactionsLayer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractSequentialTransactionsLayer.java index 245f8916413..0afba82470f 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractSequentialTransactionsLayer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractSequentialTransactionsLayer.java @@ -47,7 +47,7 @@ public void remove(final PendingTransaction invalidatedTx, final RemovalReason r final var senderTxs = txsBySender.get(invalidatedTx.getSender()); final long invalidNonce = invalidatedTx.getNonce(); - if (senderTxs != null && invalidNonce <= senderTxs.lastKey()) { + if (senderTxs != null && Long.compareUnsigned(invalidNonce, senderTxs.lastKey()) <= 0) { // on sequential layers we need to push to next layer all the txs following the invalid one, // even if it belongs to a previous layer diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java index 878c1b0793b..0192f1cd668 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java @@ -339,7 +339,9 @@ public synchronized void selectTransactions( .filter( candidatePendingTx -> !alreadyChecked.contains(candidatePendingTx.getHash()) - && candidatePendingTx.getNonce() <= highPrioPendingTx.getNonce()) + && Long.compareUnsigned( + candidatePendingTx.getNonce(), highPrioPendingTx.getNonce()) + <= 0) .forEach( candidatePendingTx -> { alreadyChecked.add(candidatePendingTx.getHash()); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java index e036f2fd215..414f12b3d26 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java @@ -101,7 +101,9 @@ protected TransactionAddedResult canAdd( orderByGap.get(gap).add(pendingTransaction); return gap; } - if (pendingTransaction.getNonce() < txsBySender.get(sender).firstKey()) { + if (Long.compareUnsigned( + pendingTransaction.getNonce(), txsBySender.get(sender).firstKey()) + < 0) { orderByGap.get(currGap).remove(sender); orderByGap.get(gap).add(pendingTransaction); return gap; @@ -431,7 +433,7 @@ protected void internalConsistencyCheck( while (itNonce.hasNext()) { final long currNonce = itNonce.next().getKey(); - assert prevNonce < currNonce : "non incremental nonce"; + assert Long.compareUnsigned(prevNonce, currNonce) < 0 : "non incremental nonce"; prevNonce = currNonce; } }); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/PendingTransactionsForSender.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/PendingTransactionsForSender.java index f4cd95cba21..634727b9df2 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/PendingTransactionsForSender.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/PendingTransactionsForSender.java @@ -42,7 +42,7 @@ public void trackPendingTransaction(final PendingTransaction pendingTransaction) synchronized (pendingTransactions) { if (!pendingTransactions.isEmpty()) { final long expectedNext = pendingTransactions.lastKey() + 1; - if (nonce > (expectedNext) && nextGap.isEmpty()) { + if (Long.compareUnsigned(nonce, expectedNext) > 0 && nextGap.isEmpty()) { nextGap = OptionalLong.of(expectedNext); } } diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java index 014279bf4a6..6a8134e999e 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java @@ -519,7 +519,7 @@ public static void dumpWorldState(final WorldState worldState, final PrintWriter out.println(" },"); } out.print(" \"balance\": \"" + account.getBalance().toShortHexString() + "\""); - if (account.getNonce() > 0) { + if (account.getNonce() != 0) { out.println(","); out.println( " \"nonce\": \"" diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java index c3e831a25a1..683458bf7c0 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java @@ -448,7 +448,7 @@ static T8nResult runTest( accountStorageEntry.getValue().toHexString())); } accountObject.put("balance", account.getBalance().toShortHexString()); - if (account.getNonce() > 0) { + if (account.getNonce() != 0) { accountObject.put( "nonce", Bytes.ofUnsignedLong(account.getNonce()).toShortHexString()); } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/processor/ContractCreationProcessor.java b/evm/src/main/java/org/hyperledger/besu/evm/processor/ContractCreationProcessor.java index f18473b0bf2..987b72b3635 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/processor/ContractCreationProcessor.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/processor/ContractCreationProcessor.java @@ -98,7 +98,7 @@ public ContractCreationProcessor( private static boolean accountExists(final Account account) { // The account exists if it has sent a transaction // or already has its code initialized. - return account.getNonce() > 0 || !account.getCode().isEmpty(); + return account.getNonce() != 0 || !account.getCode().isEmpty(); } @Override From ec06ab556769103ea11c72680a09db960557b88c Mon Sep 17 00:00:00 2001 From: garyschulte Date: Sun, 14 Apr 2024 16:27:20 -0700 Subject: [PATCH 09/59] Fix named network default disabled for downgrade protection (#6943) * fix default disabled for downgrade protection on named networks implement comparable for VersionMetadata, add explicit coverage Signed-off-by: garyschulte * test method rename Signed-off-by: garyschulte * remove errant comment Signed-off-by: garyschulte * do not use static version metadata, to facilitate unit tests Signed-off-by: garyschulte --------- Signed-off-by: garyschulte --- .../org/hyperledger/besu/cli/BesuCommand.java | 3 +- .../besu/ethereum/core/VersionMetadata.java | 48 +++++++++++-------- .../ethereum/core/VersionMetadataTest.java | 37 ++++++++++++-- 3 files changed, 65 insertions(+), 23 deletions(-) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java index 4c504c4e33b..9648122de3b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java @@ -2679,7 +2679,8 @@ private SyncMode getDefaultSyncModeIfNotSet() { private Boolean getDefaultVersionCompatibilityProtectionIfNotSet() { // Version compatibility protection is enabled by default for non-named networks return Optional.ofNullable(versionCompatibilityProtection) - .orElse(commandLine.getParseResult().hasMatchedOption("network") ? false : true); + // if we have a specific genesis file or custom network id, we are not using a named network + .orElse(genesisFile != null || networkId != null); } private String generateConfigurationOverview() { diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java index 5246cb5fae3..0346dd84018 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java @@ -18,6 +18,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Path; +import javax.annotation.Nonnull; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -27,7 +28,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class VersionMetadata { +public class VersionMetadata implements Comparable { private static final Logger LOG = LoggerFactory.getLogger(VersionMetadata.class); /** Represents an unknown Besu version in the version metadata file */ @@ -42,12 +43,16 @@ public class VersionMetadata { * * @return the version of Besu */ - public static String getRuntimeVersion() { + public static String getRuntimeVersionString() { return VersionMetadata.class.getPackage().getImplementationVersion() == null ? BESU_VERSION_UNKNOWN : VersionMetadata.class.getPackage().getImplementationVersion(); } + public static VersionMetadata getRuntimeVersion() { + return new VersionMetadata(getRuntimeVersionString()); + } + @JsonCreator public VersionMetadata(@JsonProperty("besuVersion") final String besuVersion) { this.besuVersion = besuVersion; @@ -103,52 +108,57 @@ private static VersionMetadata resolveVersionMetadata(final File metadataFile) */ public static void versionCompatibilityChecks( final boolean enforceCompatibilityProtection, final Path dataDir) throws IOException { - final VersionMetadata versionMetaData = VersionMetadata.lookUpFrom(dataDir); - if (versionMetaData.getBesuVersion().equals(VersionMetadata.BESU_VERSION_UNKNOWN)) { + final VersionMetadata metadataVersion = VersionMetadata.lookUpFrom(dataDir); + final VersionMetadata runtimeVersion = getRuntimeVersion(); + if (metadataVersion.getBesuVersion().equals(VersionMetadata.BESU_VERSION_UNKNOWN)) { // The version isn't known, potentially because the file doesn't exist. Write the latest // version to the metadata file. LOG.info( "No version data detected. Writing Besu version {} to metadata file", - VersionMetadata.getRuntimeVersion()); - new VersionMetadata(VersionMetadata.getRuntimeVersion()).writeToDirectory(dataDir); + runtimeVersion.getBesuVersion()); + runtimeVersion.writeToDirectory(dataDir); } else { // Check the runtime version against the most recent version as recorded in the version // metadata file - final String installedVersion = VersionMetadata.getRuntimeVersion().split("-", 2)[0]; - final String metadataVersion = versionMetaData.getBesuVersion().split("-", 2)[0]; - final int versionComparison = - new ComparableVersion(installedVersion).compareTo(new ComparableVersion(metadataVersion)); + final int versionComparison = runtimeVersion.compareTo(metadataVersion); if (versionComparison == 0) { // Versions match - no-op } else if (versionComparison < 0) { if (!enforceCompatibilityProtection) { LOG.warn( "Besu version {} is lower than version {} that last started. Allowing startup because --version-compatibility-protection has been disabled.", - installedVersion, - metadataVersion); + runtimeVersion.getBesuVersion(), + metadataVersion.getBesuVersion()); // We've allowed startup at an older version of Besu. Since the version in the metadata // file records the latest version of // Besu to write to the database we'll update the metadata version to this // downgraded-version. - new VersionMetadata(VersionMetadata.getRuntimeVersion()).writeToDirectory(dataDir); + runtimeVersion.writeToDirectory(dataDir); } else { final String message = "Besu version " - + installedVersion + + runtimeVersion.getBesuVersion() + " is lower than version " - + metadataVersion + + metadataVersion.getBesuVersion() + " that last started. Remove --version-compatibility-protection option to allow Besu to start at " + " the lower version (warning - this may have unrecoverable effects on the database)."; - LOG.error(message, installedVersion, metadataVersion); + LOG.error(message); throw new IllegalStateException(message); } } else { LOG.info( "Besu version {} is higher than version {} that last started. Updating version metadata.", - installedVersion, - metadataVersion); - new VersionMetadata(VersionMetadata.getRuntimeVersion()).writeToDirectory(dataDir); + runtimeVersion.getBesuVersion(), + metadataVersion.getBesuVersion()); + runtimeVersion.writeToDirectory(dataDir); } } } + + @Override + public int compareTo(@Nonnull final VersionMetadata versionMetadata) { + final String thisVersion = this.getBesuVersion().split("-", 2)[0]; + final String metadataVersion = versionMetadata.getBesuVersion().split("-", 2)[0]; + return new ComparableVersion(thisVersion).compareTo(new ComparableVersion(metadataVersion)); + } } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/VersionMetadataTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/VersionMetadataTest.java index 0cebcd4bda8..dce027b5e5d 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/VersionMetadataTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/VersionMetadataTest.java @@ -22,10 +22,14 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.stream.Stream; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; import org.mockito.MockedStatic; import org.mockito.Mockito; @@ -60,6 +64,33 @@ void dataDirShouldBeCreatedIfNotPresent() throws Exception { assertThat(Files.exists(temporaryFolder)).isTrue(); } + static Stream versionTestProvider() { + return Stream.of( + Arguments.of("24.4.0", "24.3.3", 1), + Arguments.of("24.3.3", "24.3.3", 0), + Arguments.of("24.2.0", "24.3.3", -1), + Arguments.of("24.3.3", "24.3-develop-59da092", 1), + Arguments.of("24.3.0", "24.3-develop-59da092", 0), + Arguments.of("24.3.3", "24.4-develop-59da092", -1), + Arguments.of("24.2-develop-59da092", "24.3-develop-9999999", -1), + Arguments.of("24.3-develop-59da092", "24.3-develop-9999999", 0), + Arguments.of("24.4-develop-59da092", "24.3-develop-9999999", 1), + Arguments.of("24.4-develop-59da092", "24.3.0", 1), + Arguments.of("24.4-develop-59da092", "24.4.0", 0), + Arguments.of("24.4-develop-59da092", "24.4.1", -1)); + } + + @ParameterizedTest + @MethodSource("versionTestProvider") + public void assertComparableChecks( + final String runtimeVersion, + final String metadataVersion, + final int expectedComparisonResult) { + VersionMetadata runtime = new VersionMetadata(runtimeVersion); + VersionMetadata develop = new VersionMetadata(metadataVersion); + assertThat(runtime.compareTo(develop)).isEqualTo(expectedComparisonResult); + } + @Test void compatibilityCheckShouldThrowExceptionIfEnabled() throws Exception { // The version file says the last version to start was 23.10.3 @@ -69,7 +100,7 @@ void compatibilityCheckShouldThrowExceptionIfEnabled() throws Exception { // The runtime says the current version is 23.10.2 (i.e. a downgrade) try (MockedStatic mocked = Mockito.mockStatic(VersionMetadata.class, Mockito.CALLS_REAL_METHODS)) { - mocked.when(VersionMetadata::getRuntimeVersion).thenReturn("23.10.2"); + mocked.when(VersionMetadata::getRuntimeVersionString).thenReturn("23.10.2"); final VersionMetadata versionMetadata = VersionMetadata.lookUpFrom(tempDataDir); assertThat(versionMetadata).isNotNull(); @@ -96,7 +127,7 @@ void compatibilityCheckShouldNotThrowExceptionIfDisabled() throws Exception { // version-compatibility-protection = false so no exception should be thrown try (MockedStatic mocked = Mockito.mockStatic(VersionMetadata.class, Mockito.CALLS_REAL_METHODS)) { - mocked.when(VersionMetadata::getRuntimeVersion).thenReturn("23.10.2"); + mocked.when(VersionMetadata::getRuntimeVersionString).thenReturn("23.10.2"); final VersionMetadata versionMetadata = VersionMetadata.lookUpFrom(tempDataDir); assertThat(versionMetadata).isNotNull(); @@ -122,7 +153,7 @@ void compatibilityCheckShouldNotThrowExceptionIfResultIsUpgrade() throws Excepti // The runtime says the current version is 23.10.2 (i.e. a downgrade) try (MockedStatic mocked = Mockito.mockStatic(VersionMetadata.class, Mockito.CALLS_REAL_METHODS)) { - mocked.when(VersionMetadata::getRuntimeVersion).thenReturn("23.10.4"); + mocked.when(VersionMetadata::getRuntimeVersionString).thenReturn("23.10.4"); final VersionMetadata versionMetadata = VersionMetadata.lookUpFrom(tempDataDir); assertThat(versionMetadata).isNotNull(); From 6699907204651f054aca41bbc90df1310a7859bc Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Mon, 15 Apr 2024 14:45:35 +1000 Subject: [PATCH 10/59] check for empty in disconnect reason bytes (#6938) Signed-off-by: Sally MacFarlane --- .../besu/ethereum/p2p/network/PeerDenylistManager.java | 2 +- .../p2p/rlpx/wire/messages/DisconnectMessage.java | 8 ++++++++ .../ethereum/p2p/network/PeerDenylistManagerTest.java | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/PeerDenylistManager.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/PeerDenylistManager.java index e4469337d4b..505e38aa865 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/PeerDenylistManager.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/PeerDenylistManager.java @@ -52,7 +52,7 @@ public void onDisconnect( final boolean initiatedByPeer) { // we have a number of reasons that use the same code, but with different message strings // so here we use the code of the reason param to ensure we get the no-message version - if (shouldBlock(DisconnectReason.forCode(reason.getValue().get(0)), initiatedByPeer)) { + if (shouldBlock(DisconnectReason.forCode(reason.getValue()), initiatedByPeer)) { if (maintainedPeers.contains(connection.getPeer())) { LOG.debug( "Skip adding maintained peer {} to peer denylist for reason {}", diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/messages/DisconnectMessage.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/messages/DisconnectMessage.java index ae19e71fff5..66337903358 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/messages/DisconnectMessage.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/messages/DisconnectMessage.java @@ -174,6 +174,14 @@ public static DisconnectReason forCode(final Byte code) { return BY_ID[code]; } + public static DisconnectReason forCode(final Bytes codeBytes) { + if (codeBytes == null || codeBytes.isEmpty()) { + return UNKNOWN; + } else { + return forCode(codeBytes.get(0)); + } + } + DisconnectReason(final Byte code) { this.code = Optional.ofNullable(code); this.message = Optional.empty(); diff --git a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/PeerDenylistManagerTest.java b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/PeerDenylistManagerTest.java index a8091e1f8df..bef39a2a09b 100644 --- a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/PeerDenylistManagerTest.java +++ b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/PeerDenylistManagerTest.java @@ -111,6 +111,15 @@ public void denylistIncompatiblePeerWhoIssuesDisconnect() { checkPermissions(denylist, peer.getPeer(), false); } + @Test + public void disconnectReasonWithEmptyValue_doesNotAddToDenylist() { + final PeerConnection peer = generatePeerConnection(); + + checkPermissions(denylist, peer.getPeer(), true); + peerDenylistManager.onDisconnect(peer, DisconnectReason.UNKNOWN, false); + checkPermissions(denylist, peer.getPeer(), true); + } + private void checkPermissions( final PeerPermissionsDenylist denylist, final Peer remotePeer, final boolean expectedResult) { for (PeerPermissions.Action action : PeerPermissions.Action.values()) { From b67ad6903ec11cddfce31099b04b04418df7e79a Mon Sep 17 00:00:00 2001 From: garyschulte Date: Sun, 14 Apr 2024 22:33:26 -0700 Subject: [PATCH 11/59] Docker develop publishing task (#6893) Publish to dockerhub on merge to the main branch Signed-off-by: garyschulte Co-authored-by: Simon Dudley --- .github/workflows/develop.yml | 121 ++++++++++++++++++++++++++++++++++ build.gradle | 1 + ethereum/evmtool/build.gradle | 2 +- 3 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/develop.yml diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml new file mode 100644 index 00000000000..a5447473147 --- /dev/null +++ b/.github/workflows/develop.yml @@ -0,0 +1,121 @@ +name: docker develop + +on: + push: + branches: + - main +env: + registry: docker.io + +jobs: + hadolint: + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Set up Java + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 + with: + distribution: temurin + java-version: 17 + - name: setup gradle + uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true + + - name: hadoLint + run: docker run --rm -i hadolint/hadolint < docker/Dockerfile + buildDocker: + needs: hadolint + permissions: + contents: read + packages: write + + strategy: + fail-fast: false + matrix: + platform: + - ubuntu-22.04 + - [self-hosted, ARM64] + runs-on: ${{ matrix.platform }} + steps: + - name: Prepare + id: prep + run: | + platform=${{ matrix.platform }} + if [ "$platform" = 'ubuntu-22.04' ]; then + echo "PLATFORM_PAIR=linux-amd64" >> $GITHUB_OUTPUT + echo "ARCH=amd64" >> $GITHUB_OUTPUT + else + echo "PLATFORM_PAIR=linux-arm64" >> $GITHUB_OUTPUT + echo "ARCH=arm64" >> $GITHUB_OUTPUT + fi + + # Get the current date and time in the format YY.MM + DATE_TIME=$(date +"%y.%-m") + # Get the short SHA of the merge commit + SHORT_SHA=${GITHUB_SHA::7} + # Construct the build target name + BUILD_TARGET_NAME="${DATE_TIME}-develop-${SHORT_SHA}" + echo "Build Target Name: $BUILD_TARGET_NAME" + # Set the build target name as an environment variable + echo "BUILD_TARGET_NAME=${BUILD_TARGET_NAME}" >> $GITHUB_ENV + + - name: Checkout Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Set up Java + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 + with: + distribution: temurin + java-version: 17 + - name: setup gradle + uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true + - name: install goss + run: | + mkdir -p docker/reports + curl -L https://github.com/aelsabbahy/goss/releases/download/v0.4.4/goss-${{ steps.prep.outputs.PLATFORM_PAIR }} -o ./docker/tests/goss-${{ steps.prep.outputs.PLATFORM_PAIR }} + - name: login to ${{ env.registry }} + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d + with: + registry: ${{ env.registry }} + username: ${{ secrets.DOCKER_USER_RW }} + password: ${{ secrets.DOCKER_PASSWORD_RW }} + - name: build and test docker + uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + env: + architecture: ${{ steps.prep.outputs.ARCH }} + with: + cache-disabled: true + arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{ env.BUILD_TARGET_NAME}} -Prelease.releaseVersion=develop + - name: publish + env: + architecture: ${{ steps.prep.outputs.ARCH }} + run: ./gradlew --no-daemon dockerUpload -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{ env.BUILD_TARGET_NAME }} -Prelease.releaseVersion=develop + multiArch: + needs: buildDocker + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + steps: + - name: Checkout Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Set up Java + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 + with: + distribution: temurin + java-version: 17 + - name: setup gradle + uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true + - name: login to ${{ env.registry }} + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d + with: + registry: ${{ env.registry }} + username: ${{ secrets.DOCKER_USER_RW }} + password: ${{ secrets.DOCKER_PASSWORD_RW }} + - name: multi-arch docker + run: ./gradlew manifestDocker -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{ env.BUILD_TARGET_NAME }} -Prelease.releaseVersion=develop diff --git a/build.gradle b/build.gradle index 63c2b24b882..31eec61f219 100644 --- a/build.gradle +++ b/build.gradle @@ -979,6 +979,7 @@ def getGitCommitDetails(length = 8) { def isInterimBuild(dockerBuildVersion) { return (dockerBuildVersion ==~ /.*-SNAPSHOT/) || (dockerBuildVersion ==~ /.*-alpha/) || (dockerBuildVersion ==~ /.*-beta/) || (dockerBuildVersion ==~ /.*-RC.*/) + || (dockerBuildVersion ==~ /.*develop.*/) } tasks.register("verifyDistributions") { diff --git a/ethereum/evmtool/build.gradle b/ethereum/evmtool/build.gradle index db582bcb02f..0d1700082fa 100644 --- a/ethereum/evmtool/build.gradle +++ b/ethereum/evmtool/build.gradle @@ -139,7 +139,7 @@ tasks.register('dockerUpload', Exec) { additionalTags.add('develop') } - if (!(dockerBuildVersion ==~ /.*-SNAPSHOT/)) { + if (!(dockerBuildVersion ==~ /.*-SNAPSHOT/ || dockerBuildVersion ==~/.*develop.*/)) { additionalTags.add('latest') additionalTags.add(dockerBuildVersion.split(/\./)[0..1].join('.')) } From da03bf241707d21dddb72888dfa87b3a5a66c46e Mon Sep 17 00:00:00 2001 From: ahamlat Date: Mon, 15 Apr 2024 09:53:58 +0200 Subject: [PATCH 12/59] Change block miner log to include all the performance number on one line with Info level (#6939) Signed-off-by: Ameziane H Co-authored-by: Sally MacFarlane --- .../besu/ethereum/blockcreation/BlockMiner.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockMiner.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockMiner.java index bdeac24be10..646e6d52510 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockMiner.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockMiner.java @@ -170,16 +170,15 @@ protected boolean mineBlock() throws InterruptedException { private void logProducedBlock(final Block block, final BlockCreationTiming blockCreationTiming) { LOG.info( String.format( - "Produced #%,d / %d tx / %d om / %,d (%01.1f%%) gas / (%s) in %01.3fs", + "Produced #%,d / %d tx / %d om / %,d (%01.1f%%) gas / (%s) in %01.3fs / Timing(%s)", block.getHeader().getNumber(), block.getBody().getTransactions().size(), block.getBody().getOmmers().size(), block.getHeader().getGasUsed(), (block.getHeader().getGasUsed() * 100.0) / block.getHeader().getGasLimit(), block.getHash(), - blockCreationTiming.end("log").toMillis() / 1000.0)); - - LOG.debug("Timing #{} / {}", block.getHeader().getNumber(), blockCreationTiming); + blockCreationTiming.end("log").toMillis() / 1000.0, + blockCreationTiming)); } public void cancel() { From b1d8554e236047d2944050202c6009bef54bb3f9 Mon Sep 17 00:00:00 2001 From: Simon Dudley Date: Tue, 16 Apr 2024 10:54:37 +1000 Subject: [PATCH 13/59] Revert 7e46889 which slowed down ATs (#6948) This reverts commit 7e46889817b718d21b385c0568b19163ca9c1372. Signed-off-by: Simon Dudley --- .../acceptance/dsl/AcceptanceTestBase.java | 9 ++++++--- .../tests/acceptance/dsl/node/BesuNode.java | 15 --------------- .../dsl/node/ProcessBesuNodeRunner.java | 18 ++++++------------ 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/AcceptanceTestBase.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/AcceptanceTestBase.java index 0e1f6d65d5f..cac4deb9d9b 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/AcceptanceTestBase.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/AcceptanceTestBase.java @@ -56,12 +56,15 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import org.junit.jupiter.api.AfterEach; +import org.junit.After; import org.junit.jupiter.api.extension.ExtendWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** Superclass for acceptance tests. */ +/** + * Superclass for acceptance tests. For now (transition to junit5 is ongoing) this class supports + * junit4 format. + */ @ExtendWith(AcceptanceTestBaseTestWatcher.class) public class AcceptanceTestBase { @@ -128,7 +131,7 @@ protected AcceptanceTestBase() { exitedSuccessfully = new ExitedWithCode(0); } - @AfterEach + @After public void tearDownAcceptanceTestBase() { reportMemory(); cluster.close(); diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java index b2f9bc0abf7..80fbf7f727d 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java @@ -789,21 +789,6 @@ public void stop() { nodeRequests.shutdown(); nodeRequests = null; } - - deleteRuntimeFiles(); - } - - private void deleteRuntimeFiles() { - try { - Files.deleteIfExists(homeDirectory.resolve("besu.networks")); - } catch (IOException e) { - LOG.error("Failed to clean up besu.networks file in {}", homeDirectory, e); - } - try { - Files.deleteIfExists(homeDirectory.resolve("besu.ports")); - } catch (IOException e) { - LOG.error("Failed to clean up besu.ports file in {}", homeDirectory, e); - } } @Override diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java index adf872e19cc..2b80ebea568 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java @@ -52,7 +52,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import org.apache.commons.lang3.SystemUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; @@ -78,15 +77,8 @@ public void startNode(final BesuNode node) { final Path dataDir = node.homeDirectory(); - final var workingDir = - new File(System.getProperty("user.dir")).getParentFile().getParentFile().toPath(); - final List params = new ArrayList<>(); - if (SystemUtils.IS_OS_WINDOWS) { - params.add(workingDir.resolve("build\\install\\besu\\bin\\besu.bat").toString()); - } else { - params.add("build/install/besu/bin/besu"); - } + params.add("build/install/besu/bin/besu"); params.add("--data-path"); params.add(dataDir.toAbsolutePath().toString()); @@ -430,13 +422,15 @@ public void startNode(final BesuNode node) { LOG.info("Creating besu process with params {}", params); final ProcessBuilder processBuilder = new ProcessBuilder(params) - .directory(workingDir.toFile()) + .directory(new File(System.getProperty("user.dir")).getParentFile().getParentFile()) .redirectErrorStream(true) .redirectInput(Redirect.INHERIT); if (!node.getPlugins().isEmpty()) { processBuilder .environment() - .put("BESU_OPTS", "-Dbesu.plugins.dir=" + dataDir.resolve("plugins").toAbsolutePath()); + .put( + "BESU_OPTS", + "-Dbesu.plugins.dir=" + dataDir.resolve("plugins").toAbsolutePath().toString()); } // Use non-blocking randomness for acceptance tests processBuilder @@ -578,7 +572,7 @@ private void killBesuProcess(final String name) { LOG.info("Killing {} process, pid {}", name, process.pid()); - process.descendants().forEach(ProcessHandle::destroy); + process.destroy(); try { process.waitFor(30, TimeUnit.SECONDS); } catch (final InterruptedException e) { From 941ab014266a23a7faf7710f38f86fb0f14f4879 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Tue, 16 Apr 2024 11:17:41 +0200 Subject: [PATCH 14/59] Split acceptance tests by time (#6953) Signed-off-by: Fabio Di Fabio --- .github/workflows/acceptance-tests.yml | 21 +++++------ .github/workflows/splitTestsByTime.sh | 52 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 11 deletions(-) create mode 100755 .github/workflows/splitTestsByTime.sh diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 74ba75c2f91..7b212cdcad1 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -35,6 +35,8 @@ jobs: with: distribution: temurin java-version: 17 + - name: Install required packages + run: sudo apt-get install -y xmlstarlet - name: get acceptance test report uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d with: @@ -48,19 +50,16 @@ jobs: with: cache-disabled: true - name: Split tests - id: split-tests - uses: r7kamura/split-tests-by-timings@9322bd292d9423e2bc5a65bec548901801341e3f + run: .github/workflows/splitTestsByTime.sh tmp/junit-xml-reports-downloaded ${{env.total-runners}} ${{ matrix.runner_index }} > testList.txt + - name: Upload Timing + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + if: matrix.runner_index == 0 with: - reports: tmp/junit-xml-reports-downloaded - glob: 'acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/**/*Test.java' - total: ${{env.total-runners}} - index: ${{ matrix.runner_index }} - - name: write out test list - run: echo "${{ steps.split-tests.outputs.paths }}" >> testList.txt + name: acceptance-tests-timing + path: 'tmp/timing.tsv' - name: format gradle args - #regex means: first truncate file paths to align with package name, then swap path delimiter with package delimiter, - #then drop file extension, then insert --tests option between each. - run: cat testList.txt | sed -e 's@acceptance-tests/tests/src/test/java/@--tests\ @g;s@/@.@g;s/\.java//g' > gradleArgs.txt + # insert --tests option between each. + run: cat testList.txt | sed -e 's/^\| / --tests /g' | tee gradleArgs.txt - name: run acceptance tests run: ./gradlew acceptanceTestNotPrivacy `cat gradleArgs.txt` -Dorg.gradle.parallel=true -Dorg.gradle.caching=true - name: cleanup tempfiles diff --git a/.github/workflows/splitTestsByTime.sh b/.github/workflows/splitTestsByTime.sh new file mode 100755 index 00000000000..3afb614d427 --- /dev/null +++ b/.github/workflows/splitTestsByTime.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +REPORTS_DIR="$1" +SPLIT_COUNT=$2 +SPLIT_INDEX=$3 + +# extract tests time from Junit XML reports +find "$REPORTS_DIR" -type f -name TEST-*.xml | xargs -I{} bash -c "xmlstarlet sel -t -v 'sum(//testcase/@time)' '{}'; echo '{}' | sed 's/.*TEST\-\(.*\)\.xml/ \1/'" > tmp/timing.tsv + +# Sort times in descending order +IFS=$'\n' sorted=($(sort -nr tmp/timing.tsv)) +unset IFS + +sums=() +tests=() + +# Initialize sums +for ((i=0; i Date: Tue, 16 Apr 2024 09:56:26 -0600 Subject: [PATCH 15/59] Update execution-spec-tests support (#6942) Update t8n, b11r, and friends to support current execution spec * bonsai migration introduced issues with deleted storage/accounts * status on pre-constantinople json was invalid * track refund across tx, not call frame * allow tests to be executed by name * fix withdrawal self-destruct test * trace support in execution-spec-tests * fix blob tests * t8n results changes Signed-off-by: Danno Ferrin --- .../besu/evmtool/B11rSubCommand.java | 2 +- .../besu/evmtool/EvmToolCommand.java | 39 ++-- .../besu/evmtool/StateTestSubCommand.java | 15 +- .../hyperledger/besu/evmtool/T8nExecutor.java | 172 ++++++++++-------- .../besu/evmtool/T8nServerSubCommand.java | 102 +++++++++-- .../besu/evmtool/t8n/cancun-blobs-per-tx.json | 4 +- .../BonsaiReferenceTestWorldStateStorage.java | 4 +- .../referencetests/ReferenceTestEnv.java | 25 +-- .../vm/BlockchainReferenceTestTools.java | 32 ++-- .../vm/GeneralStateReferenceTestTools.java | 21 +-- .../besu/evm/frame/MessageFrame.java | 14 +- .../hyperledger/besu/evm/frame/TxValues.java | 5 +- .../evm/operation/AbstractCallOperation.java | 1 - .../operation/AbstractCreateOperation.java | 1 - 14 files changed, 261 insertions(+), 176 deletions(-) diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java index 6c65fc2804e..c48d1cf1da3 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java @@ -56,7 +56,7 @@ @Command( name = COMMAND_NAME, aliases = {COMMAND_ALIAS}, - description = "Execute an Ethereum State Test.", + description = "Block Builder subcommand.", mixinStandardHelpOptions = true, versionProvider = VersionProvider.class) public class B11rSubCommand implements Runnable { diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java index 6a8134e999e..59a72f28254 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java @@ -26,6 +26,7 @@ import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder; import org.hyperledger.besu.ethereum.core.Difficulty; +import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; @@ -33,13 +34,11 @@ import org.hyperledger.besu.evm.Code; import org.hyperledger.besu.evm.EVM; import org.hyperledger.besu.evm.EvmSpecVersion; -import org.hyperledger.besu.evm.account.AccountStorageEntry; import org.hyperledger.besu.evm.code.CodeInvalid; import org.hyperledger.besu.evm.frame.MessageFrame; import org.hyperledger.besu.evm.log.LogsBloomFilter; import org.hyperledger.besu.evm.tracing.OperationTracer; import org.hyperledger.besu.evm.tracing.StandardJsonTracer; -import org.hyperledger.besu.evm.worldstate.WorldState; import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.metrics.MetricsSystemModule; import org.hyperledger.besu.util.LogConfigurator; @@ -58,7 +57,7 @@ import java.util.Deque; import java.util.LinkedHashMap; import java.util.List; -import java.util.NavigableMap; +import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -474,8 +473,9 @@ public void run() { lastTime = stopwatch.elapsed().toNanos(); stopwatch.reset(); if (showJsonAlloc && lastLoop) { + initialMessageFrame.getSelfDestructs().forEach(updater::deleteAccount); updater.commit(); - WorldState worldState = component.getWorldState(); + MutableWorldState worldState = component.getWorldState(); dumpWorldState(worldState, out); } } while (remainingIters-- > 0); @@ -486,34 +486,39 @@ public void run() { } } - public static void dumpWorldState(final WorldState worldState, final PrintWriter out) { + public static void dumpWorldState(final MutableWorldState worldState, final PrintWriter out) { out.println("{"); worldState .streamAccounts(Bytes32.ZERO, Integer.MAX_VALUE) .sorted(Comparator.comparing(o -> o.getAddress().get().toHexString())) .forEach( - account -> { - out.println( - " \"" + account.getAddress().map(Address::toHexString).orElse("-") + "\": {"); + a -> { + var account = worldState.get(a.getAddress().get()); + out.println(" \"" + account.getAddress().toHexString() + "\": {"); if (account.getCode() != null && !account.getCode().isEmpty()) { out.println(" \"code\": \"" + account.getCode().toHexString() + "\","); } - NavigableMap storageEntries = - account.storageEntriesFrom(Bytes32.ZERO, Integer.MAX_VALUE); + var storageEntries = + account.storageEntriesFrom(Bytes32.ZERO, Integer.MAX_VALUE).values().stream() + .map( + e -> + Map.entry( + e.getKey().get(), + account.getStorageValue(UInt256.fromBytes(e.getKey().get())))) + .filter(e -> !e.getValue().isZero()) + .sorted(Map.Entry.comparingByKey()) + .toList(); if (!storageEntries.isEmpty()) { out.println(" \"storage\": {"); out.println( STORAGE_JOINER.join( - storageEntries.values().stream() + storageEntries.stream() .map( - accountStorageEntry -> + e -> " \"" - + accountStorageEntry - .getKey() - .map(UInt256::toQuantityHexString) - .orElse("-") + + e.getKey().toQuantityHexString() + "\": \"" - + accountStorageEntry.getValue().toQuantityHexString() + + e.getValue().toQuantityHexString() + "\"") .toList())); out.println(" },"); diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java index f45797f9643..66b0e26ab87 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java @@ -85,6 +85,11 @@ public class StateTestSubCommand implements Runnable { description = "Force the state tests to run on a specific fork.") private String fork = null; + @Option( + names = {"--test-name"}, + description = "Limit execution to one named test.") + private String testName = null; + @Option( names = {"--data-index"}, description = "Limit execution to one data variable.") @@ -173,10 +178,12 @@ public void run() { private void executeStateTest(final Map generalStateTests) { for (final Map.Entry generalStateTestEntry : generalStateTests.entrySet()) { - generalStateTestEntry - .getValue() - .finalStateSpecs() - .forEach((__, specs) -> traceTestSpecs(generalStateTestEntry.getKey(), specs)); + if (testName == null || testName.equals(generalStateTestEntry.getKey())) { + generalStateTestEntry + .getValue() + .finalStateSpecs() + .forEach((__, specs) -> traceTestSpecs(generalStateTestEntry.getKey(), specs)); + } } } diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java index 683458bf7c0..3b0123b45cc 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java @@ -18,6 +18,7 @@ import static org.hyperledger.besu.ethereum.core.Transaction.REPLAY_PROTECTED_V_BASE; import static org.hyperledger.besu.ethereum.core.Transaction.REPLAY_PROTECTED_V_MIN; import static org.hyperledger.besu.ethereum.core.Transaction.REPLAY_UNPROTECTED_V_BASE; +import static org.hyperledger.besu.ethereum.mainnet.feemarket.ExcessBlobGasCalculator.calculateExcessBlobGasForParent; import static org.hyperledger.besu.ethereum.referencetests.ReferenceTestProtocolSchedules.shouldClearEmptyAccounts; import org.hyperledger.besu.config.StubGenesisConfigOptions; @@ -26,7 +27,6 @@ import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.datatypes.AccessListEntry; import org.hyperledger.besu.datatypes.Address; -import org.hyperledger.besu.datatypes.BlobGas; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.datatypes.VersionedHash; @@ -37,6 +37,7 @@ import org.hyperledger.besu.ethereum.core.TransactionReceipt; import org.hyperledger.besu.ethereum.mainnet.BodyValidation; import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; +import org.hyperledger.besu.ethereum.mainnet.ParentBeaconBlockRootHelper; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.mainnet.TransactionValidationParams; @@ -50,7 +51,7 @@ import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.evm.account.Account; -import org.hyperledger.besu.evm.account.AccountStorageEntry; +import org.hyperledger.besu.evm.gascalculator.GasCalculator; import org.hyperledger.besu.evm.log.Log; import org.hyperledger.besu.evm.tracing.OperationTracer; import org.hyperledger.besu.evm.worldstate.WorldUpdater; @@ -63,10 +64,11 @@ import java.util.Comparator; import java.util.Iterator; import java.util.List; -import java.util.NavigableMap; +import java.util.Map; import java.util.Spliterator; import java.util.Spliterators; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; import java.util.stream.StreamSupport; import com.fasterxml.jackson.databind.JsonNode; @@ -252,20 +254,40 @@ static T8nResult runTest( final MainnetTransactionProcessor processor = protocolSpec.getTransactionProcessor(); final WorldUpdater worldStateUpdater = worldState.updater(); final ReferenceTestBlockchain blockchain = new ReferenceTestBlockchain(blockHeader.getNumber()); + final Wei blobGasPrice = protocolSpec .getFeeMarket() - .blobGasPricePerGas(blockHeader.getExcessBlobGas().orElse(BlobGas.ZERO)); + .blobGasPricePerGas(calculateExcessBlobGasForParent(protocolSpec, blockHeader)); + long blobGasLimit = protocolSpec.getGasLimitCalculator().currentBlobGasLimit(); + referenceTestEnv + .getParentBeaconBlockRoot() + .ifPresent( + bytes32 -> + ParentBeaconBlockRootHelper.storeParentBeaconBlockRoot( + worldStateUpdater.updater(), referenceTestEnv.getTimestamp(), bytes32)); List receipts = new ArrayList<>(); List invalidTransactions = new ArrayList<>(rejections); List validTransactions = new ArrayList<>(); ArrayNode receiptsArray = objectMapper.createArrayNode(); long gasUsed = 0; + long blobGasUsed = 0; for (int i = 0; i < transactions.size(); i++) { Transaction transaction = transactions.get(i); - final Stopwatch timer = Stopwatch.createStarted(); + + GasCalculator gasCalculator = protocolSpec.getGasCalculator(); + int blobCount = transaction.getBlobCount(); + blobGasUsed += gasCalculator.blobGasCost(blobCount); + if (blobGasUsed > blobGasLimit) { + invalidTransactions.add( + new RejectedTransaction( + i, + String.format( + "blob gas (%d) would exceed block maximum %d", blobGasUsed, blobGasLimit))); + continue; + } final OperationTracer tracer; // You should have picked Mercy. final TransactionProcessingResult result; @@ -304,52 +326,51 @@ static T8nResult runTest( if (result.isInvalid()) { invalidTransactions.add( new RejectedTransaction(i, result.getValidationResult().getErrorMessage())); + continue; + } + validTransactions.add(transaction); + + long transactionGasUsed = transaction.getGasLimit() - result.getGasRemaining(); + + gasUsed += transactionGasUsed; + long intrinsicGas = + gasCalculator.transactionIntrinsicGasCost( + transaction.getPayload(), transaction.getTo().isEmpty()); + TransactionReceipt receipt = + protocolSpec + .getTransactionReceiptFactory() + .create(transaction.getType(), result, worldState, gasUsed); + tracer.traceEndTransaction( + worldStateUpdater, + transaction, + result.isSuccessful(), + result.getOutput(), + result.getLogs(), + gasUsed - intrinsicGas, + timer.elapsed(TimeUnit.NANOSECONDS)); + Bytes gasUsedInTransaction = Bytes.ofUnsignedLong(transactionGasUsed); + receipts.add(receipt); + ObjectNode receiptObject = receiptsArray.addObject(); + receiptObject.put( + "root", receipt.getStateRoot() == null ? "0x" : receipt.getStateRoot().toHexString()); + int status = receipt.getStatus(); + receiptObject.put("status", "0x" + Math.max(status, 0)); + receiptObject.put("cumulativeGasUsed", Bytes.ofUnsignedLong(gasUsed).toQuantityHexString()); + receiptObject.put("logsBloom", receipt.getBloomFilter().toHexString()); + if (result.getLogs().isEmpty()) { + receiptObject.putNull("logs"); } else { - validTransactions.add(transaction); - - long transactionGasUsed = transaction.getGasLimit() - result.getGasRemaining(); - - gasUsed += transactionGasUsed; - long intrinsicGas = - protocolSpec - .getGasCalculator() - .transactionIntrinsicGasCost( - transaction.getPayload(), transaction.getTo().isEmpty()); - TransactionReceipt receipt = - protocolSpec - .getTransactionReceiptFactory() - .create(transaction.getType(), result, worldState, gasUsed); - tracer.traceEndTransaction( - worldStateUpdater, - transaction, - result.isSuccessful(), - result.getOutput(), - result.getLogs(), - gasUsed - intrinsicGas, - timer.elapsed(TimeUnit.NANOSECONDS)); - Bytes gasUsedInTransaction = Bytes.ofUnsignedLong(transactionGasUsed); - receipts.add(receipt); - ObjectNode receiptObject = receiptsArray.addObject(); - receiptObject.put( - "root", receipt.getStateRoot() == null ? "0x" : receipt.getStateRoot().toHexString()); - receiptObject.put("status", "0x" + receipt.getStatus()); - receiptObject.put("cumulativeGasUsed", Bytes.ofUnsignedLong(gasUsed).toQuantityHexString()); - receiptObject.put("logsBloom", receipt.getBloomFilter().toHexString()); - if (result.getLogs().isEmpty()) { - receiptObject.putNull("logs"); - } else { - ArrayNode logsArray = receiptObject.putArray("logs"); - for (Log log : result.getLogs()) { - logsArray.addPOJO(log); - } + ArrayNode logsArray = receiptObject.putArray("logs"); + for (Log log : result.getLogs()) { + logsArray.addPOJO(log); } - receiptObject.put("transactionHash", transaction.getHash().toHexString()); - receiptObject.put( - "contractAddress", transaction.contractAddress().orElse(Address.ZERO).toHexString()); - receiptObject.put("gasUsed", gasUsedInTransaction.toQuantityHexString()); - receiptObject.put("blockHash", Hash.ZERO.toHexString()); - receiptObject.put("transactionIndex", Bytes.ofUnsignedLong(i).toQuantityHexString()); } + receiptObject.put("transactionHash", transaction.getHash().toHexString()); + receiptObject.put( + "contractAddress", transaction.contractAddress().orElse(Address.ZERO).toHexString()); + receiptObject.put("gasUsed", gasUsedInTransaction.toQuantityHexString()); + receiptObject.put("blockHash", Hash.ZERO.toHexString()); + receiptObject.put("transactionIndex", Bytes.ofUnsignedLong(i).toQuantityHexString()); } final ObjectNode resultObject = objectMapper.createObjectNode(); @@ -366,19 +387,19 @@ static T8nResult runTest( .incrementBalance(reward); } + worldStateUpdater.commit(); // Invoke the withdrawal processor to handle CL withdrawals. if (!referenceTestEnv.getWithdrawals().isEmpty()) { try { protocolSpec .getWithdrawalsProcessor() .ifPresent( - p -> p.processWithdrawals(referenceTestEnv.getWithdrawals(), worldStateUpdater)); + p -> p.processWithdrawals(referenceTestEnv.getWithdrawals(), worldState.updater())); } catch (RuntimeException re) { resultObject.put("exception", re.getMessage()); } } - worldStateUpdater.commit(); worldState.persist(blockHeader); resultObject.put("stateRoot", worldState.rootHash().toHexString()); @@ -411,41 +432,48 @@ static T8nResult runTest( blockHeader .getWithdrawalsRoot() .ifPresent(wr -> resultObject.put("withdrawalsRoot", wr.toHexString())); - blockHeader - .getBlobGasUsed() - .ifPresentOrElse( - bgu -> resultObject.put("blobGasUsed", Bytes.ofUnsignedLong(bgu).toQuantityHexString()), - () -> - blockHeader - .getExcessBlobGas() - .ifPresent(ebg -> resultObject.put("blobGasUsed", "0x0"))); + AtomicLong bgHolder = new AtomicLong(blobGasUsed); blockHeader .getExcessBlobGas() - .ifPresent(ebg -> resultObject.put("currentExcessBlobGas", ebg.toShortHexString())); + .ifPresent( + ebg -> { + resultObject.put( + "currentExcessBlobGas", + calculateExcessBlobGasForParent(protocolSpec, blockHeader) + .toBytes() + .toQuantityHexString()); + resultObject.put( + "blobGasUsed", Bytes.ofUnsignedLong(bgHolder.longValue()).toQuantityHexString()); + }); ObjectNode allocObject = objectMapper.createObjectNode(); worldState .streamAccounts(Bytes32.ZERO, Integer.MAX_VALUE) .sorted(Comparator.comparing(o -> o.getAddress().get().toHexString())) .forEach( - account -> { - ObjectNode accountObject = - allocObject.putObject( - account.getAddress().map(Address::toHexString).orElse("0x")); + a -> { + var account = worldState.get(a.getAddress().get()); + ObjectNode accountObject = allocObject.putObject(account.getAddress().toHexString()); if (account.getCode() != null && !account.getCode().isEmpty()) { accountObject.put("code", account.getCode().toHexString()); } - NavigableMap storageEntries = - account.storageEntriesFrom(Bytes32.ZERO, Integer.MAX_VALUE); + var storageEntries = + account.storageEntriesFrom(Bytes32.ZERO, Integer.MAX_VALUE).values().stream() + .map( + e -> + Map.entry( + e.getKey().get(), + account.getStorageValue(UInt256.fromBytes(e.getKey().get())))) + .filter(e -> !e.getValue().isZero()) + .sorted(Map.Entry.comparingByKey()) + .toList(); if (!storageEntries.isEmpty()) { ObjectNode storageObject = accountObject.putObject("storage"); - storageEntries.values().stream() - .sorted(Comparator.comparing(a -> a.getKey().get())) - .forEach( - accountStorageEntry -> - storageObject.put( - accountStorageEntry.getKey().map(UInt256::toHexString).orElse("0x"), - accountStorageEntry.getValue().toHexString())); + storageEntries.forEach( + accountStorageEntry -> + storageObject.put( + accountStorageEntry.getKey().toHexString(), + accountStorageEntry.getValue().toHexString())); } accountObject.put("balance", account.getBalance().toShortHexString()); if (account.getNonce() != 0) { diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java index a0ef6384b08..afb12635afd 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java @@ -25,14 +25,19 @@ import org.hyperledger.besu.evm.EvmSpecVersion; import org.hyperledger.besu.evm.internal.EvmConfiguration; import org.hyperledger.besu.evm.tracing.OperationTracer; +import org.hyperledger.besu.evm.tracing.StandardJsonTracer; import org.hyperledger.besu.evmtool.T8nExecutor.RejectedTransaction; import org.hyperledger.besu.util.LogConfigurator; import java.io.ByteArrayOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; import java.io.PrintStream; import java.io.PrintWriter; import java.nio.charset.StandardCharsets; +import java.nio.file.Path; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -49,7 +54,9 @@ import io.vertx.core.http.HttpServerOptions; import io.vertx.core.http.HttpServerRequest; import picocli.CommandLine; +import picocli.CommandLine.ParentCommand; +@SuppressWarnings("java:S106") // using standard output is the point of this class @CommandLine.Command( name = "t8n-server", description = "Run Ethereum State Test server", @@ -66,6 +73,24 @@ public class T8nServerSubCommand implements Runnable { description = "Port to bind to") private int port = 3000; + @CommandLine.Option( + names = {"--output.basedir"}, + paramLabel = "full path", + description = "The output ") + private final Path outDir = Path.of("."); + + @ParentCommand private final EvmToolCommand parentCommand; + + @SuppressWarnings("unused") + public T8nServerSubCommand() { + // PicoCLI requires this + this(null); + } + + T8nServerSubCommand(final EvmToolCommand parentCommand) { + this.parentCommand = parentCommand; + } + @Override public void run() { LogConfigurator.setLevel("", "OFF"); @@ -144,6 +169,57 @@ void handleT8nRequest( } } + T8nExecutor.TracerManager tracerManager; + if (parentCommand.showJsonResults) { + tracerManager = + new T8nExecutor.TracerManager() { + private final Map outputStreams = + new HashMap<>(); + + @Override + public OperationTracer getManagedTracer(final int txIndex, final Hash txHash) + throws Exception { + outDir.toFile().mkdirs(); + var traceDest = + new FileOutputStream( + outDir + .resolve( + String.format("trace-%d-%s.jsonl", txIndex, txHash.toHexString())) + .toFile()); + + var jsonTracer = + new StandardJsonTracer( + new PrintStream(traceDest), + parentCommand.showMemory, + !parentCommand.hideStack, + parentCommand.showReturnData, + parentCommand.showStorage); + outputStreams.put(jsonTracer, traceDest); + return jsonTracer; + } + + @Override + public void disposeTracer(final OperationTracer tracer) throws IOException { + if (outputStreams.containsKey(tracer)) { + outputStreams.remove(tracer).close(); + } + } + }; + } else { + tracerManager = + new T8nExecutor.TracerManager() { + @Override + public OperationTracer getManagedTracer(final int txIndex, final Hash txHash) { + return OperationTracer.NO_TRACING; + } + + @Override + public void disposeTracer(final OperationTracer tracer) { + // single-test mode doesn't need to track tracers + } + }; + } + result = T8nExecutor.runTest( chainId, @@ -154,17 +230,7 @@ void handleT8nRequest( initialWorldState, transactions, rejections, - new T8nExecutor.TracerManager() { - @Override - public OperationTracer getManagedTracer(final int txIndex, final Hash txHash) { - return OperationTracer.NO_TRACING; - } - - @Override - public void disposeTracer(final OperationTracer tracer) { - // No output streams to dispose of - } - }); + tracerManager); } ObjectNode outputObject = objectMapper.createObjectNode(); @@ -172,15 +238,11 @@ public void disposeTracer(final OperationTracer tracer) { outputObject.set("body", result.bodyBytes()); outputObject.set("result", result.resultObject()); - try { - String response = - objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(outputObject); - req.response().setChunked(true); - req.response().putHeader("Content-Type", "application/json").send(response); - } catch (JsonProcessingException e) { - req.response().setStatusCode(500).end(e.getMessage()); - } - } catch (Throwable t) { + String response = + objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(outputObject); + req.response().setChunked(true); + req.response().putHeader("Content-Type", "application/json").send(response); + } catch (Exception t) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos, true, StandardCharsets.UTF_8); t.printStackTrace(ps); diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/cancun-blobs-per-tx.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/cancun-blobs-per-tx.json index 0912b52b81a..d5822aa7d71 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/cancun-blobs-per-tx.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/cancun-blobs-per-tx.json @@ -111,8 +111,8 @@ "gasUsed": "0x5208", "currentBaseFee": "0x7", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "blobGasUsed": "0x0", - "currentExcessBlobGas": "0x0" + "currentExcessBlobGas": "0x0", + "blobGasUsed": "0x20000" } } } diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldStateStorage.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldStateStorage.java index 0993d4425be..6cdbb3834e4 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldStateStorage.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldStateStorage.java @@ -25,6 +25,7 @@ import org.hyperledger.besu.evm.worldstate.WorldState; import java.util.Comparator; +import java.util.Map; import java.util.NavigableMap; import java.util.Optional; import java.util.TreeMap; @@ -53,7 +54,7 @@ public NavigableMap storageEntriesFrom( .stream() .collect( Collectors.toMap( - e -> e.getKey(), + Map.Entry::getKey, e -> AccountStorageEntry.create( UInt256.fromBytes(RLP.decodeValue(e.getValue())), @@ -80,6 +81,7 @@ public Stream streamAccounts( BonsaiAccount.fromRLP(context, address, entry.getValue(), false)))) .filter(Optional::isPresent) .map(Optional::get) + .filter(acct -> context.updater().getAccount(acct.getAddress().orElse(null)) != null) .sorted(Comparator.comparing(account -> account.getAddress().orElse(Address.ZERO))); } } diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java index 8e4b3d0f9b9..4fb35f9724f 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java @@ -107,10 +107,8 @@ public ReferenceTestEnv( @JsonProperty("currentBeaconRoot") final String currentBeaconRoot, @JsonProperty("currentBlobGasUsed") final String currentBlobGasUsed, @JsonProperty("currentCoinbase") final String coinbase, - @JsonProperty("currentDataGasUsed") final String currentDataGasUsed, @JsonProperty("currentDifficulty") final String difficulty, @JsonProperty("currentExcessBlobGas") final String currentExcessBlobGas, - @JsonProperty("currentExcessDataGas") final String currentExcessDataGas, @JsonProperty("currentGasLimit") final String gasLimit, @JsonProperty("currentNumber") final String number, @JsonProperty("currentRandom") final String random, @@ -119,10 +117,8 @@ public ReferenceTestEnv( @JsonProperty("currentWithdrawalsRoot") final String currentWithdrawalsRoot, @JsonProperty("parentBaseFee") final String parentBaseFee, @JsonProperty("parentBlobGasUsed") final String parentBlobGasUsed, - @JsonProperty("parentDataGasUsed") final String parentDataGasUsed, @JsonProperty("parentDifficulty") final String parentDifficulty, @JsonProperty("parentExcessBlobGas") final String parentExcessBlobGas, - @JsonProperty("parentExcessDataGas") final String parentExcessDataGas, @JsonProperty("parentGasLimit") final String parentGasLimit, @JsonProperty("parentGasUsed") final String parentGasUsed, @JsonProperty("parentTimestamp") final String parentTimestamp, @@ -145,12 +141,8 @@ public ReferenceTestEnv( Optional.ofNullable(random).map(Difficulty::fromHexString).orElse(Difficulty.ZERO), 0L, currentWithdrawalsRoot == null ? null : Hash.fromHexString(currentWithdrawalsRoot), - currentBlobGasUsed == null - ? currentDataGasUsed == null ? null : Long.decode(currentDataGasUsed) - : Long.decode(currentBlobGasUsed), - currentExcessBlobGas == null - ? currentExcessDataGas == null ? null : BlobGas.fromHexString(currentExcessDataGas) - : BlobGas.fromHexString(currentExcessBlobGas), + currentBlobGasUsed == null ? null : Long.decode(currentBlobGasUsed), + currentExcessBlobGas == null ? null : BlobGas.of(Long.decode(currentExcessBlobGas)), beaconRoot == null ? null : Bytes32.fromHexString(beaconRoot), null, // depositsRoot null, // exitsRoot @@ -160,9 +152,8 @@ public ReferenceTestEnv( this.parentGasUsed = parentGasUsed; this.parentGasLimit = parentGasLimit; this.parentTimestamp = parentTimestamp; - this.parentExcessBlobGas = - parentExcessBlobGas == null ? parentExcessDataGas : parentExcessBlobGas; - this.parentBlobGasUsed = parentBlobGasUsed == null ? parentDataGasUsed : parentBlobGasUsed; + this.parentExcessBlobGas = parentExcessBlobGas; + this.parentBlobGasUsed = parentBlobGasUsed; this.withdrawals = withdrawals == null ? List.of() @@ -230,12 +221,8 @@ public BlockHeader updateFromParentValues(final ProtocolSpec protocolSpec) { null))); } if (parentExcessBlobGas != null && parentBlobGasUsed != null) { - builder.excessBlobGas( - BlobGas.of( - protocolSpec - .getGasCalculator() - .computeExcessBlobGas( - Long.decode(parentExcessBlobGas), Long.decode(parentBlobGasUsed)))); + builder.excessBlobGas(BlobGas.of(Long.decode(parentExcessBlobGas))); + builder.blobGasUsed(Long.decode(parentBlobGasUsed)); } return builder.buildBlockHeader(); diff --git a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java index 69b3a300205..08d0fb6b6bc 100644 --- a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java +++ b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java @@ -101,12 +101,13 @@ public static Collection generateTestParametersForConfig(final String[ return params.generate(filePath); } + @SuppressWarnings("java:S5960") // this is actually test code public static void executeTest(final BlockchainReferenceTestCaseSpec spec) { final BlockHeader genesisBlockHeader = spec.getGenesisBlockHeader(); final MutableWorldState worldState = spec.getWorldStateArchive() .getMutable(genesisBlockHeader.getStateRoot(), genesisBlockHeader.getHash()) - .get(); + .orElseThrow(); final ProtocolSchedule schedule = REFERENCE_TEST_PROTOCOL_SCHEDULES.getByName(spec.getNetwork()); @@ -126,18 +127,7 @@ public static void executeTest(final BlockchainReferenceTestCaseSpec spec) { final ProtocolSpec protocolSpec = schedule.getByBlockHeader(block.getHeader()); final BlockImporter blockImporter = protocolSpec.getBlockImporter(); - EVM evm = protocolSpec.getEvm(); - if (evm.getEvmConfiguration().worldUpdaterMode() == WorldUpdaterMode.JOURNALED) { - assumeThat( - worldState - .streamAccounts(Bytes32.ZERO, Integer.MAX_VALUE) - .anyMatch(AccountState::isEmpty)) - .withFailMessage("Journaled account configured and empty account detected") - .isFalse(); - assumeThat(EvmSpecVersion.SPURIOUS_DRAGON.compareTo(evm.getEvmVersion()) > 0) - .withFailMessage("Journaled account configured and fork prior to the merge specified") - .isFalse(); - } + verifyJournaledEVMAccountCompatability(worldState, protocolSpec); final HeaderValidationMode validationMode = "NoProof".equalsIgnoreCase(spec.getSealEngine()) @@ -154,4 +144,20 @@ public static void executeTest(final BlockchainReferenceTestCaseSpec spec) { Assertions.assertThat(blockchain.getChainHeadHash()).isEqualTo(spec.getLastBlockHash()); } + + static void verifyJournaledEVMAccountCompatability( + final MutableWorldState worldState, final ProtocolSpec protocolSpec) { + EVM evm = protocolSpec.getEvm(); + if (evm.getEvmConfiguration().worldUpdaterMode() == WorldUpdaterMode.JOURNALED) { + assumeThat( + worldState + .streamAccounts(Bytes32.ZERO, Integer.MAX_VALUE) + .anyMatch(AccountState::isEmpty)) + .withFailMessage("Journaled account configured and empty account detected") + .isFalse(); + assumeThat(EvmSpecVersion.SPURIOUS_DRAGON.compareTo(evm.getEvmVersion()) > 0) + .withFailMessage("Journaled account configured and fork prior to the merge specified") + .isFalse(); + } + } } diff --git a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java index 7d1915b9106..3dde0e6d078 100644 --- a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java +++ b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/GeneralStateReferenceTestTools.java @@ -15,14 +15,13 @@ package org.hyperledger.besu.ethereum.vm; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assumptions.assumeThat; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; -import org.apache.tuweni.bytes.Bytes32; + import org.hyperledger.besu.datatypes.BlobGas; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.Wei; @@ -39,11 +38,7 @@ import org.hyperledger.besu.ethereum.referencetests.ReferenceTestProtocolSchedules; import org.hyperledger.besu.ethereum.referencetests.ReferenceTestWorldState; import org.hyperledger.besu.ethereum.rlp.RLP; -import org.hyperledger.besu.evm.EVM; -import org.hyperledger.besu.evm.EvmSpecVersion; import org.hyperledger.besu.evm.account.Account; -import org.hyperledger.besu.evm.account.AccountState; -import org.hyperledger.besu.evm.internal.EvmConfiguration.WorldUpdaterMode; import org.hyperledger.besu.evm.log.Log; import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.testutil.JsonTestParameters; @@ -121,24 +116,14 @@ public static Collection generateTestParametersForConfig(final String[ return params.generate(filePath); } + @SuppressWarnings("java:S5960") // this is actually test support code, not production code public static void executeTest(final GeneralStateTestCaseEipSpec spec) { final BlockHeader blockHeader = spec.getBlockHeader(); final ReferenceTestWorldState initialWorldState = spec.getInitialWorldState(); final Transaction transaction = spec.getTransaction(); ProtocolSpec protocolSpec = protocolSpec(spec.getFork()); - EVM evm = protocolSpec.getEvm(); - if (evm.getEvmConfiguration().worldUpdaterMode() == WorldUpdaterMode.JOURNALED) { - assumeThat( - initialWorldState - .streamAccounts(Bytes32.ZERO, Integer.MAX_VALUE) - .anyMatch(AccountState::isEmpty)) - .withFailMessage("Journaled account configured and empty account detected") - .isFalse(); - assumeThat(EvmSpecVersion.SPURIOUS_DRAGON.compareTo(evm.getEvmVersion()) > 0) - .withFailMessage("Journaled account configured and fork prior to the merge specified") - .isFalse(); - } + BlockchainReferenceTestTools.verifyJournaledEVMAccountCompatability(initialWorldState, protocolSpec); // Sometimes the tests ask us assemble an invalid transaction. If we have // no valid transaction then there is no test. GeneralBlockChain tests diff --git a/evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java b/evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java index e203649557e..d59e7e45b29 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java @@ -18,6 +18,7 @@ import static java.util.Collections.emptySet; import org.hyperledger.besu.collections.trie.BytesTrieSet; +import org.hyperledger.besu.collections.undo.UndoScalar; import org.hyperledger.besu.collections.undo.UndoSet; import org.hyperledger.besu.collections.undo.UndoTable; import org.hyperledger.besu.datatypes.Address; @@ -220,7 +221,6 @@ public enum Type { // Transaction state fields. private final List logs = new ArrayList<>(); - private long gasRefund = 0L; private final Map refunds = new HashMap<>(); // Execution Environment fields. @@ -414,7 +414,8 @@ public void clearGasRemaining() { * @return the amount of gas available, after deductions. */ public long decrementRemainingGas(final long amount) { - return this.gasRemaining -= amount; + this.gasRemaining -= amount; + return this.gasRemaining; } /** @@ -892,12 +893,12 @@ public List getLogs() { * @param amount The amount to increment the refund */ public void incrementGasRefund(final long amount) { - this.gasRefund += amount; + this.txValues.gasRefunds().set(this.txValues.gasRefunds().get() + amount); } /** Clear the accumulated gas refund. */ public void clearGasRefund() { - gasRefund = 0L; + this.txValues.gasRefunds().set(0L); } /** @@ -906,7 +907,7 @@ public void clearGasRefund() { * @return accumulated gas refund */ public long getGasRefund() { - return gasRefund; + return txValues.gasRefunds().get(); } /** @@ -1731,7 +1732,8 @@ public MessageFrame build() { versionedHashes, UndoTable.of(HashBasedTable.create()), UndoSet.of(new BytesTrieSet<>(Address.SIZE)), - UndoSet.of(new BytesTrieSet<>(Address.SIZE))); + UndoSet.of(new BytesTrieSet<>(Address.SIZE)), + new UndoScalar<>(0L)); updater = worldUpdater; newStatic = isStatic; } else { diff --git a/evm/src/main/java/org/hyperledger/besu/evm/frame/TxValues.java b/evm/src/main/java/org/hyperledger/besu/evm/frame/TxValues.java index 6ef1143530f..eba208d5b5d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/frame/TxValues.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/frame/TxValues.java @@ -14,6 +14,7 @@ */ package org.hyperledger.besu.evm.frame; +import org.hyperledger.besu.collections.undo.UndoScalar; import org.hyperledger.besu.collections.undo.UndoSet; import org.hyperledger.besu.collections.undo.UndoTable; import org.hyperledger.besu.datatypes.Address; @@ -47,7 +48,8 @@ public record TxValues( Optional> versionedHashes, UndoTable transientStorage, UndoSet

creates, - UndoSet
selfDestructs) { + UndoSet
selfDestructs, + UndoScalar gasRefunds) { /** * For all data stored in this record, undo the changes since the mark. @@ -60,5 +62,6 @@ public void undoChanges(final long mark) { transientStorage.undo(mark); creates.undo(mark); selfDestructs.undo(mark); + gasRefunds.undo(mark); } } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCallOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCallOperation.java index 511578d10da..3e038de65ef 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCallOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCallOperation.java @@ -289,7 +289,6 @@ public void complete(final MessageFrame frame, final MessageFrame childFrame) { frame.addLogs(childFrame.getLogs()); frame.addSelfDestructs(childFrame.getSelfDestructs()); frame.addCreates(childFrame.getCreates()); - frame.incrementGasRefund(childFrame.getGasRefund()); final long gasRemaining = childFrame.getRemainingGas(); frame.incrementRemainingGas(gasRemaining); diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java index f18461e2c09..1cac2ceee86 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java @@ -191,7 +191,6 @@ private void complete(final MessageFrame frame, final MessageFrame childFrame, f frame.addLogs(childFrame.getLogs()); frame.addSelfDestructs(childFrame.getSelfDestructs()); frame.addCreates(childFrame.getCreates()); - frame.incrementGasRefund(childFrame.getGasRefund()); if (childFrame.getState() == MessageFrame.State.COMPLETED_SUCCESS) { Address createdAddress = childFrame.getContractAddress(); From 4dd9c65ff7518d2254a45a40aea4f09449fd9a30 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Tue, 16 Apr 2024 23:23:10 +0200 Subject: [PATCH 16/59] Port permissioning acceptance tests to JUnit 5 (#6959) Signed-off-by: Fabio Di Fabio --- ...AndOnchainPermissioningAcceptanceTest.java | 6 ++-- ...ocalConfigPermissioningAcceptanceTest.java | 6 ++-- ...nfigPermissioningImportAcceptanceTest.java | 31 +++++++++---------- ...rtContractPermissioningAcceptanceTest.java | 6 ++-- .../AllowlistPersistorAcceptanceTest.java | 6 ++-- ...lowlistWithDnsPersistorAcceptanceTest.java | 6 ++-- ...AndOnchainPermissioningAcceptanceTest.java | 6 ++-- ...ocalConfigPermissioningAcceptanceTest.java | 6 ++-- ...rtContractPermissioningAcceptanceTest.java | 6 ++-- ...PermissioningIbft2StallAcceptanceTest.java | 2 +- ...tPermissioningOutOfSyncAcceptanceTest.java | 6 ++-- ...ContractPermissioningV2AcceptanceTest.java | 6 ++-- ...tractPermissioningV2DNSAcceptanceTest.java | 6 ++-- ...ermissioningStaticNodesAcceptanceTest.java | 6 ++-- 14 files changed, 52 insertions(+), 53 deletions(-) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalAndOnchainPermissioningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalAndOnchainPermissioningAcceptanceTest.java index 4b6401303be..1d38f7e6c7c 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalAndOnchainPermissioningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalAndOnchainPermissioningAcceptanceTest.java @@ -21,15 +21,15 @@ import java.math.BigInteger; import java.util.Arrays; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class AccountLocalAndOnchainPermissioningAcceptanceTest extends AccountSmartContractPermissioningAcceptanceTestBase { private Account senderC; - @Before + @BeforeEach public void setUp() { senderC = accounts.createAccount("Account-C"); } diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalConfigPermissioningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalConfigPermissioningAcceptanceTest.java index 78a9fee0413..4b163a4efc9 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalConfigPermissioningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalConfigPermissioningAcceptanceTest.java @@ -22,8 +22,8 @@ import java.math.BigInteger; import java.util.Collections; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class AccountLocalConfigPermissioningAcceptanceTest extends AcceptanceTestBase { @@ -31,7 +31,7 @@ public class AccountLocalConfigPermissioningAcceptanceTest extends AcceptanceTes private Account senderA; private Account senderB; - @Before + @BeforeEach public void setUp() throws Exception { senderA = accounts.getPrimaryBenefactor(); senderB = accounts.getSecondaryBenefactor(); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalConfigPermissioningImportAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalConfigPermissioningImportAcceptanceTest.java index 4415a03f807..c3a2ab6e11a 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalConfigPermissioningImportAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalConfigPermissioningImportAcceptanceTest.java @@ -21,20 +21,19 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.cluster.Cluster; import org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfigurationBuilder; -import java.io.File; import java.io.IOException; +import java.nio.file.Files; import java.nio.file.Path; import java.util.List; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class AccountLocalConfigPermissioningImportAcceptanceTest extends AcceptanceTestBase { - @Rule public TemporaryFolder folder = new TemporaryFolder(); + @TempDir Path folder; private static final String GENESIS_FILE = "/ibft/ibft.json"; @@ -45,20 +44,20 @@ public class AccountLocalConfigPermissioningImportAcceptanceTest extends Accepta private BesuNode nodeB; private Cluster permissionedCluster; - @Before + @BeforeEach public void setUp() throws IOException { sender = accounts.getPrimaryBenefactor(); beneficiary = accounts.createAccount("beneficiary"); final List allowList = List.of(sender.getAddress(), beneficiary.getAddress()); - final File sharedFile = folder.newFile(); - persistAllowList(allowList, sharedFile.toPath()); + final Path sharedFile = Files.createFile(folder.resolve("sharedFile")); + persistAllowList(allowList, sharedFile); bootnode = besu.createIbft2NonValidatorBootnode("bootnode", GENESIS_FILE); nodeA = besu.createIbft2NodeWithLocalAccountPermissioning( - "nodeA", GENESIS_FILE, allowList, sharedFile); + "nodeA", GENESIS_FILE, allowList, sharedFile.toFile()); nodeB = besu.createIbft2NodeWithLocalAccountPermissioning( - "nodeB", GENESIS_FILE, allowList, sharedFile); + "nodeB", GENESIS_FILE, allowList, sharedFile.toFile()); permissionedCluster = new Cluster(new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build(), net); @@ -67,12 +66,12 @@ public void setUp() throws IOException { @Test public void transactionFromDeniedAccountShouldNotBreakBlockImport() throws IOException { - final File newPermissionsFile = folder.newFile(); + final Path newPermissionsFile = Files.createFile(folder.resolve("newPermissionsFile")); final List allowList = List.of(beneficiary.getAddress()); - persistAllowList(allowList, newPermissionsFile.toPath()); + persistAllowList(allowList, newPermissionsFile); final BesuNode nodeC = besu.createIbft2NodeWithLocalAccountPermissioning( - "nodeC", GENESIS_FILE, allowList, newPermissionsFile); + "nodeC", GENESIS_FILE, allowList, newPermissionsFile.toFile()); waitForBlockHeight(bootnode, 2); @@ -91,7 +90,7 @@ private void persistAllowList(final List allowList, final Path path) thr AllowlistPersistor.ALLOWLIST_TYPE.ACCOUNTS, allowList, path); } - @After + @AfterEach public void tearDown() { permissionedCluster.stop(); } diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountSmartContractPermissioningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountSmartContractPermissioningAcceptanceTest.java index 6d9e74e04a6..9009721d94d 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountSmartContractPermissioningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountSmartContractPermissioningAcceptanceTest.java @@ -21,8 +21,8 @@ import java.math.BigInteger; import java.util.Collections; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class AccountSmartContractPermissioningAcceptanceTest extends AccountSmartContractPermissioningAcceptanceTestBase { @@ -31,7 +31,7 @@ public class AccountSmartContractPermissioningAcceptanceTest private Account allowedSender; private Account otherAccount; - @Before + @BeforeEach public void setUp() { node = permissionedNode("node1", Collections.emptyList()); permissionedCluster.start(node); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AllowlistPersistorAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AllowlistPersistorAcceptanceTest.java index 5a563cc5264..71258222d78 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AllowlistPersistorAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AllowlistPersistorAcceptanceTest.java @@ -26,8 +26,8 @@ import java.util.Collections; import org.assertj.core.api.Assertions; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class AllowlistPersistorAcceptanceTest extends AcceptanceTestBase { @@ -45,7 +45,7 @@ public class AllowlistPersistorAcceptanceTest extends AcceptanceTestBase { private Account senderB; private Path tempFile; - @Before + @BeforeEach public void setUp() throws Exception { senderA = accounts.getPrimaryBenefactor(); senderB = accounts.getSecondaryBenefactor(); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AllowlistWithDnsPersistorAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AllowlistWithDnsPersistorAcceptanceTest.java index 88c7e783777..08761ef6e07 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AllowlistWithDnsPersistorAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AllowlistWithDnsPersistorAcceptanceTest.java @@ -31,8 +31,8 @@ import java.util.ArrayList; import java.util.Collections; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class AllowlistWithDnsPersistorAcceptanceTest extends AcceptanceTestBase { @@ -48,7 +48,7 @@ public class AllowlistWithDnsPersistorAcceptanceTest extends AcceptanceTestBase private Account senderA; private Path tempFile; - @Before + @BeforeEach public void setUp() throws Exception { ENODE_LOCALHOST_DNS = ENODE_PREFIX + InetAddress.getLocalHost().getHostName() + PORT_SUFFIX; ENODE_LOCALHOST_IP = ENODE_PREFIX + "127.0.0.1" + PORT_SUFFIX; diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalAndOnchainPermissioningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalAndOnchainPermissioningAcceptanceTest.java index 6a7b8e9b35f..3dfdae528a8 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalAndOnchainPermissioningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalAndOnchainPermissioningAcceptanceTest.java @@ -16,8 +16,8 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.Node; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class NodeLocalAndOnchainPermissioningAcceptanceTest extends NodeSmartContractPermissioningAcceptanceTestBase { @@ -27,7 +27,7 @@ public class NodeLocalAndOnchainPermissioningAcceptanceTest private Node allowedNode; private Node forbiddenNode; - @Before + @BeforeEach public void setUp() { bootnode = bootnode("bootnode"); forbiddenNode = node("forbidden-node"); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalConfigPermissioningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalConfigPermissioningAcceptanceTest.java index 7d8128d66c7..d889abb9fbb 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalConfigPermissioningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalConfigPermissioningAcceptanceTest.java @@ -20,8 +20,8 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration; import org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfigurationBuilder; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class NodeLocalConfigPermissioningAcceptanceTest extends AcceptanceTestBase { @@ -31,7 +31,7 @@ public class NodeLocalConfigPermissioningAcceptanceTest extends AcceptanceTestBa private Node allowedNode; private Node permissionedNode; - @Before + @BeforeEach public void setUp() throws Exception { final ClusterConfiguration clusterConfiguration = new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build(); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java index e9442bc0077..8f17c78adde 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java @@ -16,8 +16,8 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.Node; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class NodeSmartContractPermissioningAcceptanceTest extends NodeSmartContractPermissioningAcceptanceTestBase { @@ -27,7 +27,7 @@ public class NodeSmartContractPermissioningAcceptanceTest private Node allowedNode; private Node forbiddenNode; - @Before + @BeforeEach public void setUp() { bootnode = bootnode("bootnode"); forbiddenNode = node("forbidden-node"); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningIbft2StallAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningIbft2StallAcceptanceTest.java index e9da331a9e3..ed48ad9db97 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningIbft2StallAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningIbft2StallAcceptanceTest.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class NodeSmartContractPermissioningIbft2StallAcceptanceTest extends NodeSmartContractPermissioningAcceptanceTestBase { diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java index 2f8adf43867..4315151473b 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java @@ -16,8 +16,8 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.Node; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class NodeSmartContractPermissioningOutOfSyncAcceptanceTest extends NodeSmartContractPermissioningAcceptanceTestBase { @@ -25,7 +25,7 @@ public class NodeSmartContractPermissioningOutOfSyncAcceptanceTest private Node permissionedNodeA; private Node permissionedNodeB; - @Before + @BeforeEach public void setUp() throws InterruptedException { bootnode = bootnode("bootnode"); permissionedNodeA = permissionedNode("permissioned-node-A"); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java index 4e2cb9a8778..843d14004fc 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java @@ -16,8 +16,8 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.Node; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class NodeSmartContractPermissioningV2AcceptanceTest extends NodeSmartContractPermissioningV2AcceptanceTestBase { @@ -27,7 +27,7 @@ public class NodeSmartContractPermissioningV2AcceptanceTest private Node allowedNode; private Node forbiddenNode; - @Before + @BeforeEach public void setUp() { bootnode = bootnode("bootnode"); forbiddenNode = node("forbidden-node"); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2DNSAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2DNSAcceptanceTest.java index b2ed27d7c5d..7a55283e4f4 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2DNSAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2DNSAcceptanceTest.java @@ -24,8 +24,8 @@ import java.net.UnknownHostException; import org.assertj.core.api.Assertions; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class NodeSmartContractPermissioningV2DNSAcceptanceTest extends NodeSmartContractPermissioningV2AcceptanceTestBase { @@ -38,7 +38,7 @@ public class NodeSmartContractPermissioningV2DNSAcceptanceTest final ImmutableEnodeDnsConfiguration enodeDnsConfiguration = ImmutableEnodeDnsConfiguration.builder().dnsEnabled(true).updateEnabled(true).build(); - @Before + @BeforeEach public void setUp() { bootnode = bootnode("bootnode"); forbiddenNode = node("forbidden-node"); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodesSmartContractPermissioningStaticNodesAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodesSmartContractPermissioningStaticNodesAcceptanceTest.java index 57253d474c2..4f516d1cda5 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodesSmartContractPermissioningStaticNodesAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodesSmartContractPermissioningStaticNodesAcceptanceTest.java @@ -24,8 +24,8 @@ import java.util.List; import javax.annotation.Nonnull; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class NodesSmartContractPermissioningStaticNodesAcceptanceTest extends NodeSmartContractPermissioningAcceptanceTestBase { @@ -33,7 +33,7 @@ public class NodesSmartContractPermissioningStaticNodesAcceptanceTest private Node miner; private Node permissionedNode; - @Before + @BeforeEach public void setUp() { miner = miner("miner"); permissionedCluster.start(miner); From b5b7b9f5f04fcf135dd6875d149a7f5489c6cdf9 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Wed, 17 Apr 2024 07:54:08 +1000 Subject: [PATCH 17/59] Peer disconnect message - add client info (#6947) * add client info to disconnect message Signed-off-by: Sally MacFarlane * exclude disconnect reason message since it makes it harder to analyse Signed-off-by: Sally MacFarlane --------- Signed-off-by: Sally MacFarlane --- .../eth/manager/EthProtocolManager.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java index 364b2925224..df1ee33d480 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java @@ -425,16 +425,18 @@ public void handleDisconnect( final PeerConnection connection, final DisconnectReason reason, final boolean initiatedByPeer) { - if (ethPeers.registerDisconnect(connection)) { - LOG.atDebug() - .setMessage("Disconnect - {} - {} - {} - {} peers left") - .addArgument(initiatedByPeer ? "Inbound" : "Outbound") - .addArgument(reason::toString) - .addArgument(() -> connection.getPeer().getLoggableId()) - .addArgument(ethPeers::peerCount) - .log(); - LOG.atTrace().setMessage("{}").addArgument(ethPeers::toString).log(); - } + final boolean wasActiveConnection = ethPeers.registerDisconnect(connection); + LOG.atDebug() + .setMessage("Disconnect - active Connection? {} - {} - {} {} - {} {} - {} peers left") + .addArgument(wasActiveConnection) + .addArgument(initiatedByPeer ? "Inbound" : "Outbound") + .addArgument(reason::getValue) + .addArgument(reason::name) + .addArgument(() -> connection.getPeer().getLoggableId()) + .addArgument(() -> connection.getPeerInfo().getClientId()) + .addArgument(ethPeers::peerCount) + .log(); + LOG.atTrace().setMessage("{}").addArgument(ethPeers::toString).log(); } private void handleStatusMessage(final EthPeer peer, final Message message) { From 02754e8136e85023474bd5c0b8e8c75c37bdcefd Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Wed, 17 Apr 2024 01:31:19 +0200 Subject: [PATCH 18/59] Use tx effective gas price when comparing with min mineable gas price configuration (#6958) Signed-off-by: Fabio Di Fabio Co-authored-by: Sally MacFarlane --- .../BaseFeePrioritizedTransactions.java | 4 +- ...ingTransactionEstimatedMemorySizeTest.java | 12 ++--- .../BaseFeePrioritizedTransactionsTest.java | 48 ++++++++++--------- .../layered/BaseTransactionPoolTest.java | 18 +++++-- .../eth/transactions/layered/LayersTest.java | 6 ++- 5 files changed, 52 insertions(+), 36 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java index e1d10e9ee2a..8c0cd37f0cf 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java @@ -158,10 +158,10 @@ protected boolean promotionFilter(final PendingTransaction pendingTransaction) { // priority txs are promoted even if they pay less if (!pendingTransaction.hasPriority()) { - // check if max fee per gas is higher than the min gas price + // check if effective gas price is higher than the min gas price if (pendingTransaction .getTransaction() - .getMaxGasPrice() + .getEffectiveGasPrice(nextBlockBaseFee) .lessThan(miningParameters.getMinTransactionGasPrice())) { return false; } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java index 1710a6cb230..23d2c6f7c38 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java @@ -69,7 +69,7 @@ public class PendingTransactionEstimatedMemorySizeTest extends BaseTransactionPo @Test public void toSize() { TransactionTestFixture preparedTx = - prepareTransaction(TransactionType.ACCESS_LIST, 10, Wei.of(500), 10, 0); + prepareTransaction(TransactionType.ACCESS_LIST, 10, Wei.of(500), Wei.ZERO, 10, 0); Transaction txTo = preparedTx.to(Optional.of(Address.extract(Bytes32.random()))).createTransaction(KEYS1); BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); @@ -115,7 +115,7 @@ public void toSize() { public void payloadSize() { TransactionTestFixture preparedTx = - prepareTransaction(TransactionType.ACCESS_LIST, 10, Wei.of(500), 10, 0); + prepareTransaction(TransactionType.ACCESS_LIST, 10, Wei.of(500), Wei.ZERO, 10, 0); Transaction txPayload = preparedTx.createTransaction(KEYS1); BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); txPayload.writeTo(rlpOut); @@ -207,7 +207,7 @@ private void blobsWithCommitmentsFieldSize( final long containerSize, final long itemSize) { TransactionTestFixture preparedTx = - prepareTransaction(TransactionType.BLOB, 10, Wei.of(500), 10, 1); + prepareTransaction(TransactionType.BLOB, 10, Wei.of(500), Wei.of(50), 10, 1); Transaction txBlob = preparedTx.createTransaction(KEYS1); BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); TransactionEncoder.encodeRLP(txBlob, rlpOut, EncodingContext.POOLED_TRANSACTION); @@ -239,7 +239,7 @@ private void blobsWithCommitmentsFieldSize( @Test public void blobsWithCommitmentsSize() { TransactionTestFixture preparedTx = - prepareTransaction(TransactionType.BLOB, 10, Wei.of(500), 10, 1); + prepareTransaction(TransactionType.BLOB, 10, Wei.of(500), Wei.of(50), 10, 1); Transaction txBlob = preparedTx.createTransaction(KEYS1); BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); TransactionEncoder.encodeRLP(txBlob, rlpOut, EncodingContext.POOLED_TRANSACTION); @@ -268,7 +268,7 @@ public void blobsWithCommitmentsSize() { public void pendingTransactionSize() { TransactionTestFixture preparedTx = - prepareTransaction(TransactionType.ACCESS_LIST, 10, Wei.of(500), 10, 0); + prepareTransaction(TransactionType.ACCESS_LIST, 10, Wei.of(500), Wei.ZERO, 10, 0); Transaction txPayload = preparedTx.createTransaction(KEYS1); BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); txPayload.writeTo(rlpOut); @@ -300,7 +300,7 @@ public void accessListSize() { final List ales = List.of(ale1); TransactionTestFixture preparedTx = - prepareTransaction(TransactionType.ACCESS_LIST, 0, Wei.of(500), 0, 0); + prepareTransaction(TransactionType.ACCESS_LIST, 0, Wei.of(500), Wei.ZERO, 0, 0); Transaction txAccessList = preparedTx.accessList(ales).createTransaction(KEYS1); BytesValueRLPOutput rlpOut = new BytesValueRLPOutput(); txAccessList.writeTo(rlpOut); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java index 31785fa1898..67c066de9c0 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java @@ -37,7 +37,6 @@ import java.util.Comparator; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.Random; import java.util.function.BiFunction; @@ -45,9 +44,12 @@ import java.util.stream.IntStream; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; public class BaseFeePrioritizedTransactionsTest extends AbstractPrioritizedTransactionsTestBase { private static final FeeMarket EIP1559_FEE_MARKET = FeeMarket.london(0L); + private static final Wei DEFAULT_BASE_FEE = DEFAULT_MIN_GAS_PRICE.subtract(2); private static final Random randomizeTxType = new Random(); @Override @@ -72,7 +74,7 @@ AbstractPrioritizedTransactions getSorter( @Override protected BlockHeader mockBlockHeader() { - return mockBlockHeader(Wei.ONE); + return mockBlockHeader(DEFAULT_BASE_FEE); } private BlockHeader mockBlockHeader(final Wei baseFee) { @@ -112,19 +114,9 @@ protected Transaction createTransactionReplacement( keys); } - @Test - public void shouldPrioritizePriorityFeeThenTimeAddedToPoolOnlyEIP1559Txs() { - shouldPrioritizePriorityFeeThenTimeAddedToPoolSameTypeTxs(EIP1559); - } - - @Test - public void shouldPrioritizeGasPriceThenTimeAddedToPoolOnlyFrontierTxs() { - shouldPrioritizePriorityFeeThenTimeAddedToPoolSameTypeTxs(FRONTIER); - } - @Test public void shouldPrioritizeEffectivePriorityFeeThenTimeAddedToPoolOnMixedTypes() { - final var nextBlockBaseFee = Optional.of(Wei.ONE); + final var nextBlockBaseFee = Optional.of(DEFAULT_MIN_GAS_PRICE.subtract(1)); final PendingTransaction highGasPriceTransaction = createRemotePendingTransaction( @@ -167,7 +159,6 @@ public void shouldPrioritizeEffectivePriorityFeeThenTimeAddedToPoolOnMixedTypes( @Test public void txBelowCurrentMineableMinPriorityFeeIsNotPrioritized() { - setBaseFee(DEFAULT_MIN_GAS_PRICE.subtract(2)); miningParameters.setMinPriorityFeePerGas(Wei.of(5)); final PendingTransaction lowPriorityFeeTx = createRemotePendingTransaction( @@ -179,7 +170,6 @@ public void txBelowCurrentMineableMinPriorityFeeIsNotPrioritized() { @Test public void txWithPriorityBelowCurrentMineableMinPriorityFeeIsPrioritized() { - setBaseFee(DEFAULT_MIN_GAS_PRICE.subtract(2)); miningParameters.setMinPriorityFeePerGas(Wei.of(5)); final PendingTransaction lowGasPriceTx = createRemotePendingTransaction( @@ -188,11 +178,29 @@ public void txWithPriorityBelowCurrentMineableMinPriorityFeeIsPrioritized() { assertTransactionPrioritized(lowGasPriceTx); } - private void shouldPrioritizePriorityFeeThenTimeAddedToPoolSameTypeTxs( + @ParameterizedTest + @EnumSource( + value = TransactionType.class, + names = {"EIP1559", "BLOB"}) + public void txWithEffectiveGasPriceBelowCurrentMineableMinGasPriceIsNotPrioritized( + final TransactionType type) { + final PendingTransaction lowGasPriceTx = + createRemotePendingTransaction( + createTransaction(type, 0, DEFAULT_MIN_GAS_PRICE, Wei.ONE, 0, 1, KEYS1)); + assertThat(prioritizeTransaction(lowGasPriceTx)).isEqualTo(DROPPED); + assertEvicted(lowGasPriceTx); + assertTransactionNotPrioritized(lowGasPriceTx); + } + + @ParameterizedTest + @EnumSource( + value = TransactionType.class, + names = {"EIP1559", "FRONTIER"}) + public void shouldPrioritizePriorityFeeThenTimeAddedToPoolSameTypeTxs( final TransactionType transactionType) { final PendingTransaction highGasPriceTransaction = createRemotePendingTransaction( - createTransaction(0, DEFAULT_MIN_GAS_PRICE.multiply(20), KEYS1)); + createTransaction(0, DEFAULT_MIN_GAS_PRICE.multiply(200), KEYS1)); final var lowValueTxs = IntStream.range(0, MAX_TRANSACTIONS) @@ -202,7 +210,7 @@ private void shouldPrioritizePriorityFeeThenTimeAddedToPoolSameTypeTxs( createTransaction( transactionType, 0, - DEFAULT_MIN_GAS_PRICE.add(1), + DEFAULT_MIN_GAS_PRICE.add(1).multiply(20), 0, SIGNATURE_ALGORITHM.get().generateKeyPair()))) .collect(Collectors.toUnmodifiableList()); @@ -210,8 +218,4 @@ private void shouldPrioritizePriorityFeeThenTimeAddedToPoolSameTypeTxs( shouldPrioritizeValueThenTimeAddedToPool( lowValueTxs.iterator(), highGasPriceTransaction, lowValueTxs.get(0)); } - - private void setBaseFee(final Wei baseFee) { - transactions.blockAdded(EIP1559_FEE_MARKET, mockBlockHeader(baseFee), Map.of()); - } } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java index 160c60c66d9..7d6e44059df 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java @@ -94,7 +94,13 @@ protected Transaction createEIP1559Transaction( protected Transaction createEIP4844Transaction( final long nonce, final KeyPair keys, final int gasFeeMultiplier, final int blobCount) { return createTransaction( - TransactionType.BLOB, nonce, Wei.of(5000L).multiply(gasFeeMultiplier), 0, blobCount, keys); + TransactionType.BLOB, + nonce, + Wei.of(5000L).multiply(gasFeeMultiplier), + Wei.of(5000L).multiply(gasFeeMultiplier).divide(10), + 0, + blobCount, + keys); } protected Transaction createTransaction( @@ -112,17 +118,20 @@ protected Transaction createTransaction( final Wei maxGasPrice, final int payloadSize, final KeyPair keys) { - return createTransaction(type, nonce, maxGasPrice, payloadSize, 0, keys); + return createTransaction( + type, nonce, maxGasPrice, maxGasPrice.divide(10), payloadSize, 0, keys); } protected Transaction createTransaction( final TransactionType type, final long nonce, final Wei maxGasPrice, + final Wei maxPriorityFeePerGas, final int payloadSize, final int blobCount, final KeyPair keys) { - return prepareTransaction(type, nonce, maxGasPrice, payloadSize, blobCount) + return prepareTransaction( + type, nonce, maxGasPrice, maxPriorityFeePerGas, payloadSize, blobCount) .createTransaction(keys); } @@ -130,6 +139,7 @@ protected TransactionTestFixture prepareTransaction( final TransactionType type, final long nonce, final Wei maxGasPrice, + final Wei maxPriorityFeePerGas, final int payloadSize, final int blobCount) { @@ -145,7 +155,7 @@ protected TransactionTestFixture prepareTransaction( } if (type.supports1559FeeMarket()) { tx.maxFeePerGas(Optional.of(maxGasPrice)) - .maxPriorityFeePerGas(Optional.of(maxGasPrice.divide(10))); + .maxPriorityFeePerGas(Optional.of(maxPriorityFeePerGas)); if (type.supportsBlob() && blobCount > 0) { final var versionHashes = IntStream.range(0, blobCount) diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayersTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayersTest.java index c89540fcf76..5ba6bde8dc1 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayersTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayersTest.java @@ -59,6 +59,8 @@ public class LayersTest extends BaseTransactionPoolTest { private static final int MAX_PRIO_TRANSACTIONS = 3; private static final int MAX_FUTURE_FOR_SENDER = 10; + private static final Wei BASE_FEE = Wei.ONE; + private static final Wei MIN_GAS_PRICE = BASE_FEE; private final TransactionPoolConfiguration poolConfig = ImmutableTransactionPoolConfiguration.builder() @@ -96,7 +98,7 @@ public class LayersTest extends BaseTransactionPoolTest { this::transactionReplacementTester, FeeMarket.london(0L), new BlobCache(), - MiningParameters.newDefault()); + MiningParameters.newDefault().setMinTransactionGasPrice(MIN_GAS_PRICE)); private final LayeredPendingTransactions pendingTransactions = new LayeredPendingTransactions(poolConfig, prioritizedTransactions); @@ -1180,7 +1182,7 @@ static Stream providerPrioritySenders() { private static BlockHeader mockBlockHeader() { final BlockHeader blockHeader = mock(BlockHeader.class); - when(blockHeader.getBaseFee()).thenReturn(Optional.of(Wei.ONE)); + when(blockHeader.getBaseFee()).thenReturn(Optional.of(BASE_FEE)); return blockHeader; } From 2bb0a59860ba698291d7c73c85f9f64095e933fb Mon Sep 17 00:00:00 2001 From: StevenMia <166844090+StevenMia@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:09:48 +0800 Subject: [PATCH 19/59] chore: fix some typos in comments (#6951) * chore: fix some typos in comments Signed-off-by: StevenMia * Apply suggestions from code review fix typo Signed-off-by: Sally MacFarlane --------- Signed-off-by: StevenMia Signed-off-by: Sally MacFarlane Co-authored-by: Sally MacFarlane --- .../besu/consensus/ibft/statemachine/IbftController.java | 2 +- .../besu/consensus/qbft/statemachine/QbftController.java | 2 +- .../java/org/hyperledger/besu/ethereum/eth/manager/EthPeer.java | 2 +- .../besu/ethereum/p2p/discovery/PeerDiscoveryTestHelper.java | 2 +- .../besu/metrics/prometheus/PrometheusMetricsSystem.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftController.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftController.java index 2e3c879b76c..c19bd9f1958 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftController.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftController.java @@ -46,7 +46,7 @@ public class IbftController extends BaseBftController { * @param gossiper the gossiper * @param duplicateMessageTracker the duplicate message tracker * @param futureMessageBuffer the future message buffer - * @param sychronizerUpdater the sychronizer updater + * @param sychronizerUpdater the synchronizer updater */ public IbftController( final Blockchain blockchain, diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftController.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftController.java index c639a0f2057..bd2751ff321 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftController.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftController.java @@ -48,7 +48,7 @@ public class QbftController extends BaseBftController { * @param gossiper the gossiper * @param duplicateMessageTracker the duplicate message tracker * @param futureMessageBuffer the future message buffer - * @param sychronizerUpdater the sychronizer updater + * @param sychronizerUpdater the synchronizer updater * @param bftExtraDataCodec the bft extra data codec */ public QbftController( diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeer.java index dba3926f4ac..4ea10ef96e5 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeer.java @@ -461,7 +461,7 @@ void dispatch(final EthMessage ethMessage) { * * @param protocolName the type of protocol the message is for * @param code the message code - * @return a request manager for the received response messsage, or Optional.empty() if this is a + * @return a request manager for the received response message, or Optional.empty() if this is a * request message */ private Optional getRequestManager(final String protocolName, final int code) { diff --git a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryTestHelper.java b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryTestHelper.java index ffc9fb1c300..c29855374ea 100644 --- a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryTestHelper.java +++ b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryTestHelper.java @@ -128,7 +128,7 @@ public void sendMessageBetweenAgents( } /** - * Starts multiple discovery agents with the provided boostrap peers. + * Starts multiple discovery agents with the provided bootstrap peers. * * @param count the number of agents to start * @param bootstrapPeers the list of bootstrap peers diff --git a/metrics/core/src/main/java/org/hyperledger/besu/metrics/prometheus/PrometheusMetricsSystem.java b/metrics/core/src/main/java/org/hyperledger/besu/metrics/prometheus/PrometheusMetricsSystem.java index 59211ee08a7..218f5755101 100644 --- a/metrics/core/src/main/java/org/hyperledger/besu/metrics/prometheus/PrometheusMetricsSystem.java +++ b/metrics/core/src/main/java/org/hyperledger/besu/metrics/prometheus/PrometheusMetricsSystem.java @@ -300,7 +300,7 @@ public String convertToPrometheusName(final MetricCategory category, final Strin /** * Convert to prometheus counter name. Prometheus adds a _total suffix to the name if not present, - * so we remember if the original name already has it, to be able to covert back correctly + * so we remember if the original name already has it, to be able to convert back correctly * * @param category the category * @param name the name From f68db3801b580e11e8b89d9e19782d79ef6c7fe3 Mon Sep 17 00:00:00 2001 From: Simon Dudley Date: Wed, 17 Apr 2024 16:30:48 +1000 Subject: [PATCH 20/59] Fix docker goss test (#6955) Disable IPv6 in docker container for goss_wait test Since docker 26.0.0, IPv6 is used by default but our goss_wait test is expecting ports to be exposed on IPv4. Disabling IPv6 should work for all docker versions --------- Signed-off-by: Simon Dudley Co-authored-by: Usman Saleem --- docker/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test.sh b/docker/test.sh index 1d30224f45a..1538ced8d50 100755 --- a/docker/test.sh +++ b/docker/test.sh @@ -20,7 +20,7 @@ if [[ $i != 0 ]]; then exit $i; fi # we test that things listen on the right interface/port, not what interface the advertise # hence we dont set p2p-host=0.0.0.0 because this sets what its advertising to devp2p; the important piece is that it defaults to listening on all interfaces GOSS_FILES_PATH=$TEST_PATH/01 \ -bash $TEST_PATH/dgoss run $DOCKER_IMAGE \ +bash $TEST_PATH/dgoss run --sysctl net.ipv6.conf.all.disable_ipv6=1 $DOCKER_IMAGE \ --network=dev \ --rpc-http-enabled \ --rpc-ws-enabled \ From 61432831d5728fe16235d59a56c9f203b57ec607 Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Thu, 18 Apr 2024 09:00:39 +1200 Subject: [PATCH 21/59] EIP-7002: Validator Exit contract helper and adding exits to created blocks (#6883) Signed-off-by: Lucas Saldanha --- .../jsonrpc/engine/prague/genesis.json | 18 ++ .../test-cases/01_cancun_prepare_payload.json | 8 +- .../test-cases/02_cancun_getPayloadV3.json | 8 +- .../test-cases/03_cancun_newPayloadV3.json | 8 +- .../04_cancun_forkchoiceUpdatedV3.json | 8 +- .../05_prague_forkchoiceUpdatedV3.json | 10 +- .../test-cases/06_prague_getPayloadV4.json | 15 +- .../test-cases/09_prague_newPayloadV4.json | 25 ++- .../10_prague_forkchoiceUpdatedV3.json | 10 +- .../test-cases/11_prague_getPayloadV4.json | 8 +- .../test-cases/12_cancun_newPayloadV4.json | 42 ++++ ...ague_send_raw_transaction_create_exit.json | 14 ++ .../14_prague_forkchoiceUpdatedV3.json | 34 +++ .../test-cases/15_prague_getPayloadV4.json | 54 +++++ .../results/EngineGetPayloadResultV4.java | 4 +- .../engine/EngineNewPayloadV4Test.java | 5 +- .../blockcreation/AbstractBlockCreator.java | 8 +- .../besu/ethereum/core/ValidatorExit.java | 2 +- .../mainnet/AbstractBlockProcessor.java | 6 + .../mainnet/MainnetBlockBodyValidator.java | 13 ++ .../mainnet/MainnetProtocolSpecs.java | 2 +- .../PragueValidatorExitsValidator.java | 85 ++++++++ .../mainnet/ValidatorExitContractHelper.java | 146 +++++++++++++ .../mainnet/ValidatorExitsValidator.java | 38 +++- .../BlockImportExceptionHandlingTest.java | 3 + .../mainnet/AbstractBlockProcessorTest.java | 3 + .../MainnetBlockBodyValidatorTest.java | 54 ++++- .../mainnet/MainnetBlockProcessorTest.java | 2 + .../PragueValidatorExitsValidatorTest.java | 81 +++++++ .../ValidatorExitContractHelperTest.java | 197 ++++++++++++++++++ .../mainnet/ValidatorExitsValidatorTest.java | 77 +++++++ .../ValidatorExitsValidatorTestFixtures.java | 155 ++++++++++++++ .../MainnetPrecompiledContracts.java | 2 - 33 files changed, 1071 insertions(+), 74 deletions(-) create mode 100644 acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json create mode 100644 acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json create mode 100644 acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json create mode 100644 acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json create mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidator.java create mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelper.java create mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidatorTest.java create mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelperTest.java create mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTest.java create mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTestFixtures.java diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json index 98d388cc0f7..1c8a221858a 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json @@ -32,6 +32,24 @@ "0xa4664C40AACeBD82A2Db79f0ea36C06Bc6A19Adb": { "balance": "1000000000000000000000000000" }, + "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f": { + "comment": "This is the account used to sign the transaction that creates a validator exit", + "balance": "1000000000000000000000000000" + }, + "0x0f1ee3e66777F27a7703400644C6fCE41527E017": { + "comment": "This is the runtime bytecode for the Validator Exit Smart Contract. It was created from the deployment transaction in EIP-7002 (https://eips.ethereum.org/EIPS/eip-7002#deployment)", + "balance": "0", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b36603014156101325760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061013257600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460ed5780604402838201600302600401805490600101805490600101549160601b8160a01c17835260601b8160a01c17826020015260601b906040015260010160a6565b910180921460fe5790600255610109565b90505f6002555f6003555b5f546001546002828201116101205750505f610126565b01600290035b5f555f6001556044025ff35b5f5ffd", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000001": "0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000002": "0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000003": "0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000004": "000000000000000000000000a4664C40AACeBD82A2Db79f0ea36C06Bc6A19Adb", + "0x0000000000000000000000000000000000000000000000000000000000000005": "b10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee9922355", + "0x0000000000000000000000000000000000000000000000000000000000000006": "5d8601f0cb3bcc4ce1af9864779a416e00000000000000000000000000000000" + } + }, "0x4242424242424242424242424242424242424242": { "balance": "0", "code": "0x60806040526004361061003f5760003560e01c806301ffc9a71461004457806322895118146100a4578063621fd130146101ba578063c5f2892f14610244575b600080fd5b34801561005057600080fd5b506100906004803603602081101561006757600080fd5b50357fffffffff000000000000000000000000000000000000000000000000000000001661026b565b604080519115158252519081900360200190f35b6101b8600480360360808110156100ba57600080fd5b8101906020810181356401000000008111156100d557600080fd5b8201836020820111156100e757600080fd5b8035906020019184600183028401116401000000008311171561010957600080fd5b91939092909160208101903564010000000081111561012757600080fd5b82018360208201111561013957600080fd5b8035906020019184600183028401116401000000008311171561015b57600080fd5b91939092909160208101903564010000000081111561017957600080fd5b82018360208201111561018b57600080fd5b803590602001918460018302840111640100000000831117156101ad57600080fd5b919350915035610304565b005b3480156101c657600080fd5b506101cf6110b5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102095781810151838201526020016101f1565b50505050905090810190601f1680156102365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025057600080fd5b506102596110c7565b60408051918252519081900360200190f35b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f8564090700000000000000000000000000000000000000000000000000000000145b92915050565b6030861461035d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118056026913960400191505060405180910390fd5b602084146103b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061179c6036913960400191505060405180910390fd5b6060821461040f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806118786029913960400191505060405180910390fd5b670de0b6b3a7640000341015610470576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118526026913960400191505060405180910390fd5b633b9aca003406156104cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806117d26033913960400191505060405180910390fd5b633b9aca00340467ffffffffffffffff811115610535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061182b6027913960400191505060405180910390fd5b6060610540826114ba565b90507f649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c589898989858a8a6105756020546114ba565b6040805160a0808252810189905290819060208201908201606083016080840160c085018e8e80828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910187810386528c815260200190508c8c808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920188810386528c5181528c51602091820193918e019250908190849084905b83811015610648578181015183820152602001610630565b50505050905090810190601f1680156106755780820380516001836020036101000a031916815260200191505b5086810383528881526020018989808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018881038452895181528951602091820193918b019250908190849084905b838110156106ef5781810151838201526020016106d7565b50505050905090810190601f16801561071c5780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390a1600060028a8a600060801b604051602001808484808284377fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941691909301908152604080517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0818403018152601090920190819052815191955093508392506020850191508083835b602083106107fc57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016107bf565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610859573d6000803e3d6000fd5b5050506040513d602081101561086e57600080fd5b5051905060006002806108846040848a8c6116fe565b6040516020018083838082843780830192505050925050506040516020818303038152906040526040518082805190602001908083835b602083106108f857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016108bb565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610955573d6000803e3d6000fd5b5050506040513d602081101561096a57600080fd5b5051600261097b896040818d6116fe565b60405160009060200180848480828437919091019283525050604080518083038152602092830191829052805190945090925082918401908083835b602083106109f457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016109b7565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610a51573d6000803e3d6000fd5b5050506040513d6020811015610a6657600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b60208310610ada57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a9d565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610b37573d6000803e3d6000fd5b5050506040513d6020811015610b4c57600080fd5b50516040805160208101858152929350600092600292839287928f928f92018383808284378083019250505093505050506040516020818303038152906040526040518082805190602001908083835b60208310610bd957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610b9c565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610c36573d6000803e3d6000fd5b5050506040513d6020811015610c4b57600080fd5b50516040518651600291889160009188916020918201918291908601908083835b60208310610ca957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c6c565b6001836020036101000a0380198251168184511680821785525050505050509050018367ffffffffffffffff191667ffffffffffffffff1916815260180182815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610d4e57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610d11565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610dab573d6000803e3d6000fd5b5050506040513d6020811015610dc057600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b60208310610e3457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610df7565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610e91573d6000803e3d6000fd5b5050506040513d6020811015610ea657600080fd5b50519050858114610f02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260548152602001806117486054913960600191505060405180910390fd5b60205463ffffffff11610f60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117276021913960400191505060405180910390fd5b602080546001019081905560005b60208110156110a9578160011660011415610fa0578260008260208110610f9157fe5b0155506110ac95505050505050565b600260008260208110610faf57fe5b01548460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061102557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610fe8565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015611082573d6000803e3d6000fd5b5050506040513d602081101561109757600080fd5b50519250600282049150600101610f6e565b50fe5b50505050505050565b60606110c26020546114ba565b905090565b6020546000908190815b60208110156112f05781600116600114156111e6576002600082602081106110f557fe5b01548460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061116b57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161112e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa1580156111c8573d6000803e3d6000fd5b5050506040513d60208110156111dd57600080fd5b505192506112e2565b600283602183602081106111f657fe5b015460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061126b57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161122e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa1580156112c8573d6000803e3d6000fd5b5050506040513d60208110156112dd57600080fd5b505192505b6002820491506001016110d1565b506002826112ff6020546114ba565b600060401b6040516020018084815260200183805190602001908083835b6020831061135a57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161131d565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790527fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000095909516920191825250604080518083037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8018152601890920190819052815191955093508392850191508083835b6020831061143f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611402565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa15801561149c573d6000803e3d6000fd5b5050506040513d60208110156114b157600080fd5b50519250505090565b60408051600880825281830190925260609160208201818036833701905050905060c082901b8060071a60f81b826000815181106114f457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060061a60f81b8260018151811061153757fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060051a60f81b8260028151811061157a57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060041a60f81b826003815181106115bd57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060031a60f81b8260048151811061160057fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060021a60f81b8260058151811061164357fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060011a60f81b8260068151811061168657fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060001a60f81b826007815181106116c957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535050919050565b6000808585111561170d578182fd5b83861115611719578182fd5b505082019391909203915056fe4465706f736974436f6e74726163743a206d65726b6c6520747265652066756c6c4465706f736974436f6e74726163743a207265636f6e7374727563746564204465706f7369744461746120646f6573206e6f74206d6174636820737570706c696564206465706f7369745f646174615f726f6f744465706f736974436f6e74726163743a20696e76616c6964207769746864726177616c5f63726564656e7469616c73206c656e6774684465706f736974436f6e74726163743a206465706f7369742076616c7565206e6f74206d756c7469706c65206f6620677765694465706f736974436f6e74726163743a20696e76616c6964207075626b6579206c656e6774684465706f736974436f6e74726163743a206465706f7369742076616c756520746f6f20686967684465706f736974436f6e74726163743a206465706f7369742076616c756520746f6f206c6f774465706f736974436f6e74726163743a20696e76616c6964207369676e6174757265206c656e677468a26469706673582212201dd26f37a621703009abf16e77e69c93dc50c79db7f6cc37543e3e0e3decdc9764736f6c634300060b0033", diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json index 47063a25e4b..8ac474dea4a 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json @@ -4,8 +4,8 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x78a301e0d846bd169889c9755c9aa4ce2972dfc4bd63de61f3303887d3e81f98", - "safeBlockHash": "0x78a301e0d846bd169889c9755c9aa4ce2972dfc4bd63de61f3303887d3e81f98", + "headBlockHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", + "safeBlockHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", "finalizedBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x78a301e0d846bd169889c9755c9aa4ce2972dfc4bd63de61f3303887d3e81f98", + "latestValidHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", "validationError": null }, - "payloadId": "0x282643d459a6f711" + "payloadId": "0x2826439412796511" } }, "statusCode": 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json index c6180edaad3..6af7c3d2f91 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV3", "params": [ - "0x282643d459a6f711" + "0x2826439412796511" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0x78a301e0d846bd169889c9755c9aa4ce2972dfc4bd63de61f3303887d3e81f98", + "parentHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0x9b8c4a9a86cb49252075c0db2f0e72fb1e49350a0f70ea36f26f700201961e62", + "stateRoot": "0xaddb5efeb344ec083c36c46c789e48e6509d82d754aaf4830ca4a51f5c904d84", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -29,7 +29,7 @@ "blockNumber": "0x1", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", - "blockHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315" + "blockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331" }, "blockValue": "0x0", "blobsBundle": { diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json index b8ae8dbd89a..a5394d55b51 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json @@ -4,9 +4,9 @@ "method": "engine_newPayloadV3", "params": [ { - "parentHash": "0x78a301e0d846bd169889c9755c9aa4ce2972dfc4bd63de61f3303887d3e81f98", + "parentHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0x9b8c4a9a86cb49252075c0db2f0e72fb1e49350a0f70ea36f26f700201961e62", + "stateRoot": "0xaddb5efeb344ec083c36c46c789e48e6509d82d754aaf4830ca4a51f5c904d84", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -17,7 +17,7 @@ "transactions": [], "withdrawals": [], "blockNumber": "0x1", - "blockHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", + "blockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "excessBlobGas": "0x0", "blobGasUsed": "0x0" @@ -32,7 +32,7 @@ "id": 67, "result": { "status": "VALID", - "latestValidHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", + "latestValidHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", "validationError": null } }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json index 3e7d9adcb42..f9025cc13f8 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", - "safeBlockHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", - "finalizedBlockHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315" + "headBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "safeBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "finalizedBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331" }, null ], @@ -18,7 +18,7 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", + "latestValidHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", "validationError": null }, "payloadId": null diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json index 30317597867..dd6f9edc87d 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", - "safeBlockHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", - "finalizedBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + "headBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "safeBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "finalizedBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331" }, { "timestamp": "0x20", @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", + "latestValidHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", "validationError": null }, - "payloadId": "0x282643b909febddf" + "payloadId": "0x282643d6e5fecedf" } }, "statusCode": 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json index 7405dbae026..41b58811455 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV4", "params": [ - "0x282643b909febddf" + "0x282643d6e5fecedf" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", + "parentHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0x9b8c4a9a86cb49252075c0db2f0e72fb1e49350a0f70ea36f26f700201961e62", + "stateRoot": "0xa194d7c0cff95750c211567fba96e394faa89644a661dd1c1b75426dc90728e2", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -27,9 +27,14 @@ "transactions": [], "withdrawals": [], "depositReceipts": [], - "exits": [], + "exits": [ + { + "sourceAddress": "0xa4664c40aacebd82a2db79f0ea36c06bc6a19adb", + "validatorPubKey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e" + } + ], "blockNumber": "0x2", - "blockHash": "0x194d190af2a85c418947fecca405eb168c832481f33f618b0c36326ba65d4767", + "blockHash": "0x8494d3fc0fd54898100ffa2bda4c3ffdfb9faa3a4c2b2c1638970721e646c35b", "blobGasUsed": "0x0", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json index 1f63502a891..f2c3bee85f5 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json @@ -4,9 +4,9 @@ "method": "engine_newPayloadV4", "params": [ { - "parentHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", + "parentHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0x14208ac0e218167936e220b72d5d5887a963cb858ea2f2d268518f014a3da3fa", + "stateRoot": "0xd5d6e8c8d57e328871c5b81f078ab69e02466ab0e487c2c597effb4ffc185384", "logsBloom": "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -19,12 +19,23 @@ "0x02f9021c8217de808459682f008459682f0e830271009442424242424242424242424242424242424242428901bc16d674ec800000b901a422895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120749715de5d1226545c6b3790f515d551a5cc5bf1d49c87a696860554d2fc4f14000000000000000000000000000000000000000000000000000000000000003096a96086cff07df17668f35f7418ef8798079167e3f4f9b72ecde17b28226137cf454ab1dd20ef5d924786ab3483c2f9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef20000000000000000000000000000000000000000000000000000000000000060b1acdb2c4d3df3f1b8d3bfd33421660df358d84d78d16c4603551935f4b67643373e7eb63dcb16ec359be0ec41fee33b03a16e80745f2374ff1d3c352508ac5d857c6476d3c3bcf7e6ca37427c9209f17be3af5264c0e2132b3dd1156c28b4e9c080a09f597089338d7f44f5c59f8230bb38f243849228a8d4e9d2e2956e6050f5b2c7a076486996c7e62802b8f95eee114783e4b403fd11093ba96286ff42c595f24452" ], "withdrawals": [], - "depositReceipts" : [ - {"amount":"0x773594000","index":"0x0","pubkey":"0x96a96086cff07df17668f35f7418ef8798079167e3f4f9b72ecde17b28226137cf454ab1dd20ef5d924786ab3483c2f9","signature":"0xb1acdb2c4d3df3f1b8d3bfd33421660df358d84d78d16c4603551935f4b67643373e7eb63dcb16ec359be0ec41fee33b03a16e80745f2374ff1d3c352508ac5d857c6476d3c3bcf7e6ca37427c9209f17be3af5264c0e2132b3dd1156c28b4e9","withdrawalCredentials":"0x003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef2"} + "depositReceipts": [ + { + "amount": "0x773594000", + "index": "0x0", + "pubkey": "0x96a96086cff07df17668f35f7418ef8798079167e3f4f9b72ecde17b28226137cf454ab1dd20ef5d924786ab3483c2f9", + "signature": "0xb1acdb2c4d3df3f1b8d3bfd33421660df358d84d78d16c4603551935f4b67643373e7eb63dcb16ec359be0ec41fee33b03a16e80745f2374ff1d3c352508ac5d857c6476d3c3bcf7e6ca37427c9209f17be3af5264c0e2132b3dd1156c28b4e9", + "withdrawalCredentials": "0x003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef2" + } + ], + "exits": [ + { + "sourceAddress": "0xa4664c40aacebd82a2db79f0ea36c06bc6a19adb", + "validatorPubKey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e" + } ], - "exits": [], "blockNumber": "0x2", - "blockHash": "0x84e13dc50074ba4be5841bd7e453a87b6f77261a8907518a78f3de8c9d877ee7", + "blockHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", "receiptsRoot": "0x79ee3424eb720a3ad4b1c5a372bb8160580cbe4d893778660f34213c685627a9", "blobGasUsed": "0x0" }, @@ -38,7 +49,7 @@ "id": 67, "result": { "status": "VALID", - "latestValidHash": "0x84e13dc50074ba4be5841bd7e453a87b6f77261a8907518a78f3de8c9d877ee7", + "latestValidHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", "validationError": null } }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json index cf4554ddfdc..188503e6215 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x84e13dc50074ba4be5841bd7e453a87b6f77261a8907518a78f3de8c9d877ee7", - "safeBlockHash": "0x84e13dc50074ba4be5841bd7e453a87b6f77261a8907518a78f3de8c9d877ee7", - "finalizedBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + "headBlockHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", + "safeBlockHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", + "finalizedBlockHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae" }, { "timestamp": "0x30", @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x84e13dc50074ba4be5841bd7e453a87b6f77261a8907518a78f3de8c9d877ee7", + "latestValidHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", "validationError": null }, - "payloadId": "0x282643f559414ecf" + "payloadId": "0x2826439bac38c031" } }, "statusCode" : 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json index 7f2a1884518..61d4e0976c8 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV4", "params": [ - "0x282643f559414ecf" + "0x2826439bac38c031" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0x84e13dc50074ba4be5841bd7e453a87b6f77261a8907518a78f3de8c9d877ee7", + "parentHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0x14208ac0e218167936e220b72d5d5887a963cb858ea2f2d268518f014a3da3fa", + "stateRoot": "0xd5d6e8c8d57e328871c5b81f078ab69e02466ab0e487c2c597effb4ffc185384", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -29,7 +29,7 @@ "depositReceipts": [], "exits": [], "blockNumber": "0x3", - "blockHash": "0xec4741580be2d83cde0dcd6346a67a71636d915f5da592f39d4470aecef72020", + "blockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0" }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json new file mode 100644 index 00000000000..9a0e933e3e3 --- /dev/null +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json @@ -0,0 +1,42 @@ +{ + "request": { + "jsonrpc": "2.0", + "method": "engine_newPayloadV3", + "params": [ + { + "parentHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", + "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "stateRoot": "0xd5d6e8c8d57e328871c5b81f078ab69e02466ab0e487c2c597effb4ffc185384", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0x1c9c380", + "gasUsed": "0x0", + "timestamp": "0x30", + "extraData": "0x", + "baseFeePerGas": "0x7", + "transactions": [], + "withdrawals": [], + "depositReceipts": [], + "exits": [], + "blockNumber": "0x3", + "blockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "excessBlobGas": "0x0", + "blobGasUsed": "0x0" + }, + [], + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "id": 67 + }, + "response": { + "jsonrpc": "2.0", + "id": 67, + "result": { + "status": "VALID", + "latestValidHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "validationError": null + } + }, + "statusCode": 200 +} \ No newline at end of file diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json new file mode 100644 index 00000000000..28521cd657a --- /dev/null +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json @@ -0,0 +1,14 @@ +{ + "request": { + "jsonrpc": "2.0", + "method": "eth_sendRawTransaction", + "params": ["0xf8978085e8d4a51000832dc6c0940f1ee3e66777f27a7703400644c6fce41527e01702b08706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243822fdfa01527e82d4155c70f3dc6c1df4ba26f9fb9d7cea03a402a17d630dd5465a82a9aa0378b1a45916be48d98b8ef547df0daf34f2e85037360887d954ccacdc069b222"], + "id": 67 + }, + "response": { + "jsonrpc": "2.0", + "id": 67, + "result": "0xf4aaedb9020f067d720daf555a4ccb6756741365defb4cd9c94c5ba39d64a5e5" + }, + "statusCode": 200 +} \ No newline at end of file diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json new file mode 100644 index 00000000000..1f2540d97dd --- /dev/null +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json @@ -0,0 +1,34 @@ +{ + "request": { + "jsonrpc": "2.0", + "method": "engine_forkchoiceUpdatedV3", + "params": [ + { + "headBlockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "safeBlockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "finalizedBlockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771" + }, + { + "timestamp": "0x40", + "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", + "suggestedFeeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "withdrawals": [], + "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "id": 67 + }, + "response": { + "jsonrpc": "2.0", + "id": 67, + "result": { + "payloadStatus": { + "status": "VALID", + "latestValidHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "validationError": null + }, + "payloadId": "0x282643bbede61941" + } + }, + "statusCode" : 200 +} \ No newline at end of file diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json new file mode 100644 index 00000000000..8cb90d0c357 --- /dev/null +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json @@ -0,0 +1,54 @@ +{ + "request": { + "jsonrpc": "2.0", + "method": "engine_getPayloadV4", + "params": [ + "0x282643bbede61941" + ], + "id": 67 + }, + "response": { + "jsonrpc": "2.0", + "id": 67, + "result": { + "executionPayload": { + "parentHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "stateRoot": "0x99b256355fb804ab33458099469f9a2904b4b4e9171d023334b84d3f0e3a8d43", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0x1c9c380", + "gasUsed": "0x145b3", + "timestamp": "0x40", + "extraData": "0x", + "baseFeePerGas": "0x7", + "excessBlobGas": "0x0", + "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactions": [ + "0xf8978085e8d4a51000832dc6c0940f1ee3e66777f27a7703400644c6fce41527e01702b08706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243822fdfa01527e82d4155c70f3dc6c1df4ba26f9fb9d7cea03a402a17d630dd5465a82a9aa0378b1a45916be48d98b8ef547df0daf34f2e85037360887d954ccacdc069b222" + ], + "withdrawals": [], + "depositReceipts": [], + "exits": [ + { + "sourceAddress": "0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f", + "validatorPubKey": "0x8706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243" + } + ], + "receiptsRoot": "0xf2e2f11f0c553ed811be4460880996149ab3947bd0d2c1330457925a11254514", + "blobGasUsed": "0x0", + "blockHash": "0xb26d2fa98315d4d4cdcae8e5590964787b3343c11ff64eb548179687a612d467", + "blockNumber": "0x4" + }, + "blockValue": "0x12838c23cb1481b", + "blobsBundle": { + "commitments": [], + "proofs": [], + "blobs": [] + }, + "shouldOverrideBuilder": false + } + }, + "statusCode": 200, + "waitTime": 1500 +} \ No newline at end of file diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java index b88049bee45..de96619853f 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java @@ -132,8 +132,8 @@ public PayloadResult( this.exits = exits .map( - ds -> - ds.stream() + exit -> + exit.stream() .map(ValidatorExitParameter::fromValidatorExit) .collect(Collectors.toList())) .orElse(null); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java index 54dbc3d8e6a..4695d63dd3b 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java @@ -44,6 +44,7 @@ import org.hyperledger.besu.ethereum.core.Withdrawal; import org.hyperledger.besu.ethereum.mainnet.BodyValidation; import org.hyperledger.besu.ethereum.mainnet.DepositsValidator; +import org.hyperledger.besu.ethereum.mainnet.PragueValidatorExitsValidator; import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidator; import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator; @@ -196,7 +197,7 @@ public void shouldReturnValidIfExitsIsNull_WhenExitsProhibited() { @Test public void shouldReturnInvalidIfExitsIsNull_WhenExitsAllowed() { - when(protocolSpec.getExitsValidator()).thenReturn(new ValidatorExitsValidator.AllowedExits()); + when(protocolSpec.getExitsValidator()).thenReturn(new PragueValidatorExitsValidator()); var resp = resp( @@ -216,7 +217,7 @@ public void shouldReturnValidIfExitsIsNotNull_WhenExitsAllowed() { final List validatorExitsParams = List.of(VALIDATOR_EXIT_PARAMETER_1); final List validatorExits = List.of(VALIDATOR_EXIT_PARAMETER_1.toValidatorExit()); - when(protocolSpec.getExitsValidator()).thenReturn(new ValidatorExitsValidator.AllowedExits()); + when(protocolSpec.getExitsValidator()).thenReturn(new PragueValidatorExitsValidator()); BlockHeader mockHeader = setupValidPayload( diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java index a1fec9475d1..aaa6dce2c4c 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java @@ -50,6 +50,7 @@ import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; +import org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper; import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidator; import org.hyperledger.besu.ethereum.mainnet.WithdrawalsProcessor; import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket; @@ -255,12 +256,11 @@ protected BlockCreationResult createBlock( throwIfStopped(); - // TODO implement logic to retrieve validator exits from precompile - // https://github.com/hyperledger/besu/issues/6800 final ValidatorExitsValidator exitsValidator = newProtocolSpec.getExitsValidator(); Optional> maybeExits = Optional.empty(); - if (exitsValidator instanceof ValidatorExitsValidator.AllowedExits) { - maybeExits = Optional.of(List.of()); + if (exitsValidator.allowValidatorExits()) { + maybeExits = + Optional.of(ValidatorExitContractHelper.popExitsFromQueue(disposableWorldState)); } throwIfStopped(); diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ValidatorExit.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ValidatorExit.java index 5ebc75a6dc8..d45bb0d465b 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ValidatorExit.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ValidatorExit.java @@ -64,7 +64,7 @@ public String toString() { return "ValidatorExit{" + "sourceAddress=" + sourceAddress - + "validatorPubKey=" + + " validatorPubKey=" + validatorPubKey + '}'; } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java index c6cf6898eb1..339582a3da3 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java @@ -197,6 +197,12 @@ public BlockProcessingResult processBlock( } } + final ValidatorExitsValidator exitsValidator = protocolSpec.getExitsValidator(); + if (exitsValidator.allowValidatorExits()) { + // Performing system-call logic + ValidatorExitContractHelper.popExitsFromQueue(worldState); + } + if (!rewardCoinbase(worldState, blockHeader, ommers, skipZeroBlockRewards)) { // no need to log, rewardCoinbase logs the error. if (worldState instanceof BonsaiWorldState) { diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidator.java index abaab920666..cb26168f6a9 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidator.java @@ -20,6 +20,7 @@ import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.TransactionReceipt; +import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.evm.log.LogsBloomFilter; import java.util.HashSet; @@ -108,6 +109,12 @@ public boolean validateBodyLight( return false; } + if (body.getExits().isPresent()) { + if (!validateExits(block, body.getExits().get())) { + return false; + } + } + return true; } @@ -323,4 +330,10 @@ private boolean validateDeposits(final Block block, final List exits) { + final ValidatorExitsValidator exitsValidator = + protocolSchedule.getByBlockHeader(block.getHeader()).getExitsValidator(); + return exitsValidator.validateExitsInBlock(block, exits); + } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java index 0e6dcf91eeb..6483223d9ca 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java @@ -764,7 +764,7 @@ static ProtocolSpecBuilder pragueDefinition( // use prague precompiled contracts .precompileContractRegistryBuilder(MainnetPrecompiledContractRegistries::prague) .depositsValidator(new DepositsValidator.AllowedDeposits(depositContractAddress)) - .exitsValidator(new ValidatorExitsValidator.AllowedExits()) + .exitsValidator(new PragueValidatorExitsValidator()) .name("Prague"); } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidator.java new file mode 100644 index 00000000000..a5fd3bb72cd --- /dev/null +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidator.java @@ -0,0 +1,85 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.hyperledger.besu.ethereum.mainnet; + +import org.hyperledger.besu.datatypes.Hash; +import org.hyperledger.besu.ethereum.core.Block; +import org.hyperledger.besu.ethereum.core.ValidatorExit; + +import java.util.List; +import java.util.Optional; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class PragueValidatorExitsValidator implements ValidatorExitsValidator { + + private static final Logger LOG = LoggerFactory.getLogger(PragueValidatorExitsValidator.class); + + @Override + public boolean allowValidatorExits() { + return true; + } + + @Override + public boolean validateValidatorExitParameter( + final Optional> validatorExits) { + return validatorExits.isPresent(); + } + + @Override + public boolean validateExitsInBlock(final Block block, final List expectedExits) { + final Hash blockHash = block.getHash(); + + if (block.getHeader().getExitsRoot().isEmpty()) { + LOG.warn("Block {} must contain exits_root", blockHash); + return false; + } + + if (block.getBody().getExits().isEmpty()) { + LOG.warn("Block {} must contain exits (even if empty list)", blockHash); + return false; + } + + final List exitsInBlock = block.getBody().getExits().get(); + // TODO Do we need to allow for customization? (e.g. if the value changes in the next fork) + if (exitsInBlock.size() > ValidatorExitContractHelper.MAX_EXITS_PER_BLOCK) { + LOG.warn("Block {} has more than the allowed maximum number of exits", blockHash); + return false; + } + + // Validate exits_root + final Hash expectedExitsRoot = BodyValidation.exitsRoot(exitsInBlock); + if (!expectedExitsRoot.equals(block.getHeader().getExitsRoot().get())) { + LOG.warn( + "Block {} exits_root does not match expected hash root for exits in block", blockHash); + return false; + } + + // Validate exits + final boolean expectedExitsMatch = expectedExits.equals(exitsInBlock); + if (!expectedExitsMatch) { + LOG.warn( + "Block {} has a mismatch between its exits and expected exits (in_block = {}, expected = {})", + blockHash, + exitsInBlock, + expectedExits); + return false; + } + + return true; + } +} diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelper.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelper.java new file mode 100644 index 00000000000..52e41a641c8 --- /dev/null +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelper.java @@ -0,0 +1,146 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.mainnet; + +import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.BLSPublicKey; +import org.hyperledger.besu.datatypes.Hash; +import org.hyperledger.besu.ethereum.core.MutableWorldState; +import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.evm.account.Account; +import org.hyperledger.besu.evm.account.MutableAccount; +import org.hyperledger.besu.evm.worldstate.WorldUpdater; + +import java.util.ArrayList; +import java.util.List; + +import com.google.common.annotations.VisibleForTesting; +import org.apache.tuweni.bytes.Bytes; +import org.apache.tuweni.units.bigints.UInt256; + +/** + * Helper for interacting with the Validator Exit Contract (https://eips.ethereum.org/EIPS/eip-7002) + * + *

TODO: Please note that this is not the spec-way of interacting with the Validator Exit + * contract. See https://github.com/hyperledger/besu/issues/6918 for more information. + */ +public class ValidatorExitContractHelper { + + public static final Address VALIDATOR_EXIT_ADDRESS = + Address.fromHexString("0x0f1ee3e66777F27a7703400644C6fCE41527E017"); + + @VisibleForTesting + // Storage slot to store the difference between number of exits since last block and target exits + // per block + static final UInt256 EXCESS_EXITS_STORAGE_SLOT = UInt256.valueOf(0L); + + @VisibleForTesting + // Storage slot to store the number of exits added since last block + static final UInt256 EXIT_COUNT_STORAGE_SLOT = UInt256.valueOf(1L); + + @VisibleForTesting + static final UInt256 EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT = UInt256.valueOf(2L); + + @VisibleForTesting + static final UInt256 EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT = UInt256.valueOf(3L); + + private static final UInt256 EXIT_MESSAGE_QUEUE_STORAGE_OFFSET = UInt256.valueOf(4L); + // How many slots each exit occupies in the account state + private static final int EXIT_MESSAGE_STORAGE_SLOT_SIZE = 3; + @VisibleForTesting static final int MAX_EXITS_PER_BLOCK = 16; + private static final int TARGET_EXITS_PER_BLOCK = 2; + + /* + Pop the expected list of exits from the validator exit smart contract, updating the queue pointers and other + control variables in the contract state. + */ + public static List popExitsFromQueue(final MutableWorldState mutableWorldState) { + final WorldUpdater worldUpdater = mutableWorldState.updater(); + final MutableAccount account = worldUpdater.getAccount(VALIDATOR_EXIT_ADDRESS); + if (Hash.EMPTY.equals(account.getCodeHash())) { + return List.of(); + } + + final List exits = dequeueExits(account); + updateExcessExits(account); + resetExitCount(account); + + worldUpdater.commit(); + + return exits; + } + + private static List dequeueExits(final MutableAccount account) { + final UInt256 queueHeadIndex = account.getStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT); + final UInt256 queueTailIndex = account.getStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT); + + final List exits = peekExpectedExits(account, queueHeadIndex, queueTailIndex); + + final UInt256 newQueueHeadIndex = queueHeadIndex.plus(exits.size()); + if (newQueueHeadIndex.equals(queueTailIndex)) { + // Queue is empty, reset queue pointers + account.setStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, UInt256.valueOf(0L)); + account.setStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT, UInt256.valueOf(0L)); + } else { + account.setStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, newQueueHeadIndex); + } + + return exits; + } + + private static List peekExpectedExits( + final Account account, final UInt256 queueHeadIndex, final UInt256 queueTailIndex) { + final long numExitsInQueue = queueTailIndex.subtract(queueHeadIndex).toLong(); + final long numExitsDequeued = Long.min(numExitsInQueue, MAX_EXITS_PER_BLOCK); + + final List exits = new ArrayList<>(); + + for (int i = 0; i < numExitsDequeued; i++) { + final UInt256 queueStorageSlot = + EXIT_MESSAGE_QUEUE_STORAGE_OFFSET.plus( + queueHeadIndex.plus(i).multiply(EXIT_MESSAGE_STORAGE_SLOT_SIZE)); + final Address sourceAddress = + Address.wrap(account.getStorageValue(queueStorageSlot).toBytes().slice(12, 20)); + final BLSPublicKey validatorPubKey = + BLSPublicKey.wrap( + Bytes.concatenate( + account + .getStorageValue(queueStorageSlot.plus(1)) + .toBytes() + .slice(0, 32), // no need to slice + account.getStorageValue(queueStorageSlot.plus(2)).toBytes().slice(0, 16))); + + exits.add(new ValidatorExit(sourceAddress, validatorPubKey)); + } + + return exits; + } + + private static void updateExcessExits(final MutableAccount account) { + final UInt256 previousExcessExits = account.getStorageValue(EXCESS_EXITS_STORAGE_SLOT); + final UInt256 exitCount = account.getStorageValue(EXIT_COUNT_STORAGE_SLOT); + + UInt256 newExcessExits = UInt256.valueOf(0L); + if (previousExcessExits.plus(exitCount).toLong() > TARGET_EXITS_PER_BLOCK) { + newExcessExits = previousExcessExits.plus(exitCount).subtract(TARGET_EXITS_PER_BLOCK); + } + + account.setStorageValue(EXCESS_EXITS_STORAGE_SLOT, newExcessExits); + } + + private static void resetExitCount(final MutableAccount account) { + account.setStorageValue(EXIT_COUNT_STORAGE_SLOT, UInt256.valueOf(0L)); + } +} diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidator.java index 06bc803ba5e..762947597ba 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidator.java @@ -16,18 +16,33 @@ package org.hyperledger.besu.ethereum.mainnet; +import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.ValidatorExit; import java.util.List; import java.util.Optional; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public interface ValidatorExitsValidator { + boolean allowValidatorExits(); + boolean validateValidatorExitParameter(Optional> validatorExits); + boolean validateExitsInBlock(Block block, List validatorExits); + /** Used before Prague */ class ProhibitedExits implements ValidatorExitsValidator { + private static final Logger LOG = LoggerFactory.getLogger(ProhibitedExits.class); + + @Override + public boolean allowValidatorExits() { + return false; + } + /** * Before Prague we do not expect to have execution layer triggered exits, so it is expected the * optional parameter will be empty @@ -40,17 +55,22 @@ public boolean validateValidatorExitParameter( final Optional> validatorExits) { return validatorExits.isEmpty(); } - } - - /** Used after Prague */ - class AllowedExits implements ValidatorExitsValidator { @Override - public boolean validateValidatorExitParameter( - final Optional> validatorExits) { - // TODO implement any extra required validation (see - // https://github.com/hyperledger/besu/issues/6800) - return validatorExits.isPresent(); + public boolean validateExitsInBlock( + final Block block, final List validatorExits) { + final Optional> maybeExits = block.getBody().getExits(); + if (maybeExits.isPresent()) { + LOG.warn("Block {} contains exits but exits are prohibited", block.getHash()); + return false; + } + + if (block.getHeader().getExitsRoot().isPresent()) { + LOG.warn("Block {} header contains exits_root but exits are prohibited", block.getHash()); + return false; + } + + return true; } } } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java index d451a6fb7b2..01d9359a6a5 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java @@ -40,6 +40,7 @@ import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; +import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidator; import org.hyperledger.besu.ethereum.storage.StorageProvider; import org.hyperledger.besu.ethereum.trie.diffbased.bonsai.BonsaiWorldStateProvider; import org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage.BonsaiWorldStateKeyValueStorage; @@ -109,6 +110,8 @@ public void setup() { when(protocolContext.getBlockchain()).thenReturn(blockchain); when(protocolContext.getWorldStateArchive()).thenReturn(worldStateArchive); when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); + when(protocolSpec.getExitsValidator()) + .thenReturn(new ValidatorExitsValidator.ProhibitedExits()); mainnetBlockValidator = new MainnetBlockValidator( blockHeaderValidator, blockBodyValidator, blockProcessor, badBlockManager); diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java index 867bfeb7e5f..030db38139f 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java @@ -66,6 +66,9 @@ abstract class AbstractBlockProcessorTest { @BeforeEach void baseSetup() { lenient().when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); + lenient() + .when(protocolSpec.getExitsValidator()) + .thenReturn(new ValidatorExitsValidator.ProhibitedExits()); blockProcessor = new TestBlockProcessor( transactionProcessor, diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java index 8543321b470..fa97168e30e 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java @@ -18,6 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode.NONE; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.when; import org.hyperledger.besu.datatypes.Address; @@ -34,6 +35,7 @@ import java.util.Optional; import org.apache.tuweni.units.bigints.UInt64; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; @@ -50,6 +52,23 @@ class MainnetBlockBodyValidatorTest { @Mock private ProtocolSpec protocolSpec; @Mock private WithdrawalsValidator withdrawalsValidator; @Mock private DepositsValidator depositsValidator; + @Mock private ValidatorExitsValidator exitsValidator; + + @BeforeEach + public void setUp() { + lenient().when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); + + lenient().when(protocolSpec.getWithdrawalsValidator()).thenReturn(withdrawalsValidator); + lenient().when(withdrawalsValidator.validateWithdrawals(any())).thenReturn(true); + lenient().when(withdrawalsValidator.validateWithdrawalsRoot(any())).thenReturn(true); + + lenient().when(protocolSpec.getDepositsValidator()).thenReturn(depositsValidator); + lenient().when(depositsValidator.validateDeposits(any(), any())).thenReturn(true); + lenient().when(depositsValidator.validateDepositsRoot(any())).thenReturn(true); + + lenient().when(protocolSpec.getExitsValidator()).thenReturn(exitsValidator); + lenient().when(exitsValidator.validateExitsInBlock(any(), any())).thenReturn(true); + } @Test void validatesWithdrawals() { @@ -67,13 +86,7 @@ void validatesWithdrawals() { .setWithdrawalsRoot(BodyValidation.withdrawalsRoot(withdrawals))); blockchainSetupUtil.getBlockchain().appendBlock(block, Collections.emptyList()); - when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); - when(protocolSpec.getWithdrawalsValidator()).thenReturn(withdrawalsValidator); - when(protocolSpec.getDepositsValidator()).thenReturn(depositsValidator); when(withdrawalsValidator.validateWithdrawals(Optional.of(withdrawals))).thenReturn(true); - when(withdrawalsValidator.validateWithdrawalsRoot(block)).thenReturn(true); - when(depositsValidator.validateDeposits(any(), any())).thenReturn(true); - when(depositsValidator.validateDepositsRoot(block)).thenReturn(true); assertThat( new MainnetBlockBodyValidator(protocolSchedule) @@ -97,8 +110,6 @@ void validationFailsIfWithdrawalsValidationFails() { .setWithdrawalsRoot(BodyValidation.withdrawalsRoot(withdrawals))); blockchainSetupUtil.getBlockchain().appendBlock(block, Collections.emptyList()); - when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); - when(protocolSpec.getWithdrawalsValidator()).thenReturn(withdrawalsValidator); when(withdrawalsValidator.validateWithdrawals(Optional.empty())).thenReturn(false); assertThat( @@ -123,9 +134,6 @@ void validationFailsIfWithdrawalsRootValidationFails() { .setWithdrawals(Optional.of(withdrawals))); blockchainSetupUtil.getBlockchain().appendBlock(block, Collections.emptyList()); - when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); - when(protocolSpec.getWithdrawalsValidator()).thenReturn(withdrawalsValidator); - when(withdrawalsValidator.validateWithdrawals(Optional.of(withdrawals))).thenReturn(true); when(withdrawalsValidator.validateWithdrawalsRoot(block)).thenReturn(false); assertThat( @@ -134,4 +142,28 @@ void validationFailsIfWithdrawalsRootValidationFails() { blockchainSetupUtil.getProtocolContext(), block, emptyList(), NONE)) .isFalse(); } + + @Test + public void validationFailsIfExitsValidationFails() { + final Block block = + blockDataGenerator.block( + new BlockOptions() + .setBlockNumber(1) + .setGasUsed(0) + .hasTransactions(false) + .hasOmmers(false) + .setReceiptsRoot(BodyValidation.receiptsRoot(emptyList())) + .setLogsBloom(LogsBloomFilter.empty()) + .setParentHash(blockchainSetupUtil.getBlockchain().getChainHeadHash()) + .setExits(Optional.of(List.of()))); + blockchainSetupUtil.getBlockchain().appendBlock(block, Collections.emptyList()); + + when(exitsValidator.validateExitsInBlock(any(), any())).thenReturn(false); + + assertThat( + new MainnetBlockBodyValidator(protocolSchedule) + .validateBodyLight( + blockchainSetupUtil.getProtocolContext(), block, emptyList(), NONE)) + .isFalse(); + } } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockProcessorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockProcessorTest.java index 1b106686bfc..34fe31731d3 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockProcessorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockProcessorTest.java @@ -48,6 +48,8 @@ public class MainnetBlockProcessorTest extends AbstractBlockProcessorTest { @BeforeEach public void setup() { when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); + when(protocolSpec.getExitsValidator()) + .thenReturn(new ValidatorExitsValidator.ProhibitedExits()); } @Test diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidatorTest.java new file mode 100644 index 00000000000..df888f88a89 --- /dev/null +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidatorTest.java @@ -0,0 +1,81 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.mainnet; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsAndExitsRoot; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsMismatch; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsRootMismatch; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsWithoutExitsRoot; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithMoreThanMaximumExits; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithoutExitsAndExitsRoot; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithoutExitsWithExitsRoot; + +import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.ValidateExitTestParameter; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class PragueValidatorExitsValidatorTest { + + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("paramsForValidateValidatorExitParameter") + public void validateValidatorExitParameter( + final String description, + final Optional> maybeExits, + final boolean expectedValidity) { + assertThat(new PragueValidatorExitsValidator().validateValidatorExitParameter(maybeExits)) + .isEqualTo(expectedValidity); + } + + private static Stream paramsForValidateValidatorExitParameter() { + return Stream.of( + Arguments.of("Allowed exits - validating empty exits", Optional.empty(), false), + Arguments.of("Allowed exits - validating present exits", Optional.of(List.of()), true)); + } + + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("validateExitsInBlockParamsForPrague") + public void validateExitsInBlock_WhenPrague( + final ValidateExitTestParameter param, final boolean expectedValidity) { + assertThat( + new PragueValidatorExitsValidator() + .validateExitsInBlock(param.block, param.expectedExits)) + .isEqualTo(expectedValidity); + } + + private static Stream validateExitsInBlockParamsForPrague() { + return Stream.of( + Arguments.of(blockWithExitsAndExitsRoot(), true), + Arguments.of(blockWithExitsWithoutExitsRoot(), false), + Arguments.of(blockWithoutExitsWithExitsRoot(), false), + Arguments.of(blockWithoutExitsAndExitsRoot(), false), + Arguments.of(blockWithExitsRootMismatch(), false), + Arguments.of(blockWithExitsMismatch(), false), + Arguments.of(blockWithMoreThanMaximumExits(), false)); + } + + @Test + public void allowExitsShouldReturnTrue() { + assertThat(new PragueValidatorExitsValidator().allowValidatorExits()).isTrue(); + } +} diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelperTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelperTest.java new file mode 100644 index 00000000000..daf6c48fb95 --- /dev/null +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelperTest.java @@ -0,0 +1,197 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.mainnet; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider.createInMemoryWorldStateArchive; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.EXCESS_EXITS_STORAGE_SLOT; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.EXIT_COUNT_STORAGE_SLOT; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.VALIDATOR_EXIT_ADDRESS; + +import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.BLSPublicKey; +import org.hyperledger.besu.ethereum.core.MutableWorldState; +import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.evm.account.MutableAccount; +import org.hyperledger.besu.evm.worldstate.WorldUpdater; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.apache.tuweni.bytes.Bytes; +import org.apache.tuweni.bytes.Bytes32; +import org.apache.tuweni.bytes.Bytes48; +import org.apache.tuweni.units.bigints.UInt256; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ValidatorExitContractHelperTest { + + private MutableWorldState worldState; + private MutableAccount contract; + + @BeforeEach + public void setUp() { + worldState = createInMemoryWorldStateArchive().getMutable(); + } + + @Test + public void popExitsFromQueue_ReadExitsCorrectly() { + final List validatorExits = List.of(createExit(), createExit(), createExit()); + loadContractStorage(worldState, validatorExits); + + final List poppedExits = + ValidatorExitContractHelper.popExitsFromQueue(worldState); + + assertThat(poppedExits).isEqualTo(validatorExits); + } + + @Test + public void popExitsFromQueue_whenContractCodeIsEmpty_ReturnsEmptyListOfExits() { + // Create account with empty code + final WorldUpdater updater = worldState.updater(); + updater.createAccount(VALIDATOR_EXIT_ADDRESS); + updater.commit(); + + assertThat(ValidatorExitContractHelper.popExitsFromQueue(worldState)).isEmpty(); + } + + @Test + public void popExitsFromQueue_WhenMoreExits_UpdatesQueuePointers() { + // Loading contract with more than 16 exits + final List validatorExits = + IntStream.range(0, 30).mapToObj(__ -> createExit()).collect(Collectors.toList()); + loadContractStorage(worldState, validatorExits); + // After loading the contract, the exit count since last block should match the size of the list + assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, validatorExits.size()); + + final List poppedExits = + ValidatorExitContractHelper.popExitsFromQueue(worldState); + assertThat(poppedExits).hasSize(16); + + // Check that queue pointers were updated successfully (head advanced to index 16) + assertContractStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, 16); + assertContractStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT, 30); + + // We had 30 exits in the queue, and target per block is 2, so we have 28 excess + assertContractStorageValue(EXCESS_EXITS_STORAGE_SLOT, 28); + + // We always reset the exit count after processing the queue + assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, 0); + } + + @Test + public void popExitsFromQueue_WhenNoMoreExits_ZeroQueuePointers() { + final List validatorExits = List.of(createExit(), createExit(), createExit()); + loadContractStorage(worldState, validatorExits); + // After loading the contract, the exit count since last block should match the size of the list + assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, validatorExits.size()); + + final List poppedExits = + ValidatorExitContractHelper.popExitsFromQueue(worldState); + assertThat(poppedExits).hasSize(3); + + // Check that queue pointers were updated successfully (head and tail zero because queue is + // empty) + assertContractStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, 0); + assertContractStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT, 0); + + // We had 3 exits in the queue, target per block is 2, so we have 1 excess + assertContractStorageValue(EXCESS_EXITS_STORAGE_SLOT, 1); + + // We always reset the exit count after processing the queue + assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, 0); + } + + @Test + public void popExitsFromQueue_WhenNoExits_DoesNothing() { + // Loading contract with 0 exits + loadContractStorage(worldState, List.of()); + // After loading storage, we have the exit count as zero because no exits were aded + assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, 0); + + final List poppedExits = + ValidatorExitContractHelper.popExitsFromQueue(worldState); + assertThat(poppedExits).hasSize(0); + + // Check that queue pointers are correct (head and tail are zero) + assertContractStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, 0); + assertContractStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT, 0); + + // We had 0 exits in the queue, and target per block is 2, so we have 0 excess + assertContractStorageValue(EXCESS_EXITS_STORAGE_SLOT, 0); + + // We always reset the exit count after processing the queue + assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, 0); + } + + private void assertContractStorageValue(final UInt256 slot, final int expectedValue) { + assertContractStorageValue(slot, UInt256.valueOf(expectedValue)); + } + + private void assertContractStorageValue(final UInt256 slot, final UInt256 expectedValue) { + assertThat(worldState.get(VALIDATOR_EXIT_ADDRESS).getStorageValue(slot)) + .isEqualTo(expectedValue); + } + + private void loadContractStorage( + final MutableWorldState worldState, final List exits) { + final WorldUpdater updater = worldState.updater(); + contract = updater.getOrCreate(VALIDATOR_EXIT_ADDRESS); + + contract.setCode( + Bytes.fromHexString( + "0x61013680600a5f395ff33373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b36603014156101325760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061013257600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460ed5780604402838201600302600401805490600101805490600101549160601b8160a01c17835260601b8160a01c17826020015260601b906040015260010160a6565b910180921460fe5790600255610109565b90505f6002555f6003555b5f546001546002828201116101205750505f610126565b01600290035b5f555f6001556044025ff35b5f5ffd")); + // excess exits + contract.setStorageValue(UInt256.valueOf(0), UInt256.valueOf(0)); + // exits count + contract.setStorageValue(UInt256.valueOf(1), UInt256.valueOf(exits.size())); + // exits queue head pointer + contract.setStorageValue(UInt256.valueOf(2), UInt256.valueOf(0)); + // exits queue tail pointer + contract.setStorageValue(UInt256.valueOf(3), UInt256.valueOf(exits.size())); + + int offset = 4; + for (int i = 0; i < exits.size(); i++) { + final ValidatorExit exit = exits.get(i); + // source_account + contract.setStorageValue( + // set account to slot, with 12 bytes padding on the left + UInt256.valueOf(offset++), + UInt256.fromBytes( + Bytes.concatenate( + Bytes.fromHexString("0x000000000000000000000000"), exit.getSourceAddress()))); + // validator_pubkey + contract.setStorageValue( + UInt256.valueOf(offset++), UInt256.fromBytes(exit.getValidatorPubKey().slice(0, 32))); + contract.setStorageValue( + // set public key to slot, with 16 bytes padding on the right + UInt256.valueOf(offset++), + UInt256.fromBytes( + Bytes.concatenate( + exit.getValidatorPubKey().slice(32, 16), + Bytes.fromHexString("0x00000000000000000000000000000000")))); + } + updater.commit(); + } + + private ValidatorExit createExit() { + return new ValidatorExit( + Address.extract(Bytes32.random()), BLSPublicKey.wrap(Bytes48.random())); + } +} diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTest.java new file mode 100644 index 00000000000..d4ccf7474df --- /dev/null +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTest.java @@ -0,0 +1,77 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.mainnet; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsAndExitsRoot; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsWithoutExitsRoot; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithoutExitsAndExitsRoot; +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithoutExitsWithExitsRoot; + +import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.ValidateExitTestParameter; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class ValidatorExitsValidatorTest { + + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("paramsForValidateValidatorExitParameter") + public void validateValidatorExitParameter( + final String description, + final Optional> maybeExits, + final boolean expectedValidity) { + assertThat( + new ValidatorExitsValidator.ProhibitedExits() + .validateValidatorExitParameter(maybeExits)) + .isEqualTo(expectedValidity); + } + + private static Stream paramsForValidateValidatorExitParameter() { + return Stream.of( + Arguments.of("Prohibited exits - validating empty exits", Optional.empty(), true), + Arguments.of("Prohibited exits - validating present exits", Optional.of(List.of()), false)); + } + + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("validateExitsInBlockParamsForProhibited") + public void validateExitsInBlock_WhenProhibited( + final ValidateExitTestParameter param, final boolean expectedValidity) { + assertThat( + new ValidatorExitsValidator.ProhibitedExits() + .validateExitsInBlock(param.block, param.expectedExits)) + .isEqualTo(expectedValidity); + } + + private static Stream validateExitsInBlockParamsForProhibited() { + return Stream.of( + Arguments.of(blockWithExitsAndExitsRoot(), false), + Arguments.of(blockWithExitsWithoutExitsRoot(), false), + Arguments.of(blockWithoutExitsWithExitsRoot(), false), + Arguments.of(blockWithoutExitsAndExitsRoot(), true)); + } + + @Test + public void allowExitsShouldReturnFalse() { + assertThat(new ValidatorExitsValidator.ProhibitedExits().allowValidatorExits()).isFalse(); + } +} diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTestFixtures.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTestFixtures.java new file mode 100644 index 00000000000..f030a574163 --- /dev/null +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTestFixtures.java @@ -0,0 +1,155 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.hyperledger.besu.ethereum.mainnet; + +import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.MAX_EXITS_PER_BLOCK; + +import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.BLSPublicKey; +import org.hyperledger.besu.datatypes.Hash; +import org.hyperledger.besu.ethereum.core.Block; +import org.hyperledger.besu.ethereum.core.BlockDataGenerator; +import org.hyperledger.besu.ethereum.core.ValidatorExit; + +import java.util.List; +import java.util.Optional; +import java.util.stream.IntStream; + +import org.apache.tuweni.bytes.Bytes32; +import org.apache.tuweni.bytes.Bytes48; + +public class ValidatorExitsValidatorTestFixtures { + + private static final BlockDataGenerator blockDataGenerator = new BlockDataGenerator(); + + static ValidateExitTestParameter blockWithExitsAndExitsRoot() { + final Optional> maybeExits = Optional.of(List.of(createExit())); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create() + .setExitsRoot(BodyValidation.exitsRoot(maybeExits.get())) + .setExits(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new ValidateExitTestParameter("Block with exits and exits_root", block, maybeExits); + } + + static ValidateExitTestParameter blockWithoutExitsWithExitsRoot() { + final Optional> maybeExits = Optional.empty(); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create().setExitsRoot(Hash.EMPTY).setExits(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new ValidateExitTestParameter( + "Block with exits_root but without exits", block, maybeExits); + } + + static ValidateExitTestParameter blockWithExitsWithoutExitsRoot() { + final Optional> maybeExits = Optional.of(List.of(createExit())); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create().setExits(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new ValidateExitTestParameter( + "Block with exits but without exits_root", block, maybeExits); + } + + static ValidateExitTestParameter blockWithoutExitsAndExitsRoot() { + final Optional> maybeExits = Optional.empty(); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create().setExits(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new ValidateExitTestParameter("Block without exits and exits_root", block, maybeExits); + } + + static ValidateExitTestParameter blockWithExitsRootMismatch() { + final Optional> maybeExits = Optional.of(List.of(createExit())); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create().setExitsRoot(Hash.EMPTY).setExits(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new ValidateExitTestParameter("Block with exits_root mismatch", block, maybeExits); + } + + static ValidateExitTestParameter blockWithExitsMismatch() { + final Optional> maybeExits = + Optional.of(List.of(createExit(), createExit())); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create() + .setExitsRoot(BodyValidation.exitsRoot(maybeExits.get())) + .setExits(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new ValidateExitTestParameter( + "Block with exits mismatch", block, maybeExits, List.of(createExit())); + } + + static ValidateExitTestParameter blockWithMoreThanMaximumExits() { + final List validatorExits = + IntStream.range(0, MAX_EXITS_PER_BLOCK + 1).mapToObj(__ -> createExit()).toList(); + final Optional> maybeExits = Optional.of(validatorExits); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create() + .setExitsRoot(BodyValidation.exitsRoot(maybeExits.get())) + .setExits(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new ValidateExitTestParameter("Block with more than maximum exits", block, maybeExits); + } + + static ValidatorExit createExit() { + return new ValidatorExit( + Address.extract(Bytes32.random()), BLSPublicKey.wrap(Bytes48.random())); + } + + static class ValidateExitTestParameter { + + String description; + Block block; + Optional> maybeExits; + List expectedExits; + + public ValidateExitTestParameter( + final String description, + final Block block, + final Optional> maybeExits) { + this(description, block, maybeExits, maybeExits.orElseGet(List::of)); + } + + public ValidateExitTestParameter( + final String description, + final Block block, + final Optional> maybeExits, + final List expectedExits) { + this.description = description; + this.block = block; + this.maybeExits = maybeExits; + this.expectedExits = expectedExits; + } + + @Override + public String toString() { + return description; + } + } +} diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java index 4fa64db2683..3f9f567dc2d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java @@ -163,8 +163,6 @@ static void populateForPrague( populateForCancun(registry, gasCalculator); // TODO: add Prague precompiles here - // EIP-7002 - Execution layer triggerable exits - // (https://github.com/hyperledger/besu/issues/6800) } /** From a1f73d925e8c50716e6e8e0b043a912dbe71eabc Mon Sep 17 00:00:00 2001 From: Gabriel-Trintinalia Date: Fri, 19 Apr 2024 13:38:35 -0300 Subject: [PATCH 22/59] Enhanced control over plugins registration (#6700) Signed-off-by: Gabriel-Trintinalia --- CHANGELOG.md | 2 + .../dsl/node/ThreadBesuNodeRunner.java | 4 +- .../services/BesuPluginContextImplTest.java | 142 ++++++++--- .../org/hyperledger/besu/cli/BesuCommand.java | 114 ++++++--- .../besu/cli/DefaultCommandValues.java | 3 + .../cli/converter/PluginInfoConverter.java | 53 +++++ .../stable/PluginsConfigurationOptions.java | 63 +++++ .../besu/cli/util/CommandLineUtils.java | 57 +++++ ...> ConfigDefaultValueProviderStrategy.java} | 30 +-- .../besu/services/BesuPluginContextImpl.java | 224 ++++++++++++------ .../cli/CommandLineUtilsDefaultsTest.java | 110 +++++++++ .../besu/cli/CommandLineUtilsTest.java | 1 - ...nfigDefaultValueProviderStrategyTest.java} | 39 ++- .../core/plugins/PluginConfiguration.java | 92 +++++++ .../ethereum/core/plugins/PluginInfo.java | 37 +++ plugin-api/build.gradle | 2 +- .../hyperledger/besu/plugin/BesuPlugin.java | 20 ++ 17 files changed, 799 insertions(+), 194 deletions(-) create mode 100644 besu/src/main/java/org/hyperledger/besu/cli/converter/PluginInfoConverter.java create mode 100644 besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java rename besu/src/main/java/org/hyperledger/besu/cli/util/{ConfigOptionSearchAndRunHandler.java => ConfigDefaultValueProviderStrategy.java} (74%) create mode 100644 besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsDefaultsTest.java rename besu/src/test/java/org/hyperledger/besu/cli/util/{ConfigOptionSearchAndRunHandlerTest.java => ConfigDefaultValueProviderStrategyTest.java} (83%) create mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginConfiguration.java create mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginInfo.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 045968989cc..20833b7f2f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ - Expose bad block events via the BesuEvents plugin API [#6848](https://github.com/hyperledger/besu/pull/6848) - Add RPC errors metric [#6919](https://github.com/hyperledger/besu/pull/6919/) - Add `rlp decode` subcommand to decode IBFT/QBFT extraData to validator list [#6895](https://github.com/hyperledger/besu/pull/6895) +- Allow users to specify which plugins are registered [#6700](https://github.com/hyperledger/besu/pull/6700) + ### Bug fixes - Fix txpool dump/restore race condition [#6665](https://github.com/hyperledger/besu/pull/6665) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java index 5ab01326d70..e0805d57283 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java @@ -31,6 +31,7 @@ import org.hyperledger.besu.ethereum.api.ApiConfiguration; import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration; import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; +import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration; import org.hyperledger.besu.ethereum.eth.transactions.ImmutableTransactionPoolConfiguration; @@ -141,7 +142,8 @@ private BesuPluginContextImpl buildPluginContext( besuPluginContext.addService(PermissioningService.class, permissioningService); besuPluginContext.addService(PrivacyPluginService.class, new PrivacyPluginServiceImpl()); - besuPluginContext.registerPlugins(pluginsPath); + besuPluginContext.registerPlugins(new PluginConfiguration(pluginsPath)); + commandLine.parseArgs(node.getConfiguration().getExtraCLIOptions().toArray(new String[0])); // register built-in plugins diff --git a/acceptance-tests/test-plugins/src/test/java/org/hyperledger/besu/services/BesuPluginContextImplTest.java b/acceptance-tests/test-plugins/src/test/java/org/hyperledger/besu/services/BesuPluginContextImplTest.java index 57797462739..c266eaf66a1 100644 --- a/acceptance-tests/test-plugins/src/test/java/org/hyperledger/besu/services/BesuPluginContextImplTest.java +++ b/acceptance-tests/test-plugins/src/test/java/org/hyperledger/besu/services/BesuPluginContextImplTest.java @@ -16,24 +16,31 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration; +import org.hyperledger.besu.ethereum.core.plugins.PluginInfo; import org.hyperledger.besu.plugin.BesuPlugin; +import org.hyperledger.besu.tests.acceptance.plugins.TestBesuEventsPlugin; import org.hyperledger.besu.tests.acceptance.plugins.TestPicoCLIPlugin; -import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.List; +import java.util.NoSuchElementException; import java.util.Optional; -import org.assertj.core.api.Assertions; import org.assertj.core.api.ThrowableAssert; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; public class BesuPluginContextImplTest { + private static final Path DEFAULT_PLUGIN_DIRECTORY = Paths.get("."); + private BesuPluginContextImpl contextImpl; @BeforeAll public static void createFakePluginDir() throws IOException { @@ -49,16 +56,20 @@ public void clearTestPluginState() { System.clearProperty("testPicoCLIPlugin.testOption"); } + @BeforeEach + void setup() { + contextImpl = new BesuPluginContextImpl(); + } + @Test public void verifyEverythingGoesSmoothly() { - final BesuPluginContextImpl contextImpl = new BesuPluginContextImpl(); + assertThat(contextImpl.getRegisteredPlugins()).isEmpty(); + contextImpl.registerPlugins(new PluginConfiguration(DEFAULT_PLUGIN_DIRECTORY)); + assertThat(contextImpl.getRegisteredPlugins()).isNotEmpty(); - assertThat(contextImpl.getPlugins()).isEmpty(); - contextImpl.registerPlugins(new File(".").toPath()); - assertThat(contextImpl.getPlugins()).isNotEmpty(); - - final Optional testPluginOptional = findTestPlugin(contextImpl.getPlugins()); - Assertions.assertThat(testPluginOptional).isPresent(); + final Optional testPluginOptional = + findTestPlugin(contextImpl.getRegisteredPlugins(), TestPicoCLIPlugin.class); + assertThat(testPluginOptional).isPresent(); final TestPicoCLIPlugin testPicoCLIPlugin = testPluginOptional.get(); assertThat(testPicoCLIPlugin.getState()).isEqualTo("registered"); @@ -72,33 +83,34 @@ public void verifyEverythingGoesSmoothly() { @Test public void registrationErrorsHandledSmoothly() { - final BesuPluginContextImpl contextImpl = new BesuPluginContextImpl(); System.setProperty("testPicoCLIPlugin.testOption", "FAILREGISTER"); - assertThat(contextImpl.getPlugins()).isEmpty(); - contextImpl.registerPlugins(new File(".").toPath()); - assertThat(contextImpl.getPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); + assertThat(contextImpl.getRegisteredPlugins()).isEmpty(); + contextImpl.registerPlugins(new PluginConfiguration(DEFAULT_PLUGIN_DIRECTORY)); + assertThat(contextImpl.getRegisteredPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); contextImpl.beforeExternalServices(); - assertThat(contextImpl.getPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); + assertThat(contextImpl.getRegisteredPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); contextImpl.startPlugins(); - assertThat(contextImpl.getPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); + assertThat(contextImpl.getRegisteredPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); contextImpl.stopPlugins(); - assertThat(contextImpl.getPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); + assertThat(contextImpl.getRegisteredPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); } @Test public void startErrorsHandledSmoothly() { - final BesuPluginContextImpl contextImpl = new BesuPluginContextImpl(); System.setProperty("testPicoCLIPlugin.testOption", "FAILSTART"); - assertThat(contextImpl.getPlugins()).isEmpty(); - contextImpl.registerPlugins(new File(".").toPath()); - assertThat(contextImpl.getPlugins()).extracting("class").contains(TestPicoCLIPlugin.class); + assertThat(contextImpl.getRegisteredPlugins()).isEmpty(); + contextImpl.registerPlugins(new PluginConfiguration(DEFAULT_PLUGIN_DIRECTORY)); + assertThat(contextImpl.getRegisteredPlugins()) + .extracting("class") + .contains(TestPicoCLIPlugin.class); - final Optional testPluginOptional = findTestPlugin(contextImpl.getPlugins()); + final Optional testPluginOptional = + findTestPlugin(contextImpl.getRegisteredPlugins(), TestPicoCLIPlugin.class); assertThat(testPluginOptional).isPresent(); final TestPicoCLIPlugin testPicoCLIPlugin = testPluginOptional.get(); assertThat(testPicoCLIPlugin.getState()).isEqualTo("registered"); @@ -106,22 +118,24 @@ public void startErrorsHandledSmoothly() { contextImpl.beforeExternalServices(); contextImpl.startPlugins(); assertThat(testPicoCLIPlugin.getState()).isEqualTo("failstart"); - assertThat(contextImpl.getPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); + assertThat(contextImpl.getRegisteredPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); contextImpl.stopPlugins(); - assertThat(contextImpl.getPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); + assertThat(contextImpl.getRegisteredPlugins()).isNotInstanceOfAny(TestPicoCLIPlugin.class); } @Test public void stopErrorsHandledSmoothly() { - final BesuPluginContextImpl contextImpl = new BesuPluginContextImpl(); System.setProperty("testPicoCLIPlugin.testOption", "FAILSTOP"); - assertThat(contextImpl.getPlugins()).isEmpty(); - contextImpl.registerPlugins(new File(".").toPath()); - assertThat(contextImpl.getPlugins()).extracting("class").contains(TestPicoCLIPlugin.class); + assertThat(contextImpl.getRegisteredPlugins()).isEmpty(); + contextImpl.registerPlugins(new PluginConfiguration(DEFAULT_PLUGIN_DIRECTORY)); + assertThat(contextImpl.getRegisteredPlugins()) + .extracting("class") + .contains(TestPicoCLIPlugin.class); - final Optional testPluginOptional = findTestPlugin(contextImpl.getPlugins()); + final Optional testPluginOptional = + findTestPlugin(contextImpl.getRegisteredPlugins(), TestPicoCLIPlugin.class); assertThat(testPluginOptional).isPresent(); final TestPicoCLIPlugin testPicoCLIPlugin = testPluginOptional.get(); assertThat(testPicoCLIPlugin.getState()).isEqualTo("registered"); @@ -136,9 +150,8 @@ public void stopErrorsHandledSmoothly() { @Test public void lifecycleExceptions() throws Throwable { - final BesuPluginContextImpl contextImpl = new BesuPluginContextImpl(); final ThrowableAssert.ThrowingCallable registerPlugins = - () -> contextImpl.registerPlugins(new File(".").toPath()); + () -> contextImpl.registerPlugins(new PluginConfiguration(DEFAULT_PLUGIN_DIRECTORY)); assertThatExceptionOfType(IllegalStateException.class).isThrownBy(contextImpl::startPlugins); assertThatExceptionOfType(IllegalStateException.class).isThrownBy(contextImpl::stopPlugins); @@ -158,9 +171,74 @@ public void lifecycleExceptions() throws Throwable { assertThatExceptionOfType(IllegalStateException.class).isThrownBy(contextImpl::stopPlugins); } - private Optional findTestPlugin(final List plugins) { + @Test + public void shouldRegisterAllPluginsWhenNoPluginsOption() { + final PluginConfiguration config = createConfigurationForAllPlugins(); + + assertThat(contextImpl.getRegisteredPlugins()).isEmpty(); + contextImpl.registerPlugins(config); + final Optional testPluginOptional = + findTestPlugin(contextImpl.getRegisteredPlugins(), TestPicoCLIPlugin.class); + assertThat(testPluginOptional).isPresent(); + final TestPicoCLIPlugin testPicoCLIPlugin = testPluginOptional.get(); + assertThat(testPicoCLIPlugin.getState()).isEqualTo("registered"); + } + + @Test + public void shouldRegisterOnlySpecifiedPluginWhenPluginsOptionIsSet() { + final PluginConfiguration config = createConfigurationForSpecificPlugin("TestPicoCLIPlugin"); + + assertThat(contextImpl.getRegisteredPlugins()).isEmpty(); + contextImpl.registerPlugins(config); + + final Optional requestedPlugin = + findTestPlugin(contextImpl.getRegisteredPlugins(), TestPicoCLIPlugin.class); + + assertThat(requestedPlugin).isPresent(); + assertThat(requestedPlugin.get().getState()).isEqualTo("registered"); + + final Optional nonRequestedPlugin = + findTestPlugin(contextImpl.getRegisteredPlugins(), TestBesuEventsPlugin.class); + + assertThat(nonRequestedPlugin).isEmpty(); + } + + @Test + public void shouldNotRegisterUnspecifiedPluginsWhenPluginsOptionIsSet() { + final PluginConfiguration config = createConfigurationForSpecificPlugin("TestPicoCLIPlugin"); + assertThat(contextImpl.getRegisteredPlugins()).isEmpty(); + contextImpl.registerPlugins(config); + + final Optional nonRequestedPlugin = + findTestPlugin(contextImpl.getRegisteredPlugins(), TestBesuEventsPlugin.class); + assertThat(nonRequestedPlugin).isEmpty(); + } + + @Test + void shouldThrowExceptionIfExplicitlySpecifiedPluginNotFound() { + PluginConfiguration config = createConfigurationForSpecificPlugin("NonExistentPlugin"); + + String exceptionMessage = + assertThrows(NoSuchElementException.class, () -> contextImpl.registerPlugins(config)) + .getMessage(); + final String expectedMessage = + "The following requested plugins were not found: NonExistentPlugin"; + assertThat(exceptionMessage).isEqualTo(expectedMessage); + assertThat(contextImpl.getRegisteredPlugins()).isEmpty(); + } + + private PluginConfiguration createConfigurationForAllPlugins() { + return new PluginConfiguration(null, DEFAULT_PLUGIN_DIRECTORY); + } + + private PluginConfiguration createConfigurationForSpecificPlugin(final String pluginName) { + return new PluginConfiguration(List.of(new PluginInfo(pluginName)), DEFAULT_PLUGIN_DIRECTORY); + } + + private Optional findTestPlugin( + final List plugins, final Class type) { return plugins.stream() - .filter(p -> p instanceof TestPicoCLIPlugin) + .filter(p -> type.equals(p.getClass())) .map(p -> (TestPicoCLIPlugin) p) .findFirst(); } diff --git a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java index 9648122de3b..2d147be517b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java @@ -58,6 +58,7 @@ import org.hyperledger.besu.cli.options.stable.NodePrivateKeyFileOption; import org.hyperledger.besu.cli.options.stable.P2PTLSConfigOptions; import org.hyperledger.besu.cli.options.stable.PermissionsOptions; +import org.hyperledger.besu.cli.options.stable.PluginsConfigurationOptions; import org.hyperledger.besu.cli.options.stable.RpcWebsocketOptions; import org.hyperledger.besu.cli.options.unstable.ChainPruningOptions; import org.hyperledger.besu.cli.options.unstable.DnsOptions; @@ -85,7 +86,7 @@ import org.hyperledger.besu.cli.subcommands.storage.StorageSubCommand; import org.hyperledger.besu.cli.util.BesuCommandCustomFactory; import org.hyperledger.besu.cli.util.CommandLineUtils; -import org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler; +import org.hyperledger.besu.cli.util.ConfigDefaultValueProviderStrategy; import org.hyperledger.besu.cli.util.VersionProvider; import org.hyperledger.besu.components.BesuComponent; import org.hyperledger.besu.config.CheckpointConfigOptions; @@ -121,6 +122,7 @@ import org.hyperledger.besu.ethereum.core.MiningParametersMetrics; import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.VersionMetadata; +import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration; import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration; import org.hyperledger.besu.ethereum.eth.transactions.ImmutableTransactionPoolConfiguration; @@ -876,6 +878,10 @@ static class MetricsOptionGroup { @Mixin private PkiBlockCreationOptions pkiBlockCreationOptions; + // Plugins Configuration Option Group + @CommandLine.ArgGroup(validate = false) + PluginsConfigurationOptions pluginsConfigurationOptions = new PluginsConfigurationOptions(); + private EthNetworkConfig ethNetworkConfig; private JsonRpcConfiguration jsonRpcConfiguration; private JsonRpcConfiguration engineJsonRpcConfiguration; @@ -1020,6 +1026,16 @@ protected BesuCommand( * @param args arguments to Besu command * @return success or failure exit code. */ + /** + * Parses command line arguments and configures the application accordingly. + * + * @param resultHandler The strategy to handle the execution result. + * @param parameterExceptionHandler Handler for exceptions related to command line parameters. + * @param executionExceptionHandler Handler for exceptions during command execution. + * @param in The input stream for commands. + * @param args The command line arguments. + * @return The execution result status code. + */ public int parse( final IExecutionStrategy resultHandler, final BesuParameterExceptionHandler parameterExceptionHandler, @@ -1027,9 +1043,24 @@ public int parse( final InputStream in, final String... args) { - toCommandLine(); + initializeCommandLineSettings(in); - // use terminal width for usage message + // Create the execution strategy chain. + final IExecutionStrategy executeTask = createExecuteTask(resultHandler); + final IExecutionStrategy pluginRegistrationTask = createPluginRegistrationTask(executeTask); + final IExecutionStrategy setDefaultValueProviderTask = + createDefaultValueProviderTask(pluginRegistrationTask); + + // 1- Config default value provider + // 2- Register plugins + // 3- Execute command + return executeCommandLine( + setDefaultValueProviderTask, parameterExceptionHandler, executionExceptionHandler, args); + } + + private void initializeCommandLineSettings(final InputStream in) { + toCommandLine(); + // Automatically adjust the width of usage messages to the terminal width. commandLine.getCommandSpec().usageMessage().autoWidth(true); handleStableOptions(); @@ -1037,11 +1068,51 @@ public int parse( registerConverters(); handleUnstableOptions(); preparePlugins(); + } - final int exitCode = - parse(resultHandler, executionExceptionHandler, parameterExceptionHandler, args); + private IExecutionStrategy createExecuteTask(final IExecutionStrategy nextStep) { + return parseResult -> { + commandLine.setExecutionStrategy(nextStep); + // At this point we don't allow unmatched options since plugins were already registered + commandLine.setUnmatchedArgumentsAllowed(false); + return commandLine.execute(parseResult.originalArgs().toArray(new String[0])); + }; + } - return exitCode; + private IExecutionStrategy createPluginRegistrationTask(final IExecutionStrategy nextStep) { + return parseResult -> { + PluginConfiguration configuration = + PluginsConfigurationOptions.fromCommandLine(parseResult.commandSpec().commandLine()); + besuPluginContext.registerPlugins(configuration); + commandLine.setExecutionStrategy(nextStep); + return commandLine.execute(parseResult.originalArgs().toArray(new String[0])); + }; + } + + private IExecutionStrategy createDefaultValueProviderTask(final IExecutionStrategy nextStep) { + return new ConfigDefaultValueProviderStrategy(nextStep, environment); + } + + /** + * Executes the command line with the provided execution strategy and exception handlers. + * + * @param executionStrategy The execution strategy to use. + * @param args The command line arguments. + * @return The execution result status code. + */ + private int executeCommandLine( + final IExecutionStrategy executionStrategy, + final BesuParameterExceptionHandler parameterExceptionHandler, + final BesuExecutionExceptionHandler executionExceptionHandler, + final String... args) { + return commandLine + .setExecutionStrategy(executionStrategy) + .setParameterExceptionHandler(parameterExceptionHandler) + .setExecutionExceptionHandler(executionExceptionHandler) + // As this happens before the plugins registration and plugins can add options, we must + // allow unmatched options + .setUnmatchedArgumentsAllowed(true) + .execute(args); } /** Used by Dagger to parse all options into a commandline instance. */ @@ -1208,8 +1279,6 @@ private void preparePlugins() { rocksDBPlugin.register(besuPluginContext); new InMemoryStoragePlugin().register(besuPluginContext); - besuPluginContext.registerPlugins(pluginsDir()); - metricCategoryRegistry .getMetricCategories() .forEach(metricCategoryConverter::addRegistryCategory); @@ -1235,26 +1304,6 @@ public KeyPair loadKeyPair(final File nodePrivateKeyFile) { return KeyPairUtil.loadKeyPair(resolveNodePrivateKeyFile(nodePrivateKeyFile)); } - private int parse( - final CommandLine.IExecutionStrategy resultHandler, - final BesuExecutionExceptionHandler besuExecutionExceptionHandler, - final BesuParameterExceptionHandler besuParameterExceptionHandler, - final String... args) { - // Create a handler that will search for a config file option and use it for - // default values - // and eventually it will run regular parsing of the remaining options. - - final ConfigOptionSearchAndRunHandler configParsingHandler = - new ConfigOptionSearchAndRunHandler( - resultHandler, besuParameterExceptionHandler, environment); - - return commandLine - .setExecutionStrategy(configParsingHandler) - .setParameterExceptionHandler(besuParameterExceptionHandler) - .setExecutionExceptionHandler(besuExecutionExceptionHandler) - .execute(args); - } - private void preSynchronization() { preSynchronizationTaskRunner.runTasks(besuController); } @@ -2382,15 +2431,6 @@ public Path dataDir() { return dataPath.toAbsolutePath(); } - private Path pluginsDir() { - final String pluginsDir = System.getProperty("besu.plugins.dir"); - if (pluginsDir == null) { - return new File(System.getProperty("besu.home", "."), "plugins").toPath(); - } else { - return new File(pluginsDir).toPath(); - } - } - private SecurityModule securityModule() { return securityModuleService .getByName(securityModuleName) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java b/besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java index 62de356e5f2..84055db663c 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java @@ -125,6 +125,9 @@ public interface DefaultCommandValues { /** The Default tls protocols. */ List DEFAULT_TLS_PROTOCOLS = List.of("TLSv1.3", "TLSv1.2"); + /** The constant DEFAULT_PLUGINS_OPTION_NAME. */ + String DEFAULT_PLUGINS_OPTION_NAME = "--plugins"; + /** * Gets default besu data path. * diff --git a/besu/src/main/java/org/hyperledger/besu/cli/converter/PluginInfoConverter.java b/besu/src/main/java/org/hyperledger/besu/cli/converter/PluginInfoConverter.java new file mode 100644 index 00000000000..9dd5e21c8db --- /dev/null +++ b/besu/src/main/java/org/hyperledger/besu/cli/converter/PluginInfoConverter.java @@ -0,0 +1,53 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.cli.converter; + +import org.hyperledger.besu.ethereum.core.plugins.PluginInfo; + +import java.util.List; +import java.util.stream.Stream; + +import picocli.CommandLine; + +/** + * Converts a comma-separated string into a list of {@link PluginInfo} objects. This converter is + * intended for use with PicoCLI to process command line arguments that specify plugin information. + */ +public class PluginInfoConverter implements CommandLine.ITypeConverter> { + + /** + * Converts a comma-separated string into a list of {@link PluginInfo}. + * + * @param value The comma-separated string representing plugin names. + * @return A list of {@link PluginInfo} objects created from the provided string. + */ + @Override + public List convert(final String value) { + if (value == null || value.isBlank()) { + return List.of(); + } + return Stream.of(value.split(",")).map(String::trim).map(this::toPluginInfo).toList(); + } + + /** + * Creates a {@link PluginInfo} object from a plugin name. + * + * @param pluginName The name of the plugin. + * @return A {@link PluginInfo} object representing the plugin. + */ + private PluginInfo toPluginInfo(final String pluginName) { + return new PluginInfo(pluginName); + } +} diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java new file mode 100644 index 00000000000..abf9085b1f8 --- /dev/null +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java @@ -0,0 +1,63 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.cli.options.stable; + +import static org.hyperledger.besu.cli.DefaultCommandValues.DEFAULT_PLUGINS_OPTION_NAME; + +import org.hyperledger.besu.cli.converter.PluginInfoConverter; +import org.hyperledger.besu.cli.options.CLIOptions; +import org.hyperledger.besu.cli.util.CommandLineUtils; +import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration; +import org.hyperledger.besu.ethereum.core.plugins.PluginInfo; + +import java.util.List; + +import picocli.CommandLine; + +/** The Plugins Options options. */ +public class PluginsConfigurationOptions implements CLIOptions { + @CommandLine.Option( + names = {DEFAULT_PLUGINS_OPTION_NAME}, + description = "Comma-separated list of plugin names", + split = ",", + hidden = true, + converter = PluginInfoConverter.class, + arity = "1..*") + private List plugins; + + @Override + public PluginConfiguration toDomainObject() { + return new PluginConfiguration(plugins); + } + + @Override + public List getCLIOptions() { + return CommandLineUtils.getCLIOptions(this, new PluginsConfigurationOptions()); + } + + /** + * Constructs a {@link PluginConfiguration} instance based on the command line options. + * + * @param commandLine The command line instance containing parsed options. + * @return A new {@link PluginConfiguration} instance. + */ + public static PluginConfiguration fromCommandLine(final CommandLine commandLine) { + List plugins = + CommandLineUtils.getOptionValueOrDefault( + commandLine, DEFAULT_PLUGINS_OPTION_NAME, new PluginInfoConverter()); + + return new PluginConfiguration(plugins); + } +} diff --git a/besu/src/main/java/org/hyperledger/besu/cli/util/CommandLineUtils.java b/besu/src/main/java/org/hyperledger/besu/cli/util/CommandLineUtils.java index 38418dd11df..710fbbcada8 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/util/CommandLineUtils.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/util/CommandLineUtils.java @@ -264,4 +264,61 @@ public static boolean isOptionSet(final CommandLine commandLine, final String op .filter(optionSpec -> Arrays.stream(optionSpec.names()).anyMatch(optionName::equals)) .anyMatch(CommandLineUtils::isOptionSet); } + + /** + * Retrieves the value of a specified command line option, converting it to its appropriate type, + * or returns the default value if the option was not specified. + * + * @param The type of the option value. + * @param commandLine The {@link CommandLine} instance containing the parsed command line options. + * @param optionName The name of the option whose value is to be retrieved. + * @param converter A converter that converts the option's string value to its appropriate type. + * @return The value of the specified option converted to its type, or the default value if the + * option was not specified. Returns {@code null} if the option does not exist or if there is + * no default value and the option was not specified. + */ + public static T getOptionValueOrDefault( + final CommandLine commandLine, + final String optionName, + final CommandLine.ITypeConverter converter) { + + return commandLine + .getParseResult() + .matchedOptionValue(optionName, getDefaultOptionValue(commandLine, optionName, converter)); + } + + /** + * Retrieves the default value for a specified command line option, converting it to its + * appropriate type. + * + * @param The type of the option value. + * @param commandLine The {@link CommandLine} instance containing the parsed command line options. + * @param optionName The name of the option whose default value is to be retrieved. + * @param converter A converter that converts the option's default string value to its appropriate + * type. + * @return The default value of the specified option converted to its type, or {@code null} if the + * option does not exist, does not have a default value, or if an error occurs during + * conversion. + * @throws RuntimeException if there is an error converting the default value string to its type. + */ + private static T getDefaultOptionValue( + final CommandLine commandLine, + final String optionName, + final CommandLine.ITypeConverter converter) { + + CommandLine.Model.OptionSpec optionSpec = commandLine.getCommandSpec().findOption(optionName); + if (optionSpec == null || commandLine.getDefaultValueProvider() == null) { + return null; + } + + try { + String defaultValueString = commandLine.getDefaultValueProvider().defaultValue(optionSpec); + return defaultValueString != null + ? converter.convert(defaultValueString) + : optionSpec.getValue(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to convert default value for option " + optionName + ": " + e.getMessage(), e); + } + } } diff --git a/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigOptionSearchAndRunHandler.java b/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategy.java similarity index 74% rename from besu/src/main/java/org/hyperledger/besu/cli/util/ConfigOptionSearchAndRunHandler.java rename to besu/src/main/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategy.java index 52b67652822..d3ff29dbc66 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigOptionSearchAndRunHandler.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategy.java @@ -25,47 +25,37 @@ import picocli.CommandLine; import picocli.CommandLine.IDefaultValueProvider; import picocli.CommandLine.IExecutionStrategy; -import picocli.CommandLine.IParameterExceptionHandler; import picocli.CommandLine.ParameterException; import picocli.CommandLine.ParseResult; /** Custom Config option search and run handler. */ -public class ConfigOptionSearchAndRunHandler extends CommandLine.RunLast { +public class ConfigDefaultValueProviderStrategy implements IExecutionStrategy { private final IExecutionStrategy resultHandler; - private final IParameterExceptionHandler parameterExceptionHandler; private final Map environment; /** * Instantiates a new Config option search and run handler. * * @param resultHandler the result handler - * @param parameterExceptionHandler the parameter exception handler * @param environment the environment variables map */ - public ConfigOptionSearchAndRunHandler( - final IExecutionStrategy resultHandler, - final IParameterExceptionHandler parameterExceptionHandler, - final Map environment) { + public ConfigDefaultValueProviderStrategy( + final IExecutionStrategy resultHandler, final Map environment) { this.resultHandler = resultHandler; - this.parameterExceptionHandler = parameterExceptionHandler; this.environment = environment; } @Override - public List handle(final ParseResult parseResult) throws ParameterException { + public int execute(final ParseResult parseResult) + throws CommandLine.ExecutionException, ParameterException { final CommandLine commandLine = parseResult.commandSpec().commandLine(); - commandLine.setDefaultValueProvider( createDefaultValueProvider( commandLine, new ConfigFileFinder().findConfiguration(environment, parseResult), new ProfileFinder().findConfiguration(environment, parseResult))); - commandLine.setExecutionStrategy(resultHandler); - commandLine.setParameterExceptionHandler(parameterExceptionHandler); - commandLine.execute(parseResult.originalArgs().toArray(new String[0])); - - return new ArrayList<>(); + return commandLine.execute(parseResult.originalArgs().toArray(new String[0])); } /** @@ -73,10 +63,11 @@ public List handle(final ParseResult parseResult) throws ParameterExcept * * @param commandLine the command line * @param configFile the config file + * @param profile the profile file * @return the default value provider */ @VisibleForTesting - IDefaultValueProvider createDefaultValueProvider( + public IDefaultValueProvider createDefaultValueProvider( final CommandLine commandLine, final Optional configFile, final Optional profile) { @@ -94,9 +85,4 @@ IDefaultValueProvider createDefaultValueProvider( p -> providers.add(TomlConfigurationDefaultProvider.fromInputStream(commandLine, p))); return new CascadingDefaultProvider(providers); } - - @Override - public ConfigOptionSearchAndRunHandler self() { - return this; - } } diff --git a/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java b/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java index a35c3e0a87a..e79770f9428 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java @@ -17,6 +17,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; +import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration; import org.hyperledger.besu.plugin.BesuContext; import org.hyperledger.besu.plugin.BesuPlugin; import org.hyperledger.besu.plugin.services.BesuService; @@ -35,11 +36,13 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.NoSuchElementException; import java.util.Optional; import java.util.ServiceLoader; -import java.util.function.Predicate; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; +import java.util.stream.StreamSupport; import com.google.common.annotations.VisibleForTesting; import org.slf4j.Logger; @@ -73,9 +76,13 @@ private enum Lifecycle { private Lifecycle state = Lifecycle.UNINITIALIZED; private final Map, ? super BesuService> serviceRegistry = new HashMap<>(); - private final List plugins = new ArrayList<>(); + + private List detectedPlugins = new ArrayList<>(); + private List requestedPlugins = new ArrayList<>(); + + private final List registeredPlugins = new ArrayList<>(); + private final List pluginVersions = new ArrayList<>(); - final List lines = new ArrayList<>(); /** * Add service. @@ -99,75 +106,96 @@ public Optional getService(final Class serviceType return Optional.ofNullable((T) serviceRegistry.get(serviceType)); } + private List detectPlugins(final PluginConfiguration config) { + ClassLoader pluginLoader = + pluginDirectoryLoader(config.getPluginsDir()).orElse(getClass().getClassLoader()); + ServiceLoader serviceLoader = ServiceLoader.load(BesuPlugin.class, pluginLoader); + return StreamSupport.stream(serviceLoader.spliterator(), false).toList(); + } + /** - * Register plugins. + * Registers plugins based on the provided {@link PluginConfiguration}. This method finds plugins + * according to the configuration settings, filters them if necessary and then registers the + * filtered or found plugins * - * @param pluginsDir the plugins dir + * @param config The configuration settings used to find and filter plugins for registration. The + * configuration includes the plugin directory and any configured plugin identifiers if + * applicable. + * @throws IllegalStateException if the system is not in the UNINITIALIZED state. */ - public void registerPlugins(final Path pluginsDir) { - lines.add("Plugins:"); + public void registerPlugins(final PluginConfiguration config) { checkState( state == Lifecycle.UNINITIALIZED, - "Besu plugins have already been registered. Cannot register additional plugins."); + "Besu plugins have already been registered. Cannot register additional plugins."); + state = Lifecycle.REGISTERING; - final ClassLoader pluginLoader = - pluginDirectoryLoader(pluginsDir).orElse(this.getClass().getClassLoader()); + detectedPlugins = detectPlugins(config); + if (!config.getRequestedPlugins().isEmpty()) { + // Register only the plugins that were explicitly requested and validated + requestedPlugins = config.getRequestedPlugins(); - state = Lifecycle.REGISTERING; + // Match and validate the requested plugins against the detected plugins + List registeringPlugins = + matchAndValidateRequestedPlugins(requestedPlugins, detectedPlugins); - final ServiceLoader serviceLoader = - ServiceLoader.load(BesuPlugin.class, pluginLoader); + registerPlugins(registeringPlugins); + } else { + // If no plugins were specified, register all detected plugins + registerPlugins(detectedPlugins); + } + } - int pluginsCount = 0; - for (final BesuPlugin plugin : serviceLoader) { - pluginsCount++; - try { - plugin.register(this); - LOG.info("Registered plugin of type {}.", plugin.getClass().getName()); - String pluginVersion = getPluginVersion(plugin); - pluginVersions.add(pluginVersion); - lines.add(String.format("%s (%s)", plugin.getClass().getSimpleName(), pluginVersion)); - } catch (final Exception e) { - LOG.error( - "Error registering plugin of type " - + plugin.getClass().getName() - + ", start and stop will not be called.", - e); - lines.add(String.format("ERROR %s", plugin.getClass().getSimpleName())); - continue; - } - plugins.add(plugin); + private List matchAndValidateRequestedPlugins( + final List requestedPluginNames, final List detectedPlugins) + throws NoSuchElementException { + + // Filter detected plugins to include only those that match the requested names + List matchingPlugins = + detectedPlugins.stream() + .filter(plugin -> requestedPluginNames.contains(plugin.getClass().getSimpleName())) + .toList(); + + // Check if all requested plugins were found among the detected plugins + if (matchingPlugins.size() != requestedPluginNames.size()) { + // Find which requested plugins were not matched to throw a detailed exception + Set matchedPluginNames = + matchingPlugins.stream() + .map(plugin -> plugin.getClass().getSimpleName()) + .collect(Collectors.toSet()); + String missingPlugins = + requestedPluginNames.stream() + .filter(name -> !matchedPluginNames.contains(name)) + .collect(Collectors.joining(", ")); + throw new NoSuchElementException( + "The following requested plugins were not found: " + missingPlugins); } + return matchingPlugins; + } - LOG.debug("Plugin registration complete."); - lines.add( - String.format( - "TOTAL = %d of %d plugins successfully loaded", plugins.size(), pluginsCount)); - lines.add(String.format("from %s", pluginsDir.toAbsolutePath())); + private void registerPlugins(final List pluginsToRegister) { + for (final BesuPlugin plugin : pluginsToRegister) { + if (registerPlugin(plugin)) { + registeredPlugins.add(plugin); + } + } state = Lifecycle.REGISTERED; } - /** - * get the summary log, as a list of string lines - * - * @return the summary - */ - public List getPluginsSummaryLog() { - return lines; - } - - private String getPluginVersion(final BesuPlugin plugin) { - final Package pluginPackage = plugin.getClass().getPackage(); - final String implTitle = - Optional.ofNullable(pluginPackage.getImplementationTitle()) - .filter(Predicate.not(String::isBlank)) - .orElse(plugin.getClass().getSimpleName()); - final String implVersion = - Optional.ofNullable(pluginPackage.getImplementationVersion()) - .filter(Predicate.not(String::isBlank)) - .orElse(""); - return implTitle + "/v" + implVersion; + private boolean registerPlugin(final BesuPlugin plugin) { + try { + plugin.register(this); + LOG.info("Registered plugin of type {}.", plugin.getClass().getName()); + pluginVersions.add(plugin.getVersion()); + } catch (final Exception e) { + LOG.error( + "Error registering plugin of type " + + plugin.getClass().getName() + + ", start and stop will not be called.", + e); + return false; + } + return true; } /** Before external services. */ @@ -178,7 +206,7 @@ public void beforeExternalServices() { Lifecycle.REGISTERED, state); state = Lifecycle.BEFORE_EXTERNAL_SERVICES_STARTED; - final Iterator pluginsIterator = plugins.iterator(); + final Iterator pluginsIterator = registeredPlugins.iterator(); while (pluginsIterator.hasNext()) { final BesuPlugin plugin = pluginsIterator.next(); @@ -209,7 +237,7 @@ public void startPlugins() { Lifecycle.BEFORE_EXTERNAL_SERVICES_FINISHED, state); state = Lifecycle.BEFORE_MAIN_LOOP_STARTED; - final Iterator pluginsIterator = plugins.iterator(); + final Iterator pluginsIterator = registeredPlugins.iterator(); while (pluginsIterator.hasNext()) { final BesuPlugin plugin = pluginsIterator.next(); @@ -240,7 +268,7 @@ public void stopPlugins() { state); state = Lifecycle.STOPPING; - for (final BesuPlugin plugin : plugins) { + for (final BesuPlugin plugin : registeredPlugins) { try { plugin.stop(); LOG.debug("Stopped plugin of type {}.", plugin.getClass().getName()); @@ -253,11 +281,6 @@ public void stopPlugins() { state = Lifecycle.STOPPED; } - @Override - public Collection getPluginVersions() { - return Collections.unmodifiableList(pluginVersions); - } - private static URL pathToURIOrNull(final Path p) { try { return p.toUri().toURL(); @@ -266,16 +289,6 @@ private static URL pathToURIOrNull(final Path p) { } } - /** - * Gets plugins. - * - * @return the plugins - */ - @VisibleForTesting - List getPlugins() { - return Collections.unmodifiableList(plugins); - } - private Optional pluginDirectoryLoader(final Path pluginsDir) { if (pluginsDir != null && pluginsDir.toFile().isDirectory()) { LOG.debug("Searching for plugins in {}", pluginsDir.toAbsolutePath()); @@ -299,14 +312,73 @@ private Optional pluginDirectoryLoader(final Path pluginsDir) { return Optional.empty(); } + @Override + public Collection getPluginVersions() { + return Collections.unmodifiableList(pluginVersions); + } + + /** + * Gets plugins. + * + * @return the plugins + */ + @VisibleForTesting + List getRegisteredPlugins() { + return Collections.unmodifiableList(registeredPlugins); + } + /** * Gets named plugins. * * @return the named plugins */ public Map getNamedPlugins() { - return plugins.stream() + return registeredPlugins.stream() .filter(plugin -> plugin.getName().isPresent()) .collect(Collectors.toMap(plugin -> plugin.getName().get(), plugin -> plugin, (a, b) -> b)); } + + /** + * Generates a summary log of plugin registration. The summary includes registered plugins, + * detected but not registered (skipped) plugins + * + * @return A list of strings, each representing a line in the summary log. + */ + public List getPluginsSummaryLog() { + List summary = new ArrayList<>(); + summary.add("Plugin Registration Summary:"); + + // Log registered plugins with their names and versions + if (registeredPlugins.isEmpty()) { + summary.add("No plugins have been registered."); + } else { + summary.add("Registered Plugins:"); + registeredPlugins.forEach( + plugin -> + summary.add( + String.format( + " - %s (Version: %s)", + plugin.getClass().getSimpleName(), plugin.getVersion()))); + } + + // Identify and log detected but not registered (skipped) plugins + List skippedPlugins = + detectedPlugins.stream() + .filter(plugin -> !registeredPlugins.contains(plugin)) + .map(plugin -> plugin.getClass().getSimpleName()) + .toList(); + + if (!skippedPlugins.isEmpty()) { + summary.add("Skipped Plugins:"); + skippedPlugins.forEach( + pluginName -> + summary.add(String.format(" - %s (Detected but not registered)", pluginName))); + } + summary.add( + String.format( + "TOTAL = %d of %d plugins successfully registered.", + registeredPlugins.size(), detectedPlugins.size())); + + return summary; + } } diff --git a/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsDefaultsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsDefaultsTest.java new file mode 100644 index 00000000000..836d7fb3c4e --- /dev/null +++ b/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsDefaultsTest.java @@ -0,0 +1,110 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.hyperledger.besu.cli; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.cli.util.CommandLineUtils.getOptionValueOrDefault; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import org.hyperledger.besu.cli.util.CommandLineUtils; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import picocli.CommandLine; + +/** + * Unit tests for {@link CommandLineUtils} focusing on the retrieval of option values + * (getOptionValueOrDefault). + */ +public class CommandLineUtilsDefaultsTest { + private static final String OPTION_NAME = "option"; + private static final String OPTION_VALUE = "optionValue"; + private static final String DEFAULT_VALUE = "defaultValue"; + public final CommandLine.ITypeConverter converter = String::valueOf; + private CommandLine commandLine; + private CommandLine.Model.OptionSpec optionSpec; + private CommandLine.IDefaultValueProvider defaultValueProvider; + private CommandLine.ParseResult parseResult; + + @BeforeEach + public void setUp() { + commandLine = mock(CommandLine.class); + parseResult = mock(CommandLine.ParseResult.class); + CommandLine.Model.CommandSpec commandSpec = mock(CommandLine.Model.CommandSpec.class); + optionSpec = mock(CommandLine.Model.OptionSpec.class); + defaultValueProvider = mock(CommandLine.IDefaultValueProvider.class); + when(commandLine.getParseResult()).thenReturn(parseResult); + when(commandLine.getCommandSpec()).thenReturn(commandSpec); + when(commandLine.getDefaultValueProvider()).thenReturn(defaultValueProvider); + when(parseResult.matchedOptionValue(anyString(), any())).thenCallRealMethod(); + when(commandSpec.findOption(OPTION_NAME)).thenReturn(optionSpec); + } + + @Test + public void testGetOptionValueOrDefault_UserProvidedValue() { + when(parseResult.matchedOption(OPTION_NAME)).thenReturn(optionSpec); + when(optionSpec.getValue()).thenReturn(OPTION_VALUE); + + String result = getOptionValueOrDefault(commandLine, OPTION_NAME, converter); + assertThat(result).isEqualTo(OPTION_VALUE); + } + + @Test + public void testGetOptionValueOrDefault_DefaultValue() throws Exception { + when(defaultValueProvider.defaultValue(optionSpec)).thenReturn(DEFAULT_VALUE); + String result = getOptionValueOrDefault(commandLine, OPTION_NAME, converter); + assertThat(result).isEqualTo(DEFAULT_VALUE); + } + + @Test + public void userOptionOverridesDefaultValue() throws Exception { + when(parseResult.matchedOption(OPTION_NAME)).thenReturn(optionSpec); + when(optionSpec.getValue()).thenReturn(OPTION_VALUE); + + when(defaultValueProvider.defaultValue(optionSpec)).thenReturn(DEFAULT_VALUE); + String result = getOptionValueOrDefault(commandLine, OPTION_NAME, converter); + assertThat(result).isEqualTo(OPTION_VALUE); + } + + @Test + public void testGetOptionValueOrDefault_NoValueOrDefault() { + String result = getOptionValueOrDefault(commandLine, OPTION_NAME, converter); + assertThat(result).isNull(); + } + + @Test + public void testGetOptionValueOrDefault_ConversionFailure() throws Exception { + when(defaultValueProvider.defaultValue(optionSpec)).thenReturn(DEFAULT_VALUE); + + CommandLine.ITypeConverter failingConverter = + value -> { + throw new Exception("Conversion failed"); + }; + + String actualMessage = + assertThrows( + RuntimeException.class, + () -> getOptionValueOrDefault(commandLine, OPTION_NAME, failingConverter)) + .getMessage(); + final String expectedMessage = + "Failed to convert default value for option option: Conversion failed"; + assertThat(actualMessage).isEqualTo(expectedMessage); + } +} diff --git a/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsTest.java index d8e8912eefa..24b840dc74b 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsTest.java @@ -69,7 +69,6 @@ private abstract static class AbstractTestCommand implements Runnable { commandLine.setDefaultValueProvider(new EnvironmentVariableDefaultProvider(environment)); } - // Completely disables p2p within Besu. @Option( names = {"--option-enabled"}, arity = "1") diff --git a/besu/src/test/java/org/hyperledger/besu/cli/util/ConfigOptionSearchAndRunHandlerTest.java b/besu/src/test/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategyTest.java similarity index 83% rename from besu/src/test/java/org/hyperledger/besu/cli/util/ConfigOptionSearchAndRunHandlerTest.java rename to besu/src/test/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategyTest.java index fbc672dc0a1..a2ea92e48b2 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/util/ConfigOptionSearchAndRunHandlerTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategyTest.java @@ -52,7 +52,7 @@ import picocli.CommandLine.RunLast; @ExtendWith(MockitoExtension.class) -public class ConfigOptionSearchAndRunHandlerTest { +public class ConfigDefaultValueProviderStrategyTest { private static final String CONFIG_FILE_OPTION_NAME = "--config-file"; @TempDir public Path temp; @@ -61,7 +61,7 @@ public class ConfigOptionSearchAndRunHandlerTest { private final IExecutionStrategy resultHandler = new RunLast(); private final Map environment = singletonMap("BESU_LOGGING", "ERROR"); - private ConfigOptionSearchAndRunHandler configParsingHandler; + private ConfigDefaultValueProviderStrategy configParsingHandler; @Mock ParseResult mockParseResult; @Mock CommandSpec mockCommandSpec; @@ -84,60 +84,52 @@ public void initMocks() { lenient().when(mockConfigOptionSpec.getter()).thenReturn(mockConfigOptionGetter); levelOption = new LoggingLevelOption(); levelOption.setLogLevel("INFO"); - configParsingHandler = - new ConfigOptionSearchAndRunHandler( - resultHandler, mockParameterExceptionHandler, environment); + configParsingHandler = new ConfigDefaultValueProviderStrategy(resultHandler, environment); } @Test public void handleWithCommandLineOption() throws Exception { when(mockConfigOptionGetter.get()).thenReturn(Files.createTempFile("tmp", "txt").toFile()); - final List result = configParsingHandler.handle(mockParseResult); + configParsingHandler.execute(mockParseResult); verify(mockCommandLine).setDefaultValueProvider(any(IDefaultValueProvider.class)); verify(mockCommandLine).setExecutionStrategy(eq(resultHandler)); - verify(mockCommandLine).setParameterExceptionHandler(eq(mockParameterExceptionHandler)); verify(mockCommandLine).execute(anyString()); - - assertThat(result).isEmpty(); } @Test public void handleWithEnvironmentVariable() throws IOException { when(mockParseResult.hasMatchedOption(CONFIG_FILE_OPTION_NAME)).thenReturn(false); - final ConfigOptionSearchAndRunHandler environmentConfigFileParsingHandler = - new ConfigOptionSearchAndRunHandler( + final ConfigDefaultValueProviderStrategy environmentConfigFileParsingHandler = + new ConfigDefaultValueProviderStrategy( resultHandler, - mockParameterExceptionHandler, singletonMap( "BESU_CONFIG_FILE", Files.createFile(temp.resolve("tmp")).toFile().getAbsolutePath())); when(mockParseResult.hasMatchedOption(CONFIG_FILE_OPTION_NAME)).thenReturn(false); - environmentConfigFileParsingHandler.handle(mockParseResult); + environmentConfigFileParsingHandler.execute(mockParseResult); } @Test public void handleWithCommandLineOptionShouldRaiseExceptionIfNoFileParam() throws Exception { final String error_message = "an error occurred during get"; when(mockConfigOptionGetter.get()).thenThrow(new Exception(error_message)); - assertThatThrownBy(() -> configParsingHandler.handle(mockParseResult)) + assertThatThrownBy(() -> configParsingHandler.execute(mockParseResult)) .isInstanceOf(Exception.class) .hasMessage(error_message); } @Test public void handleWithEnvironmentVariableOptionShouldRaiseExceptionIfNoFileParam() { - final ConfigOptionSearchAndRunHandler environmentConfigFileParsingHandler = - new ConfigOptionSearchAndRunHandler( - resultHandler, - mockParameterExceptionHandler, - singletonMap("BESU_CONFIG_FILE", "not_found.toml")); + final ConfigDefaultValueProviderStrategy environmentConfigFileParsingHandler = + new ConfigDefaultValueProviderStrategy( + resultHandler, singletonMap("BESU_CONFIG_FILE", "not_found.toml")); when(mockParseResult.hasMatchedOption(CONFIG_FILE_OPTION_NAME)).thenReturn(false); - assertThatThrownBy(() -> environmentConfigFileParsingHandler.handle(mockParseResult)) + assertThatThrownBy(() -> environmentConfigFileParsingHandler.execute(mockParseResult)) .isInstanceOf(CommandLine.ParameterException.class); } @@ -163,15 +155,14 @@ public void shouldRetrieveConfigFromEnvironmentWhenConfigFileNotSpecified() thro public void handleThrowsErrorWithWithEnvironmentVariableAndCommandLineSpecified() throws IOException { - final ConfigOptionSearchAndRunHandler environmentConfigFileParsingHandler = - new ConfigOptionSearchAndRunHandler( + final ConfigDefaultValueProviderStrategy environmentConfigFileParsingHandler = + new ConfigDefaultValueProviderStrategy( resultHandler, - mockParameterExceptionHandler, singletonMap("BESU_CONFIG_FILE", temp.resolve("tmp").toFile().getAbsolutePath())); when(mockParseResult.hasMatchedOption(CONFIG_FILE_OPTION_NAME)).thenReturn(true); - assertThatThrownBy(() -> environmentConfigFileParsingHandler.handle(mockParseResult)) + assertThatThrownBy(() -> environmentConfigFileParsingHandler.execute(mockParseResult)) .isInstanceOf(CommandLine.ParameterException.class); } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginConfiguration.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginConfiguration.java new file mode 100644 index 00000000000..1f38386aeae --- /dev/null +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginConfiguration.java @@ -0,0 +1,92 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.core.plugins; + +import static java.util.Objects.requireNonNull; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.List; + +/** + * Configuration for managing plugins, including their information, detection type, and directory. + */ +public class PluginConfiguration { + private final List requestedPlugins; + private final Path pluginsDir; + + /** + * Constructs a new PluginConfiguration with the specified plugin information and requestedPlugins + * directory. + * + * @param requestedPlugins List of {@link PluginInfo} objects representing the requestedPlugins. + * @param pluginsDir The directory where requestedPlugins are located. + */ + public PluginConfiguration(final List requestedPlugins, final Path pluginsDir) { + this.requestedPlugins = requestedPlugins; + this.pluginsDir = pluginsDir; + } + + /** + * Constructs a PluginConfiguration with specified plugins using the default directory. + * + * @param requestedPlugins List of plugins for consideration or registration. discoverable plugins + * are. + */ + public PluginConfiguration(final List requestedPlugins) { + this.requestedPlugins = requestedPlugins; + this.pluginsDir = PluginConfiguration.defaultPluginsDir(); + } + + /** + * Constructs a PluginConfiguration with the specified plugins directory + * + * @param pluginsDir The directory where plugins are located. Cannot be null. + */ + public PluginConfiguration(final Path pluginsDir) { + this.requestedPlugins = null; + this.pluginsDir = requireNonNull(pluginsDir); + } + + /** + * Returns the names of requested plugins, or an empty list if none. + * + * @return List of requested plugin names, never {@code null}. + */ + public List getRequestedPlugins() { + return requestedPlugins == null + ? Collections.emptyList() + : requestedPlugins.stream().map(PluginInfo::name).toList(); + } + + public Path getPluginsDir() { + return pluginsDir; + } + + /** + * Returns the default plugins directory based on system properties. + * + * @return The default {@link Path} to the plugin's directory. + */ + public static Path defaultPluginsDir() { + final String pluginsDirProperty = System.getProperty("besu.plugins.dir"); + if (pluginsDirProperty == null) { + return Paths.get(System.getProperty("besu.home", "."), "plugins"); + } else { + return Paths.get(pluginsDirProperty); + } + } +} diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginInfo.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginInfo.java new file mode 100644 index 00000000000..a30d4d55f91 --- /dev/null +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginInfo.java @@ -0,0 +1,37 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.core.plugins; + +/** Represents information about a plugin, including its name. */ +public final class PluginInfo { + private final String name; + + /** + * Constructs a new PluginInfo instance with the specified name. + * + * @param name The name of the plugin. Cannot be null or empty. + * @throws IllegalArgumentException if the name is null or empty. + */ + public PluginInfo(final String name) { + if (name == null || name.isBlank()) { + throw new IllegalArgumentException("Plugin name cannot be null or empty."); + } + this.name = name; + } + + public String name() { + return name; + } +} diff --git a/plugin-api/build.gradle b/plugin-api/build.gradle index fddd2255a8b..8e2d8b726df 100644 --- a/plugin-api/build.gradle +++ b/plugin-api/build.gradle @@ -69,7 +69,7 @@ Calculated : ${currentHash} tasks.register('checkAPIChanges', FileStateChecker) { description = "Checks that the API for the Plugin-API project does not change without deliberate thought" files = sourceSets.main.allJava.files - knownHash = '0mJiCGsToqx5aAJEvwnT3V0R8o4PXBYWiB0wT6CMpuo=' + knownHash = '78xbZ20PDB9CDcaSVY92VA8cXWGu4GwaZkvegWgep24=' } check.dependsOn('checkAPIChanges') diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/BesuPlugin.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/BesuPlugin.java index 5a54808a6c1..9c9dc44bf02 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/BesuPlugin.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/BesuPlugin.java @@ -84,4 +84,24 @@ default CompletableFuture reloadConfiguration() { * started. */ void stop(); + + /** + * Retrieves the version information of the plugin. It constructs a version string using the + * implementation title and version from the package information. If either the title or version + * is not available, it defaults to the class's simple name and "Unknown Version", respectively. + * + * @return A string representing the plugin's version information, formatted as "Title/vVersion". + */ + default String getVersion() { + Package pluginPackage = this.getClass().getPackage(); + String implTitle = + Optional.ofNullable(pluginPackage.getImplementationTitle()) + .filter(title -> !title.isBlank()) + .orElseGet(() -> this.getClass().getSimpleName()); + String implVersion = + Optional.ofNullable(pluginPackage.getImplementationVersion()) + .filter(version -> !version.isBlank()) + .orElse(""); + return implTitle + "/v" + implVersion; + } } From 32dae8ff8710f588e6a40a649d93813c33304bb8 Mon Sep 17 00:00:00 2001 From: goodactive <167312449+goodactive@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:51:26 +0800 Subject: [PATCH 23/59] chore: remove repetitive word (#6971) Signed-off-by: goodactive Co-authored-by: Sally MacFarlane --- .../java/org/hyperledger/besu/testutil/JsonTestParameters.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutil/src/main/java/org/hyperledger/besu/testutil/JsonTestParameters.java b/testutil/src/main/java/org/hyperledger/besu/testutil/JsonTestParameters.java index 942a04d29ba..88588d52187 100644 --- a/testutil/src/main/java/org/hyperledger/besu/testutil/JsonTestParameters.java +++ b/testutil/src/main/java/org/hyperledger/besu/testutil/JsonTestParameters.java @@ -133,7 +133,7 @@ public interface Generator { // The type to which the json file is directly mapped private final Class jsonFileMappedType; - // The final type of the test case spec, which may or may not not be same than jsonFileMappedType + // The final type of the test case spec, which may or may not be same than jsonFileMappedType // Note that we don't really use this field as of now, but as this is the actual type of the final // spec used by tests, it feels "right" to have it passed explicitly at construction and having it // around could prove useful later. From 381e692b1ff8c9f34b519924baa14c000945458c Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Sun, 21 Apr 2024 21:56:44 -0600 Subject: [PATCH 24/59] Refactor: take blockchain out of MainnetTransactionProcessor (#6962) Remove an unused parameter in MainnetTransactionProcessor, as well as all code supporting sending that parameter. Signed-off-by: Danno Ferrin Co-authored-by: Sally MacFarlane --- .../besu/services/TraceServiceImpl.java | 1 - .../methods/ExecuteTransactionStep.java | 1 - .../internal/processor/BlockReplay.java | 2 -- .../internal/processor/BlockTracer.java | 1 - .../internal/processor/TransactionTracer.java | 1 - .../processor/TransactionTracerTest.java | 2 -- .../txselection/BlockTransactionSelector.java | 1 - .../AbstractBlockTransactionSelectorTest.java | 4 ++-- .../vm/TraceTransactionIntegrationTest.java | 3 --- .../mainnet/AbstractBlockProcessor.java | 1 - .../mainnet/MainnetTransactionProcessor.java | 18 ++---------------- .../PrivateGroupRehydrationBlockProcessor.java | 1 - .../PrivateMigrationBlockProcessor.java | 1 - .../transaction/TransactionSimulator.java | 1 - .../MainnetTransactionProcessorTest.java | 6 ------ .../mainnet/PrivacyBlockProcessorTest.java | 2 +- .../transaction/TransactionSimulatorTest.java | 2 -- .../besu/evmtool/StateTestSubCommand.java | 4 ---- .../hyperledger/besu/evmtool/T8nExecutor.java | 4 ---- .../vm/GeneralStateReferenceTestTools.java | 3 +-- 20 files changed, 6 insertions(+), 53 deletions(-) diff --git a/besu/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java b/besu/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java index 43af4e3866e..0a4cc74f50f 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java @@ -212,7 +212,6 @@ private List trace( final WorldUpdater worldUpdater = chainUpdater.getNextUpdater(); final TransactionProcessingResult result = transactionProcessor.processTransaction( - blockchain, worldUpdater, header, transaction, diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecuteTransactionStep.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecuteTransactionStep.java index 6ccdb85cd0d..b2b48e1a42e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecuteTransactionStep.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecuteTransactionStep.java @@ -98,7 +98,6 @@ public TransactionTrace apply(final TransactionTrace transactionTrace) { final BlockHashLookup blockHashLookup = new CachingBlockHashLookup(header, blockchain); result = transactionProcessor.processTransaction( - blockchain, chainUpdater.getNextUpdater(), header, transactionTrace.getTransaction(), diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockReplay.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockReplay.java index 9ae802fda58..ddae82d3beb 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockReplay.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockReplay.java @@ -107,7 +107,6 @@ public Optional beforeTransactionInBlock( transaction, header, blockchain, transactionProcessor, blobGasPrice)); } else { transactionProcessor.processTransaction( - blockchain, mutableWorldState.updater(), header, transaction, @@ -134,7 +133,6 @@ public Optional afterTransactionInBlock( (transaction, blockHeader, blockchain, transactionProcessor, blobGasPrice) -> { final ProtocolSpec spec = protocolSchedule.getByBlockHeader(blockHeader); transactionProcessor.processTransaction( - blockchain, mutableWorldState.updater(), blockHeader, transaction, diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockTracer.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockTracer.java index b6651093702..5ede2d4a7b2 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockTracer.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockTracer.java @@ -64,7 +64,6 @@ private BlockReplay.TransactionAction prepareReplayAction( chainedUpdater = chainedUpdater.updater(); final TransactionProcessingResult result = transactionProcessor.processTransaction( - blockchain, chainedUpdater, header, transaction, diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java index 5b9cdfc2fcc..6524109ac6f 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java @@ -187,7 +187,6 @@ private TransactionProcessingResult processTransaction( final OperationTracer tracer, final Wei blobGasPrice) { return transactionProcessor.processTransaction( - blockchain, worldUpdater, header, transaction, diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracerTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracerTest.java index 8bf94f197f2..6626a66bb09 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracerTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracerTest.java @@ -180,7 +180,6 @@ public void traceTransactionShouldReturnResultFromProcessTransaction() { final WorldUpdater updater = mock(WorldUpdater.class); when(mutableWorldState.updater()).thenReturn(updater); when(transactionProcessor.processTransaction( - eq(blockchain), eq(updater), eq(blockHeader), eq(transaction), @@ -269,7 +268,6 @@ public void traceTransactionToFileShouldReturnResultFromProcessTransaction() thr final WorldUpdater stackedUpdater = mock(StackedUpdater.class); when(updater.updater()).thenReturn(stackedUpdater); when(transactionProcessor.processTransaction( - eq(blockchain), eq(stackedUpdater), eq(blockHeader), eq(transaction), diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java index c12061f4cbe..ea49aac8b23 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java @@ -326,7 +326,6 @@ private TransactionProcessingResult processTransaction( final BlockHashLookup blockHashLookup = new CachingBlockHashLookup(blockSelectionContext.processableBlockHeader(), blockchain); return transactionProcessor.processTransaction( - blockchain, worldStateUpdater, blockSelectionContext.processableBlockHeader(), pendingTransaction.getTransaction(), diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java index 26c3eb74cca..2eddaf7fa52 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java @@ -1345,7 +1345,7 @@ protected void ensureTransactionIsValid( final long gasRemaining, final long processingTime) { when(transactionProcessor.processTransaction( - any(), any(), any(), eq(tx), any(), any(), any(), anyBoolean(), any(), any())) + any(), any(), eq(tx), any(), any(), any(), anyBoolean(), any(), any())) .thenAnswer( invocation -> { if (processingTime > 0) { @@ -1370,7 +1370,7 @@ protected void ensureTransactionIsInvalid( final TransactionInvalidReason invalidReason, final long processingTime) { when(transactionProcessor.processTransaction( - any(), any(), any(), eq(tx), any(), any(), any(), anyBoolean(), any(), any())) + any(), any(), eq(tx), any(), any(), any(), anyBoolean(), any(), any())) .thenAnswer( invocation -> { if (processingTime > 0) { diff --git a/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java b/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java index 275bb6e2f78..862215395ab 100644 --- a/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java +++ b/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java @@ -100,7 +100,6 @@ public void shouldTraceSStoreOperation() { final WorldUpdater createTransactionUpdater = worldState.updater(); TransactionProcessingResult result = transactionProcessor.processTransaction( - blockchain, createTransactionUpdater, genesisBlockHeader, createTransaction, @@ -133,7 +132,6 @@ public void shouldTraceSStoreOperation() { final WorldUpdater storeUpdater = worldState.updater(); result = transactionProcessor.processTransaction( - blockchain, storeUpdater, genesisBlockHeader, executeTransaction, @@ -172,7 +170,6 @@ public void shouldTraceContractCreation() { new BytesValueRLPInput(Bytes.fromHexString(CONTRACT_CREATION_TX), false)); final BlockHeader genesisBlockHeader = genesisBlock.getHeader(); transactionProcessor.processTransaction( - blockchain, worldStateArchive .getMutable(genesisBlockHeader.getStateRoot(), genesisBlockHeader.getHash()) .get() diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java index 339582a3da3..8f929542351 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java @@ -138,7 +138,6 @@ public BlockProcessingResult processBlock( final TransactionProcessingResult result = transactionProcessor.processTransaction( - blockchain, worldStateUpdater, blockHeader, transaction, diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java index 9f849bd9a2b..209fc87c490 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java @@ -23,7 +23,6 @@ import org.hyperledger.besu.datatypes.AccessListEntry; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Wei; -import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader; import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.feemarket.CoinbaseFeePriceCalculator; @@ -101,7 +100,6 @@ public MainnetTransactionProcessor( /** * Applies a transaction to the current system state. * - * @param blockchain The current blockchain * @param worldState The current world state * @param blockHeader The current block header * @param transaction The transaction to process @@ -115,7 +113,6 @@ public MainnetTransactionProcessor( * @see TransactionValidationParams */ public TransactionProcessingResult processTransaction( - final Blockchain blockchain, final WorldUpdater worldState, final ProcessableBlockHeader blockHeader, final Transaction transaction, @@ -125,7 +122,6 @@ public TransactionProcessingResult processTransaction( final TransactionValidationParams transactionValidationParams, final Wei blobGasPrice) { return processTransaction( - blockchain, worldState, blockHeader, transaction, @@ -141,7 +137,6 @@ public TransactionProcessingResult processTransaction( /** * Applies a transaction to the current system state. * - * @param blockchain The current blockchain * @param worldState The current world state * @param blockHeader The current block header * @param transaction The transaction to process @@ -156,7 +151,6 @@ public TransactionProcessingResult processTransaction( * @see TransactionValidationParams */ public TransactionProcessingResult processTransaction( - final Blockchain blockchain, final WorldUpdater worldState, final ProcessableBlockHeader blockHeader, final Transaction transaction, @@ -167,7 +161,6 @@ public TransactionProcessingResult processTransaction( final OperationTracer operationTracer, final Wei blobGasPrice) { return processTransaction( - blockchain, worldState, blockHeader, transaction, @@ -183,18 +176,16 @@ public TransactionProcessingResult processTransaction( /** * Applies a transaction to the current system state. * - * @param blockchain The current blockchain * @param worldState The current world state * @param blockHeader The current block header * @param transaction The transaction to process - * @param operationTracer The tracer to record results of each EVM operation * @param miningBeneficiary The address which is to receive the transaction fee + * @param operationTracer The tracer to record results of each EVM operation * @param blockHashLookup The {@link BlockHashLookup} to use for BLOCKHASH operations * @param isPersistingPrivateState Whether the resulting private state will be persisted * @return the transaction result */ public TransactionProcessingResult processTransaction( - final Blockchain blockchain, final WorldUpdater worldState, final ProcessableBlockHeader blockHeader, final Transaction transaction, @@ -204,7 +195,6 @@ public TransactionProcessingResult processTransaction( final Boolean isPersistingPrivateState, final Wei blobGasPrice) { return processTransaction( - blockchain, worldState, blockHeader, transaction, @@ -220,19 +210,17 @@ public TransactionProcessingResult processTransaction( /** * Applies a transaction to the current system state. * - * @param blockchain The current blockchain * @param worldState The current world state * @param blockHeader The current block header * @param transaction The transaction to process - * @param operationTracer The tracer to record results of each EVM operation * @param miningBeneficiary The address which is to receive the transaction fee + * @param operationTracer The tracer to record results of each EVM operation * @param blockHashLookup The {@link BlockHashLookup} to use for BLOCKHASH operations * @param isPersistingPrivateState Whether the resulting private state will be persisted * @param transactionValidationParams The transaction validation parameters to use * @return the transaction result */ public TransactionProcessingResult processTransaction( - final Blockchain blockchain, final WorldUpdater worldState, final ProcessableBlockHeader blockHeader, final Transaction transaction, @@ -243,7 +231,6 @@ public TransactionProcessingResult processTransaction( final TransactionValidationParams transactionValidationParams, final Wei blobGasPrice) { return processTransaction( - blockchain, worldState, blockHeader, transaction, @@ -257,7 +244,6 @@ public TransactionProcessingResult processTransaction( } public TransactionProcessingResult processTransaction( - final Blockchain ignoredBlockchain, final WorldUpdater worldState, final ProcessableBlockHeader blockHeader, final Transaction transaction, diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateGroupRehydrationBlockProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateGroupRehydrationBlockProcessor.java index 462bd9c6619..a6724d77534 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateGroupRehydrationBlockProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateGroupRehydrationBlockProcessor.java @@ -171,7 +171,6 @@ public BlockProcessingResult processBlock( // depend on public state final TransactionProcessingResult result = transactionProcessor.processTransaction( - blockchain, worldStateUpdater, blockHeader, transaction, diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/storage/migration/PrivateMigrationBlockProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/storage/migration/PrivateMigrationBlockProcessor.java index 0310700e1f5..0cce3fbfe82 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/storage/migration/PrivateMigrationBlockProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/storage/migration/PrivateMigrationBlockProcessor.java @@ -103,7 +103,6 @@ public BlockProcessingResult processBlock( final TransactionProcessingResult result = transactionProcessor.processTransaction( - blockchain, worldStateUpdater, blockHeader, transaction, diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java index c0cf365bbc5..c073ac4148c 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java @@ -277,7 +277,6 @@ public Optional processWithWorldUpdater( final Transaction transaction = maybeTransaction.get(); final TransactionProcessingResult result = transactionProcessor.processTransaction( - blockchain, updater, blockHeaderToProcess, transaction, diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessorTest.java index ae95014150a..f57c85b567b 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessorTest.java @@ -22,7 +22,6 @@ import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.Wei; -import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader; import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.feemarket.CoinbaseFeePriceCalculator; @@ -69,7 +68,6 @@ class MainnetTransactionProcessorTest { @Mock private AbstractMessageProcessor contractCreationProcessor; @Mock private AbstractMessageProcessor messageCallProcessor; - @Mock private Blockchain blockchain; @Mock private WorldUpdater worldState; @Mock private ProcessableBlockHeader blockHeader; @Mock private Transaction transaction; @@ -124,7 +122,6 @@ void shouldWarmCoinbaseIfRequested() { var transactionProcessor = createTransactionProcessor(true); transactionProcessor.processTransaction( - blockchain, worldState, blockHeader, transaction, @@ -138,7 +135,6 @@ void shouldWarmCoinbaseIfRequested() { transactionProcessor = createTransactionProcessor(false); transactionProcessor.processTransaction( - blockchain, worldState, blockHeader, transaction, @@ -187,7 +183,6 @@ void shouldTraceEndTxOnFailingTransaction(final Exception exception) { var transactionProcessor = createTransactionProcessor(true); try { transactionProcessor.processTransaction( - blockchain, worldState, blockHeader, transaction, @@ -237,7 +232,6 @@ void shouldCallTransactionValidatorWithExpectedTransactionValidationParams() { var transactionProcessor = createTransactionProcessor(false); transactionProcessor.processTransaction( - blockchain, worldState, blockHeader, transaction, diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessorTest.java index 4711e456cf0..5937b296b81 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessorTest.java @@ -202,7 +202,7 @@ private ProtocolSpec mockProtocolSpec() { final MainnetTransactionProcessor mockPublicTransactionProcessor = mock(MainnetTransactionProcessor.class); when(mockPublicTransactionProcessor.processTransaction( - any(), any(), any(), any(), any(), any(), anyBoolean(), any(), any())) + any(), any(), any(), any(), any(), anyBoolean(), any(), any())) .thenReturn( TransactionProcessingResult.successful( Collections.emptyList(), 0, 0, Bytes.EMPTY, ValidationResult.valid())); diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java index 78b7a347f0d..7142d8830e5 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java @@ -742,7 +742,6 @@ private void mockProcessorStatusForTransaction( } when(transactionProcessor.processTransaction( - any(), any(), any(), eq(transaction), @@ -758,7 +757,6 @@ private void mockProcessorStatusForTransaction( private void verifyTransactionWasProcessed(final Transaction expectedTransaction) { verify(transactionProcessor) .processTransaction( - any(), any(), any(), eq(expectedTransaction), diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java index 66b0e26ab87..3368c458e14 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java @@ -34,7 +34,6 @@ import org.hyperledger.besu.ethereum.processing.TransactionProcessingResult; import org.hyperledger.besu.ethereum.referencetests.GeneralStateTestCaseEipSpec; import org.hyperledger.besu.ethereum.referencetests.GeneralStateTestCaseSpec; -import org.hyperledger.besu.ethereum.referencetests.ReferenceTestBlockchain; import org.hyperledger.besu.ethereum.referencetests.ReferenceTestProtocolSchedules; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.evm.account.Account; @@ -248,14 +247,11 @@ private void traceTestSpecs(final String test, final List Date: Mon, 22 Apr 2024 18:12:08 +1000 Subject: [PATCH 25/59] check nodes are producing blocks and synced before sending tx (#6975) Signed-off-by: Sally MacFarlane --- .../clique/CliqueMiningAcceptanceTest.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueMiningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueMiningAcceptanceTest.java index 50c58f8b34b..f6718b4ded1 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueMiningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueMiningAcceptanceTest.java @@ -86,7 +86,7 @@ public void shouldMineTransactionsOnMultipleNodes() throws IOException { final BesuNode minerNode1 = besu.createCliqueNode("miner1"); final BesuNode minerNode2 = besu.createCliqueNode("miner2"); final BesuNode minerNode3 = besu.createCliqueNode("miner3"); - cluster.start(minerNode1, minerNode2, minerNode3); + startClusterAndVerifyProducingBlocks(minerNode1, minerNode2, minerNode3); final Account sender = accounts.createAccount("account1"); final Account receiver = accounts.createAccount("account2"); @@ -106,7 +106,7 @@ public void shouldStallMiningWhenInsufficientValidators() throws IOException { final BesuNode minerNode1 = besu.createCliqueNode("miner1"); final BesuNode minerNode2 = besu.createCliqueNode("miner2"); final BesuNode minerNode3 = besu.createCliqueNode("miner3"); - cluster.start(minerNode1, minerNode2, minerNode3); + startClusterAndVerifyProducingBlocks(minerNode1, minerNode2, minerNode3); cluster.stopNode(minerNode2); cluster.stopNode(minerNode3); @@ -116,12 +116,23 @@ public void shouldStallMiningWhenInsufficientValidators() throws IOException { minerNode1.verify(clique.noNewBlockCreated(minerNode1)); } + private void startClusterAndVerifyProducingBlocks( + final BesuNode minerNode1, final BesuNode minerNode2, final BesuNode minerNode3) { + cluster.start(minerNode1, minerNode2, minerNode3); + + // verify that we have started producing blocks + waitForBlockHeight(minerNode1, 1); + final var minerChainHead = minerNode1.execute(ethTransactions.block()); + minerNode2.verify(blockchain.minimumHeight(minerChainHead.getNumber().longValue())); + minerNode3.verify(blockchain.minimumHeight(minerChainHead.getNumber().longValue())); + } + @Test public void shouldStillMineWhenANodeFailsAndHasSufficientValidators() throws IOException { final BesuNode minerNode1 = besu.createCliqueNode("miner1"); final BesuNode minerNode2 = besu.createCliqueNode("miner2"); final BesuNode minerNode3 = besu.createCliqueNode("miner3"); - cluster.start(minerNode1, minerNode2, minerNode3); + startClusterAndVerifyProducingBlocks(minerNode1, minerNode2, minerNode3); cluster.verifyOnActiveNodes(blockchain.reachesHeight(minerNode1, 1, 85)); From e4e9f670fed5c734d0ce442d286f42f28ecb8343 Mon Sep 17 00:00:00 2001 From: Jason Frame Date: Tue, 23 Apr 2024 15:42:14 +1000 Subject: [PATCH 26/59] Fix worldstate halt with snap sync during initial sync (#6981) Signed-off-by: Karim Taam Signed-off-by: Jason Frame Co-authored-by: Sally MacFarlane --- CHANGELOG.md | 1 + .../eth/sync/snapsync/CompleteTaskStep.java | 8 +-- .../eth/sync/snapsync/RequestDataStep.java | 15 +++--- .../sync/snapsync/SnapWorldDownloadState.java | 19 +++---- .../SnapWorldStateDownloadProcess.java | 51 ------------------- .../snapsync/SnapWorldStateDownloader.java | 1 - 6 files changed, 21 insertions(+), 74 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20833b7f2f2..c5332c57b9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ - Fix to avoid broadcasting full blob txs, instead of only the tx announcement, to a subset of nodes [#6835](https://github.com/hyperledger/besu/pull/6835) - Snap client fixes discovered during snap server testing [#6847](https://github.com/hyperledger/besu/pull/6847) - Correctly initialize the txpool as disabled on creation [#6890](https://github.com/hyperledger/besu/pull/6890) +- Fix worldstate download halt when using snap sync during initial sync [#6981](https://github.com/hyperledger/besu/pull/6981) ### Download Links diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java index 202853ce28f..3a2ffa35065 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java @@ -43,9 +43,11 @@ public CompleteTaskStep( public synchronized void markAsCompleteOrFailed( final SnapWorldDownloadState downloadState, final Task task) { - if (task.getData().isResponseReceived() - || (task.getData() instanceof TrieNodeHealingRequest - && task.getData().isExpired(snapSyncState))) { + final boolean isResponseReceived = task.getData().isResponseReceived(); + final boolean isExpiredRequest = + task.getData() instanceof TrieNodeHealingRequest && task.getData().isExpired(snapSyncState); + // if pivot block has changed, the request is expired and we mark this one completed + if (isResponseReceived || isExpiredRequest) { completedRequestsCounter.inc(); task.markCompleted(); downloadState.checkCompletion(snapSyncState.getPivotBlockHeader().orElseThrow()); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java index f866f4c41ba..f2df979baac 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java @@ -44,6 +44,7 @@ import java.util.NavigableMap; import java.util.TreeMap; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import com.google.common.collect.Lists; @@ -95,10 +96,11 @@ public CompletableFuture> requestAccount( downloadState.addOutstandingTask(getAccountTask); return getAccountTask .run() + .orTimeout(10, TimeUnit.SECONDS) .handle( (response, error) -> { + downloadState.removeOutstandingTask(getAccountTask); if (response != null) { - downloadState.removeOutstandingTask(getAccountTask); accountDataRequest.setRootHash(blockHeader.getStateRoot()); accountDataRequest.addResponse( worldStateProofProvider, response.accounts(), response.proofs()); @@ -130,13 +132,12 @@ public CompletableFuture>> requestStorage( downloadState.addOutstandingTask(getStorageRangeTask); return getStorageRangeTask .run() + .orTimeout(10, TimeUnit.SECONDS) .handle( (response, error) -> { + downloadState.removeOutstandingTask(getStorageRangeTask); if (response != null) { - downloadState.removeOutstandingTask(getStorageRangeTask); final ArrayDeque> slots = new ArrayDeque<>(); - // Check if we have an empty range - /* * Checks if the response represents an "empty range". * @@ -186,10 +187,11 @@ public CompletableFuture>> requestCode( downloadState.addOutstandingTask(getByteCodeTask); return getByteCodeTask .run() + .orTimeout(10, TimeUnit.SECONDS) .handle( (response, error) -> { + downloadState.removeOutstandingTask(getByteCodeTask); if (response != null) { - downloadState.removeOutstandingTask(getByteCodeTask); for (Task requestTask : requestTasks) { final BytecodeRequest request = (BytecodeRequest) requestTask.getData(); request.setRootHash(blockHeader.getStateRoot()); @@ -225,10 +227,11 @@ public CompletableFuture>> requestTrieNodeByPath( downloadState.addOutstandingTask(getTrieNodeFromPeerTask); return getTrieNodeFromPeerTask .run() + .orTimeout(10, TimeUnit.SECONDS) .handle( (response, error) -> { + downloadState.removeOutstandingTask(getTrieNodeFromPeerTask); if (response != null) { - downloadState.removeOutstandingTask(getTrieNodeFromPeerTask); for (final Task task : requestTasks) { final TrieNodeHealingRequest request = (TrieNodeHealingRequest) task.getData(); final Bytes matchingData = response.get(request.getPathId()); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadState.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadState.java index 3d93b852297..1b6567588b2 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadState.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadState.java @@ -46,7 +46,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.OptionalLong; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; @@ -86,7 +85,7 @@ public class SnapWorldDownloadState extends WorldDownloadState // blockchain private final Blockchain blockchain; - private OptionalLong blockObserverId; + private final Long blockObserverId; // metrics around the snapsync private final SnapSyncMetricsManager metricsManager; @@ -111,7 +110,8 @@ public SnapWorldDownloadState( this.blockchain = blockchain; this.snapSyncState = snapSyncState; this.metricsManager = metricsManager; - this.blockObserverId = OptionalLong.empty(); + this.blockObserverId = blockchain.observeBlockAdded(createBlockchainObserver()); + metricsManager .getMetricsSystem() .createLongGauge( @@ -174,11 +174,6 @@ public synchronized boolean checkCompletion(final BlockHeader header) { // if all snapsync tasks are completed and the healing process was not running if (!snapSyncState.isHealTrieInProgress()) { - // Register blockchain observer if not already registered - blockObserverId = - blockObserverId.isEmpty() - ? OptionalLong.of(blockchain.observeBlockAdded(createBlockchainObserver())) - : blockObserverId; // Start the healing process startTrieHeal(); } @@ -192,8 +187,6 @@ else if (pivotBlockSelector.isBlockchainBehind()) { // if all snapsync tasks are completed and the healing was running and the blockchain is not // behind the pivot block else { - // Remove the blockchain observer - blockObserverId.ifPresent(blockchain::removeObserver); // If the flat database healing process is not in progress and the flat database mode is // FULL if (!snapSyncState.isHealFlatDatabaseInProgress() @@ -213,6 +206,8 @@ else if (pivotBlockSelector.isBlockchainBehind()) { }); updater.commit(); + // Remove the blockchain observer + blockchain.removeObserver(blockObserverId); // Notify that the snap sync has completed metricsManager.notifySnapSyncCompleted(); // Clear the snap context @@ -441,9 +436,7 @@ public BlockAddedObserver createBlockchainObserver() { final boolean isBlockchainCaughtUp = snapSyncState.isWaitingBlockchain() && !pivotBlockSelector.isBlockchainBehind(); - if (isNewPivotBlockFound - || isBlockchainCaughtUp) { // restart heal if we found a new pivot block or if close to - // head again + if (snapSyncState.isHealTrieInProgress() && (isNewPivotBlockFound || isBlockchainCaughtUp)) { snapSyncState.setWaitingBlockchain(false); reloadTrieHeal(); } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloadProcess.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloadProcess.java index c19ae6facc7..ddab9688043 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloadProcess.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloadProcess.java @@ -15,7 +15,6 @@ package org.hyperledger.besu.ethereum.eth.sync.snapsync; import static com.google.common.base.Preconditions.checkNotNull; -import static org.hyperledger.besu.ethereum.eth.sync.snapsync.DynamicPivotBlockSelector.doNothingOnPivotChange; import static org.hyperledger.besu.services.pipeline.PipelineBuilder.createPipelineFrom; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; @@ -159,19 +158,12 @@ public static class Builder { private SnapSyncProcessState snapSyncState; private PersistDataStep persistDataStep; private CompleteTaskStep completeTaskStep; - private DynamicPivotBlockSelector pivotBlockManager; public Builder configuration(final SnapSyncConfiguration snapSyncConfiguration) { this.snapSyncConfiguration = snapSyncConfiguration; return this; } - public Builder dynamicPivotBlockSelector( - final DynamicPivotBlockSelector dynamicPivotBlockSelector) { - this.pivotBlockManager = dynamicPivotBlockSelector; - return this; - } - public Builder maxOutstandingRequests(final int maxOutstandingRequests) { this.maxOutstandingRequests = maxOutstandingRequests; return this; @@ -265,12 +257,6 @@ public SnapWorldStateDownloadProcess build() { outputCounter, true, "world_state_download") - .thenProcess( - "checkNewPivotBlock-Account", - tasks -> { - pivotBlockManager.check(doNothingOnPivotChange); - return tasks; - }) .thenProcessAsync( "batchDownloadAccountData", requestTask -> requestDataStep.requestAccount(requestTask), @@ -288,12 +274,6 @@ public SnapWorldStateDownloadProcess build() { true, "world_state_download") .inBatches(snapSyncConfiguration.getStorageCountPerRequest()) - .thenProcess( - "checkNewPivotBlock-Storage", - tasks -> { - pivotBlockManager.check(doNothingOnPivotChange); - return tasks; - }) .thenProcessAsyncOrdered( "batchDownloadStorageData", requestTask -> requestDataStep.requestStorage(requestTask), @@ -314,12 +294,6 @@ public SnapWorldStateDownloadProcess build() { outputCounter, true, "world_state_download") - .thenProcess( - "checkNewPivotBlock-LargeStorage", - tasks -> { - pivotBlockManager.check(doNothingOnPivotChange); - return tasks; - }) .thenProcessAsyncOrdered( "batchDownloadLargeStorageData", requestTask -> requestDataStep.requestStorage(List.of(requestTask)), @@ -354,14 +328,6 @@ public SnapWorldStateDownloadProcess build() { .map(BytecodeRequest::getCodeHash) .distinct() .count()) - .thenProcess( - "checkNewPivotBlock-Code", - tasks -> { - pivotBlockManager.check( - (blockHeader, newBlockFound) -> - reloadHealWhenNeeded(snapSyncState, downloadState, newBlockFound)); - return tasks; - }) .thenProcessAsyncOrdered( "batchDownloadCodeData", tasks -> requestDataStep.requestCode(tasks), @@ -390,14 +356,6 @@ public SnapWorldStateDownloadProcess build() { 3, bufferCapacity) .inBatches(snapSyncConfiguration.getTrienodeCountPerRequest()) - .thenProcess( - "checkNewPivotBlock-TrieNode", - tasks -> { - pivotBlockManager.check( - (blockHeader, newBlockFound) -> - reloadHealWhenNeeded(snapSyncState, downloadState, newBlockFound)); - return tasks; - }) .thenProcessAsync( "batchDownloadTrieNodeData", tasks -> requestDataStep.requestTrieNodeByPath(tasks), @@ -461,13 +419,4 @@ public SnapWorldStateDownloadProcess build() { requestsToComplete); } } - - private static void reloadHealWhenNeeded( - final SnapSyncProcessState snapSyncState, - final SnapWorldDownloadState downloadState, - final boolean newBlockFound) { - if (snapSyncState.isHealTrieInProgress() && newBlockFound) { - downloadState.reloadTrieHeal(); - } - } } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloader.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloader.java index 471c84a6321..0e0e1b1ac30 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloader.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloader.java @@ -214,7 +214,6 @@ public CompletableFuture run( SnapWorldStateDownloadProcess.builder() .configuration(snapSyncConfiguration) .maxOutstandingRequests(maxOutstandingRequests) - .dynamicPivotBlockSelector(dynamicPivotBlockManager) .loadLocalDataStep( new LoadLocalDataStep( worldStateStorageCoordinator, From 3d5f45c35ffce4b5173b2ce5972827f9634317d6 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Tue, 23 Apr 2024 09:49:56 +0200 Subject: [PATCH 27/59] Layered txpool tuning for blob transactions (#6940) Signed-off-by: Fabio Di Fabio --- CHANGELOG.md | 2 +- .../cli/options/TransactionPoolOptions.java | 17 ++ .../options/TransactionPoolOptionsTest.java | 49 +++++ .../src/test/resources/everything_config.toml | 1 + .../eth/transactions/TransactionPool.java | 10 + .../TransactionPoolConfiguration.java | 10 + .../AbstractPrioritizedTransactions.java | 34 ++- .../layered/AbstractTransactionsLayer.java | 61 ++++-- .../BaseFeePrioritizedTransactions.java | 1 + .../eth/transactions/layered/EndLayer.java | 6 +- .../layered/ReadyTransactions.java | 7 +- .../layered/SparseTransactions.java | 8 +- .../layered/TransactionsLayer.java | 7 +- ...stractPrioritizedTransactionsTestBase.java | 6 + .../BaseFeePrioritizedTransactionsTest.java | 72 +++++++ .../layered/BaseTransactionPoolTest.java | 30 ++- .../LayeredPendingTransactionsTest.java | 52 +++-- .../eth/transactions/layered/LayersTest.java | 196 +++++++++++++----- .../eth/transactions/layered/ReplayTest.java | 15 ++ 19 files changed, 490 insertions(+), 94 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5332c57b9f..60b94c41090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ - Add RPC errors metric [#6919](https://github.com/hyperledger/besu/pull/6919/) - Add `rlp decode` subcommand to decode IBFT/QBFT extraData to validator list [#6895](https://github.com/hyperledger/besu/pull/6895) - Allow users to specify which plugins are registered [#6700](https://github.com/hyperledger/besu/pull/6700) - +- Layered txpool tuning for blob transactions [#6940](https://github.com/hyperledger/besu/pull/6940) ### Bug fixes - Fix txpool dump/restore race condition [#6665](https://github.com/hyperledger/besu/pull/6665) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/TransactionPoolOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/TransactionPoolOptions.java index b2013a4ab06..b6aa2bc645f 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/TransactionPoolOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/TransactionPoolOptions.java @@ -27,6 +27,7 @@ import org.hyperledger.besu.cli.util.CommandLineUtils; import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.eth.transactions.ImmutableTransactionPoolConfiguration; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration; @@ -37,6 +38,7 @@ import java.io.File; import java.time.Duration; import java.util.List; +import java.util.Map; import java.util.Set; import picocli.CommandLine; @@ -155,6 +157,8 @@ public class TransactionPoolOptions implements CLIOptions txPoolMaxPrioritizedByType = + TransactionPoolConfiguration.DEFAULT_MAX_PRIORITIZED_TRANSACTIONS_BY_TYPE; + @CommandLine.Option( names = {TX_POOL_MAX_FUTURE_BY_SENDER}, paramLabel = MANDATORY_INTEGER_FORMAT_HELP, @@ -297,6 +311,8 @@ public static TransactionPoolOptions fromConfig(final TransactionPoolConfigurati options.layeredOptions.txPoolLayerMaxCapacity = config.getPendingTransactionsLayerMaxCapacityBytes(); options.layeredOptions.txPoolMaxPrioritized = config.getMaxPrioritizedTransactions(); + options.layeredOptions.txPoolMaxPrioritizedByType = + config.getMaxPrioritizedTransactionsByType(); options.layeredOptions.txPoolMaxFutureBySender = config.getMaxFutureBySender(); options.sequencedOptions.txPoolLimitByAccountPercentage = config.getTxPoolLimitByAccountPercentage(); @@ -354,6 +370,7 @@ public TransactionPoolConfiguration toDomainObject() { .minGasPrice(minGasPrice) .pendingTransactionsLayerMaxCapacityBytes(layeredOptions.txPoolLayerMaxCapacity) .maxPrioritizedTransactions(layeredOptions.txPoolMaxPrioritized) + .maxPrioritizedTransactionsByType(layeredOptions.txPoolMaxPrioritizedByType) .maxFutureBySender(layeredOptions.txPoolMaxFutureBySender) .txPoolLimitByAccountPercentage(sequencedOptions.txPoolLimitByAccountPercentage) .txPoolMaxSize(sequencedOptions.txPoolMaxSize) diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java index 6b7363eb915..3c17661f639 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java @@ -21,11 +21,14 @@ import org.hyperledger.besu.cli.converter.DurationMillisConverter; import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.eth.transactions.ImmutableTransactionPoolConfiguration; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration; import org.hyperledger.besu.util.number.Percentage; +import java.io.IOException; +import java.nio.file.Path; import java.time.Duration; import org.junit.jupiter.api.Test; @@ -369,6 +372,52 @@ public void eth65TrxAnnouncedBufferingPeriodWithInvalidInputShouldFail2() { "-1"); } + @Test + public void maxPrioritizedTxsPerType() { + final int maxBlobs = 2; + final int maxFrontier = 200; + internalTestSuccess( + config -> { + assertThat(config.getMaxPrioritizedTransactionsByType().get(TransactionType.BLOB)) + .isEqualTo(maxBlobs); + assertThat(config.getMaxPrioritizedTransactionsByType().get(TransactionType.FRONTIER)) + .isEqualTo(maxFrontier); + }, + "--tx-pool-max-prioritized-by-type", + "BLOB=" + maxBlobs + ",FRONTIER=" + maxFrontier); + } + + @Test + public void maxPrioritizedTxsPerTypeConfigFile() throws IOException { + final int maxBlobs = 2; + final int maxFrontier = 200; + final Path tempConfigFilePath = + createTempFile( + "config", + String.format( + """ + tx-pool-max-prioritized-by-type=["BLOB=%s","FRONTIER=%s"] + """, + maxBlobs, maxFrontier)); + internalTestSuccess( + config -> { + assertThat(config.getMaxPrioritizedTransactionsByType().get(TransactionType.BLOB)) + .isEqualTo(maxBlobs); + assertThat(config.getMaxPrioritizedTransactionsByType().get(TransactionType.FRONTIER)) + .isEqualTo(maxFrontier); + }, + "--config-file", + tempConfigFilePath.toString()); + } + + @Test + public void maxPrioritizedTxsPerTypeWrongTxType() { + internalTestFailure( + "Invalid value for option '--tx-pool-max-prioritized-by-type' (MAP): expected one of [FRONTIER, ACCESS_LIST, EIP1559, BLOB] (case-insensitive) but was 'WRONG_TYPE'", + "--tx-pool-max-prioritized-by-type", + "WRONG_TYPE=1"); + } + @Override protected TransactionPoolConfiguration createDefaultDomainObject() { return TransactionPoolConfiguration.DEFAULT; diff --git a/besu/src/test/resources/everything_config.toml b/besu/src/test/resources/everything_config.toml index f2b112eccb1..a92eac34e5c 100644 --- a/besu/src/test/resources/everything_config.toml +++ b/besu/src/test/resources/everything_config.toml @@ -185,6 +185,7 @@ tx-pool-save-file="txpool.dump" ## Layered tx-pool-layer-max-capacity=12345678 tx-pool-max-prioritized=9876 +tx-pool-max-prioritized-by-type=["BLOB=10","FRONTIER=100"] tx-pool-max-future-by-sender=321 ## Legacy/Sequenced tx-pool-retention-hours=999 diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java index b5171ac7d50..c069a771eb2 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java @@ -149,6 +149,16 @@ private void initLogForReplay() { .map(Address::toHexString) .collect(Collectors.joining(","))) .log(); + // log the max prioritized txs by type + LOG_FOR_REPLAY + .atTrace() + .setMessage("{}") + .addArgument( + () -> + configuration.getMaxPrioritizedTransactionsByType().entrySet().stream() + .map(e -> e.getKey().name() + "=" + e.getValue()) + .collect(Collectors.joining(","))) + .log(); } @VisibleForTesting diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolConfiguration.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolConfiguration.java index 08610f507ab..18a8598ab86 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolConfiguration.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolConfiguration.java @@ -15,6 +15,7 @@ package org.hyperledger.besu.ethereum.eth.transactions; import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.plugin.services.TransactionPoolValidatorService; import org.hyperledger.besu.plugin.services.txvalidator.PluginTransactionPoolValidator; @@ -24,6 +25,8 @@ import java.io.File; import java.time.Duration; +import java.util.EnumMap; +import java.util.Map; import java.util.Set; import org.immutables.value.Value; @@ -71,6 +74,8 @@ enum Implementation { File DEFAULT_SAVE_FILE = new File(DEFAULT_SAVE_FILE_NAME); long DEFAULT_PENDING_TRANSACTIONS_LAYER_MAX_CAPACITY_BYTES = 12_500_000L; int DEFAULT_MAX_PRIORITIZED_TRANSACTIONS = 2000; + EnumMap DEFAULT_MAX_PRIORITIZED_TRANSACTIONS_BY_TYPE = + new EnumMap<>(Map.of(TransactionType.BLOB, 6)); int DEFAULT_MAX_FUTURE_BY_SENDER = 200; Implementation DEFAULT_TX_POOL_IMPLEMENTATION = Implementation.LAYERED; Set
DEFAULT_PRIORITY_SENDERS = Set.of(); @@ -148,6 +153,11 @@ default int getMaxPrioritizedTransactions() { return DEFAULT_MAX_PRIORITIZED_TRANSACTIONS; } + @Value.Default + default Map getMaxPrioritizedTransactionsByType() { + return DEFAULT_MAX_PRIORITIZED_TRANSACTIONS_BY_TYPE; + } + @Value.Default default int getMaxFutureBySender() { return DEFAULT_MAX_FUTURE_BY_SENDER; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java index 8929e221062..b728ed08638 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java @@ -15,6 +15,7 @@ package org.hyperledger.besu.ethereum.eth.transactions.layered; import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.eth.transactions.BlobCache; import org.hyperledger.besu.ethereum.eth.transactions.PendingTransaction; @@ -87,6 +88,15 @@ protected void internalReplaced(final PendingTransaction replacedTx) { } private boolean hasPriority(final PendingTransaction pendingTransaction) { + // check if there is space for that tx type + final var txType = pendingTransaction.getTransaction().getType(); + if (txCountByType[txType.ordinal()] + >= poolConfig + .getMaxPrioritizedTransactionsByType() + .getOrDefault(txType, Integer.MAX_VALUE)) { + return false; + } + // if it does not pass the promotion filter, then has not priority if (!promotionFilter(pendingTransaction)) { return false; @@ -123,10 +133,32 @@ protected void internalRemove( public List promote( final Predicate promotionFilter, final long freeSpace, - final int freeSlots) { + final int freeSlots, + final int[] remainingPromotionsPerType) { return List.of(); } + /** + * Here the max number of txs of a specific type that can be promoted, is defined by the + * configuration, so we return the difference between the configured max and the current count of + * txs for each type + * + * @return an array containing the max amount of txs that can be promoted for each type + */ + @Override + protected int[] getRemainingPromotionsPerType() { + final var allTypes = TransactionType.values(); + final var remainingPromotionsPerType = new int[allTypes.length]; + for (int i = 0; i < allTypes.length; i++) { + remainingPromotionsPerType[i] = + poolConfig + .getMaxPrioritizedTransactionsByType() + .getOrDefault(allTypes[i], Integer.MAX_VALUE) + - txCountByType[i]; + } + return remainingPromotionsPerType; + } + @Override public Stream stream() { return orderByFee.descendingSet().stream(); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java index 68ecb99c5c7..2885edc42a3 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java @@ -61,6 +61,13 @@ public abstract class AbstractTransactionsLayer implements TransactionsLayer { private static final Logger LOG = LoggerFactory.getLogger(AbstractTransactionsLayer.class); private static final NavigableMap EMPTY_SENDER_TXS = new TreeMap<>(); + private static final int[] UNLIMITED_PROMOTIONS_PER_TYPE = + new int[TransactionType.values().length]; + + static { + Arrays.fill(UNLIMITED_PROMOTIONS_PER_TYPE, Integer.MAX_VALUE); + } + protected final TransactionPoolConfiguration poolConfig; protected final TransactionsLayer nextLayer; protected final BiFunction @@ -170,7 +177,7 @@ public TransactionAddedResult add(final PendingTransaction pendingTransaction, f if (!maybeFull()) { // if there is space try to see if the added tx filled some gaps - tryFillGap(addStatus, pendingTransaction); + tryFillGap(addStatus, pendingTransaction, getRemainingPromotionsPerType()); } notifyTransactionAdded(pendingTransaction); @@ -207,16 +214,21 @@ private boolean maybeFull() { } private void tryFillGap( - final TransactionAddedResult addStatus, final PendingTransaction pendingTransaction) { + final TransactionAddedResult addStatus, + final PendingTransaction pendingTransaction, + final int[] remainingPromotionsPerType) { // it makes sense to fill gaps only if the add is not a replacement and this layer does not // allow gaps if (!addStatus.isReplacement() && !gapsAllowed()) { final PendingTransaction promotedTx = - nextLayer.promoteFor(pendingTransaction.getSender(), pendingTransaction.getNonce()); + nextLayer.promoteFor( + pendingTransaction.getSender(), + pendingTransaction.getNonce(), + remainingPromotionsPerType); if (promotedTx != null) { processAdded(promotedTx); if (!maybeFull()) { - tryFillGap(ADDED, promotedTx); + tryFillGap(ADDED, promotedTx, remainingPromotionsPerType); } } } @@ -251,22 +263,30 @@ protected abstract void internalNotifyAdded( final PendingTransaction pendingTransaction); @Override - public PendingTransaction promoteFor(final Address sender, final long nonce) { + public PendingTransaction promoteFor( + final Address sender, final long nonce, final int[] remainingPromotionsPerType) { final var senderTxs = txsBySender.get(sender); if (senderTxs != null) { long expectedNonce = nonce + 1; if (senderTxs.firstKey() == expectedNonce) { - final PendingTransaction promotedTx = senderTxs.pollFirstEntry().getValue(); - processRemove(senderTxs, promotedTx.getTransaction(), PROMOTED); - metrics.incrementRemoved(promotedTx, "promoted", name()); - - if (senderTxs.isEmpty()) { - txsBySender.remove(sender); + final var candidateTx = senderTxs.firstEntry().getValue(); + final var txType = candidateTx.getTransaction().getType(); + + if (remainingPromotionsPerType[txType.ordinal()] > 0) { + senderTxs.pollFirstEntry(); + processRemove(senderTxs, candidateTx.getTransaction(), PROMOTED); + metrics.incrementRemoved(candidateTx, "promoted", name()); + + if (senderTxs.isEmpty()) { + txsBySender.remove(sender); + } + --remainingPromotionsPerType[txType.ordinal()]; + return candidateTx; } - return promotedTx; + return null; } } - return nextLayer.promoteFor(sender, nonce); + return nextLayer.promoteFor(sender, nonce, remainingPromotionsPerType); } private TransactionAddedResult addToNextLayer( @@ -425,11 +445,24 @@ final void promoteTransactions() { if (freeSlots > 0 && freeSpace > 0) { nextLayer - .promote(this::promotionFilter, cacheFreeSpace(), freeSlots) + .promote( + this::promotionFilter, cacheFreeSpace(), freeSlots, getRemainingPromotionsPerType()) .forEach(this::processAdded); } } + /** + * How many txs of a specified type can be promoted? This make sense when a max number of txs of a + * type can be included in a single block (ex. blob txs), to avoid filling the layer with more txs + * than the useful ones. By default, there are no limits, but each layer can define its own + * policy. + * + * @return an array containing the max amount of txs that can be promoted for each type + */ + protected int[] getRemainingPromotionsPerType() { + return Arrays.copyOf(UNLIMITED_PROMOTIONS_PER_TYPE, UNLIMITED_PROMOTIONS_PER_TYPE.length); + } + private void confirmed(final Address sender, final long maxConfirmedNonce) { final var senderTxs = txsBySender.get(sender); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java index 8c0cd37f0cf..a308b84f604 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java @@ -149,6 +149,7 @@ private Wei calculateNextBlockBaseFee(final FeeMarket feeMarket, final BlockHead @Override protected boolean promotionFilter(final PendingTransaction pendingTransaction) { + // check if the tx is willing to pay at least the base fee if (nextBlockBaseFee .map(pendingTransaction.getTransaction().getMaxGasPrice()::lessThan) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EndLayer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EndLayer.java index e79ce1d8a71..d511a89c557 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EndLayer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EndLayer.java @@ -122,7 +122,8 @@ public OptionalLong getCurrentNonceFor(final Address sender) { public List promote( final Predicate promotionFilter, final long freeSpace, - final int freeSlots) { + final int freeSlots, + final int[] remainingPromotionsPerType) { return List.of(); } @@ -152,7 +153,8 @@ protected void notifyTransactionDropped(final PendingTransaction pendingTransact } @Override - public PendingTransaction promoteFor(final Address sender, final long nonce) { + public PendingTransaction promoteFor( + final Address sender, final long nonce, final int[] remainingPromotionsPerType) { return null; } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReadyTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReadyTransactions.java index a3dc195d1bf..570099d3392 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReadyTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReadyTransactions.java @@ -146,7 +146,8 @@ public Stream stream() { public List promote( final Predicate promotionFilter, final long freeSpace, - final int freeSlots) { + final int freeSlots, + final int[] remainingPromotionsPerType) { long accumulatedSpace = 0; final List promotedTxs = new ArrayList<>(); @@ -155,10 +156,12 @@ public List promote( for (final var senderFirstTx : orderByMaxFee.descendingSet()) { final var senderTxs = txsBySender.get(senderFirstTx.getSender()); for (final var candidateTx : senderTxs.values()) { - if (promotionFilter.test(candidateTx)) { + final var txType = candidateTx.getTransaction().getType(); + if (promotionFilter.test(candidateTx) && remainingPromotionsPerType[txType.ordinal()] > 0) { accumulatedSpace += candidateTx.memorySize(); if (promotedTxs.size() < freeSlots && accumulatedSpace <= freeSpace) { promotedTxs.add(candidateTx); + --remainingPromotionsPerType[txType.ordinal()]; } else { // no room for more txs the search is over exit the loops break search; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java index 414f12b3d26..cc0d4d9f4d8 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java @@ -147,7 +147,8 @@ protected void internalBlockAdded(final BlockHeader blockHeader, final FeeMarket public List promote( final Predicate promotionFilter, final long freeSpace, - final int freeSlots) { + final int freeSlots, + final int[] remainingPromotionsPerType) { long accumulatedSpace = 0; final List promotedTxs = new ArrayList<>(); @@ -158,11 +159,12 @@ public List promote( final var senderSeqTxs = getSequentialSubset(txsBySender.get(sender)); for (final var candidateTx : senderSeqTxs.values()) { - - if (promotionFilter.test(candidateTx)) { + final var txType = candidateTx.getTransaction().getType(); + if (promotionFilter.test(candidateTx) && remainingPromotionsPerType[txType.ordinal()] > 0) { accumulatedSpace += candidateTx.memorySize(); if (promotedTxs.size() < freeSlots && accumulatedSpace <= freeSpace) { promotedTxs.add(candidateTx); + --remainingPromotionsPerType[txType.ordinal()]; } else { // no room for more txs the search is over exit the loops break search; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/TransactionsLayer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/TransactionsLayer.java index 688eb6721e8..0630ec1f934 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/TransactionsLayer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/TransactionsLayer.java @@ -70,7 +70,10 @@ void blockAdded( OptionalLong getCurrentNonceFor(Address sender); List promote( - Predicate promotionFilter, final long freeSpace, final int freeSlots); + Predicate promotionFilter, + final long freeSpace, + final int freeSlots, + final int[] remainingPromotionsPerType); long subscribeToAdded(PendingTransactionAddedListener listener); @@ -80,7 +83,7 @@ List promote( void unsubscribeFromDropped(long id); - PendingTransaction promoteFor(Address sender, long nonce); + PendingTransaction promoteFor(Address sender, long nonce, final int[] remainingPromotionsPerType); void notifyAdded(PendingTransaction pendingTransaction); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactionsTestBase.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactionsTestBase.java index 6fe7f9381c8..095516487f0 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactionsTestBase.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactionsTestBase.java @@ -18,6 +18,7 @@ import static org.hyperledger.besu.ethereum.eth.transactions.TransactionAddedResult.ADDED; import static org.hyperledger.besu.ethereum.eth.transactions.TransactionAddedResult.DROPPED; +import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.MiningParameters; @@ -30,8 +31,10 @@ import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolReplacementHandler; import java.util.ArrayList; +import java.util.EnumMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.function.BiFunction; import java.util.stream.IntStream; @@ -39,6 +42,8 @@ public abstract class AbstractPrioritizedTransactionsTestBase extends BaseTransactionPoolTest { protected static final int MAX_TRANSACTIONS = 5; + protected static final EnumMap MAX_TRANSACTIONS_BY_TYPE = + new EnumMap<>(Map.of(TransactionType.BLOB, 2)); protected final TransactionPoolMetrics txPoolMetrics = new TransactionPoolMetrics(metricsSystem); protected final EvictCollectorLayer evictCollector = new EvictCollectorLayer(txPoolMetrics); protected final MiningParameters miningParameters = @@ -49,6 +54,7 @@ public abstract class AbstractPrioritizedTransactionsTestBase extends BaseTransa getSorter( ImmutableTransactionPoolConfiguration.builder() .maxPrioritizedTransactions(MAX_TRANSACTIONS) + .maxPrioritizedTransactionsByType(MAX_TRANSACTIONS_BY_TYPE) .maxFutureBySender(MAX_TRANSACTIONS) .build(), miningParameters); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java index 67c066de9c0..877c3c7d049 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java @@ -35,6 +35,7 @@ import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolMetrics; import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket; +import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Optional; @@ -111,6 +112,9 @@ protected Transaction createTransactionReplacement( originalTransaction.getType(), originalTransaction.getNonce(), originalTransaction.getMaxGasPrice().multiply(2), + originalTransaction.getMaxGasPrice().multiply(2).divide(10), + originalTransaction.getPayload().size(), + originalTransaction.getBlobCount(), keys); } @@ -218,4 +222,72 @@ public void shouldPrioritizePriorityFeeThenTimeAddedToPoolSameTypeTxs( shouldPrioritizeValueThenTimeAddedToPool( lowValueTxs.iterator(), highGasPriceTransaction, lowValueTxs.get(0)); } + + @Test + public void maxNumberOfTxsForTypeIsEnforced() { + final var limitedType = MAX_TRANSACTIONS_BY_TYPE.entrySet().iterator().next(); + final var maxNumber = limitedType.getValue(); + final var addedTxs = new ArrayList(maxNumber); + for (int i = 0; i < maxNumber; i++) { + final var tx = + createTransaction( + limitedType.getKey(), + 0, + DEFAULT_MIN_GAS_PRICE, + DEFAULT_MIN_GAS_PRICE.divide(10), + 0, + 1, + SIGNATURE_ALGORITHM.get().generateKeyPair()); + addedTxs.add(tx); + assertThat(prioritizeTransaction(tx)).isEqualTo(ADDED); + } + + final var overflowTx = + createTransaction( + limitedType.getKey(), + 0, + DEFAULT_MIN_GAS_PRICE, + DEFAULT_MIN_GAS_PRICE.divide(10), + 0, + 1, + SIGNATURE_ALGORITHM.get().generateKeyPair()); + assertThat(prioritizeTransaction(overflowTx)).isEqualTo(DROPPED); + + addedTxs.forEach(this::assertTransactionPrioritized); + assertTransactionNotPrioritized(overflowTx); + } + + @Test + public void maxNumberOfTxsForTypeWithReplacement() { + final var limitedType = MAX_TRANSACTIONS_BY_TYPE.entrySet().iterator().next(); + final var maxNumber = limitedType.getValue(); + final var addedTxs = new ArrayList(maxNumber); + for (int i = 0; i < maxNumber; i++) { + final var tx = + createTransaction( + limitedType.getKey(), + i, + DEFAULT_MIN_GAS_PRICE, + DEFAULT_MIN_GAS_PRICE.divide(10), + 0, + 1, + KEYS1); + addedTxs.add(tx); + assertThat(prioritizeTransaction(tx)).isEqualTo(ADDED); + } + + final var replacedTx = addedTxs.get(0); + final var replacementTx = createTransactionReplacement(replacedTx, KEYS1); + final var txAddResult = prioritizeTransaction(replacementTx); + + assertThat(txAddResult.isReplacement()).isTrue(); + assertThat(txAddResult.maybeReplacedTransaction()) + .map(PendingTransaction::getTransaction) + .contains(replacedTx); + + addedTxs.remove(replacedTx); + addedTxs.forEach(this::assertTransactionPrioritized); + assertTransactionNotPrioritized(replacedTx); + assertTransactionPrioritized(replacementTx); + } } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java index 7d6e44059df..8f5399e29eb 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java @@ -61,6 +61,7 @@ public class BaseTransactionPoolTest { protected final Transaction transaction0 = createTransaction(0); protected final Transaction transaction1 = createTransaction(1); protected final Transaction transaction2 = createTransaction(2); + protected final Transaction blobTransaction0 = createEIP4844Transaction(0, KEYS1, 1, 1); protected final StubMetricsSystem metricsSystem = new StubMetricsSystem(); @@ -103,13 +104,33 @@ protected Transaction createEIP4844Transaction( keys); } + protected Transaction createTransactionOfSize( + final long nonce, final Wei maxGasPrice, final int txSize, final KeyPair keys) { + + final TransactionType txType = + TransactionType.values()[ + randomizeTxType.nextInt(txSize < blobTransaction0.getSize() ? 3 : 4)]; + + final Transaction baseTx = + createTransaction(txType, nonce, maxGasPrice, maxGasPrice.divide(10), 0, 1, keys); + final int payloadSize = txSize - baseTx.getSize(); + + return createTransaction( + txType, nonce, maxGasPrice, maxGasPrice.divide(10), payloadSize, 1, keys); + } + protected Transaction createTransaction( final long nonce, final Wei maxGasPrice, final int payloadSize, final KeyPair keys) { - // ToDo 4844: include BLOB tx here - final TransactionType txType = TransactionType.values()[randomizeTxType.nextInt(3)]; + final TransactionType txType = TransactionType.values()[randomizeTxType.nextInt(4)]; - return createTransaction(txType, nonce, maxGasPrice, payloadSize, keys); + return switch (txType) { + case FRONTIER, ACCESS_LIST, EIP1559 -> + createTransaction(txType, nonce, maxGasPrice, payloadSize, keys); + case BLOB -> + createTransaction( + txType, nonce, maxGasPrice, maxGasPrice.divide(10), payloadSize, 1, keys); + }; } protected Transaction createTransaction( @@ -157,6 +178,7 @@ protected TransactionTestFixture prepareTransaction( tx.maxFeePerGas(Optional.of(maxGasPrice)) .maxPriorityFeePerGas(Optional.of(maxPriorityFeePerGas)); if (type.supportsBlob() && blobCount > 0) { + tx.maxFeePerBlobGas(Optional.of(maxGasPrice)); final var versionHashes = IntStream.range(0, blobCount) .mapToObj(i -> new VersionedHash((byte) 1, Hash.ZERO)) @@ -186,7 +208,9 @@ protected Transaction createTransactionReplacement( originalTransaction.getType(), originalTransaction.getNonce(), originalTransaction.getMaxGasPrice().multiply(2), + originalTransaction.getMaxGasPrice().multiply(2).divide(10), 0, + 1, keys); } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactionsTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactionsTest.java index 1253246506b..196baffa3a9 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactionsTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactionsTest.java @@ -15,6 +15,7 @@ package org.hyperledger.besu.ethereum.eth.transactions.layered; import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.datatypes.TransactionType.BLOB; import static org.hyperledger.besu.ethereum.eth.transactions.TransactionAddedResult.ADDED; import static org.hyperledger.besu.ethereum.eth.transactions.TransactionAddedResult.ALREADY_KNOWN; import static org.hyperledger.besu.ethereum.eth.transactions.TransactionAddedResult.NONCE_TOO_FAR_IN_FUTURE_FOR_SENDER; @@ -55,6 +56,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.OptionalLong; import java.util.function.BiFunction; @@ -68,7 +70,8 @@ public class LayeredPendingTransactionsTest extends BaseTransactionPoolTest { protected static final int MAX_TRANSACTIONS = 5; - protected static final int MAX_CAPACITY_BYTES = 10_000; + protected static final int MAX_PRIORITIZED_BLOB_TRANSACTIONS = MAX_TRANSACTIONS + 1; + protected static final int MAX_CAPACITY_BYTES = 150_000; protected static final Wei DEFAULT_BASE_FEE = Wei.of(100); protected static final int LIMITED_TRANSACTIONS_BY_SENDER = 4; protected static final String REMOTE = "remote"; @@ -82,20 +85,31 @@ public class LayeredPendingTransactionsTest extends BaseTransactionPoolTest { private final TransactionPoolConfiguration poolConf = ImmutableTransactionPoolConfiguration.builder() .maxPrioritizedTransactions(MAX_TRANSACTIONS) + .maxPrioritizedTransactionsByType(Map.of(BLOB, MAX_PRIORITIZED_BLOB_TRANSACTIONS)) .maxFutureBySender(MAX_TRANSACTIONS) - .pendingTransactionsLayerMaxCapacityBytes(MAX_CAPACITY_BYTES) .build(); private final TransactionPoolConfiguration senderLimitedConfig = ImmutableTransactionPoolConfiguration.builder() .maxPrioritizedTransactions(MAX_TRANSACTIONS) + .maxPrioritizedTransactionsByType(Map.of(BLOB, MAX_PRIORITIZED_BLOB_TRANSACTIONS)) + .maxFutureBySender(LIMITED_TRANSACTIONS_BY_SENDER) + .build(); + + private final TransactionPoolConfiguration smallPoolConfig = + ImmutableTransactionPoolConfiguration.builder() + .maxPrioritizedTransactions(MAX_TRANSACTIONS) + .maxPrioritizedTransactionsByType(Map.of(BLOB, MAX_PRIORITIZED_BLOB_TRANSACTIONS)) .maxFutureBySender(LIMITED_TRANSACTIONS_BY_SENDER) .pendingTransactionsLayerMaxCapacityBytes(MAX_CAPACITY_BYTES) .build(); + private LayeredPendingTransactions senderLimitedTransactions; private LayeredPendingTransactions pendingTransactions; + private LayeredPendingTransactions smallPendingTransactions; private CreatedLayers senderLimitedLayers; private CreatedLayers layers; + private CreatedLayers smallLayers; private TransactionPoolMetrics txPoolMetrics; private static BlockHeader mockBlockHeader() { @@ -151,12 +165,16 @@ public void setup() { layers = createLayers(poolConf); senderLimitedLayers = createLayers(senderLimitedConfig); + smallLayers = createLayers(smallPoolConfig); pendingTransactions = new LayeredPendingTransactions(poolConf, layers.prioritizedTransactions); senderLimitedTransactions = new LayeredPendingTransactions( senderLimitedConfig, senderLimitedLayers.prioritizedTransactions); + + smallPendingTransactions = + new LayeredPendingTransactions(smallPoolConfig, smallLayers.prioritizedTransactions); } @Test @@ -211,41 +229,43 @@ public void getTransactionByHash() { public void evictTransactionsWhenSizeLimitExceeded() { final List firstTxs = new ArrayList<>(MAX_TRANSACTIONS); - pendingTransactions.subscribeDroppedTransactions(droppedListener); + smallPendingTransactions.subscribeDroppedTransactions(droppedListener); for (int i = 0; i < MAX_TRANSACTIONS; i++) { final Account sender = mock(Account.class); when(sender.getNonce()).thenReturn((long) i); final var tx = - createTransaction( + createTransactionOfSize( i, - DEFAULT_MIN_GAS_PRICE.multiply(2 * (i + 1)), - (int) poolConf.getPendingTransactionsLayerMaxCapacityBytes() + 1, + DEFAULT_BASE_FEE.add(i), + (int) smallPoolConfig.getPendingTransactionsLayerMaxCapacityBytes() + 1, SIGNATURE_ALGORITHM.get().generateKeyPair()); - pendingTransactions.addTransaction(createRemotePendingTransaction(tx), Optional.of(sender)); + smallPendingTransactions.addTransaction( + createRemotePendingTransaction(tx), Optional.of(sender)); firstTxs.add(tx); - assertTransactionPending(pendingTransactions, tx); + assertTransactionPending(smallPendingTransactions, tx); } - assertThat(pendingTransactions.size()).isEqualTo(MAX_TRANSACTIONS); + assertThat(smallPendingTransactions.size()).isEqualTo(MAX_TRANSACTIONS); final Transaction lastBigTx = - createTransaction( + createTransactionOfSize( 0, DEFAULT_MIN_GAS_PRICE.multiply(1000), - (int) poolConf.getPendingTransactionsLayerMaxCapacityBytes(), + (int) smallPoolConfig.getPendingTransactionsLayerMaxCapacityBytes(), SIGNATURE_ALGORITHM.get().generateKeyPair()); final Account lastSender = mock(Account.class); when(lastSender.getNonce()).thenReturn(0L); - pendingTransactions.addTransaction( + smallPendingTransactions.addTransaction( createRemotePendingTransaction(lastBigTx), Optional.of(lastSender)); - assertTransactionPending(pendingTransactions, lastBigTx); + assertTransactionPending(smallPendingTransactions, lastBigTx); - assertTransactionNotPending(pendingTransactions, firstTxs.get(0)); + assertTransactionNotPending(smallPendingTransactions, firstTxs.get(0)); assertThat( - getRemovedCount(REMOTE, NO_PRIORITY, DROPPED.label(), layers.evictedCollector.name())) + getRemovedCount( + REMOTE, NO_PRIORITY, DROPPED.label(), smallLayers.evictedCollector.name())) .isEqualTo(1); - assertThat(layers.evictedCollector.getEvictedTransactions()) + assertThat(smallLayers.evictedCollector.getEvictedTransactions()) .map(PendingTransaction::getTransaction) .contains(firstTxs.get(0)); verify(droppedListener).onTransactionDropped(firstTxs.get(0)); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayersTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayersTest.java index 5ba6bde8dc1..41dd02fae89 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayersTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayersTest.java @@ -15,6 +15,10 @@ package org.hyperledger.besu.ethereum.eth.transactions.layered; import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.datatypes.TransactionType.ACCESS_LIST; +import static org.hyperledger.besu.datatypes.TransactionType.BLOB; +import static org.hyperledger.besu.datatypes.TransactionType.EIP1559; +import static org.hyperledger.besu.datatypes.TransactionType.FRONTIER; import static org.hyperledger.besu.ethereum.eth.transactions.layered.LayersTest.Sender.S1; import static org.hyperledger.besu.ethereum.eth.transactions.layered.LayersTest.Sender.S2; import static org.hyperledger.besu.ethereum.eth.transactions.layered.LayersTest.Sender.S3; @@ -27,6 +31,7 @@ import org.hyperledger.besu.crypto.KeyPair; import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.MiningParameters; @@ -51,7 +56,6 @@ import java.util.OptionalLong; import java.util.stream.Stream; -import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -62,51 +66,29 @@ public class LayersTest extends BaseTransactionPoolTest { private static final Wei BASE_FEE = Wei.ONE; private static final Wei MIN_GAS_PRICE = BASE_FEE; - private final TransactionPoolConfiguration poolConfig = + private static final TransactionPoolConfiguration DEFAULT_TX_POOL_CONFIG = ImmutableTransactionPoolConfiguration.builder() .maxPrioritizedTransactions(MAX_PRIO_TRANSACTIONS) + .maxPrioritizedTransactionsByType(Map.of(BLOB, 1)) .maxFutureBySender(MAX_FUTURE_FOR_SENDER) .pendingTransactionsLayerMaxCapacityBytes( - new PendingTransaction.Remote(createEIP1559Transaction(0, KEYS1, 1)).memorySize() * 3) + new PendingTransaction.Remote( + new BaseTransactionPoolTest().createEIP1559Transaction(0, KEYS1, 1)) + .memorySize() + * 3L) .build(); - private final TransactionPoolMetrics txPoolMetrics = new TransactionPoolMetrics(metricsSystem); - - private final EvictCollectorLayer evictCollector = new EvictCollectorLayer(txPoolMetrics); - private final SparseTransactions sparseTransactions = - new SparseTransactions( - poolConfig, - evictCollector, - txPoolMetrics, - this::transactionReplacementTester, - new BlobCache()); - - private final ReadyTransactions readyTransactions = - new ReadyTransactions( - poolConfig, - sparseTransactions, - txPoolMetrics, - this::transactionReplacementTester, - new BlobCache()); - - private final BaseFeePrioritizedTransactions prioritizedTransactions = - new BaseFeePrioritizedTransactions( - poolConfig, - LayersTest::mockBlockHeader, - readyTransactions, - txPoolMetrics, - this::transactionReplacementTester, - FeeMarket.london(0L), - new BlobCache(), - MiningParameters.newDefault().setMinTransactionGasPrice(MIN_GAS_PRICE)); - - private final LayeredPendingTransactions pendingTransactions = - new LayeredPendingTransactions(poolConfig, prioritizedTransactions); - - @AfterEach - void reset() { - pendingTransactions.reset(); - } + private static final TransactionPoolConfiguration BLOB_TX_POOL_CONFIG = + ImmutableTransactionPoolConfiguration.builder() + .maxPrioritizedTransactions(MAX_PRIO_TRANSACTIONS) + .maxPrioritizedTransactionsByType(Map.of(BLOB, 1)) + .maxFutureBySender(MAX_FUTURE_FOR_SENDER) + .pendingTransactionsLayerMaxCapacityBytes( + new PendingTransaction.Remote( + new BaseTransactionPoolTest().createEIP4844Transaction(0, KEYS1, 1, 1)) + .memorySize() + * 3L) + .build(); @ParameterizedTest @MethodSource("providerAddTransactions") @@ -168,7 +150,51 @@ void prioritySenders(final Scenario scenario) { assertScenario(scenario); } + @ParameterizedTest + @MethodSource("providerMaxPrioritizedByType") + void maxPrioritizedByType(final Scenario scenario) { + assertScenario(scenario, BLOB_TX_POOL_CONFIG); + } + private void assertScenario(final Scenario scenario) { + assertScenario(scenario, DEFAULT_TX_POOL_CONFIG); + } + + private void assertScenario( + final Scenario scenario, final TransactionPoolConfiguration poolConfig) { + final TransactionPoolMetrics txPoolMetrics = new TransactionPoolMetrics(metricsSystem); + + final EvictCollectorLayer evictCollector = new EvictCollectorLayer(txPoolMetrics); + final SparseTransactions sparseTransactions = + new SparseTransactions( + poolConfig, + evictCollector, + txPoolMetrics, + (pt1, pt2) -> transactionReplacementTester(poolConfig, pt1, pt2), + new BlobCache()); + + final ReadyTransactions readyTransactions = + new ReadyTransactions( + poolConfig, + sparseTransactions, + txPoolMetrics, + (pt1, pt2) -> transactionReplacementTester(poolConfig, pt1, pt2), + new BlobCache()); + + final BaseFeePrioritizedTransactions prioritizedTransactions = + new BaseFeePrioritizedTransactions( + poolConfig, + LayersTest::mockBlockHeader, + readyTransactions, + txPoolMetrics, + (pt1, pt2) -> transactionReplacementTester(poolConfig, pt1, pt2), + FeeMarket.london(0L), + new BlobCache(), + MiningParameters.newDefault().setMinTransactionGasPrice(MIN_GAS_PRICE)); + + final LayeredPendingTransactions pendingTransactions = + new LayeredPendingTransactions(poolConfig, prioritizedTransactions); + scenario.execute( pendingTransactions, prioritizedTransactions, @@ -1180,17 +1206,56 @@ static Stream providerPrioritySenders() { .expectedDroppedForSender(S3, 0))); } + static Stream providerMaxPrioritizedByType() { + return Stream.of( + Arguments.of( + new Scenario("first blob tx is prioritized") + .addForSender(S1, BLOB, 0) + .expectedPrioritizedForSender(S1, 0)), + Arguments.of( + new Scenario("multiple senders only first blob tx is prioritized") + .addForSender(S1, BLOB, 0) + .addForSender(S2, BLOB, 0) + .expectedPrioritizedForSender(S1, 0) + .expectedReadyForSender(S2, 0)), + Arguments.of( + new Scenario("same sender following blob txs are moved to ready") + .addForSender(S1, BLOB, 0, 1, 2) + .expectedPrioritizedForSender(S1, 0) + .expectedReadyForSender(S1, 1, 2)), + Arguments.of( + new Scenario("promoting txs respect prioritized count limit") + .addForSender(S1, BLOB, 0, 1, 2) + .expectedPrioritizedForSender(S1, 0) + .expectedReadyForSender(S1, 1, 2) + .confirmedForSenders(S1, 0) + .expectedPrioritizedForSender(S1, 1) + .expectedReadyForSender(S1, 2)), + Arguments.of( + new Scenario("filling gaps respect prioritized count limit") + .addForSender(S1, BLOB, 1) + .expectedSparseForSender(S1, 1) + .addForSender(S1, BLOB, 0) + .expectedPrioritizedForSender(S1, 0) + .expectedSparseForSender(S1, 1)), + Arguments.of( + new Scenario("promoting to ready is unbounded") + .addForSender(S1, BLOB, 0, 1, 2, 3, 4, 5, 6) + .expectedPrioritizedForSender(S1, 0) + .expectedReadyForSender(S1, 1, 2, 3) + .expectedSparseForSender(S1, 4, 5, 6) + .confirmedForSenders(S1, 3) + .expectedPrioritizedForSender(S1, 4) + .expectedReadyForSender(S1, 5, 6) + .expectedSparseForSenders())); + } + private static BlockHeader mockBlockHeader() { final BlockHeader blockHeader = mock(BlockHeader.class); when(blockHeader.getBaseFee()).thenReturn(Optional.of(BASE_FEE)); return blockHeader; } - private boolean transactionReplacementTester( - final PendingTransaction pt1, final PendingTransaction pt2) { - return transactionReplacementTester(poolConfig, pt1, pt2); - } - private static boolean transactionReplacementTester( final TransactionPoolConfiguration poolConfig, final PendingTransaction pt1, @@ -1235,10 +1300,14 @@ void accept( } Scenario addForSender(final Sender sender, final long... nonce) { + return addForSender(sender, EIP1559, nonce); + } + + Scenario addForSender(final Sender sender, final TransactionType type, final long... nonce) { Arrays.stream(nonce) .forEach( n -> { - final var pendingTx = getOrCreate(sender, n); + final var pendingTx = getOrCreate(sender, type, n); actions.add( (pending, prio, ready, sparse, dropped) -> { final Account mockSender = mock(Account.class); @@ -1290,22 +1359,49 @@ void execute( assertExpectedDropped(dropped, lastExpectedDropped); } - private PendingTransaction getOrCreate(final Sender sender, final long nonce) { + private PendingTransaction getOrCreate( + final Sender sender, final TransactionType type, final long nonce) { return txsBySender .get(sender) - .computeIfAbsent(nonce, n -> createEIP1559PendingTransactions(sender, n)); + .computeIfAbsent( + nonce, + n -> + switch (type) { + case FRONTIER -> createFrontierPendingTransaction(sender, n); + case ACCESS_LIST -> createAccessListPendingTransaction(sender, n); + case EIP1559 -> createEIP1559PendingTransaction(sender, n); + case BLOB -> createBlobPendingTransaction(sender, n); + }); } private PendingTransaction get(final Sender sender, final long nonce) { return txsBySender.get(sender).get(nonce); } - private PendingTransaction createEIP1559PendingTransactions( + private PendingTransaction createFrontierPendingTransaction( + final Sender sender, final long nonce) { + return createRemotePendingTransaction( + createTransaction(FRONTIER, nonce, Wei.ONE, 0, sender.key), sender.hasPriority); + } + + private PendingTransaction createAccessListPendingTransaction( + final Sender sender, final long nonce) { + return createRemotePendingTransaction( + createTransaction(ACCESS_LIST, nonce, Wei.ONE, 0, sender.key), sender.hasPriority); + } + + private PendingTransaction createEIP1559PendingTransaction( final Sender sender, final long nonce) { return createRemotePendingTransaction( createEIP1559Transaction(nonce, sender.key, sender.gasFeeMultiplier), sender.hasPriority); } + private PendingTransaction createBlobPendingTransaction(final Sender sender, final long nonce) { + return createRemotePendingTransaction( + createEIP4844Transaction(nonce, sender.key, sender.gasFeeMultiplier, 1), + sender.hasPriority); + } + public Scenario expectedPrioritizedForSender(final Sender sender, final long... nonce) { lastExpectedPrioritized = expectedForSender(sender, nonce); final var expectedCopy = List.copyOf(lastExpectedPrioritized); @@ -1469,7 +1565,7 @@ public Scenario removeForSender(final Sender sender, final long... nonce) { Arrays.stream(nonce) .forEach( n -> { - final var pendingTx = getOrCreate(sender, n); + final var pendingTx = getOrCreate(sender, EIP1559, n); actions.add( (pending, prio, ready, sparse, dropped) -> prio.remove(pendingTx, INVALIDATED)); }); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReplayTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReplayTest.java index b8a94945ec6..63367b2fda0 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReplayTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReplayTest.java @@ -22,6 +22,7 @@ import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.MiningParameters; @@ -48,11 +49,13 @@ import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.Arrays; +import java.util.EnumMap; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.function.BiFunction; +import java.util.stream.Collectors; import java.util.zip.GZIPInputStream; import com.google.common.base.Splitter; @@ -117,6 +120,7 @@ public void replay() throws IOException { final TransactionPoolConfiguration poolConfig = ImmutableTransactionPoolConfiguration.builder() .prioritySenders(readPrioritySenders(br.readLine())) + .maxPrioritizedTransactionsByType(readMaxPrioritizedByType(br.readLine())) .build(); final AbstractPrioritizedTransactions prioritizedTransactions = @@ -161,6 +165,17 @@ public void replay() throws IOException { } } + private Map readMaxPrioritizedByType(final String line) { + return Arrays.stream(line.split(",")) + .map(e -> e.split("=")) + .collect( + Collectors.toMap( + a -> TransactionType.valueOf(a[0]), + a -> Integer.parseInt(a[1]), + (a, b) -> a, + () -> new EnumMap<>(TransactionType.class))); + } + private List
readPrioritySenders(final String line) { return Arrays.stream(line.split(",")).map(Address::fromHexString).toList(); } From e4df70a350a8c180598176a61a6b01e28cc363a1 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Tue, 23 Apr 2024 23:29:11 +0200 Subject: [PATCH 28/59] Support removed and added test when splitting by time (#6990) Signed-off-by: Fabio Di Fabio --- .github/workflows/acceptance-tests.yml | 12 +++++- .github/workflows/splitTestsByTime.sh | 55 +++++++++++++++++--------- acceptance-tests/tests/build.gradle | 29 ++++++++++++++ 3 files changed, 76 insertions(+), 20 deletions(-) diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 7b212cdcad1..f7cc5d70c92 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true env: - GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" + GRADLE_OPTS: "-Xmx6g" total-runners: 16 jobs: @@ -49,6 +49,10 @@ jobs: uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 with: cache-disabled: true + - name: Compile acceptance tests + run: ./gradlew :acceptance-tests:tests:testClasses + - name: List acceptance tests + run: ./gradlew :acceptance-tests:tests:listAcceptanceTestNotPrivacy -Dorg.gradle.caching=true | fgrep org.hyperledger.besu.tests.acceptance > tmp/currentTests.list - name: Split tests run: .github/workflows/splitTestsByTime.sh tmp/junit-xml-reports-downloaded ${{env.total-runners}} ${{ matrix.runner_index }} > testList.txt - name: Upload Timing @@ -57,6 +61,12 @@ jobs: with: name: acceptance-tests-timing path: 'tmp/timing.tsv' + - name: Upload Lists + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + if: matrix.runner_index == 0 + with: + name: acceptance-tests-lists + path: 'tmp/*.list' - name: format gradle args # insert --tests option between each. run: cat testList.txt | sed -e 's/^\| / --tests /g' | tee gradleArgs.txt diff --git a/.github/workflows/splitTestsByTime.sh b/.github/workflows/splitTestsByTime.sh index 3afb614d427..2b9893819b2 100755 --- a/.github/workflows/splitTestsByTime.sh +++ b/.github/workflows/splitTestsByTime.sh @@ -26,27 +26,44 @@ for line in "${sorted[@]}"; do test_time=${line_parts[0]//./} # convert to millis test_time=${test_time##0} # remove leading zeros test_name=${line_parts[1]} - - # Find index of min sum - idx_min_sum=0 - min_sum=${sums[0]} - for ((i=0; i> tmp/processedTests.list + fi done +# Any new test? +grep -F --line-regexp -v -f tmp/processedTests.list tmp/currentTests.list > tmp/newTests.list +idx_new_test=0 +while read -r new_test_name +do + idx_group=$(( idx_new_test % SPLIT_COUNT )) + group=${tests[$idx_group]} + tests[$idx_group]="${group}${new_test_name}," + idx_new_test=$(( idx_new_test + 1 )) +done < tmp/newTests.list + + # return the requests index, without quotes to drop the last trailing space echo ${tests[$SPLIT_INDEX]//,/ } \ No newline at end of file diff --git a/acceptance-tests/tests/build.gradle b/acceptance-tests/tests/build.gradle index 10b3138384a..a608a9e5256 100644 --- a/acceptance-tests/tests/build.gradle +++ b/acceptance-tests/tests/build.gradle @@ -258,3 +258,32 @@ task acceptanceTestPermissioning(type: Test) { doFirst { mkdir "${buildDir}/jvmErrorLogs" } } + +// temporary solution to get a list of tests +// Gradle >8.3 has a supported test dry-run option to achieve the same result +task listAcceptanceTestNotPrivacy { + doLast { + def testExecutionSpec = tasks.getByName("acceptanceTestNotPrivacy") as Test + + def processor = new org.gradle.api.internal.tasks.testing.TestClassProcessor() { + void startProcessing(org.gradle.api.internal.tasks.testing.TestResultProcessor processor) {} + void stop() {} + void stopNow() {} + + void processTestClass(org.gradle.api.internal.tasks.testing.TestClassRunInfo info) { + def splitName = info.getTestClassName().split("\\."); + def testClassName = splitName[splitName.length-1]; + if(testClassName.endsWith("Test") && !testClassName.startsWith("Abstract")) { + println(info.getTestClassName()) + } + } + } + + def detector = new org.gradle.api.internal.tasks.testing.detection.DefaultTestClassScanner(testExecutionSpec.getCandidateClassFiles(), testExecutionSpec.getTestFramework().getDetector()?.tap { + setTestClasses(testExecutionSpec.getTestClassesDirs().getFiles()) + setTestClasspath(Collections.unmodifiableSet(testExecutionSpec.getClasspath().getFiles())) + }, processor) + + detector.run() + } +} From 12723ace68b305e31a97eee3957c99aa978d54e0 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Wed, 24 Apr 2024 08:22:52 +1000 Subject: [PATCH 29/59] removed tests for pki qbft and add deprecation notice (#6979) * removed tests for pki qbft and add deprecation notice Signed-off-by: Sally MacFarlane * remove more PKI and CMS creation utils from tests Signed-off-by: Sally MacFarlane --------- Signed-off-by: Sally MacFarlane --- CHANGELOG.md | 1 + .../tests/acceptance/dsl/node/BesuNode.java | 8 - .../dsl/node/ProcessBesuNodeRunner.java | 27 -- .../dsl/node/ThreadBesuNodeRunner.java | 4 - .../node/configuration/BesuNodeFactory.java | 64 ----- .../pki/PkiKeystoreConfigurationFactory.java | 196 -------------- .../acceptance/dsl/privacy/PrivacyNode.java | 1 - .../bft/pki/ParameterizedPkiQbftTestBase.java | 29 --- .../bft/pki/PkiQbftAcceptanceTest.java | 130 ---------- ...PkiQbftAcceptanceTestParameterization.java | 120 --------- .../PkiQbftBlockCreatorTest.java | 162 ------------ .../DefaultKeyStoreWrapperProviderTest.java | 85 ------ ...lockCreationConfigurationProviderTest.java | 75 ------ .../qbft/pki/PkiQbftBlockHashingTest.java | 85 ------ .../qbft/pki/PkiQbftExtraDataCodecTest.java | 243 ------------------ .../pki/cms/CmsCreationAndValidationTest.java | 202 --------------- .../besu/pki/cms/CmsTestKeystores.java | 243 ------------------ .../keystore/BaseKeyStoreFileWrapperTest.java | 156 ----------- .../besu/pki/keystore/CryptoTestUtil.java | 81 ------ .../HardwareKeyStoreFileWrapperTest.java | 119 --------- .../keystore/HardwareKeyStoreWrapperTest.java | 82 ------ .../SoftwareKeyStoreFileWrapperTest.java | 80 ------ .../keystore/SoftwareKeyStoreWrapperTest.java | 198 -------------- .../keystore/partner1client1/keys.p12 | Bin 6068 -> 0 bytes .../keystore/partner1client1/keystore.jks | Bin 6817 -> 0 bytes .../keystore/partner1client1/nss.cfg | 6 - .../keystore/partner1client1/truststore.jks | Bin 3135 -> 0 bytes 27 files changed, 1 insertion(+), 2396 deletions(-) delete mode 100644 acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/pki/PkiKeystoreConfigurationFactory.java delete mode 100644 acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/ParameterizedPkiQbftTestBase.java delete mode 100644 acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/PkiQbftAcceptanceTest.java delete mode 100644 acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/PkiQbftAcceptanceTestParameterization.java delete mode 100644 consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/blockcreation/PkiQbftBlockCreatorTest.java delete mode 100644 consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/DefaultKeyStoreWrapperProviderTest.java delete mode 100644 consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfigurationProviderTest.java delete mode 100644 consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHashingTest.java delete mode 100644 consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraDataCodecTest.java delete mode 100644 pki/src/test/java/org/hyperledger/besu/pki/cms/CmsCreationAndValidationTest.java delete mode 100644 pki/src/test/java/org/hyperledger/besu/pki/cms/CmsTestKeystores.java delete mode 100644 pki/src/test/java/org/hyperledger/besu/pki/keystore/BaseKeyStoreFileWrapperTest.java delete mode 100644 pki/src/test/java/org/hyperledger/besu/pki/keystore/CryptoTestUtil.java delete mode 100644 pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreFileWrapperTest.java delete mode 100644 pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreWrapperTest.java delete mode 100644 pki/src/test/java/org/hyperledger/besu/pki/keystore/SoftwareKeyStoreFileWrapperTest.java delete mode 100644 pki/src/test/java/org/hyperledger/besu/pki/keystore/SoftwareKeyStoreWrapperTest.java delete mode 100644 pki/src/test/resources/keystore/partner1client1/keys.p12 delete mode 100644 pki/src/test/resources/keystore/partner1client1/keystore.jks delete mode 100644 pki/src/test/resources/keystore/partner1client1/nss.cfg delete mode 100644 pki/src/test/resources/keystore/partner1client1/truststore.jks diff --git a/CHANGELOG.md b/CHANGELOG.md index 60b94c41090..7bcabc75921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Upcoming Breaking Changes - Receipt compaction will be enabled by default in a future version of Besu. After this change it will not be possible to downgrade to the previous Besu version. +- PKI-backed QBFT will be removed in a future version of Besu. Other forms of QBFT will remain unchanged. ### Deprecations diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java index 80fbf7f727d..5f30941f232 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java @@ -35,7 +35,6 @@ import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration; import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; -import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration; import org.hyperledger.besu.tests.acceptance.dsl.condition.Condition; import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.NodeConfiguration; import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationProvider; @@ -132,7 +131,6 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable private final List staticNodes; private boolean isDnsEnabled = false; private Optional exitCode = Optional.empty(); - private Optional pkiKeyStoreConfiguration = Optional.empty(); private final boolean isStrictTxReplayProtectionEnabled; private final Map environment; @@ -169,7 +167,6 @@ public BesuNode( final Optional privacyParameters, final List runCommand, final Optional keyPair, - final Optional pkiKeyStoreConfiguration, final boolean isStrictTxReplayProtectionEnabled, final Map environment) throws IOException { @@ -230,7 +227,6 @@ public BesuNode( this.staticNodes = staticNodes; this.isDnsEnabled = isDnsEnabled; privacyParameters.ifPresent(this::setPrivacyParameters); - this.pkiKeyStoreConfiguration = pkiKeyStoreConfiguration; this.environment = environment; LOG.info("Created BesuNode {}", this); } @@ -763,10 +759,6 @@ public List getRunCommand() { return runCommand; } - public Optional getPkiKeyStoreConfiguration() { - return pkiKeyStoreConfiguration; - } - public boolean isStrictTxReplayProtectionEnabled() { return isStrictTxReplayProtectionEnabled; } diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java index 2b80ebea568..583992718aa 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java @@ -377,33 +377,6 @@ public void startNode(final BesuNode node) { permissioningConfiguration.getNodeSmartContractInterfaceVersion())); }); - node.getPkiKeyStoreConfiguration() - .ifPresent( - pkiConfig -> { - params.add("--Xpki-block-creation-enabled"); - - params.add("--Xpki-block-creation-keystore-certificate-alias"); - params.add(pkiConfig.getCertificateAlias()); - - params.add("--Xpki-block-creation-keystore-type"); - params.add(pkiConfig.getKeyStoreType()); - - params.add("--Xpki-block-creation-keystore-file"); - params.add(pkiConfig.getKeyStorePath().toAbsolutePath().toString()); - - params.add("--Xpki-block-creation-keystore-password-file"); - params.add(pkiConfig.getKeyStorePasswordPath().toAbsolutePath().toString()); - - params.add("--Xpki-block-creation-truststore-type"); - params.add(pkiConfig.getTrustStoreType()); - - params.add("--Xpki-block-creation-truststore-file"); - params.add(pkiConfig.getTrustStorePath().toAbsolutePath().toString()); - - params.add("--Xpki-block-creation-truststore-password-file"); - params.add(pkiConfig.getTrustStorePasswordPath().toAbsolutePath().toString()); - }); - params.addAll(node.getExtraCLIOptions()); params.add("--key-value-storage"); diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java index e0805d57283..1493df6f0f5 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java @@ -21,7 +21,6 @@ import org.hyperledger.besu.cli.config.EthNetworkConfig; import org.hyperledger.besu.cli.config.NetworkName; import org.hyperledger.besu.config.GenesisConfigFile; -import org.hyperledger.besu.consensus.qbft.pki.PkiBlockCreationConfigurationProvider; import org.hyperledger.besu.controller.BesuController; import org.hyperledger.besu.controller.BesuControllerBuilder; import org.hyperledger.besu.crypto.KeyPairUtil; @@ -253,9 +252,6 @@ public void startNode(final BesuNode node) { .isRevertReasonEnabled(node.isRevertReasonEnabled()) .storageProvider(storageProvider) .gasLimitCalculator(GasLimitCalculator.constant()) - .pkiBlockCreationConfiguration( - node.getPkiKeyStoreConfiguration() - .map(pkiConfig -> new PkiBlockCreationConfigurationProvider().load(pkiConfig))) .evmConfiguration(EvmConfiguration.DEFAULT) .maxPeers(maxPeers) .maxRemotelyInitiatedPeers(15) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java index ff6dc2ac9b1..51244ea9f31 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java @@ -39,7 +39,6 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.RunnableNode; import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationFactory; import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationFactory.CliqueOptions; -import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.pki.PkiKeystoreConfigurationFactory; import java.io.File; import java.io.IOException; @@ -57,8 +56,6 @@ public class BesuNodeFactory { private final NodeConfigurationFactory node = new NodeConfigurationFactory(); - private final PkiKeystoreConfigurationFactory pkiKeystoreConfigurationFactory = - new PkiKeystoreConfigurationFactory(); public BesuNode create(final BesuNodeConfiguration config) throws IOException { return new BesuNode( @@ -94,7 +91,6 @@ public BesuNode create(final BesuNodeConfiguration config) throws IOException { config.getPrivacyParameters(), config.getRunCommand(), config.getKeyPair(), - config.getPkiKeyStoreConfiguration(), config.isStrictTxReplayProtectionEnabled(), config.getEnvironment()); } @@ -517,31 +513,6 @@ public BesuNode createQbftNode(final String name) throws IOException { .build()); } - public BesuNode createPkiQbftJKSNode(final String name) throws IOException { - return createPkiQbftNode(KeyStoreWrapper.KEYSTORE_TYPE_JKS, name); - } - - public BesuNode createPkiQbftPKCS11Node(final String name) throws IOException { - return createPkiQbftNode(KeyStoreWrapper.KEYSTORE_TYPE_PKCS11, name); - } - - public BesuNode createPkiQbftPKCS12Node(final String name) throws IOException { - return createPkiQbftNode(KeyStoreWrapper.KEYSTORE_TYPE_PKCS12, name); - } - - public BesuNode createPkiQbftNode(final String type, final String name) throws IOException { - return create( - new BesuNodeConfigurationBuilder() - .name(name) - .miningEnabled() - .jsonRpcConfiguration(node.createJsonRpcWithQbftEnabledConfig(false)) - .webSocketConfiguration(node.createWebSocketEnabledConfig()) - .devMode(false) - .genesisConfigProvider(GenesisConfigurationFactory::createQbftGenesisConfig) - .pkiBlockCreationEnabled(pkiKeystoreConfigurationFactory.createPkiConfig(type, name)) - .build()); - } - public BesuNode createCustomGenesisNode( final String name, final String genesisPath, final boolean canBeBootnode) throws IOException { return createCustomGenesisNode(name, genesisPath, canBeBootnode, false); @@ -699,41 +670,6 @@ public BesuNode createQbftNodeWithContractBasedValidators( .build()); } - public BesuNode createPkiQbftJKSNodeWithValidators(final String name, final String... validators) - throws IOException { - return createPkiQbftNodeWithValidators(KeyStoreWrapper.KEYSTORE_TYPE_JKS, name, validators); - } - - public BesuNode createPkiQbftPKCS11NodeWithValidators( - final String name, final String... validators) throws IOException { - return createPkiQbftNodeWithValidators(KeyStoreWrapper.KEYSTORE_TYPE_PKCS11, name, validators); - } - - public BesuNode createPkiQbftPKCS12NodeWithValidators( - final String name, final String... validators) throws IOException { - return createPkiQbftNodeWithValidators(KeyStoreWrapper.KEYSTORE_TYPE_PKCS12, name, validators); - } - - public BesuNode createPkiQbftNodeWithValidators( - final String type, final String name, final String... validators) throws IOException { - - return create( - new BesuNodeConfigurationBuilder() - .name(name) - .miningEnabled() - .jsonRpcConfiguration(node.createJsonRpcWithQbftEnabledConfig(false)) - .webSocketConfiguration(node.createWebSocketEnabledConfig()) - .devMode(false) - .pkiBlockCreationEnabled(pkiKeystoreConfigurationFactory.createPkiConfig(type, name)) - .genesisConfigProvider( - nodes -> - node.createGenesisConfigForValidators( - asList(validators), - nodes, - GenesisConfigurationFactory::createQbftGenesisConfig)) - .build()); - } - public BesuNode createNodeWithStaticNodes(final String name, final List staticNodes) throws IOException { diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/pki/PkiKeystoreConfigurationFactory.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/pki/PkiKeystoreConfigurationFactory.java deleted file mode 100644 index ac7f814d433..00000000000 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/pki/PkiKeystoreConfigurationFactory.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.tests.acceptance.dsl.node.configuration.pki; - -import static org.hyperledger.besu.pki.util.TestCertificateUtils.createKeyPair; -import static org.hyperledger.besu.pki.util.TestCertificateUtils.createSelfSignedCertificate; -import static org.hyperledger.besu.pki.util.TestCertificateUtils.issueCertificate; - -import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration; -import org.hyperledger.besu.pki.keystore.KeyStoreWrapper; -import org.hyperledger.besu.pki.util.TestCertificateUtils; - -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.security.KeyPair; -import java.security.KeyStore; -import java.security.cert.Certificate; -import java.security.cert.X509Certificate; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.Objects; -import java.util.UUID; - -public class PkiKeystoreConfigurationFactory { - - /* - PKCS11 config files - */ - final String NSSCONFIG_PATH_STRING = "/pki-certs/%s/nss.cfg"; - final String NSSPIN_PATH_STRING = "/pki-certs/%s/nsspin.txt"; - final String TRUSTSTORE_PATH_STRING = "/pki-certs/%s/truststore.p12"; - final String CRL_PATH_STRING = "/pki-certs/crl/crl.pem"; - - /* - Software keystore config - */ - public static final String KEYSTORE_DEFAULT_PASSWORD = "password"; - - private KeyPair caKeyPair; - private X509Certificate caCertificate; - private Path trustStoreFile; - private Path passwordFile; - - public PkiKeyStoreConfiguration createPkiConfig(final String type, final String name) { - if (KeyStoreWrapper.KEYSTORE_TYPE_PKCS11.equals(type)) { - return createPKCS11PkiConfig(name); - } else { - return createSoftwareKeyStorePkiConfig(type, name); - } - } - - private PkiKeyStoreConfiguration createPKCS11PkiConfig(final String name) { - final PkiKeyStoreConfiguration.Builder pkiKeyStoreConfigBuilder = - new PkiKeyStoreConfiguration.Builder(); - - try { - pkiKeyStoreConfigBuilder - .withKeyStoreType(KeyStoreWrapper.KEYSTORE_TYPE_PKCS11) - .withKeyStorePath( - PKCS11Utils.initNSSConfigFile( - readResourceAsPath(String.format(NSSCONFIG_PATH_STRING, name)))) - .withKeyStorePasswordPath(readResourceAsPath(String.format(NSSPIN_PATH_STRING, name))) - .withTrustStoreType(KeyStoreWrapper.KEYSTORE_TYPE_PKCS12) - .withTrustStorePath(readResourceAsPath(String.format(TRUSTSTORE_PATH_STRING, name))) - .withTrustStorePasswordPath(readResourceAsPath(String.format(NSSPIN_PATH_STRING, name))) - .withCrlFilePath(readResourceAsPath(CRL_PATH_STRING)) - .withCertificateAlias(name); - - } catch (Exception e) { - throw new RuntimeException(e); - } - - return pkiKeyStoreConfigBuilder.build(); - } - - private PkiKeyStoreConfiguration createSoftwareKeyStorePkiConfig( - final String type, final String name) { - PkiKeyStoreConfiguration.Builder pkiKeyStoreConfigBuilder = - new PkiKeyStoreConfiguration.Builder(); - - pkiKeyStoreConfigBuilder.withTrustStoreType(type); - pkiKeyStoreConfigBuilder.withTrustStorePath(createTrustStore(type)); - pkiKeyStoreConfigBuilder.withTrustStorePasswordPath(passwordFile); - - pkiKeyStoreConfigBuilder.withKeyStoreType(type); - pkiKeyStoreConfigBuilder.withKeyStorePath(createKeyStore(type, name)); - pkiKeyStoreConfigBuilder.withKeyStorePasswordPath(passwordFile); - - pkiKeyStoreConfigBuilder.withCertificateAlias(name); - - return pkiKeyStoreConfigBuilder.build(); - } - - private Path createTrustStore(final String type) { - // Only create the truststore if this is the first time this method is being called - if (caKeyPair == null) { - try { - caKeyPair = createKeyPair(TestCertificateUtils.Algorithm.RSA); - caCertificate = createSelfSignedCertificate("ca", notBefore(), notAfter(), caKeyPair); - - final KeyStore truststore = KeyStore.getInstance(type); - truststore.load(null, null); - truststore.setCertificateEntry("ca", caCertificate); - - final String uniqueId = UUID.randomUUID().toString(); - trustStoreFile = writeKeyStoreFile(truststore, "truststore", uniqueId); - passwordFile = writePasswordFile(KEYSTORE_DEFAULT_PASSWORD, "password", uniqueId); - } catch (final Exception e) { - throw new RuntimeException("Error creating truststore for Acceptance Test", e); - } - } - - return trustStoreFile; - } - - private Path createKeyStore(final String type, final String alias) { - if (caKeyPair == null) { - createTrustStore(type); - } - - final KeyPair kp = createKeyPair(TestCertificateUtils.Algorithm.RSA); - final X509Certificate certificate = - issueCertificate(caCertificate, caKeyPair, "validator", notBefore(), notAfter(), kp, false); - - try { - final KeyStore keyStore = KeyStore.getInstance(type); - keyStore.load(null, null); - keyStore.setKeyEntry( - alias, - kp.getPrivate(), - KEYSTORE_DEFAULT_PASSWORD.toCharArray(), - new Certificate[] {certificate, caCertificate}); - - final String id = UUID.randomUUID().toString(); - return writeKeyStoreFile(keyStore, "keystore", id); - } catch (final Exception e) { - throw new RuntimeException("Error creating keystore for Acceptance Test", e); - } - } - - private Path writeKeyStoreFile( - final KeyStore keyStore, final String prefix, final String suffix) { - try { - final Path file = Files.createTempFile(prefix, suffix != null ? suffix : ""); - file.toFile().deleteOnExit(); - final FileOutputStream keyStoreFOS = new FileOutputStream(file.toFile()); - keyStore.store(keyStoreFOS, KEYSTORE_DEFAULT_PASSWORD.toCharArray()); - - return file; - } catch (final Exception e) { - throw new RuntimeException("Error creating keystore file", e); - } - } - - private Path writePasswordFile(final String password, final String prefix, final String suffix) { - try { - final Path file = Files.createTempFile(prefix, suffix); - file.toFile().deleteOnExit(); - Files.write(file, password.getBytes(StandardCharsets.UTF_8)); - return file; - } catch (final IOException e) { - throw new RuntimeException("Error creating password file", e); - } - } - - private Instant notBefore() { - return Instant.now().minus(1, ChronoUnit.DAYS); - } - - private Instant notAfter() { - return Instant.now().plus(10, ChronoUnit.DAYS); - } - - private Path readResourceAsPath(final String path) throws Exception { - return Path.of(Objects.requireNonNull(this.getClass().getResource(path)).toURI()); - } -} diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/PrivacyNode.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/PrivacyNode.java index 1c0df5ace6d..c9487ebcd67 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/PrivacyNode.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/PrivacyNode.java @@ -130,7 +130,6 @@ public PrivacyNode( besuConfig.getPrivacyParameters(), List.of(), Optional.empty(), - Optional.empty(), besuConfig.isStrictTxReplayProtectionEnabled(), besuConfig.getEnvironment()); } diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/ParameterizedPkiQbftTestBase.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/ParameterizedPkiQbftTestBase.java deleted file mode 100644 index b1ffcff3712..00000000000 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/ParameterizedPkiQbftTestBase.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.tests.acceptance.bft.pki; - -import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5; - -import java.util.stream.Stream; - -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.params.provider.Arguments; - -@Disabled("This is not a test class, it offers PKI QBFT parameterization only.") -public abstract class ParameterizedPkiQbftTestBase extends AcceptanceTestBaseJunit5 { - public static Stream factoryFunctions() { - return PkiQbftAcceptanceTestParameterization.getFactories(); - } -} diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/PkiQbftAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/PkiQbftAcceptanceTest.java deleted file mode 100644 index 12ae887a510..00000000000 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/PkiQbftAcceptanceTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.tests.acceptance.bft.pki; - -import org.hyperledger.besu.tests.acceptance.dsl.account.Account; -import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -public class PkiQbftAcceptanceTest extends ParameterizedPkiQbftTestBase { - - @ParameterizedTest(name = "{index}: {0}") - @MethodSource("factoryFunctions") - public void shouldMineOnSingleNode( - final String testName, final PkiQbftAcceptanceTestParameterization nodeFactory) - throws Exception { - final BesuNode minerNode = nodeFactory.createNode(besu, "miner1"); - cluster.start(minerNode); - - cluster.verify(blockchain.reachesHeight(minerNode, 1)); - - final Account sender = accounts.createAccount("account1"); - final Account receiver = accounts.createAccount("account2"); - - minerNode.execute(accountTransactions.createTransfer(sender, 50)); - cluster.verify(sender.balanceEquals(50)); - - minerNode.execute(accountTransactions.createIncrementalTransfers(sender, receiver, 1)); - cluster.verify(receiver.balanceEquals(1)); - - minerNode.execute(accountTransactions.createIncrementalTransfers(sender, receiver, 2)); - cluster.verify(receiver.balanceEquals(3)); - } - - @ParameterizedTest(name = "{index}: {0}") - @MethodSource("factoryFunctions") - public void shouldMineOnMultipleNodes( - final String testName, final PkiQbftAcceptanceTestParameterization nodeFactory) - throws Exception { - final BesuNode minerNode1 = nodeFactory.createNode(besu, "miner1"); - final BesuNode minerNode2 = nodeFactory.createNode(besu, "miner2"); - final BesuNode minerNode3 = nodeFactory.createNode(besu, "miner3"); - final BesuNode minerNode4 = nodeFactory.createNode(besu, "miner4"); - cluster.start(minerNode1, minerNode2, minerNode3, minerNode4); - - cluster.verify(blockchain.reachesHeight(minerNode1, 1, 85)); - - final Account sender = accounts.createAccount("account1"); - final Account receiver = accounts.createAccount("account2"); - - minerNode1.execute(accountTransactions.createTransfer(sender, 50)); - cluster.verify(sender.balanceEquals(50)); - - minerNode2.execute(accountTransactions.createIncrementalTransfers(sender, receiver, 1)); - cluster.verify(receiver.balanceEquals(1)); - - minerNode3.execute(accountTransactions.createIncrementalTransfers(sender, receiver, 2)); - cluster.verify(receiver.balanceEquals(3)); - - minerNode4.execute(accountTransactions.createIncrementalTransfers(sender, receiver, 3)); - cluster.verify(receiver.balanceEquals(6)); - } - - @ParameterizedTest(name = "{index}: {0}") - @MethodSource("factoryFunctions") - public void shouldMineWithIgnoringANodeInCRL( - final String testName, final PkiQbftAcceptanceTestParameterization nodeFactory) - throws Exception { - final BesuNode minerNode1 = nodeFactory.createNode(besu, "miner1"); - final BesuNode minerNode2 = nodeFactory.createNode(besu, "miner2"); - final BesuNode minerNode3 = nodeFactory.createNode(besu, "miner3"); - final BesuNode minerNode4 = nodeFactory.createNode(besu, "miner4"); - final BesuNode minerNode5 = nodeFactory.createNode(besu, "miner5"); - final BesuNode minerNode6 = nodeFactory.createNode(besu, "miner6"); - try { - cluster.start(minerNode1, minerNode2, minerNode3, minerNode4); - - cluster.startNode(minerNode5); - cluster.startNode(minerNode6); - - cluster.verify(blockchain.reachesHeight(minerNode1, 1, 85)); - - final Account sender = accounts.createAccount("account1"); - final Account receiver = accounts.createAccount("account2"); - - minerNode1.execute(accountTransactions.createTransfer(sender, 50)); - cluster.verify(sender.balanceEquals(50)); - - minerNode2.execute(accountTransactions.createIncrementalTransfers(sender, receiver, 1)); - cluster.verify(receiver.balanceEquals(1)); - - minerNode3.execute(accountTransactions.createIncrementalTransfers(sender, receiver, 2)); - cluster.verify(receiver.balanceEquals(3)); - - minerNode4.execute(accountTransactions.createIncrementalTransfers(sender, receiver, 3)); - cluster.verify(receiver.balanceEquals(6)); - - if (minerNode1.getTLSConfiguration().isEmpty()) { - minerNode1.verify(net.awaitPeerCount(5)); - minerNode5.verify(net.awaitPeerCount(5)); - minerNode6.verify(net.awaitPeerCount(5)); - } else { - minerNode1.verify(net.awaitPeerCount(3)); - minerNode5.verify(net.awaitPeerCount(0)); - minerNode6.verify(net.awaitPeerCount(0)); - } - } finally { - cluster.stopNode(minerNode5); - cluster.stopNode(minerNode6); - minerNode5.close(); - minerNode6.close(); - } - } -} diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/PkiQbftAcceptanceTestParameterization.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/PkiQbftAcceptanceTestParameterization.java deleted file mode 100644 index 7bcf09afd38..00000000000 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/pki/PkiQbftAcceptanceTestParameterization.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2020 ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.tests.acceptance.bft.pki; - -import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode; -import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Stream; - -import org.junit.jupiter.params.provider.Arguments; - -public class PkiQbftAcceptanceTestParameterization { - - public static Stream getFactories() { - List args = new ArrayList<>(); - - /* - BLOCK CREATION - */ - - args.add( - Arguments.of( - "qbft-pki-jks", - new PkiQbftAcceptanceTestParameterization( - BesuNodeFactory::createPkiQbftJKSNode, - BesuNodeFactory::createPkiQbftJKSNodeWithValidators))); - - args.add( - Arguments.of( - "qbft-pki-pkcs12", - new PkiQbftAcceptanceTestParameterization( - BesuNodeFactory::createPkiQbftPKCS12Node, - BesuNodeFactory::createPkiQbftPKCS12NodeWithValidators))); - - if (Boolean.getBoolean("acctests.runBesuAsProcess")) { - args.add( - Arguments.of( - "qbft-pki-pkcs11", - new PkiQbftAcceptanceTestParameterization( - BesuNodeFactory::createPkiQbftPKCS11Node, - BesuNodeFactory::createPkiQbftPKCS11NodeWithValidators))); - } - - /* - TLS - */ - - args.add( - Arguments.of( - "qbft-tls-jks", - new PkiQbftAcceptanceTestParameterization( - BesuNodeFactory::createQbftNodeWithTLSJKS, - BesuNodeFactory::createQbftTLSJKSNodeWithValidators))); - - args.add( - Arguments.of( - "qbft-tls-pkcs12", - new PkiQbftAcceptanceTestParameterization( - BesuNodeFactory::createQbftNodeWithTLSPKCS12, - BesuNodeFactory::createQbftTLSPKCS12NodeWithValidators))); - - if (Boolean.getBoolean("acctests.runBesuAsProcess")) { - args.add( - Arguments.of( - "qbft-tls-pkcs11", - new PkiQbftAcceptanceTestParameterization( - BesuNodeFactory::createQbftNodeWithTLSPKCS11, - BesuNodeFactory::createQbftTLSPKCS11NodeWithValidators))); - } - - return args.stream(); - } - - @FunctionalInterface - public interface NodeCreator { - - BesuNode create(BesuNodeFactory factory, String name) throws Exception; - } - - @FunctionalInterface - public interface NodeWithValidatorsCreator { - - BesuNode create(BesuNodeFactory factory, String name, String[] validators) throws Exception; - } - - private final NodeCreator creatorFn; - private final NodeWithValidatorsCreator createorWithValidatorFn; - - public PkiQbftAcceptanceTestParameterization( - final NodeCreator creatorFn, final NodeWithValidatorsCreator createorWithValidatorFn) { - this.creatorFn = creatorFn; - this.createorWithValidatorFn = createorWithValidatorFn; - } - - public BesuNode createNode(BesuNodeFactory factory, String name) throws Exception { - return creatorFn.create(factory, name); - } - - public BesuNode createNodeWithValidators( - BesuNodeFactory factory, String name, String[] validators) throws Exception { - return createorWithValidatorFn.create(factory, name, validators); - } -} diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/blockcreation/PkiQbftBlockCreatorTest.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/blockcreation/PkiQbftBlockCreatorTest.java deleted file mode 100644 index e8282f9de9b..00000000000 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/blockcreation/PkiQbftBlockCreatorTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.consensus.qbft.blockcreation; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.hyperledger.besu.consensus.common.bft.BftExtraDataFixture.createExtraData; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyLong; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; -import org.hyperledger.besu.consensus.common.bft.BftExtraData; -import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule; -import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.pki.PkiQbftBlockHeaderFunctions; -import org.hyperledger.besu.consensus.qbft.pki.PkiQbftExtraData; -import org.hyperledger.besu.consensus.qbft.pki.PkiQbftExtraDataCodec; -import org.hyperledger.besu.datatypes.Hash; -import org.hyperledger.besu.ethereum.blockcreation.BlockCreationTiming; -import org.hyperledger.besu.ethereum.blockcreation.BlockCreator; -import org.hyperledger.besu.ethereum.blockcreation.BlockCreator.BlockCreationResult; -import org.hyperledger.besu.ethereum.blockcreation.txselection.TransactionSelectionResults; -import org.hyperledger.besu.ethereum.core.Block; -import org.hyperledger.besu.ethereum.core.BlockBody; -import org.hyperledger.besu.ethereum.core.BlockHeader; -import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; -import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; -import org.hyperledger.besu.ethereum.mainnet.WithdrawalsValidator; -import org.hyperledger.besu.pki.cms.CmsCreator; - -import java.util.Collections; - -import org.apache.tuweni.bytes.Bytes; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public class PkiQbftBlockCreatorTest { - - private final PkiQbftExtraDataCodec extraDataCodec = new PkiQbftExtraDataCodec(); - - private BlockCreator blockCreator; - private CmsCreator cmsCreator; - private PkiQbftBlockCreator pkiQbftBlockCreator; - private BlockHeaderTestFixture blockHeaderBuilder; - private BlockHeader blockHeader; - private BftProtocolSchedule protocolSchedule; - private ProtocolSpec protocolSpec; - - @BeforeEach - public void before() { - blockCreator = mock(BlockCreator.class); - cmsCreator = mock(CmsCreator.class); - blockHeader = mock(BlockHeader.class); - protocolSchedule = mock(BftProtocolSchedule.class); - protocolSpec = mock(ProtocolSpec.class); - - pkiQbftBlockCreator = - new PkiQbftBlockCreator( - blockCreator, cmsCreator, extraDataCodec, blockHeader, protocolSchedule); - - blockHeaderBuilder = new BlockHeaderTestFixture(); - - when(protocolSchedule.getByBlockNumberOrTimestamp(anyLong(), anyLong())) - .thenReturn(protocolSpec); - } - - @Test - public void createProposalBehaviourWithNonPkiCodecFails() { - assertThatThrownBy( - () -> - new PkiQbftBlockCreator( - blockCreator, - cmsCreator, - new QbftExtraDataCodec(), - blockHeader, - protocolSchedule)) - .isInstanceOf(IllegalArgumentException.class) - .hasMessageContaining("PkiQbftBlockCreator must use PkiQbftExtraDataCodec"); - } - - @Test - public void cmsInProposedBlockHasValueCreatedByCmsCreator() { - createBlockBeingProposed(); - when(protocolSpec.getWithdrawalsValidator()) - .thenReturn(new WithdrawalsValidator.AllowedWithdrawals()); - - final Bytes cms = Bytes.random(32); - when(cmsCreator.create(any(Bytes.class))).thenReturn(cms); - - final Block proposedBlock = pkiQbftBlockCreator.createBlock(1L).getBlock(); - - final PkiQbftExtraData proposedBlockExtraData = - (PkiQbftExtraData) extraDataCodec.decodeRaw(proposedBlock.getHeader().getExtraData()); - assertThat(proposedBlockExtraData).isInstanceOf(PkiQbftExtraData.class); - assertThat(proposedBlockExtraData.getCms()).isEqualTo(cms); - } - - @Test - public void cmsIsCreatedWithCorrectHashingFunction() { - when(protocolSpec.getWithdrawalsValidator()) - .thenReturn(new WithdrawalsValidator.ProhibitedWithdrawals()); - final Block block = createBlockBeingProposed(); - final Hash expectedHashForCmsCreation = - PkiQbftBlockHeaderFunctions.forCmsSignature(extraDataCodec).hash(block.getHeader()); - - when(cmsCreator.create(any(Bytes.class))).thenReturn(Bytes.random(32)); - - pkiQbftBlockCreator.createBlock(1L); - - verify(cmsCreator).create(eq(expectedHashForCmsCreation)); - } - - @Test - public void proposedBlockHashUsesCommittedSealHeaderFunction() { - createBlockBeingProposed(); - when(cmsCreator.create(any(Bytes.class))).thenReturn(Bytes.random(32)); - - final Block blockWithCms = pkiQbftBlockCreator.createBlock(1L).getBlock(); - - final Hash expectedBlockHash = - BftBlockHeaderFunctions.forCommittedSeal(extraDataCodec).hash(blockWithCms.getHeader()); - - assertThat(blockWithCms.getHash()).isEqualTo(expectedBlockHash); - } - - private Block createBlockBeingProposed() { - final BftExtraData originalExtraData = - createExtraData(blockHeaderBuilder.buildHeader(), extraDataCodec); - final BlockHeader blockHeaderWithExtraData = - blockHeaderBuilder.extraData(extraDataCodec.encode(originalExtraData)).buildHeader(); - final Block block = - new Block( - blockHeaderWithExtraData, - new BlockBody(Collections.emptyList(), Collections.emptyList())); - when(blockCreator.createBlock(eq(1L))) - .thenReturn( - new BlockCreationResult( - block, new TransactionSelectionResults(), new BlockCreationTiming())); - when(blockCreator.createEmptyWithdrawalsBlock(anyLong())) - .thenReturn( - new BlockCreationResult( - block, new TransactionSelectionResults(), new BlockCreationTiming())); - - return block; - } -} diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/DefaultKeyStoreWrapperProviderTest.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/DefaultKeyStoreWrapperProviderTest.java deleted file mode 100644 index f5c91305cda..00000000000 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/DefaultKeyStoreWrapperProviderTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.consensus.qbft.pki; - -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoInteractions; - -import org.hyperledger.besu.consensus.qbft.pki.DefaultKeyStoreWrapperProvider.HardwareKeyStoreWrapperProvider; -import org.hyperledger.besu.consensus.qbft.pki.DefaultKeyStoreWrapperProvider.SoftwareKeyStoreWrapperProvider; -import org.hyperledger.besu.pki.keystore.KeyStoreWrapper; - -import java.nio.file.Path; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -@ExtendWith(MockitoExtension.class) -public class DefaultKeyStoreWrapperProviderTest { - - @Mock private HardwareKeyStoreWrapperProvider hardwareKeyStoreWrapperProvider; - @Mock private SoftwareKeyStoreWrapperProvider softwareKeyStoreWrapperProvider; - @InjectMocks private DefaultKeyStoreWrapperProvider keyStoreWrapperProvider; - - private final Path keystorePath = Path.of("/keystore"); - private final String keystorePassword = "pwd"; - private final Path crlPath = Path.of("/crl"); - - @Test - public void configWithTypePKCS11UsesHardwareKeyStoreProvider() { - keyStoreWrapperProvider.apply( - KeyStoreWrapper.KEYSTORE_TYPE_PKCS11, keystorePath, keystorePassword, crlPath); - - verify(hardwareKeyStoreWrapperProvider) - .get(eq(keystorePassword), eq(keystorePath), eq(crlPath)); - verifyNoInteractions(softwareKeyStoreWrapperProvider); - } - - @Test - public void configWithTypePKCS12UsesSoftwareKeyStoreProvider() { - keyStoreWrapperProvider.apply( - KeyStoreWrapper.KEYSTORE_TYPE_PKCS12, keystorePath, keystorePassword, crlPath); - - verify(softwareKeyStoreWrapperProvider) - .get( - eq(KeyStoreWrapper.KEYSTORE_TYPE_PKCS12), - eq(keystorePath), - eq(keystorePassword), - eq(crlPath)); - verifyNoInteractions(hardwareKeyStoreWrapperProvider); - } - - @Test - public void configWithTypeJKSUsesSoftwareKeyStoreProvider() { - keyStoreWrapperProvider.apply( - KeyStoreWrapper.KEYSTORE_TYPE_JKS, keystorePath, keystorePassword, crlPath); - - verify(softwareKeyStoreWrapperProvider) - .get( - eq(KeyStoreWrapper.KEYSTORE_TYPE_JKS), - eq(keystorePath), - eq(keystorePassword), - eq(crlPath)); - verifyNoInteractions(hardwareKeyStoreWrapperProvider); - } -} diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfigurationProviderTest.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfigurationProviderTest.java deleted file mode 100644 index 27ccfe1bcfe..00000000000 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfigurationProviderTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.consensus.qbft.pki; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.ArgumentMatchers.isNull; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - -import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration; -import org.hyperledger.besu.pki.keystore.KeyStoreWrapper; - -import java.nio.file.Path; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -@ExtendWith(MockitoExtension.class) -public class PkiBlockCreationConfigurationProviderTest { - - @Mock KeyStoreWrapperProvider keyStoreWrapperProvider; - @Mock KeyStoreWrapper keyStoreWrapper; - @Mock KeyStoreWrapper trustStoreWrapper; - - @Test - public void pkiBlockCreationConfigurationIsLoadedCorrectly() { - when(keyStoreWrapperProvider.apply(any(), eq(Path.of("/tmp/keystore")), eq("pwd"), isNull())) - .thenReturn(keyStoreWrapper); - when(keyStoreWrapperProvider.apply( - any(), eq(Path.of("/tmp/truststore")), eq("pwd"), eq(Path.of("/tmp/crl")))) - .thenReturn(trustStoreWrapper); - - final PkiKeyStoreConfiguration pkiKeyStoreConfiguration = - spy( - new PkiKeyStoreConfiguration.Builder() - .withKeyStorePath(Path.of("/tmp/keystore")) - .withKeyStorePasswordPath(Path.of("/tmp/password")) - .withTrustStorePath(Path.of("/tmp/truststore")) - .withTrustStorePasswordPath(Path.of("/tmp/password")) - .withCertificateAlias("anAlias") - .withCrlFilePath(Path.of("/tmp/crl")) - .build()); - doReturn("pwd").when(pkiKeyStoreConfiguration).getKeyStorePassword(); - doReturn("pwd").when(pkiKeyStoreConfiguration).getTrustStorePassword(); - - final PkiBlockCreationConfigurationProvider pkiBlockCreationConfigProvider = - new PkiBlockCreationConfigurationProvider(keyStoreWrapperProvider); - - final PkiBlockCreationConfiguration pkiBlockCreationConfiguration = - pkiBlockCreationConfigProvider.load(pkiKeyStoreConfiguration); - - assertThat(pkiBlockCreationConfiguration).isNotNull(); - assertThat(pkiBlockCreationConfiguration.getKeyStore()).isNotNull(); - assertThat(pkiBlockCreationConfiguration.getTrustStore()).isNotNull(); - assertThat(pkiBlockCreationConfiguration.getCertificateAlias()).isEqualTo("anAlias"); - } -} diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHashingTest.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHashingTest.java deleted file mode 100644 index 45ec1a780df..00000000000 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHashingTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.consensus.qbft.pki; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -import org.hyperledger.besu.consensus.common.bft.BftBlockHashing; -import org.hyperledger.besu.consensus.common.bft.BftExtraData; -import org.hyperledger.besu.consensus.common.bft.BftExtraDataFixture; -import org.hyperledger.besu.datatypes.Hash; -import org.hyperledger.besu.ethereum.core.BlockHeader; -import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; - -import org.apache.tuweni.bytes.Bytes; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public class PkiQbftBlockHashingTest { - - private PkiQbftExtraDataCodec pkiExtraDataCodec = new PkiQbftExtraDataCodec(); - private PkiQbftBlockHashing pkiQbftBlockHashing; - - @BeforeEach - public void before() { - pkiExtraDataCodec = spy(new PkiQbftExtraDataCodec()); - pkiQbftBlockHashing = new PkiQbftBlockHashing(pkiExtraDataCodec); - } - - @Test - public void blockHashingUsesCorrectEncodingWithoutCmsMethodInCodec() { - final PkiQbftExtraData pkiQbftExtraData = createPkiQbftExtraData(); - final BlockHeader headerWithExtraData = - new BlockHeaderTestFixture() - .number(1L) - .extraData(pkiExtraDataCodec.encode(pkiQbftExtraData)) - .buildHeader(); - - // Expected hash using the extraData encoded by the encodeWithoutCms method of the codec - final Hash expectedHash = - Hash.hash( - BftBlockHashing.serializeHeader( - headerWithExtraData, - () -> pkiExtraDataCodec.encodeWithoutCms(pkiQbftExtraData), - pkiExtraDataCodec)); - - final Hash hash = - pkiQbftBlockHashing.calculateHashOfBftBlockForCmsSignature(headerWithExtraData); - - assertThat(hash).isEqualTo(expectedHash); - - /* - Verify that the encodeWithoutCms method was called twice, once when calculating the - expected hash and a second time as part of the hash calculation on - calculateHashOfBftBlockForCmsSignature - */ - verify(pkiExtraDataCodec, times(2)).encodeWithoutCms(any(PkiQbftExtraData.class)); - } - - private PkiQbftExtraData createPkiQbftExtraData() { - final BlockHeader blockHeader = new BlockHeaderTestFixture().buildHeader(); - final BftExtraData extraData = - BftExtraDataFixture.createExtraData(blockHeader, pkiExtraDataCodec); - return new PkiQbftExtraData(extraData, Bytes.random(32)); - } -} diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraDataCodecTest.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraDataCodecTest.java deleted file mode 100644 index 32fc034b8e8..00000000000 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraDataCodecTest.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright 2020 ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.consensus.qbft.pki; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.hyperledger.besu.consensus.qbft.QbftExtraDataCodecTestUtils.createNonEmptyVanityData; - -import org.hyperledger.besu.consensus.common.bft.BftExtraData; -import org.hyperledger.besu.consensus.common.bft.Vote; -import org.hyperledger.besu.crypto.SECPSignature; -import org.hyperledger.besu.crypto.SignatureAlgorithm; -import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; -import org.hyperledger.besu.datatypes.Address; -import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput; - -import java.math.BigInteger; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; -import java.util.Random; -import java.util.function.Supplier; - -import com.google.common.base.Suppliers; -import org.apache.tuweni.bytes.Bytes; -import org.junit.jupiter.api.Test; - -public class PkiQbftExtraDataCodecTest { - - private static final Supplier SIGNATURE_ALGORITHM = - Suppliers.memoize(SignatureAlgorithmFactory::getInstance); - - // Arbitrary bytes representing a non-empty CMS - private final Bytes cms = Bytes.fromHexString("0x01"); - - private final String RAW_EXCLUDE_COMMIT_SEALS_AND_ROUND_NUMBER_ENCODED_STRING = - "0xf867a00102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20ea940000000000000000" - + "000000000000000000000001940000000000000000000000000000000000000002d7940000000000000000" - + "00000000000000000000000181ff80c001"; - - private final String RAW_EXCLUDE_COMMIT_SEALS_ENCODED_STRING = - "0xf86aa00102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20ea940000000000000000" - + "000000000000000000000001940000000000000000000000000000000000000002d7940000000000000000" - + "00000000000000000000000181ff83fedcbac001"; - - private final String RAW_ALL_ENCODED_STRING = - "0xf8f1a00102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20ea940000000000000000" - + "000000000000000000000001940000000000000000000000000000000000000002d7940000000000000000" - + "00000000000000000000000181ff83fedcbaf886b841000000000000000000000000000000000000000000" - + "0000000000000000000001000000000000000000000000000000000000000000000000000000000000000a" - + "00b841000000000000000000000000000000000000000000000000000000000000000a0000000000000000" - + "0000000000000000000000000000000000000000000000010001"; - - private final String RAW_QBFT_EXTRA_DATA = - "0xf8f0a00102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20ea940000000000000000" - + "000000000000000000000001940000000000000000000000000000000000000002d7940000000000000000" - + "00000000000000000000000181ff83fedcbaf886b841000000000000000000000000000000000000000000" - + "0000000000000000000001000000000000000000000000000000000000000000000000000000000000000a" - + "00b841000000000000000000000000000000000000000000000000000000000000000a0000000000000000" - + "00000000000000000000000000000000000000000000000100"; - - private final PkiQbftExtraDataCodec bftExtraDataCodec = new PkiQbftExtraDataCodec(); - - @Test - public void fullyPopulatedDataProducesCorrectlyFormedExtraDataObject() { - final List
validators = - Arrays.asList(Address.fromHexString("1"), Address.fromHexString("2")); - final int round = 0x00FEDCBA; - final List committerSeals = - Arrays.asList( - SIGNATURE_ALGORITHM.get().createSignature(BigInteger.ONE, BigInteger.TEN, (byte) 0), - SIGNATURE_ALGORITHM.get().createSignature(BigInteger.TEN, BigInteger.ONE, (byte) 0)); - - // Create randomised vanity data. - final byte[] vanity_bytes = createNonEmptyVanityData(); - new Random().nextBytes(vanity_bytes); - final Bytes vanity_data = Bytes.wrap(vanity_bytes); - - final BytesValueRLPOutput encoder = new BytesValueRLPOutput(); - encoder.startList(); // start extra data list - // vanity data - encoder.writeBytes(vanity_data); - // validators - encoder.writeList(validators, (validator, rlp) -> rlp.writeBytes(validator)); - // votes - encoder.startList(); - encoder.writeBytes(Address.fromHexString("1")); - encoder.writeByte(Vote.ADD_BYTE_VALUE); - encoder.endList(); - // rounds - encoder.writeIntScalar(round); - // committer seals - encoder.writeList(committerSeals, (committer, rlp) -> rlp.writeBytes(committer.encodedBytes())); - // cms - encoder.writeBytes(cms); - encoder.endList(); // end extra data list - - final Bytes bufferToInject = encoder.encoded(); - - final PkiQbftExtraData extraData = - (PkiQbftExtraData) bftExtraDataCodec.decodeRaw(bufferToInject); - - assertThat(extraData.getVanityData()).isEqualTo(vanity_data); - assertThat(extraData.getRound()).isEqualTo(round); - assertThat(extraData.getSeals()).isEqualTo(committerSeals); - assertThat(extraData.getValidators()).isEqualTo(validators); - assertThat(extraData.getCms()).isEqualTo(cms); - } - - @Test - public void decodingQbftExtraDataDelegatesToQbftCodec() { - final List
validators = - Arrays.asList(Address.fromHexString("1"), Address.fromHexString("2")); - final int round = 0x00FEDCBA; - final List committerSeals = - Arrays.asList( - SIGNATURE_ALGORITHM.get().createSignature(BigInteger.ONE, BigInteger.TEN, (byte) 0), - SIGNATURE_ALGORITHM.get().createSignature(BigInteger.TEN, BigInteger.ONE, (byte) 0)); - - // Create randomised vanity data. - final byte[] vanity_bytes = createNonEmptyVanityData(); - new Random().nextBytes(vanity_bytes); - final Bytes vanity_data = Bytes.wrap(vanity_bytes); - - final BytesValueRLPOutput encoder = new BytesValueRLPOutput(); - encoder.startList(); // start extra data list - // vanity data - encoder.writeBytes(vanity_data); - // validators - encoder.writeList(validators, (validator, rlp) -> rlp.writeBytes(validator)); - // votes - encoder.startList(); - encoder.writeBytes(Address.fromHexString("1")); - encoder.writeByte(Vote.ADD_BYTE_VALUE); - encoder.endList(); - // rounds - encoder.writeIntScalar(round); - // committer seals - encoder.writeList(committerSeals, (committer, rlp) -> rlp.writeBytes(committer.encodedBytes())); - // Not including the CMS in the list (to generate a non-pki QBFT extra data) - encoder.endList(); // end extra data list - - final Bytes bufferToInject = encoder.encoded(); - - final PkiQbftExtraData extraData = - (PkiQbftExtraData) bftExtraDataCodec.decodeRaw(bufferToInject); - - assertThat(extraData.getVanityData()).isEqualTo(vanity_data); - assertThat(extraData.getRound()).isEqualTo(round); - assertThat(extraData.getSeals()).isEqualTo(committerSeals); - assertThat(extraData.getValidators()).isEqualTo(validators); - assertThat(extraData.getCms()).isEqualTo(Bytes.EMPTY); - } - - /* - When encoding for blockchain, we ignore commit seals and round number, but we include the CMS - */ - @Test - public void encodingForBlockchainShouldIncludeCms() { - final Bytes expectedRawDecoding = - Bytes.fromHexString(RAW_EXCLUDE_COMMIT_SEALS_AND_ROUND_NUMBER_ENCODED_STRING); - final Bytes encoded = - bftExtraDataCodec.encodeWithoutCommitSealsAndRoundNumber(getDecodedExtraData(cms)); - - assertThat(encoded).isEqualTo(expectedRawDecoding); - } - - @Test - public void encodingWithoutCommitSealsShouldIncludeCms() { - final Bytes expectedRawDecoding = Bytes.fromHexString(RAW_EXCLUDE_COMMIT_SEALS_ENCODED_STRING); - final Bytes encoded = bftExtraDataCodec.encodeWithoutCommitSeals(getDecodedExtraData(cms)); - - assertThat(encoded).isEqualTo(expectedRawDecoding); - } - - @Test - public void encodingWithAllShouldIncludeCms() { - final Bytes expectedRawDecoding = Bytes.fromHexString(RAW_ALL_ENCODED_STRING); - final Bytes encoded = bftExtraDataCodec.encode(getDecodedExtraData(cms)); - - assertThat(encoded).isEqualTo(expectedRawDecoding); - } - - /* - When encoding for proposal, we include commit seals and round number, but we ignore the CMS - */ - @Test - public void encodingForCreatingCmsProposal() { - final Bytes expectedRawDecoding = Bytes.fromHexString(RAW_QBFT_EXTRA_DATA); - final Bytes encoded = bftExtraDataCodec.encodeWithoutCms(getDecodedExtraData(cms)); - - assertThat(encoded).isEqualTo(expectedRawDecoding); - } - - /* - When encoding non-pki extra data, we delegate to the regular QBFT encoder - */ - @Test - public void encodingQbftExtraData() { - final Bytes expectedRawDecoding = Bytes.fromHexString(RAW_QBFT_EXTRA_DATA); - final PkiQbftExtraData pkiBftExtraData = getDecodedExtraData(cms); - final BftExtraData bftExtraData = - new BftExtraData( - pkiBftExtraData.getVanityData(), - pkiBftExtraData.getSeals(), - pkiBftExtraData.getVote(), - pkiBftExtraData.getRound(), - pkiBftExtraData.getValidators()); - - final Bytes encoded = bftExtraDataCodec.encode(bftExtraData); - - assertThat(encoded).isEqualTo(expectedRawDecoding); - } - - private static PkiQbftExtraData getDecodedExtraData(final Bytes cms) { - final List
validators = - Arrays.asList(Address.fromHexString("1"), Address.fromHexString("2")); - final Optional vote = Optional.of(Vote.authVote(Address.fromHexString("1"))); - final int round = 0x00FEDCBA; - final List committerSeals = - Arrays.asList( - SIGNATURE_ALGORITHM.get().createSignature(BigInteger.ONE, BigInteger.TEN, (byte) 0), - SIGNATURE_ALGORITHM.get().createSignature(BigInteger.TEN, BigInteger.ONE, (byte) 0)); - - // Create a byte buffer with no data. - final byte[] vanity_bytes = createNonEmptyVanityData(); - final Bytes vanity_data = Bytes.wrap(vanity_bytes); - - return new PkiQbftExtraData(vanity_data, committerSeals, vote, round, validators, cms); - } -} diff --git a/pki/src/test/java/org/hyperledger/besu/pki/cms/CmsCreationAndValidationTest.java b/pki/src/test/java/org/hyperledger/besu/pki/cms/CmsCreationAndValidationTest.java deleted file mode 100644 index 2daf9b576be..00000000000 --- a/pki/src/test/java/org/hyperledger/besu/pki/cms/CmsCreationAndValidationTest.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.pki.cms; - -import static org.hyperledger.besu.pki.util.TestCertificateUtils.Algorithm.EC; -import static org.hyperledger.besu.pki.util.TestCertificateUtils.Algorithm.RSA; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.hyperledger.besu.pki.util.TestCertificateUtils.Algorithm; - -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.cert.X509Certificate; - -import org.apache.tuweni.bytes.Bytes; -import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder; -import org.bouncycastle.cms.CMSProcessableByteArray; -import org.bouncycastle.cms.CMSSignedData; -import org.bouncycastle.cms.CMSSignedDataGenerator; -import org.bouncycastle.cms.CMSTypedData; -import org.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilder; -import org.bouncycastle.operator.ContentSigner; -import org.bouncycastle.operator.DigestCalculatorProvider; -import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; -import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; - -public class CmsCreationAndValidationTest { - - private static final CmsTestKeystores rsaTestKeystores = new CmsTestKeystores(RSA); - private static final CmsTestKeystores ecTestKeystores = new CmsTestKeystores(EC); - - private CmsTestKeystores getCmsTestKeystores(final Algorithm algorithm) { - return switch (algorithm) { - case RSA -> rsaTestKeystores; - case EC -> ecTestKeystores; - }; - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithEmptyCmsMessage(final Algorithm algorithm) { - final Bytes data = Bytes.random(32); - - assertFalse(getCmsTestKeystores(algorithm).getCmsValidator().validate(Bytes.EMPTY, data)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithTrustedSelfSignedCertificate(final Algorithm algorithm) { - final CmsCreator cmsCreator = - new CmsCreator(getCmsTestKeystores(algorithm).getKeystoreWrapper(), "trusted_selfsigned"); - final Bytes data = Bytes.random(32); - - final Bytes cms = cmsCreator.create(data); - - assertTrue(getCmsTestKeystores(algorithm).getCmsValidator().validate(cms, data)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithUntrustedSelfSignedCertificate(final Algorithm algorithm) { - final CmsCreator cmsCreator = - new CmsCreator(getCmsTestKeystores(algorithm).getKeystoreWrapper(), "untrusted_selfsigned"); - final Bytes data = Bytes.random(32); - - final Bytes cms = cmsCreator.create(data); - - assertFalse(getCmsTestKeystores(algorithm).getCmsValidator().validate(cms, data)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithTrustedChain(final Algorithm algorithm) { - final CmsCreator cmsCreator = - new CmsCreator(getCmsTestKeystores(algorithm).getKeystoreWrapper(), "trusted"); - final Bytes data = Bytes.random(32); - - final Bytes cms = cmsCreator.create(data); - - assertTrue(getCmsTestKeystores(algorithm).getCmsValidator().validate(cms, data)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithUntrustedChain(final Algorithm algorithm) { - final CmsCreator cmsCreator = - new CmsCreator(getCmsTestKeystores(algorithm).getKeystoreWrapper(), "untrusted"); - final Bytes data = Bytes.random(32); - - final Bytes cms = cmsCreator.create(data); - - assertFalse(getCmsTestKeystores(algorithm).getCmsValidator().validate(cms, data)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithExpiredCertificate(final Algorithm algorithm) { - final CmsCreator cmsCreator = - new CmsCreator(getCmsTestKeystores(algorithm).getKeystoreWrapper(), "expired"); - final Bytes data = Bytes.random(32); - - final Bytes cms = cmsCreator.create(data); - - assertFalse(getCmsTestKeystores(algorithm).getCmsValidator().validate(cms, data)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithRevokedCertificate(final Algorithm algorithm) { - final CmsCreator cmsCreator = - new CmsCreator(getCmsTestKeystores(algorithm).getKeystoreWrapper(), "revoked"); - final Bytes data = Bytes.random(32); - - final Bytes cms = cmsCreator.create(data); - - assertFalse(getCmsTestKeystores(algorithm).getCmsValidator().validate(cms, data)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithoutCRLConfigDisablesCRLCheck(final Algorithm algorithm) { - final CmsCreator cmsCreator = - new CmsCreator(getCmsTestKeystores(algorithm).getKeystoreWrapper(), "revoked"); - final Bytes data = Bytes.random(32); - - final Bytes cms = cmsCreator.create(data); - - CmsValidator cmsValidator = getCmsTestKeystores(algorithm).getCmsValidatorWithoutCrl(); - - // Because we don't have a CRL CertStore, revocation is not checked - assertTrue(cmsValidator.validate(cms, data)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithWrongSignedData(final Algorithm algorithm) { - final CmsCreator cmsCreator = - new CmsCreator(getCmsTestKeystores(algorithm).getKeystoreWrapper(), "trusted"); - final Bytes otherData = Bytes.random(32); - final Bytes cms = cmsCreator.create(otherData); - - final Bytes expectedData = Bytes.random(32); - assertFalse(getCmsTestKeystores(algorithm).getCmsValidator().validate(cms, expectedData)); - } - - @ParameterizedTest - @EnumSource(value = Algorithm.class) - public void cmsValidationWithInvalidSignature(final Algorithm algorithm) throws Exception { - // Create a CMS message signed with a certificate, but create SignerInfo using another - // certificate to trigger the signature verification to fail. - - final PrivateKey privateKey = - getCmsTestKeystores(algorithm).getKeystoreWrapper().getPrivateKey("trusted"); - final PublicKey publicKey = - getCmsTestKeystores(algorithm).getKeystoreWrapper().getPublicKey("trusted"); - final X509Certificate signerCertificate = - (X509Certificate) - getCmsTestKeystores(algorithm).getKeystoreWrapper().getCertificate("trusted"); - final X509Certificate otherCertificate = - (X509Certificate) - getCmsTestKeystores(algorithm) - .getKeystoreWrapper() - .getCertificate("trusted_selfsigned"); - - final ContentSigner contentSigner = - new JcaContentSignerBuilder(CmsCreator.getPreferredSignatureAlgorithm(publicKey)) - .build(privateKey); - - final CMSSignedDataGenerator cmsGenerator = new CMSSignedDataGenerator(); - cmsGenerator.addCertificate(new JcaX509CertificateHolder(signerCertificate)); - cmsGenerator.addCertificate(new JcaX509CertificateHolder(otherCertificate)); - - final DigestCalculatorProvider digestCalculatorProvider = - new JcaDigestCalculatorProviderBuilder().setProvider("BC").build(); - cmsGenerator.addSignerInfoGenerator( - new JcaSignerInfoGeneratorBuilder(digestCalculatorProvider) - .build(contentSigner, otherCertificate)); - - final Bytes expectedData = Bytes.random(32); - final CMSTypedData cmsData = new CMSProcessableByteArray(expectedData.toArray()); - final CMSSignedData cmsSignedData = cmsGenerator.generate(cmsData, true); - final Bytes cmsBytes = Bytes.wrap(cmsSignedData.getEncoded()); - - assertFalse(getCmsTestKeystores(algorithm).getCmsValidator().validate(cmsBytes, expectedData)); - } -} diff --git a/pki/src/test/java/org/hyperledger/besu/pki/cms/CmsTestKeystores.java b/pki/src/test/java/org/hyperledger/besu/pki/cms/CmsTestKeystores.java deleted file mode 100644 index 3a2d4c04f8f..00000000000 --- a/pki/src/test/java/org/hyperledger/besu/pki/cms/CmsTestKeystores.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright Hyperledger Besu Contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.pki.cms; - -import static org.hyperledger.besu.pki.util.TestCertificateUtils.createCRL; -import static org.hyperledger.besu.pki.util.TestCertificateUtils.createKeyPair; -import static org.hyperledger.besu.pki.util.TestCertificateUtils.createSelfSignedCertificate; -import static org.hyperledger.besu.pki.util.TestCertificateUtils.issueCertificate; - -import org.hyperledger.besu.pki.keystore.KeyStoreWrapper; -import org.hyperledger.besu.pki.keystore.SoftwareKeyStoreWrapper; -import org.hyperledger.besu.pki.util.TestCertificateUtils.Algorithm; - -import java.security.KeyPair; -import java.security.KeyStore; -import java.security.cert.Certificate; -import java.security.cert.X509CRL; -import java.security.cert.X509Certificate; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -public class CmsTestKeystores { - private KeyStore keystore; - private KeyStore truststore; - private List CRLs; - - private KeyStoreWrapper keystoreWrapper; - private KeyStoreWrapper truststoreWrapper; - private KeyStoreWrapper truststoreWrapperWithoutCrl; - private CmsValidator cmsValidator; - private CmsValidator cmsValidatorWithoutCrl; - - public CmsTestKeystores(final Algorithm algorithm) { - try { - init(algorithm); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public void init(final Algorithm algorithm) throws Exception { - final Instant notBefore = Instant.now().minus(1, ChronoUnit.DAYS); - final Instant notAfter = Instant.now().plus(1, ChronoUnit.DAYS); - - /* - Create self-signed certificate - */ - final KeyPair selfsignedKeyPair = createKeyPair(algorithm); - final X509Certificate selfsignedCertificate = - createSelfSignedCertificate("selfsigned", notBefore, notAfter, selfsignedKeyPair); - - /* - Create trusted chain (ca -> interca -> partneraca -> partneravalidator) - */ - final KeyPair caKeyPair = createKeyPair(algorithm); - final X509Certificate caCertificate = - createSelfSignedCertificate("ca", notBefore, notAfter, caKeyPair); - - final KeyPair interCAKeyPair = createKeyPair(algorithm); - final X509Certificate interCACertificate = - issueCertificate( - caCertificate, caKeyPair, "interca", notBefore, notAfter, interCAKeyPair, true); - - final KeyPair partnerACAPair = createKeyPair(algorithm); - final X509Certificate partnerACACertificate = - issueCertificate( - interCACertificate, - interCAKeyPair, - "partneraca", - notBefore, - notAfter, - partnerACAPair, - true); - - final KeyPair parterAValidatorKeyPair = createKeyPair(algorithm); - final X509Certificate partnerAValidatorCertificate = - issueCertificate( - partnerACACertificate, - partnerACAPair, - "partneravalidator", - notBefore, - notAfter, - parterAValidatorKeyPair, - false); - - /* - Create expired certificate - */ - final KeyPair expiredKeyPair = createKeyPair(algorithm); - final X509Certificate expiredCertificate = - issueCertificate( - caCertificate, - caKeyPair, - "expired", - notBefore, - notBefore.plus(1, ChronoUnit.SECONDS), - expiredKeyPair, - true); - - /* - Create revoked and revoked certificates - */ - final KeyPair revokedKeyPair = createKeyPair(algorithm); - final X509Certificate revokedCertificate = - issueCertificate( - caCertificate, caKeyPair, "revoked", notBefore, notAfter, revokedKeyPair, true); - - /* - Create untrusted chain (untrusted_selfsigned -> unstrusted_partner) - */ - final KeyPair untrustedSelfSignedKeyPair = createKeyPair(algorithm); - final X509Certificate untrustedSelfsignedCertificate = - createSelfSignedCertificate( - "untrusted_selfsigned", notBefore, notAfter, untrustedSelfSignedKeyPair); - - final KeyPair untrustedIntermediateKeyPair = createKeyPair(algorithm); - final X509Certificate untrustedIntermediateCertificate = - issueCertificate( - untrustedSelfsignedCertificate, - untrustedSelfSignedKeyPair, - "unstrusted_partner", - notBefore, - notAfter, - untrustedIntermediateKeyPair, - true); - - /* - Create truststore wrapper with 3 trusted certificates: 'ca', 'interca' and 'selfsigned' - */ - truststore = KeyStore.getInstance("PKCS12"); - truststore.load(null, null); - - truststore.setCertificateEntry("ca", caCertificate); - truststore.setCertificateEntry("interca", interCACertificate); - truststore.setCertificateEntry("selfsigned", selfsignedCertificate); - - /* - Create keystore with certificates used in tests - */ - keystore = KeyStore.getInstance("PKCS12"); - keystore.load(null, null); - - keystore.setKeyEntry( - "trusted_selfsigned", - selfsignedKeyPair.getPrivate(), - "".toCharArray(), - new Certificate[] {selfsignedCertificate}); - keystore.setKeyEntry( - "untrusted_selfsigned", - untrustedSelfSignedKeyPair.getPrivate(), - "".toCharArray(), - new Certificate[] {untrustedSelfsignedCertificate}); - keystore.setKeyEntry( - "expired", - expiredKeyPair.getPrivate(), - "".toCharArray(), - new Certificate[] {expiredCertificate}); - keystore.setKeyEntry( - "revoked", - revokedKeyPair.getPrivate(), - "".toCharArray(), - new Certificate[] {revokedCertificate}); - keystore.setKeyEntry( - "trusted", - parterAValidatorKeyPair.getPrivate(), - "".toCharArray(), - new Certificate[] {partnerAValidatorCertificate, partnerACACertificate}); - keystore.setKeyEntry( - "untrusted", - untrustedIntermediateKeyPair.getPrivate(), - "".toCharArray(), - new Certificate[] {untrustedIntermediateCertificate, untrustedSelfsignedCertificate}); - - /* - Create CRLs for all CA certificates (mostly empty, only ca has one revoked certificate) - */ - final X509CRL caCRL = createCRL(caCertificate, caKeyPair, Set.of(revokedCertificate)); - final X509CRL intercaCRL = - createCRL(interCACertificate, interCAKeyPair, Collections.emptyList()); - final X509CRL partnerACACRL = - createCRL(partnerACACertificate, partnerACAPair, Collections.emptyList()); - final X509CRL selfsignedCRL = - createCRL(selfsignedCertificate, selfsignedKeyPair, Collections.emptyList()); - CRLs = List.of(caCRL, intercaCRL, partnerACACRL, selfsignedCRL); - - keystoreWrapper = new SoftwareKeyStoreWrapper(null, keystore, ""); - - truststoreWrapper = new SoftwareKeyStoreWrapper(CRLs, truststore, ""); - - truststoreWrapperWithoutCrl = new SoftwareKeyStoreWrapper(null, truststore, ""); - - cmsValidator = new CmsValidator(truststoreWrapper); - - cmsValidatorWithoutCrl = new CmsValidator(truststoreWrapperWithoutCrl); - } - - public KeyStore getKeystore() { - return keystore; - } - - public KeyStore getTruststore() { - return truststore; - } - - public List getCRLs() { - return CRLs; - } - - public KeyStoreWrapper getKeystoreWrapper() { - return keystoreWrapper; - } - - public KeyStoreWrapper getTruststoreWrapper() { - return truststoreWrapper; - } - - public CmsValidator getCmsValidator() { - return cmsValidator; - } - - public KeyStoreWrapper getTruststoreWrapperWithoutCrl() { - return truststoreWrapperWithoutCrl; - } - - public CmsValidator getCmsValidatorWithoutCrl() { - return cmsValidatorWithoutCrl; - } -} diff --git a/pki/src/test/java/org/hyperledger/besu/pki/keystore/BaseKeyStoreFileWrapperTest.java b/pki/src/test/java/org/hyperledger/besu/pki/keystore/BaseKeyStoreFileWrapperTest.java deleted file mode 100644 index 3cbeff8985a..00000000000 --- a/pki/src/test/java/org/hyperledger/besu/pki/keystore/BaseKeyStoreFileWrapperTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.pki.keystore; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; - -import java.nio.file.Path; -import java.security.cert.Certificate; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -public abstract class BaseKeyStoreFileWrapperTest { - protected static final String KEYSTORE_VALID_KEY_ALIAS = "partner1client1"; - protected static final String KEYSTORE_INVALID_KEY_ALIAS = "partner1clientinvalid"; - protected static final String TRUSTSTORE_VALID_CERTIFICATE_ALIAS = "interca"; - protected static final String TRUSTSTORE_INVALID_CERTIFICATE_ALIAS = "interca-invalid"; - - protected static Path toPath(final String path) throws Exception { - return null == path - ? null - : Path.of(BaseKeyStoreFileWrapperTest.class.getResource(path).toURI()); - } - - @ParameterizedTest - @MethodSource("data") - public void getPublicKey_WithValidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNotNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getPublicKey(KEYSTORE_VALID_KEY_ALIAS)); - } - - @ParameterizedTest - @MethodSource("data") - public void getPublicKey_WithInvalidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getPublicKey(KEYSTORE_INVALID_KEY_ALIAS)); - } - - @ParameterizedTest - @MethodSource("data") - public void getPrivateKey_WithValidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNotNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getPrivateKey(KEYSTORE_VALID_KEY_ALIAS), - "Private key is not null"); - } - - @ParameterizedTest - @MethodSource("data") - public void getPrivateKey_WithInvalidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getPrivateKey(KEYSTORE_INVALID_KEY_ALIAS), - "Private key is null"); - } - - @ParameterizedTest - @MethodSource("data") - public void getCertificate_WithValidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNotNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getCertificate(KEYSTORE_VALID_KEY_ALIAS), - "Certificate is not null"); - } - - @ParameterizedTest - @MethodSource("data") - public void getCertificate_WithInvalidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getCertificate(KEYSTORE_INVALID_KEY_ALIAS), - "Certificate is null"); - } - - @ParameterizedTest - @MethodSource("data") - public void getCertificateChain_WithValidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNotNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getCertificateChain(KEYSTORE_VALID_KEY_ALIAS), - "Certificate chain is not null"); - } - - @ParameterizedTest - @MethodSource("data") - public void getCertificateChain_WithInvalidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getCertificateChain( - KEYSTORE_INVALID_KEY_ALIAS), - "Certificate is null"); - } - - @ParameterizedTest - @MethodSource("data") - public void getCertificate_FromTruststore_WithValidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - final Certificate certificate = - keyStoreWrapperTestParameter.keyStoreWrapper.getCertificate( - TRUSTSTORE_VALID_CERTIFICATE_ALIAS); - if (keyStoreWrapperTestParameter.keystoreWrapperConfiguredWithTruststore) { - assertNotNull(certificate, "Certificate is not null"); - } else { - assertNull(certificate, "Certificate is null"); - } - } - - @ParameterizedTest - @MethodSource("data") - public void getCertificate_FromTruststore_WithInvalidAlias_ReturnsExpectedValue( - final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNull( - keyStoreWrapperTestParameter.keyStoreWrapper.getPrivateKey( - TRUSTSTORE_INVALID_CERTIFICATE_ALIAS), - "Certificate is null"); - } - - @ParameterizedTest - @MethodSource("data") - public void getCRLS_Check(final KeyStoreWrapperTestParameter keyStoreWrapperTestParameter) { - assertNotNull(keyStoreWrapperTestParameter.keyStoreWrapper.getCRLs(), "CRLs is not null"); - assertEquals( - keyStoreWrapperTestParameter.keyStoreWrapper.getCRLs().size(), 2, "CRLs size matches"); - } - - public static class KeyStoreWrapperTestParameter { - public String keyStoreWrapperDescription; - public boolean keystoreWrapperConfiguredWithTruststore; - public KeyStoreWrapper keyStoreWrapper; - - public KeyStoreWrapperTestParameter( - final String keyStoreWrapperDescription, - final boolean keystoreWrapperConfiguredWithTruststore, - final KeyStoreWrapper keyStoreWrapper) { - this.keyStoreWrapperDescription = keyStoreWrapperDescription; - this.keystoreWrapperConfiguredWithTruststore = keystoreWrapperConfiguredWithTruststore; - this.keyStoreWrapper = keyStoreWrapper; - } - } -} diff --git a/pki/src/test/java/org/hyperledger/besu/pki/keystore/CryptoTestUtil.java b/pki/src/test/java/org/hyperledger/besu/pki/keystore/CryptoTestUtil.java deleted file mode 100644 index 4176cac0faa..00000000000 --- a/pki/src/test/java/org/hyperledger/besu/pki/keystore/CryptoTestUtil.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.pki.keystore; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Optional; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CryptoTestUtil { - - private static final Logger LOG = LoggerFactory.getLogger(CryptoTestUtil.class); - - private CryptoTestUtil() {} - - public static boolean isNSSLibInstalled() { - try { - final String nssLibPath = getNSSLibPath(); - return nssLibPath != null && !nssLibPath.trim().isEmpty(); - } catch (final Exception e) { - LOG.info("NSS library does not seem to be installed!", e); - } - return false; - } - - public static String getNSSLibPath() throws IOException, InterruptedException { - String nssLibPath = ""; - final String centOS_nssPathCmd = - "whereis libnssdbm3 | grep -o \"\\/.*libnssdbm3\\.[0-9a-z]* \" | sed 's/\\/libnssdbm3.*//g'"; - final String debian_nssPathCmd = - "whereis libnss3 | grep -o \".*libnss3.[0-9a-z]\" | sed 's/lib.* \\(\\/.*\\)\\/lib.*/\\1/'"; - final String macOS_nssPathCmd = "dirname `which certutil` | sed 's/bin/lib/g'"; - - nssLibPath = executeSystemCmd(centOS_nssPathCmd).orElse(nssLibPath); - LOG.info("centOS_nssPathCmd: {}", nssLibPath); - if ("".equals(nssLibPath)) { - nssLibPath = executeSystemCmd(debian_nssPathCmd).orElse(nssLibPath); - LOG.info("debian_nssPathCmd: {}", nssLibPath); - } - if ("".equals(nssLibPath)) { - nssLibPath = executeSystemCmd(macOS_nssPathCmd).orElse(nssLibPath); - LOG.info("macOS_nssPathCmd: {}", nssLibPath); - } - LOG.info("Detected NSS library path: {}", nssLibPath); - return nssLibPath; - } - - public static Optional executeSystemCmd(final String cmd) - throws IOException, InterruptedException { - final Process p = Runtime.getRuntime().exec(new String[] {"/bin/sh", "-c", cmd}); - try { - if (p.waitFor() == 0) { - final java.util.Scanner s = - new java.util.Scanner(p.getInputStream(), StandardCharsets.UTF_8.name()) - .useDelimiter("\\A"); - if (s.hasNext()) { - return Optional.of(s.next().replace("\r", "").replace("\n", "")); - } - } - } finally { - if (p != null) { - p.destroy(); - } - } - return Optional.empty(); - } -} diff --git a/pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreFileWrapperTest.java b/pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreFileWrapperTest.java deleted file mode 100644 index 31eb03126c5..00000000000 --- a/pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreFileWrapperTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.pki.keystore; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assumptions.assumeTrue; - -import org.hyperledger.besu.pki.PkiException; - -import java.nio.file.Path; -import java.security.Provider; -import java.security.Security; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - -import org.junit.jupiter.api.Assumptions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.OS; - -public class HardwareKeyStoreFileWrapperTest extends BaseKeyStoreFileWrapperTest { - - private static final String config = "/keystore/partner1client1/nss.cfg"; - private static final String crl = "/keystore/partner1client1/crl.pem"; - private static final String configName = "NSScrypto-partner1client1"; - private static final String validKeystorePassword = "test123"; - private static KeyStoreWrapperTestParameter keyStoreWrapperTestParameter; - - @BeforeAll - public static void setup() { - keyStoreWrapperTestParameter = - new KeyStoreWrapperTestParameter( - "HardwareKeyStoreWrapper[PKCS11 keystore/truststore]", - true, - CryptoTestUtil.isNSSLibInstalled() ? getHardwareKeyStoreWrapper(configName) : null); - } - - public static Collection data() { - return List.of(keyStoreWrapperTestParameter); - } - - private static KeyStoreWrapper getHardwareKeyStoreWrapper(final String cfgName) { - try { - final Path path = toPath(config); - final Path crlPath = toPath(crl); - final Optional existingProvider = - Stream.of(Security.getProviders()) - .filter(p -> p.getName().equals("SunPKCS11" + cfgName)) - .findAny(); - return existingProvider - .map(provider -> new HardwareKeyStoreWrapper(validKeystorePassword, provider, crlPath)) - .orElseGet(() -> new HardwareKeyStoreWrapper(validKeystorePassword, path, crlPath)); - } catch (final Exception e) { - // nss3 is difficult to setup on mac, don't let it break unit tests for dev machines. - Assumptions.assumeFalse( - OS.MAC.isCurrentOs(), - "Failed to initialize hardware keystore: " + e.getLocalizedMessage()); - // Not a mac, probably a production build. Full failure. - throw new PkiException("Failed to initialize hardware keystore", e); - } - } - - @BeforeEach - public void beforeMethod() { - assumeTrue( - CryptoTestUtil.isNSSLibInstalled(), - "Test ignored due to NSS library not being installed/detected."); - } - - @Test - public void getPkcs11Provider() throws Exception { - final HardwareKeyStoreWrapper sut = - (HardwareKeyStoreWrapper) getHardwareKeyStoreWrapper(configName); - assertThrows( - IllegalArgumentException.class, () -> sut.getPkcs11ProviderForConfig("no-library")); - } - - @Test - public void init_keystorePassword_config() throws Exception { - new HardwareKeyStoreWrapper(validKeystorePassword, toPath(config), toPath(crl)); - } - - @Test - public void init_keystorePassword_config_invalid() throws Exception { - final String config = "invalid"; - assertThrows( - NullPointerException.class, - () -> new HardwareKeyStoreWrapper(validKeystorePassword, toPath(config), toPath(crl))); - } - - @Test - public void init_keystorePassword_config_missing_pw() throws Exception { - assertThrows( - PkiException.class, () -> new HardwareKeyStoreWrapper(null, toPath(config), toPath(crl))); - } - - @Test - public void init_keystorePassword_provider_missing_pw() throws Exception { - final Provider p = null; - assertThrows( - PkiException.class, - () -> new HardwareKeyStoreWrapper(validKeystorePassword, p, toPath(crl))); - } -} diff --git a/pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreWrapperTest.java b/pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreWrapperTest.java deleted file mode 100644 index 1d72a0537f4..00000000000 --- a/pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreWrapperTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.pki.keystore; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.mockito.Mockito.when; - -import java.security.KeyStore; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.cert.Certificate; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -@ExtendWith(MockitoExtension.class) -public class HardwareKeyStoreWrapperTest { - - private static final String KEY_ALIAS = "keyalias"; - private static final String CERTIFICATE_ALIAS = "certalias"; - private static final char[] PASSWORD = "password".toCharArray(); - - @Mock private KeyStore keyStore; - @Mock private PrivateKey privateKey; - @Mock private PublicKey publicKey; - @Mock private Certificate certificate; - - private HardwareKeyStoreWrapper keyStoreWrapper; - - @BeforeEach - public void before() { - keyStoreWrapper = new HardwareKeyStoreWrapper(null, keyStore, new String(PASSWORD)); - } - - @Test - public void getPrivateKey() throws Exception { - when(keyStore.getKey(KEY_ALIAS, PASSWORD)).thenReturn(privateKey); - - assertNotNull(keyStoreWrapper.getPrivateKey(KEY_ALIAS)); - } - - @Test - public void getPublicKey() throws Exception { - // Get public key from certificate - when(keyStore.getCertificate(KEY_ALIAS)).thenReturn(certificate); - when(certificate.getPublicKey()).thenReturn(publicKey); - - assertNotNull(keyStoreWrapper.getPublicKey(KEY_ALIAS)); - } - - @Test - public void getCertificate() throws Exception { - when(keyStore.getCertificate(CERTIFICATE_ALIAS)).thenReturn(certificate); - - assertNotNull(keyStoreWrapper.getCertificate(CERTIFICATE_ALIAS)); - } - - @Test - public void getCertificateChain() throws Exception { - when(keyStore.getCertificateChain(CERTIFICATE_ALIAS)) - .thenReturn(new Certificate[] {certificate}); - - assertEquals(keyStoreWrapper.getCertificateChain(CERTIFICATE_ALIAS).length, 1); - } -} diff --git a/pki/src/test/java/org/hyperledger/besu/pki/keystore/SoftwareKeyStoreFileWrapperTest.java b/pki/src/test/java/org/hyperledger/besu/pki/keystore/SoftwareKeyStoreFileWrapperTest.java deleted file mode 100644 index 2550d070f72..00000000000 --- a/pki/src/test/java/org/hyperledger/besu/pki/keystore/SoftwareKeyStoreFileWrapperTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.pki.keystore; - -import org.hyperledger.besu.pki.PkiException; - -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collection; - -public class SoftwareKeyStoreFileWrapperTest extends BaseKeyStoreFileWrapperTest { - - private static final String p12KeyStore = "/keystore/partner1client1/keys.p12"; - private static final String jksKeyStore = "/keystore/partner1client1/keystore.jks"; - private static final String trustStore = "/keystore/partner1client1/truststore.jks"; - private static final String crl = "/keystore/partner1client1/crl.pem"; - private static final String validKeystorePassword = "test123"; - - public static Collection data() { - return Arrays.asList( - new KeyStoreWrapperTestParameter( - "SoftwareKeyStoreWrapper[PKCS12 keystore only]", - false, - getPKCS12SoftwareKeyStoreWrapper()), - new KeyStoreWrapperTestParameter( - "SoftwareKeyStoreWrapper[JKS keystore only]", - false, - getJKSSoftwareKeyStoreWrapper(false)), - new KeyStoreWrapperTestParameter( - "SoftwareKeyStoreWrapper[JKS keystore/truststore]", - true, - getJKSSoftwareKeyStoreWrapper(true))); - } - - private static KeyStoreWrapper getPKCS12SoftwareKeyStoreWrapper() { - try { - return new SoftwareKeyStoreWrapper( - KeyStoreWrapper.KEYSTORE_TYPE_PKCS12, - toPath(p12KeyStore), - validKeystorePassword, - toPath(crl)); - } catch (final Exception e) { - throw new PkiException("Failed to initialize software keystore", e); - } - } - - private static KeyStoreWrapper getJKSSoftwareKeyStoreWrapper(final boolean setupTruststore) { - try { - final Path keystoreLocation = toPath(jksKeyStore); - if (setupTruststore) { - final Path truststoreLocation = toPath(trustStore); - // password shouldn't be needed for retrieving certificate from truststore - return new SoftwareKeyStoreWrapper( - KeyStoreWrapper.KEYSTORE_TYPE_JKS, - keystoreLocation, - validKeystorePassword, - KeyStoreWrapper.KEYSTORE_TYPE_JKS, - truststoreLocation, - null, - toPath(crl)); - } - return new SoftwareKeyStoreWrapper( - KeyStoreWrapper.KEYSTORE_TYPE_JKS, keystoreLocation, validKeystorePassword, toPath(crl)); - } catch (final Exception e) { - throw new PkiException("Failed to initialize software keystore", e); - } - } -} diff --git a/pki/src/test/java/org/hyperledger/besu/pki/keystore/SoftwareKeyStoreWrapperTest.java b/pki/src/test/java/org/hyperledger/besu/pki/keystore/SoftwareKeyStoreWrapperTest.java deleted file mode 100644 index 8f7f8164bc8..00000000000 --- a/pki/src/test/java/org/hyperledger/besu/pki/keystore/SoftwareKeyStoreWrapperTest.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.pki.keystore; - -import static org.hyperledger.besu.pki.keystore.KeyStoreWrapper.KEYSTORE_TYPE_PKCS12; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.nio.file.Path; -import java.security.KeyStore; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.cert.Certificate; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -@ExtendWith(MockitoExtension.class) -public class SoftwareKeyStoreWrapperTest { - - private static final String KEY_ALIAS = "keyalias"; - private static final String CERTIFICATE_ALIAS = "certalias"; - private static final char[] PASSWORD = "password".toCharArray(); - - private SoftwareKeyStoreWrapper keyStoreWrapper; - - @Mock private KeyStore keyStore; - @Mock private KeyStore trustStore; - @Mock private PrivateKey privateKey; - @Mock private PublicKey publicKey; - @Mock private Certificate certificate; - - @BeforeEach - public void before() { - keyStoreWrapper = new SoftwareKeyStoreWrapper(keyStore, new String(PASSWORD), null, ""); - } - - @Test - public void getPrivateKey() throws Exception { - when(keyStore.containsAlias(KEY_ALIAS)).thenReturn(true); - when(keyStore.getKey(KEY_ALIAS, PASSWORD)).thenReturn(privateKey); - - assertNotNull(keyStoreWrapper.getPrivateKey(KEY_ALIAS)); - } - - @Test - public void getPrivateKeyCaching() throws Exception { - when(keyStore.containsAlias(KEY_ALIAS)).thenReturn(true); - when(keyStore.getKey(KEY_ALIAS, PASSWORD)).thenReturn(privateKey); - - keyStoreWrapper.getPrivateKey(KEY_ALIAS); - keyStoreWrapper.getPrivateKey(KEY_ALIAS); - - verify(keyStore, times(1)).getKey(eq(KEY_ALIAS), eq(PASSWORD)); - } - - @Test - public void getPrivateKeyFallbackToTrustStore() throws Exception { - keyStoreWrapper = - new SoftwareKeyStoreWrapper( - keyStore, new String(PASSWORD), trustStore, new String(PASSWORD)); - - when(keyStore.containsAlias(KEY_ALIAS)).thenReturn(false); - when(trustStore.containsAlias(KEY_ALIAS)).thenReturn(true); - when(trustStore.getKey(KEY_ALIAS, PASSWORD)).thenReturn(privateKey); - - assertNotNull(keyStoreWrapper.getPrivateKey(KEY_ALIAS)); - - verify(trustStore).getKey(eq(KEY_ALIAS), eq(PASSWORD)); - } - - @Test - public void getPublicKey() throws Exception { - when(keyStore.containsAlias(KEY_ALIAS)).thenReturn(true); - when(keyStore.getKey(KEY_ALIAS, PASSWORD)).thenReturn(publicKey); - - assertNotNull(keyStoreWrapper.getPublicKey(KEY_ALIAS)); - } - - @Test - public void getPublicKeyCaching() throws Exception { - when(keyStore.containsAlias(KEY_ALIAS)).thenReturn(true); - when(keyStore.getKey(KEY_ALIAS, PASSWORD)).thenReturn(publicKey); - - keyStoreWrapper.getPublicKey(KEY_ALIAS); - keyStoreWrapper.getPublicKey(KEY_ALIAS); - - verify(keyStore, times(1)).getKey(eq(KEY_ALIAS), eq(PASSWORD)); - } - - @Test - public void getPublicKeyFallbackToTrustStore() throws Exception { - keyStoreWrapper = - new SoftwareKeyStoreWrapper( - keyStore, new String(PASSWORD), trustStore, new String(PASSWORD)); - - when(keyStore.containsAlias(KEY_ALIAS)).thenReturn(false); - when(trustStore.containsAlias(KEY_ALIAS)).thenReturn(true); - when(trustStore.getKey(KEY_ALIAS, PASSWORD)).thenReturn(publicKey); - - assertNotNull(keyStoreWrapper.getPublicKey(KEY_ALIAS)); - - verify(trustStore).getKey(eq(KEY_ALIAS), eq(PASSWORD)); - } - - @Test - public void getCertificate() throws Exception { - when(keyStore.getCertificate(CERTIFICATE_ALIAS)).thenReturn(certificate); - - assertNotNull(keyStoreWrapper.getCertificate(CERTIFICATE_ALIAS)); - } - - @Test - public void getCertificateCaching() throws Exception { - when(keyStore.getCertificate(CERTIFICATE_ALIAS)).thenReturn(certificate); - - keyStoreWrapper.getCertificate(CERTIFICATE_ALIAS); - keyStoreWrapper.getCertificate(CERTIFICATE_ALIAS); - - verify(keyStore, times(1)).getCertificate(eq(CERTIFICATE_ALIAS)); - } - - @Test - public void getCertificateFallbackToTrustStore() throws Exception { - keyStoreWrapper = - new SoftwareKeyStoreWrapper( - keyStore, new String(PASSWORD), trustStore, new String(PASSWORD)); - - when(keyStore.getCertificate(CERTIFICATE_ALIAS)).thenReturn(null); - when(trustStore.getCertificate(CERTIFICATE_ALIAS)).thenReturn(certificate); - - assertNotNull(keyStoreWrapper.getCertificate(CERTIFICATE_ALIAS)); - - verify(trustStore).getCertificate(eq(CERTIFICATE_ALIAS)); - } - - @Test - public void getCertificateChain() throws Exception { - when(keyStore.getCertificateChain(CERTIFICATE_ALIAS)) - .thenReturn(new Certificate[] {certificate}); - - assertEquals(keyStoreWrapper.getCertificateChain(CERTIFICATE_ALIAS).length, 1); - } - - @Test - public void getCertificateChainFallbackToTrustStore() throws Exception { - keyStoreWrapper = - new SoftwareKeyStoreWrapper( - keyStore, new String(PASSWORD), trustStore, new String(PASSWORD)); - - when(keyStore.getCertificateChain(CERTIFICATE_ALIAS)).thenReturn(null); - when(trustStore.getCertificateChain(CERTIFICATE_ALIAS)) - .thenReturn(new Certificate[] {certificate}); - - assertEquals(keyStoreWrapper.getCertificateChain(CERTIFICATE_ALIAS).length, 1); - - verify(trustStore).getCertificateChain(eq(CERTIFICATE_ALIAS)); - } - - @Test - public void loadKeyStoreFromFile() { - SoftwareKeyStoreWrapper loadedKeyStore = - new SoftwareKeyStoreWrapper( - KEYSTORE_TYPE_PKCS12, - Path.of("src/test/resources/keystore/keystore"), - "validator", - KEYSTORE_TYPE_PKCS12, - Path.of("src/test/resources/keystore/keystore"), - "validator", - null); - - assertNotNull(loadedKeyStore.getPublicKey("validator")); - assertNotNull(loadedKeyStore.getPrivateKey("validator")); - assertNotNull(loadedKeyStore.getCertificate("validator")); - // CA -> INTERCA -> PARTNERACA -> VALIDATOR - assertEquals(loadedKeyStore.getCertificateChain("validator").length, 4); - } -} diff --git a/pki/src/test/resources/keystore/partner1client1/keys.p12 b/pki/src/test/resources/keystore/partner1client1/keys.p12 deleted file mode 100644 index fb3d451add6270cdd21f90f3a8636bf6a53f9249..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6068 zcmY+IWmFUZ*R2N_I+X72W@sd&1e8Vw0cnQr?i#vNItG#M?(Xg$K{^DaTe!Y!-Fx5f z`*GGjYwxqp&;8@!ffCmsA|UZViQQ4q*}@dU?ywP15nxba3m}x(^q+0W1I0b~Z-fGa z;;#I&77!5t|77yN2?7rV3daBafQ5jyV(w}mm*V8m>8A3p55E0JDWYDF$%*FAHD~8tu#U)7RX3rpSV>^?W^;lh zjTXC2u(0MkARq{hRs`i3k!#y0_Tvy|Y{z|H%mQQyjNxt=m$~`v8~5lpveVudaAtta zb;f$?6?WwinFI_y#Rl;ZzaTGZaIk4@;FbT%Z<^%i&W53G(-{%NdrXcvyzdxA3Y`Aq zk!IE9@{m6t>@=4v+XM+OD8q?Na_{MwdklKq3~#6BNcS)ti)+YdVv}Xlt#F*gT?|7r z>wFV`y2v?tTx;x^o@6rM&SWRS_fuV|e{yTA-~buciLRV?IRu{}9t48x0}$83PZEPc zIy@&ck5U+TpLMAnU^fjrb}s%d1a{9T4K~%*ftSmtrm)iOv9mqiwa(^ah4lC{?z>%G zzXL6#oDK_Af8=nPs~{0_FQTvOpJq=6?DiAo`^w&;i9+wDC&o)&mo_&irrIxCsRQ&> zQ}e=%5LPF`lo+#wx{v>yf43s`Dyy=AKk>tNNn?|qJnFbKZ4n0QcLGjB*my+$E|a3Q zkV15FaFfmDzje|@jB^qcM!#$^R6@DF_2rrz8aVVz&)-3qGGpoNaJ?gI95G)U)UIc* z+r^}GHZ}xnTQl9cBt;*KRN40pGq=`mL``$Y-B8;jkH%N!NQrok%f1PBT=Xvx2P%)E z3d=Vh@}y(2^jL-#EUct2YCa71@tq=VY+m=)ELT;XVfMLPM{yy-Lr4TN>9c~3o~#Q{ z^cCX1neF5YSrt>|=P8%P{B9 zuXe9y7vvb>a@#t|+5yuZSXrM%5PvaDHf2(LL1rzhJJ6iloPd8Od#%@x%D$hMGFQYz z!%r2rHgm@L5@O_`Pnk+9wWLqcckaY8(^Ze{+%t(6oN)1j6SsidHzsaLv@~6K7P%26 zX{jT(k~1HPg12T&PhskbwvE9Xoo@| zN}g)!cN+odOy3iyX%~`mebt)jxXN#+jn06VZ;8Fj@4^vTZZ{Qf6m59oE58;=la;81 zl3$M|VxMgn1q{@J#)$hUl2Mg*U9VLl_Xy`5e9yFnXGZHz9IQ3BRt(T#O{(PqI`fCK z$_Qi!;qvc)JSYfM|J4&e+pZUOhcu%uTEo2f;Vs^qDJ2b|AIes*P~@Q_p0KKOP9Y;{ z=Pj}6AK{PP=s?pGv+$o!VZ zW?I|0>uFhIlf?BND$t4(Oi~elKN>=2sg+s9TyaP|K)a7S>nh)^({bM{7j(E|y|J3r z9L(Rk{;<=OWf`Bzn~t|1*$MW8f_Fb%rN~Y}au4#Cxn&L7E#0-0X-+3{vhH6x!nOOT zV?JVP8(nor2cQ&pl6d`!<>A~>WF+YhHMjweR^}Dy@TFeu$}g`ROIbZtRgcJTM6)j& z%v4QrSsAM6gx5$`EwJ32uToF8%)cGx z+nf$)`?W^#=TGBsOAUAbR7+!?H_osWM3Cet{no04u?GKiP9%`oDEUJ)axe3O$b)fq zJ*w_!6k-!)660nuN)wy`lQoz_oUV1}1wP#!D}mRgkVe`k%+Y{3$Flus5=z`3Ae5o_ zDOzUZmA#CPY(c`@HP$&_HSkWyMR|uYirJEDKpWit?8$YxF%OJSe(z4Zfa(j0ir!Zoh;WsJf-r%dJDO=_hw_Cgf_ z)~lA8I9C9X{#PlCUjsLB>s6*Q1=ql#2(g$pvTOW74Q{p2ch1EO zfp>+n84rcyMV$@_q5h}uz@O%A>kgh4`|2niUTcfhMrNtsV*07^gVfcfLrM8s{qQ17 zjAoffM~5V_DVaWxR{#7}F7$;(iMCkMH&$Jxah=vF^21Tw+WX&h88WVRoqu#}(s$`u z)LvS-Qa?^qcPwZ>u7s6Z%soG98CGc89wub{$b4FBH(E;FrDiL~hi|#W7=B;rG;iMB z_nyJ1zb8ElIXFVWDg0@5Oq@Cb;Zq_v7%7{5V2WAZh~M12bg^`HP;_^R;_Ct|>o4Sv z&`{!Z>g1GqFY1{S0+)qm%K4@-d&Gwbm<0OZ&X&OnGo&c~_6l?#{yfRuwteY5natB`|zQ zO2~I`z*M0>-uGKQYCj6p^cGOz31GWaxT+!*#}TEX2YQbS{y=MeV{dvmni`MJq-3%< z7lP_#B^dej^exfZQusLEbRU>sWPesZB}&g2ArulSIumSn!%=T%Ve^^&l@>-+5Jh96 z#mc^!SpAL;QRx!r@+*PA4jb}Cr58kQ891{P)6E%iz?LtU^sCe2%^V^BJk7C?A3(8{ z>ruj=oy(mZiBB{)^Z8#=j6YSPBtq)O-z(VVCcO|xI966 zpf{^YNE#oGKZq~ppU_lU-TaPmR$`Lxe*2tgvnBahU?v+l-+jERdv5nyif?OV{5~Yp zhn~VGir=asu}mz+E%avyQ+*$7jO)5%Kt##9B+vJ{|Iv0}%UnB+npOs&Bm$^ss_q>X z*x(Cb7dx3EoOH-L-4W1OtnQofh6=>HP+70vbvmvQx)|053(=}|F?ck5zj)G5Wb^VY zeN`)!leS6w68bP#s1kEh&r+E1Yk@Ik?NJl`7fIw;C~A97W!st~P{iB2FiiZ=>Tmd< zUDno3;6;YCk^Xj)YCoc}R6m$WHR4NyeRq%5$EJ&SLVh5NIy($(X-ni4VUjvFn;}j6 zDH!H>-3iA>dp%4mJFH)Ux1D?$rVQT;keV{lSri4giA59xKY(T^c(I^kpW)Aj6s#&S zvoftzJ7!Gu3L}wq4H!}>1|}7WB7F^XsV=1iuyHWr?14Qqtke)Nd@2(wKoF|CB-_#v z5#0Wj46VyvuzP9gE0`;s-jo{Mx!O?ctF~{~?o1UI-;40y!MQsn+7{f_P{^@#qG~B3 zrWyd9Si1r5I}>}xiay1eoSVU&O+Q#czs8=21KCIZ{mUt0h;%!6lw!vnEtr?~r8UJ( z%B^tut*+|0JE@xOo2jak-Q2Vr<%G<}=WU}lCVjW_)=$`BahRVXEJZIk&DC%`RrqAu zm}kb?Wh#Gu4*%gvg=Rkqq&gUQXm@eSuoXn>Tk>~gqC}__y!D_Tjq+t-{BTli@{!tH z+N3qDyzS}nHCd7pi&nziSaDjp0f$zSab^=QzNp=}`~=Uj)B>qiBFNx8$=`~GITBG; zJVTSyBiR+ZTh=MCu}bG-hd~VDscPlYqoYmS-aNoWA7q>F(jZL83svR1GVLHxws|XZ z_aR?GLUCk}S^t10BxnlvfY2y;aa1}4PywrQKpd-DwXF8Kc3plSR5dYim5($ii4Byl z<_SNN1&!9+L)Y^>oA`Hf(uWR*Z^ES<6!)|%r#egsGbZ-9%B!2q*=(&A>ojXb$L-E7gd0;$Z1pt8OF!x3N+(Ww^LzqWh9hw{@~>KB zH%u_BSB1+y=mNqe%6coJ-uD`*$!W;q)qdtM3$Xn<;vg;>7R^7^&vQE%_k47fb3gRF z{-mJ#=OWmdykExoux>QuOVRK!d-uq2&X4F2>fkz}Pv*`&aY3NXtG(2Ho%X~qVMS=|6G*J>W8Yz)lO;(7JIzfowK9NC`LEzeug6cyFo zuM$~`qwLt+bz9!BhA~C^)on??doZ|cq$HODx7r~3Ds3HoAln-DP>x+j=t4+rKg@$Q zL3THNW`pd5NTlDU?oQ#Ca!0mu>Te{T@xV07MAF}hv&Rswr(C6yvMjzoegQAOO57PG zVJk_fZ=&rmjMe}?#o+F1NEqPevqp2a;FL3D9JEBd^|he^I_v45L^&UCy(daz<`t8P zk+u%~c2Y7fl3z?b`kAr(oqDbBgtp)Aj+oxP!|W;6Q2L!5I}gp zxEXTT+`)tH^(Q14(*4Dx45+kMfc(^l6uCJh$PV2bt>(~D(P>hF^SsvEBb63BMTmxz zsASQZ)~1|dtuJr$2pMY3eHZvU7i9x`TlZTVr?>5AR+nyihsE zb;54svvjR<_V?~%RQBVa4M*N<%cH}hPlLKa{G{{9S1hXOK?nv3`WO`ujug0Be!MPv zNuMwg`4j2S5JLw!aTj81^t3Z*eWODur1O-!ZNJXYgz*H27T zZ)7zTgWy<8lXhd392s^+UPcgOjZ4!Cf?kHHNT>T|WYzacQoT`mk#yNAa?(B4ejg8k zm?b%9%ZgY{;#KKBbi?x*UwWj_2A#>}D2aZu#=3{jIVDGm`h{$Zv>K{mg`jhOA+^A( zssB)mnGoNjVRpMdB;*hRQn!mR)6zM!K3R3W^*k)?0dqlt^p~5U3|2XXV?B+9@KGt^ zPy^Z7z)KA$>uq>CLyy3B(iP>?UA!O3L+kDL8L#bSGZ@y`B!Lp;wY>SDR0;zL9reV~8CCRDiFC6!pG7*>c!$(B(mP|f;=cCE>A>PFlWczsExT>%=$Jt_M*kl} z?~a-(`RYpbv*ylg>*ZMp3BH!F4J2#jPn-oZdXgh7F4JW$~A|Drxf|Dir4wcKg~db(c!p*}z;a73t>0>*U7NnGP6 z=8m2#g9wb}0wi01n%k4;@|xv+w^nORu@u1q&G-kN-Ww^{^&~o)$_R-FQl1Tm$C>9f z7}m&J?7t~sC?wd32RnM+PD+6OyzqLz8FF-zdWY~aK>syz!9?8{Z8OH3tPYbJehWWp}S<2pm`@?VmppN;w>1wiSmYQCu(g!5z5*cS`{x#F zXTO^k7aQ?^#dFdHIYo6{H&0p|d58t14XB?UEgE{m8N)q^lN*KbT?sVYhl2WLpMXmldvFvO?7d|-yx|I(U-LhNG|rs#}Bbw z{PE119zgAJ;43E!JNZwuIuFG0PL1``rVrg$4vVoPbR}1v5O4A6adcI)*dh2H=6=Gl z(oP#(K2Lc_K?h(~C;Z7Y)v0(#F@-b}se=+FJ%|Q5?6&yHi_cH`_{-E|y_rDZArhQA z@ziB4iV2&Px`=SflSBQnAX|yGGOD4aX-!ksW$2BQ6t&3;W}71^@|0}3(!B0hWSHAW z$9vWm`XMarrry0=E}cyqtHUOwg7Cea<9c~P&!0xVw~VHyzXwUy(R8M5Fd!k*7@M2C zj2x*NOL)E^G`TxKyepYT#!~SL7;-B@K8mj9cmDle*decKLLtHz0G#rt>s!UFrf~0M z_ajh10WUr;nlt~g9 z>;E*;gMg)jDH}$LL~=gJ_twJE2NGhME6vPZqa=Y4h7p{=Lg>2u%z1oBItq5AQqY2L z7y9Zpp58>Y;;mAAw$tfRx;hbbob%(Uu#wssn^BTaj*Lt1C|JL+%CD+qQBQU5Ib)K zLQKM8TV}7mFYvuAn(NWXW4y^twww!<$xSiDFQ;u=q7J5{xA00I-J@(vA7pR3g8SCs zvZATVbWjy$!l#L8ZbMm(urSk3W`Z_!%NDJHBpQ zACeMAp#*(&Do~ofseUTlq_75Syfb%WO8aCUE3*7Cq>l}?x&b|pONo~Ksgm6QL}%cq zfvyCU#FC61QH>pbxYBEiuVH>(h3E?vDw1^oo;TP{j@N`lGkh$LbrTB;M9vv)GYQmd zZMe)5sJUaJUV~pxifU>>nmqLXza7yDK}0|ThC8m91z>twkR($9L#IV(w@8{-;#`56C2nRR910 diff --git a/pki/src/test/resources/keystore/partner1client1/keystore.jks b/pki/src/test/resources/keystore/partner1client1/keystore.jks deleted file mode 100644 index a51a778eff98c923cc099d529d66f134e80a932d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6817 zcmY+IRa6uJu!dn-x?yQh0qI&gR+^=eQjn06ZlpV1B%~Y3rCVa@?rxA$8l}5oulJrC z=RVB&=X~?eJpK;@4x!EhprV08sC6)~*_03C4ng<*eMA&EcVkFDFH9yc&E^Hk7DATfgdJnkLP3Uc1;VJ;S2 z%UchfTv@rW_=rMDpBp~TH6kln@*{e4%M zp7F3}0!~GH>k9KYANTzMz86#cNm0mP^6NmrPF>S@w1aM;9|*Y1w*noC_{uVGB(khr z%bS_S6c|7GY|J)2)Es>$ckEZ2ZrlqVKz2WfHlz6px@N9%w=$0# zdKV2r#cNFS0M^e$YKvm86>NO$Y5W&rZZ&Sf=*yBqFKp^xIl|gk1Hd-3>Y6i4Aob?qzT_i0YN~q| zoursbmEe-6A)NP#OUKAUjTx2i(9Yqn=ATf-80WKueRsa+33{JuzJtLrA; zG1%yjasD#89JW1d$$(B8s5)O&lH%o)mmb@JiyxVNbl7&S1{^y0^^Q+R&j<6H)K$N% z=ps|*#Z)(5N>(<`1d@;p{urGHA`g3kv1WDSe?22QkidWyVGl7Tl73dvA($K^3=H6$ zAELFEqsGSCD`_A+Y-;k&EIiYuzu?|qw66VF>mD@tJGsTpklVk|PPy7ng?uw|s`kaI z@t!Wjj4;`>Vlrv)?O%(snW{lz*h<`9jC(*0L6vT3ME2jaT^4!e!|QeN{`M7sfUCB!?!pE+P|CqTgaxlL1;qdd1 z^PuKyNuwg4(yOTMfMV6OaL~r?6nkI4ny>c~s$+bRLRj2;Z|05ZM81Qr03izE=^+P} z>@Jr}iTD+g63T_gOV!6JRC614H56rN_IzsZ1VCjpiMNkU_|e5|GLp$x;lWj}6F;>% zhCn~_LGSLbQWCimsVAmGL5&dEWIm@gZCJrxH>pfaqqI_6!iy2`2x{s=Z3~BPjCnip zHZ>AU1QU-67@1q5Vqh{jvY%)yslm}oa;S|~P95(0bf%F;{r!C2^2PPuCJlWbGEY1j zQE@1g+;={ox+-Sy9e$_vE2+-v&iL)nU}y68?xFP@BZG*-X!n#9*0aMeaq@PQlT&@E zvSvFWBR-9?+dGS=Dw7TMgPE8rd7b4P_N)u&GW|K>r|x90E;-K>oU{Mt>lK}V00zFc z?gN(_eUN?ktCO0qyErP$G1`|EZZ~OaieIEgkf%5K*u;~Xdn#)WVr{%yV6Oj-N^B7C zs~0a&oKZ|sKBKsyIHFkmQ(lx$DE25e|9Z!Nj2BG*e|9on5Rl}Zjf2H2ULihyu!x|b zfT$q95I6+X_P-`fjNA}VI+JVNVM!|~W%d`xTfo=nI9 zj7D?%Uzr;e0eG5;a8+Lk3wTD2me}ddXBBj2V7&0vEHH)1gn5N(wUfdtzDw=I zRm?4O#7r9GC$3XTZQlJl%%z=ZVn#I6^&noLX3j5|_CC!YXAO9L^J+?c=ZGOv`>}dm zOPdgt-^Us^@)@sHw>+1osFN1iSlolPkgTR{!%D2q$`b?s0?OwECOC}D+Cl&N(G4!Ag8b6wO3*m2tTbl}X~P|4IiI}6)y#u%O954-kuTMn`&;73-l z>)cZmT+|{|7}gumG<#CFaZ*Y3y$n9CwiHwAsFa#k{Fw!5>kn7^UUBG1#|KDb^GHvK+MxYP!b2^&8R3<X=GH;h%)AGew5T^2NoBj3B>@Mm74L*;ekpjh0qz-)p6-wME%NTifNBKAAJd%x3 zKYmWdD$q_%x4Rqk=yfppt4zwk47~G#g9PS`(c;{ElXjLmO$~Iyuv@Q2ejC0_ibk%d z(Af`e2})rkK@D2XSzQSV@1?lk8!*o?3XKc=P5=8KUkJCfO7vHl_Fbe%sxXRV=)BZC z<5!q_Ee{3AFODgxf0L8k`%(xT7Z90erGknXN&fv!?~#$|)Kox<-{0ddn|YJn7dES|Z*yxT+;%bs0wuv_^3O<3gsaVEh%#TE?=)8PQeh=8L$Bk* z_~TL+9;B!i@ka5*pX?8{8#C{8LjFX`0B0Cv21D98zieY$lI)JX~7wnasQ8T~VVZw%w2 z-dZ9Q=cY;D4x<)(VWaY0*0Z)5rkDheoLO&f3FPA=FbF47OEz~kyLicOfKZ32`RF;? z>nQ$XQ;-Jz%%nR01s7>Cjpjvrvv;US?tUi2%>aKTljB|Gpobi1UGuaI7fz~Q3#Y_; ziX2C6y}A8pWLXwQQij72{**FLf&C$wpfdfp!nJWV#2dSlEsaobqL}e=v>*#(yf41eB7+m&4u)p zvQ@S$95s&dN=8;`Z z2|zkRApBMuTaK6xii+#HnULV60lHRJflV z9t_f@3cx=vQdPnrkv<5ngg90fA`H(XCVzMv)y=kZ|Z76uA(VRuym}{D>6tnrKjFY?!r8VAV(|J z7V!=O61Z=JL~TZzy5IcPTaNp8`M3Tnj~~pqwg989{H{1`SURqoy{&ZeYNrL@N5cw} z%GNJ`*FqRbZ5j1nVU9A*Z&*C-IuOJb!Nb|Sn<*wZTKz4Y2zZ17Jf-g!Bi?IK(D=)m zG1k_rq;BF#!t2gSonxdbHnE(k3j^yxoorhKZg>jwUZI%PG?lF{ZZ1>{JvlQ1e_HNX zkbSkzSaawPyz@CW)=dX6Vx<;#h%%l6-%3=A)covL@~)=)HQvYOmkXfiHjr}|``9dy z%osS!ys3lbY(;^;S%Q&@?wakNC5dO8L3|)0wPot@4*O#z1><4da(N_(nrEOE?ReG| zV&td8_Hk4GZ6;N)g+jHlcb^L{s@$x1kv0ghqHg^3VQc+B7S3#O%H0e@l}5VC|M5$I z!KSjti4t96g0Ok~Lpx3+P#kKyo_&7O0EgHmGFlcWpO=Z&yNkNtiAe{ zeKPsyka=7D#6MD;GlM?gY>wCIa5YC)FLv{5Bqsypei;h6G=5)c)TjM@k$3aeMpdaM zZWl|B(TO%vSeCE#iA^2@w{=$-#p~nc&IbjV1KafqW&I-K_8zY+MnDGHJ5nXh{ z0G0%4`cKA$4eUJTw!4Cr3F2;>ipAxbNb`H!jS4If^(WL4*U#WEq#$8kw)9%CT)!eB zU$JJdrZwh)+-B@6L_hpz7%l;k#bB-Sr}-$##(Y%5Ut;kk*DBhJ5k)1emhuZ`fOl); z`=MVlRrl1fLNl?5z9RQP z@MR^XhheYAq-Vdgk~dPqul4Ok+E|7*0(M#dDeUc^!0{Iq3kH(@4h**YbYa0e-2*2w z;B7)^QVdgoUxR<=Ypa&Rh8C;FT{ZJN!J}A}<6Ij_T`7Ws&WRKU&^Ls;=J|)o>yTT0H^h_3xGy1DJndK%z znXVWX)XOwBr45dwnK=)<5G*F5GWWM&A>E&tSpF4VGLbwsI$V8Uqd~1re^;gCf7^<- z1Et)2`G#cuAZOBN_|B!%-@R9hd~?#$0J!^-=ZDU{O-^mWIv4!~qou2$GHqDh+H7i_ zqv>7ewG9i_N7_Kku;^F}OPh>Z5z1fOhqR4x%b-V$QmbfUnWHJcHq#>rqs`fw_my>) z2$J}>lhYn7QB7^%9P#GT|GQ^dC8fw2w5|~A%buM-tgZLUZpVTlsd@Ps z(}!Kg?BO8}OcS;T#0bVbj%9%Equhg(q(pM7jC#9kCz7a=pBpj6+&O1Qib5E1`r-Pw zC`)G7_R@l`p&Z$y^&9Q=<=$GVJKG-zkl!&ag%_g~>o?FsG{RRin9ym0i$-;PV6+OINMWv{Eychu=%;y{$ z3~+h}OwnvtsBvhMmzGwA%+E@Q2O%P)v>fCbj&-S<55+Y8bi+1U zcK2Qh#+yEY1byWDq5=RHQk8kk!mr(`->UE6H(#a$Xmm#B=(8siu0{foRQ^)o=>Q_L zZ%M+c@MX&;99;%tyks{c+@n=EEJ;I#BPyyWp!OuB$w5XLfFxVysZTrlm$c-g(eiky`S) z;SQFYAM)GSqOB0d*ZRH1rhr<9v>WFh3#M9KtWv)@2Oy*t!4v|*hyEWX6yC%tEyDEv8+E?CsSk68MPfhk!uXjDyKh(fc}3ZKaU5TJx>~7Q9L-Rs zDp+1J(=v^9_O`zlWrgSD!uSHqF!f!_%`cDd8Rfcl(^bS3rF?P5j&r=}^(HvN_-uYs ze0TZLBY@2Oz2R6xlaBV=Zrp0ljAG)NO{lvB*I<4*&|)LB^cYV1_jF+XNI54o5*v|q z%Eh9)cRl!SJvCZYd9L)jvj@F#j6V<Wma}vB)Fe$?I_=F$)u}7H1MDS*# zTSXlsO&;sR+T9zNW#7}{yidpTM57YJ)uWAICw1}0)UU-W!Y4*zW_ja@T=dfl;>m2B zox)@d9VG|HT}A>)kiac^$+`gKR%49IG}e1C8U^!DUs!_mWzU^QvY*`Ag;Up$J=TCm z!Evs>Q)PM(kdRl9O{K&Ro>r)q1>(4N#(40K;cs*UE*t zSnd?Jv)b`?vgcrrsvTZ+Is181zQwMuSz}`D_$}}WczZ~cuge=UkxwFLb=ngXCRAIv zMGkf1^`ViXDRqSw8P7zwcQ0qFj>WBB(b)yX_?w${AUQwE3`3Xh6V2wL;^&U>?=`5xz)xO_Ct518g1)AKoM6cMz%u3hpD_L&JB*xS*(pU(B&4cAW@#j3U zs_31V?A9hh3#G*+Oiw@QQj|4O4Ff&0;~qRjN8A10f8!nOU|>pHfoU4)RQ|;b!d_+% zNS!t#!=%EjVp%wTkh!HZIXZ5*to*$1r9+T0K40ppBoOH~w2?Y-0{ zMj9Eb**%cmxOVAFu)D^}$7*!i!+ZmI7=KEYIiQVwkaHn$LVl5FJzhmzPK$`w>e5`hhM$g5*rEK>bEw(vGy zb~xKA;@2+rZ)o6hPE6j_F0NJ;pRPEaW_-tn!)W|sz!GPHjqkDH1e5Rq(c_K12YX@7 z5WiEo(Zs+#2EFwOD5LsL({e^$ja=DHYXMA^KVB=_lH#)B=X^jjSDl?i#!og>wGEA# z%7eOWR(SbQQnSBA*~$$^L~2M^rSrJQd*H|Nz z;n0?v8i>R;cwWsuzdl-dZ`DI8Y);z9`gOqp?U5&nS|-ZMF1%98lbE?jlx%A%GVH6e zz=g}%LAQ&hFqhs_uk@=*t zFc{t%5thj|%g5_s#@RY?TU6RYJiyIZ1I=y-hUS#B+xnB|bJZ*W%`)N*=LT&M&c^Dj zP1ybMi0j6DNuIOXa@~oYz02->^vA@QoJ z7luD{zm7$&K}fHOb>7d4Dks17?6=fLI_P;R(qKRZ<5?YttEf89TceYw^|>b%@$*YX z11tM&h0}G_T8B!4hz>6fsl5eHVk$oM$PhJC=__&1fhEB7U~CL@4gxd)H986ql+##^ xizoPz@>Dr9?^}mDo?5=qzh7lqJ@4m>kY&xh&qQLJRr(OA-qB|O8Y(RJKLG4g|6l+B diff --git a/pki/src/test/resources/keystore/partner1client1/nss.cfg b/pki/src/test/resources/keystore/partner1client1/nss.cfg deleted file mode 100644 index 6cd0f7eb876..00000000000 --- a/pki/src/test/resources/keystore/partner1client1/nss.cfg +++ /dev/null @@ -1,6 +0,0 @@ - -name = NSScrypto-partner1client1 -nssSecmodDirectory = ./src/test/resources/keystore/partner1client1/nssdb -nssDbMode = readOnly -nssModule = keystore - diff --git a/pki/src/test/resources/keystore/partner1client1/truststore.jks b/pki/src/test/resources/keystore/partner1client1/truststore.jks deleted file mode 100644 index fcfd04602193433388053846383605f0eeb8aa64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3135 zcmc(hcTf}C9>=puh?LNT2*RZ|scvHEybDSb1f@#7SP-NrAWdorp(%1jDGJO50R<^a zmtqhQq^L+JiZrE)fB^ysNGRTba^?A)@y)z9;~zU`f9H2*cISJ}=d-&py)g}eK%le> zwlzZSPeCAn|9cOpF@(-iP99XIbp}BKtREym8`5D=01D;QCMoty%tTkA3Q!qLVGk;~ zx*R+}W(0#&C@%s?~;hlj2bPyN;V1Dfj5u=xu&~Bj#grRg}!+V6o~S|jrC*fEAYQ1;%DK;pHg&23SycZQPxkDFsc%k ze5gx;*()D=T>G_C+OkqwT8HOP3X{~4pG)DInE^O5tG|Fx@1-HhqpXrIYQ4hF#g#;1 zuCa{=6~Csw7E7wM?Q79}k$IVlu+C3kUEigPFM&m{Ts(F=zdr|XxR1w}2jOP+Mv()l zbEq(9sgIRc%OCRA9UQ52oeFlw7Rf&Dh&r(XZ(XOXa}pnXXsEi&Y5Q!s z2zP;9CxhE=DK`QYATOpKE1>r94R-0H1UsWx}#1Iu$=&`*o@hhrj=COa9T1JYkVKkas9xy|sm zZcQtmnKJ>(^2LqT^f6iP5)@2H2Eo9T%ORk(ocB-_q-mvAd6x$hsc^L8x(oi^V41L- zy|x6R{Yhmm#8pca`S|&x21vt$kbpiTb*V#kxkafj(rV_Z7o_{HX=}|CONU3L?Von+ z1x+mbNM=`t@TL1dq&WuU3hiZBuZqd!Wy$>P5RwMbD80nZvZBx~liq1yq|{q_e~6C@ zl&%`QL$($;yG8ykXE$#L&u#qSqTleJq2WJ8!@u(@{>Na0BGVC#(Pb9-1=lC9gcM9c z`o4?x7vuGF{Qb7I^FQf{4P^PEr|t02f*}7+GqHaSb%&aMhJJCCc3zKN3<~-dWpr@C zQ1Ysl_AM!0f_YKfWgwFtX*5;a-UusR{m(>OD=Q>gfy^~v8E11{ojkA{Um zix;o?IxV+EcG6mbs?{{_&kCUXyzRl%+^RnpQ3EZ$)u-VX) zPHWsvMX98<%LX#t>y&C+je6R;*I99V_MFBaW)~BaB89jznVQ-ot#A$rlbZL#EG{p9 zjH|!Ddo96YL0bu)`9#A&lf-$eREJLh^YT?ikWl7v&5TERu3yl11kdb1e+^+pimx+S z7|~4#-N%?pR&8lu`8oQ#|3RM~M9|QO0>IXO@v&~|08aasMSgc|w`|}LF4$qtqG{BW zVTkEaJP^E`uX191a70ED z=6&dyv*Ya1R%WX+W1SM!Y&!7ycwfkFDXfIGwjPL7`5pGjQHGgNS%xC(KKX))FttTQUZRmyJJfYIZWr?;DfCwf~5 z2##+;_(&51g(ifauR>7pi=33Uy>zkk9OF&usDYUDk+L4t9|lYN>ffI@q!(N}6{khGiNCjq(=@Y*v6QlV zRssR8tWAc-_8;&_xyJ>#gqTY@=7#ZCx6?1VeGXPS;NpN@7un^~6WxsEaga-mPdc76 zLn!@J5o3|<>a!$oaB&ej<;vPd@Z#!Q#A7P!l`4w#^G-`)hMwuk+_4*m*;5G2=hSYm zONV9mrMK})E9KU1?908Ie!vTuUk#q^n;V*o`Y>24CL%ivUDiX49qM9MQt;#^HQS7l z)d0&NFS0SpI1ufu#NVV6{^mzo2&D)cK3SY0u7tCkT%?u`i%|a@`!_B8&>R1$1;~G+ z1<4wdftQ_)!mc9mqHKAba%;ru9GneRxek*}Ay7p9S0^rb=6gAGDez^s7^`?T%|oe6 zrF$IVL!WHK9=uz-)Bl{EE)d%4e|lvp-N-1HtFX>hu>W_pfVU>X1y9g%Ea1A9(wL0gfoFuzI@!K)@LQ6#OR+>5wO0)MB}Xn>N;yiRtr{17B#?@F_4qs8YL@0T(c}4+yd6gi-VGov zJPdtONWKNW9&hK|??tsvI%|=mY&xrqr3>w5{XTUJofmz3dZMO9E$wCG;Ganq?X`Bn XZ<2LKa{5MOW6(E7@2ff42Gsryw|$O7 From 27a7de90c4c4bdd5cf2db4ede46ea28f8f4c061b Mon Sep 17 00:00:00 2001 From: ahamlat Date: Wed, 24 Apr 2024 14:20:12 +0200 Subject: [PATCH 30/59] Fix "CORS Rejected - Invalid origin" issue when origin header is empty (#6988) Signed-off-by: Ameziane H --- .../ethereum/api/jsonrpc/JsonRpcHttpService.java | 5 +++-- .../api/jsonrpc/JsonRpcHttpServiceCorsTest.java | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpService.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpService.java index bcadf993d10..af50b53bb1c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpService.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpService.java @@ -312,7 +312,8 @@ private Router buildRouter() { router .route() .handler( - CorsHandler.create(buildCorsRegexFromConfig()) + CorsHandler.create() + .addRelativeOrigin(buildCorsRegexFromConfig()) .allowedHeader("*") .allowedHeader("content-type")); router @@ -569,7 +570,7 @@ private String buildCorsRegexFromConfig() { return ""; } if (config.getCorsAllowedDomains().contains("*")) { - return ".*://.*"; + return ".*://.*|.*"; } else { final StringJoiner stringJoiner = new StringJoiner("|"); config.getCorsAllowedDomains().stream().filter(s -> !s.isEmpty()).forEach(stringJoiner::add); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceCorsTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceCorsTest.java index a875555af13..8ee1d33b792 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceCorsTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceCorsTest.java @@ -166,6 +166,18 @@ public void requestWithAnyOriginShouldSucceedWhenCorsIsStart() throws Exception } } + @Test + public void requestWithAnyOriginAndEmptyActualOriginShouldSucceed() throws Exception { + jsonRpcHttpService = createJsonRpcHttpServiceWithAllowedDomains("*"); + + final Request request = + new Request.Builder().url(jsonRpcHttpService.url()).header("Origin", "").build(); + + try (final Response response = client.newCall(request).execute()) { + assertThat(response.isSuccessful()).isTrue(); + } + } + @Test public void requestFromBrowserExtensionShouldSucceedWhenCorsIsStar() throws Exception { jsonRpcHttpService = createJsonRpcHttpServiceWithAllowedDomains("*"); From 34acf8c8393d8f4cdfdd01b5fe65677ff91bfcf4 Mon Sep 17 00:00:00 2001 From: Simon Dudley Date: Fri, 26 Apr 2024 10:35:07 +1000 Subject: [PATCH 31/59] Map SHA outputs correctly (#6998) Signed-off-by: Simon Dudley Co-authored-by: Sally MacFarlane --- .github/workflows/artifacts.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index b2848aaf381..657c4ebcbae 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -13,6 +13,9 @@ jobs: runs-on: ubuntu-22.04 permissions: contents: write + outputs: + tarSha: ${{steps.hashes.outputs.tarSha}} + zipSha: ${{steps.hashes.outputs.zipSha}} steps: - name: checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 @@ -32,6 +35,8 @@ jobs: id: hashes run: | cd build/distributions + echo "zipSha=$(shasum -a 256 besu*.zip)" + echo "tarSha=$(shasum -a 256 besu*.tar.gz)" echo "zipSha=$(shasum -a 256 besu*.zip)" >> $GITHUB_OUTPUT echo "tarSha=$(shasum -a 256 besu*.tar.gz)" >> $GITHUB_OUTPUT - name: upload tarball @@ -73,7 +78,7 @@ jobs: besu\bin\besu.bat --version publish: runs-on: ubuntu-22.04 - needs: testWindows + needs: [artifacts, testWindows] permissions: contents: write steps: @@ -91,8 +96,8 @@ jobs: build/distributions/besu*.tar.gz build/distributions/besu*.zip body: | - ${{steps.hashes.outputs.tarSha}} - ${{steps.hashes.outputs.zipSha}} + ${{needs.artifacts.outputs.tarSha}} + ${{needs.artifacts.outputs.zipSha}} artifactoryPublish: runs-on: ubuntu-22.04 needs: artifacts From 9cd50e140538505b2916c34093f3c6b7b0424232 Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Wed, 1 May 2024 08:03:54 +1200 Subject: [PATCH 32/59] EIP-7220: Updates (Exit -> Withdrawal Request) (#6967) Signed-off-by: Lucas Saldanha Signed-off-by: Gabriel-Trintinalia Co-authored-by: Gabriel-Trintinalia --- .../jsonrpc/engine/prague/genesis.json | 6 +- .../test-cases/01_cancun_prepare_payload.json | 8 +- .../test-cases/02_cancun_getPayloadV3.json | 8 +- .../test-cases/03_cancun_newPayloadV3.json | 8 +- .../04_cancun_forkchoiceUpdatedV3.json | 8 +- .../05_prague_forkchoiceUpdatedV3.json | 10 +- .../test-cases/06_prague_getPayloadV4.json | 11 +- .../test-cases/09_prague_newPayloadV4.json | 11 +- .../10_prague_forkchoiceUpdatedV3.json | 10 +- .../test-cases/11_prague_getPayloadV4.json | 10 +- .../test-cases/12_cancun_newPayloadV4.json | 10 +- ...ague_send_raw_transaction_create_exit.json | 4 +- .../14_prague_forkchoiceUpdatedV3.json | 10 +- .../test-cases/15_prague_getPayloadV4.json | 19 +- .../api/jsonrpc/JsonRpcResponseKey.java | 2 +- .../api/jsonrpc/JsonRpcResponseUtils.java | 9 +- .../engine/AbstractEngineNewPayload.java | 27 +-- ...> WithdrawalRequestValidatorProvider.java} | 15 +- .../parameters/EnginePayloadParameter.java | 13 +- ...r.java => WithdrawalRequestParameter.java} | 49 +++-- .../internal/results/BlockResultFactory.java | 2 +- .../results/EngineGetPayloadResultV4.java | 29 +-- .../engine/AbstractEngineNewPayloadTest.java | 20 +- .../engine/EngineGetPayloadV4Test.java | 2 +- .../engine/EngineNewPayloadV3Test.java | 4 +- .../engine/EngineNewPayloadV4Test.java | 53 ++--- ...va => WithdrawalRequestParameterTest.java} | 31 +-- ...java => WithdrawalRequestTestFixture.java} | 18 +- .../blockcreation/AbstractBlockCreator.java | 24 ++- .../besu/ethereum/chain/GenesisState.java | 6 +- .../hyperledger/besu/ethereum/core/Block.java | 11 +- .../besu/ethereum/core/BlockBody.java | 32 +-- .../besu/ethereum/core/BlockHeader.java | 13 +- .../ethereum/core/BlockHeaderBuilder.java | 16 +- .../ethereum/core/SealableBlockHeader.java | 10 +- ...idatorExit.java => WithdrawalRequest.java} | 36 ++-- ...der.java => WithdrawalRequestDecoder.java} | 10 +- ...der.java => WithdrawalRequestEncoder.java} | 13 +- .../mainnet/AbstractBlockProcessor.java | 6 +- .../besu/ethereum/mainnet/BodyValidation.java | 20 +- .../mainnet/MainnetBlockBodyValidator.java | 15 +- .../mainnet/MainnetProtocolSpecs.java | 2 +- .../PragueValidatorExitsValidator.java | 85 -------- .../PragueWithdrawalRequestValidator.java | 94 +++++++++ .../besu/ethereum/mainnet/ProtocolSpec.java | 10 +- .../ethereum/mainnet/ProtocolSpecBuilder.java | 11 +- .../mainnet/ValidatorExitContractHelper.java | 146 -------------- .../mainnet/ValidatorExitsValidator.java | 76 ------- .../WithdrawalRequestContractHelper.java | 186 ++++++++++++++++++ .../mainnet/WithdrawalRequestValidator.java | 82 ++++++++ .../ethereum/core/BlockDataGenerator.java | 27 +-- .../ethereum/core/BlockHeaderTestFixture.java | 8 +- .../ethereum/core/NonBesuBlockHeader.java | 2 +- .../BlockImportExceptionHandlingTest.java | 6 +- ...java => WithdrawalRequestDecoderTest.java} | 22 ++- ...java => WithdrawalRequestEncoderTest.java} | 18 +- .../mainnet/AbstractBlockProcessorTest.java | 5 +- .../MainnetBlockBodyValidatorTest.java | 10 +- .../mainnet/MainnetBlockProcessorTest.java | 5 +- .../PragueValidatorExitsValidatorTest.java | 81 -------- .../PragueWithdrawalRequestValidatorTest.java | 82 ++++++++ .../ethereum/mainnet/ValidationTestUtils.java | 8 +- .../mainnet/ValidatorExitsValidatorTest.java | 77 -------- .../ValidatorExitsValidatorTestFixtures.java | 155 --------------- ... WithdrawalRequestContractHelperTest.java} | 121 ++++++------ .../WithdrawalRequestValidatorTest.java | 76 +++++++ ...ithdrawalRequestValidatorTestFixtures.java | 175 ++++++++++++++++ .../manager/task/GetBodiesFromPeerTask.java | 21 +- .../task/GetBodiesFromPeerTaskTest.java | 9 +- .../backwardsync/ChainForTestCreator.java | 2 +- .../BlockchainReferenceTestCaseSpec.java | 8 +- .../referencetests/ReferenceTestEnv.java | 2 +- .../NoRewardProtocolScheduleWrapper.java | 2 +- plugin-api/build.gradle | 2 +- .../besu/plugin/data/BlockBody.java | 6 +- .../besu/plugin/data/BlockHeader.java | 10 +- ...idatorExit.java => WithdrawalRequest.java} | 18 +- 77 files changed, 1223 insertions(+), 1046 deletions(-) rename ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/{ValidatorExitsValidatorProvider.java => WithdrawalRequestValidatorProvider.java} (70%) rename ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/{ValidatorExitParameter.java => WithdrawalRequestParameter.java} (60%) rename ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/{ValidatorExitParameterTest.java => WithdrawalRequestParameterTest.java} (62%) rename ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/{ValidatorExitTestFixture.java => WithdrawalRequestTestFixture.java} (65%) rename ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/{ValidatorExit.java => WithdrawalRequest.java} (66%) rename ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/{ValidatorExitDecoder.java => WithdrawalRequestDecoder.java} (74%) rename ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/{ValidatorExitEncoder.java => WithdrawalRequestEncoder.java} (67%) delete mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidator.java create mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidator.java delete mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelper.java delete mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidator.java create mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelper.java create mode 100644 ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidator.java rename ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/{ValidatorExitDecoderTest.java => WithdrawalRequestDecoderTest.java} (66%) rename ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/{ValidatorExitEncoderTest.java => WithdrawalRequestEncoderTest.java} (70%) delete mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidatorTest.java create mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidatorTest.java delete mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTest.java delete mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTestFixtures.java rename ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/{ValidatorExitContractHelperTest.java => WithdrawalRequestContractHelperTest.java} (56%) create mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTest.java create mode 100644 ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTestFixtures.java rename plugin-api/src/main/java/org/hyperledger/besu/plugin/data/{ValidatorExit.java => WithdrawalRequest.java} (69%) diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json index 1c8a221858a..8c6a3d41d5a 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json @@ -36,10 +36,10 @@ "comment": "This is the account used to sign the transaction that creates a validator exit", "balance": "1000000000000000000000000000" }, - "0x0f1ee3e66777F27a7703400644C6fCE41527E017": { - "comment": "This is the runtime bytecode for the Validator Exit Smart Contract. It was created from the deployment transaction in EIP-7002 (https://eips.ethereum.org/EIPS/eip-7002#deployment)", + "0xEd8EA01d70Cb49726175BCf2778B9C982912e017": { + "comment": "This is the runtime bytecode for the Withdrawal Request Smart Contract. It was created from the deployment transaction in EIP-7002 (https://eips.ethereum.org/EIPS/eip-7002#deployment)", "balance": "0", - "code": "0x3373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b36603014156101325760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061013257600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460ed5780604402838201600302600401805490600101805490600101549160601b8160a01c17835260601b8160a01c17826020015260601b906040015260010160a6565b910180921460fe5790600255610109565b90505f6002555f6003555b5f546001546002828201116101205750505f610126565b01600290035b5f555f6001556044025ff35b5f5ffd", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b36603814156101215760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061012157600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460dd5780604c02838201600302600401805490600101805490600101549160601b83528260140152906034015260010160a6565b910180921460ed579060025560f8565b90505f6002555f6003555b5f5460015460028282011161010f5750505f610115565b01600290035b5f555f600155604c025ff35b5f5ffd", "storage": { "0x0000000000000000000000000000000000000000000000000000000000000000": "0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001": "0000000000000000000000000000000000000000000000000000000000000001", diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json index 8ac474dea4a..e810b1cad33 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json @@ -4,8 +4,8 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", - "safeBlockHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", + "headBlockHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", + "safeBlockHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", "finalizedBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", + "latestValidHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", "validationError": null }, - "payloadId": "0x2826439412796511" + "payloadId": "0x282643efdc841a11" } }, "statusCode": 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json index 6af7c3d2f91..8c7d4177c45 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV3", "params": [ - "0x2826439412796511" + "0x282643efdc841a11" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", + "parentHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xaddb5efeb344ec083c36c46c789e48e6509d82d754aaf4830ca4a51f5c904d84", + "stateRoot": "0xf4e9cba3bdb0cf3aa214612d87f2a1ab18cdc604a0af18f71110754a85de5d15", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -29,7 +29,7 @@ "blockNumber": "0x1", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", - "blockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331" + "blockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a" }, "blockValue": "0x0", "blobsBundle": { diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json index a5394d55b51..3145cd5439f 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json @@ -4,9 +4,9 @@ "method": "engine_newPayloadV3", "params": [ { - "parentHash": "0x4202d36ad886b24b9bb8c2451217884925577755ae053c8202ef4737134f3ae9", + "parentHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xaddb5efeb344ec083c36c46c789e48e6509d82d754aaf4830ca4a51f5c904d84", + "stateRoot": "0xf4e9cba3bdb0cf3aa214612d87f2a1ab18cdc604a0af18f71110754a85de5d15", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -17,7 +17,7 @@ "transactions": [], "withdrawals": [], "blockNumber": "0x1", - "blockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "blockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "excessBlobGas": "0x0", "blobGasUsed": "0x0" @@ -32,7 +32,7 @@ "id": 67, "result": { "status": "VALID", - "latestValidHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "latestValidHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", "validationError": null } }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json index f9025cc13f8..b578116448d 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", - "safeBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", - "finalizedBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331" + "headBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "safeBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "finalizedBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a" }, null ], @@ -18,7 +18,7 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "latestValidHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", "validationError": null }, "payloadId": null diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json index dd6f9edc87d..3e7d4b38595 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", - "safeBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", - "finalizedBlockHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331" + "headBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "safeBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "finalizedBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a" }, { "timestamp": "0x20", @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "latestValidHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", "validationError": null }, - "payloadId": "0x282643d6e5fecedf" + "payloadId": "0x282643882dfdc121" } }, "statusCode": 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json index 41b58811455..2608c920829 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV4", "params": [ - "0x282643d6e5fecedf" + "0x282643882dfdc121" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "parentHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xa194d7c0cff95750c211567fba96e394faa89644a661dd1c1b75426dc90728e2", + "stateRoot": "0x9d7467981e875b5b81ec6b9ab44300fa390d253b5d83da24fe58700f66a3925e", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -27,14 +27,15 @@ "transactions": [], "withdrawals": [], "depositReceipts": [], - "exits": [ + "withdrawalRequests": [ { "sourceAddress": "0xa4664c40aacebd82a2db79f0ea36c06bc6a19adb", + "amount" : "0x0", "validatorPubKey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e" } ], "blockNumber": "0x2", - "blockHash": "0x8494d3fc0fd54898100ffa2bda4c3ffdfb9faa3a4c2b2c1638970721e646c35b", + "blockHash": "0xb4be7cd1193f86d725c93275f9f9fe902c5fc34e1758b9ebcac371de370a1bdd", "blobGasUsed": "0x0", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json index f2c3bee85f5..c3ef237f912 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json @@ -4,9 +4,9 @@ "method": "engine_newPayloadV4", "params": [ { - "parentHash": "0xd93892197c5bd2130e6167edc292a1e92021bb9f292e6460aa889c3e2f972331", + "parentHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xd5d6e8c8d57e328871c5b81f078ab69e02466ab0e487c2c597effb4ffc185384", + "stateRoot": "0xdcd8284a4904f95448a522e4c47d9c2f1b4541c5f6f711b42692fb26e1e0d986", "logsBloom": "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -28,14 +28,15 @@ "withdrawalCredentials": "0x003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef2" } ], - "exits": [ + "withdrawalRequests": [ { "sourceAddress": "0xa4664c40aacebd82a2db79f0ea36c06bc6a19adb", + "amount" : "0x0", "validatorPubKey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e" } ], "blockNumber": "0x2", - "blockHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", + "blockHash": "0x57291a8c6fd912648046cae66dcae8b3f3d00b49e679c69566cd11286490458c", "receiptsRoot": "0x79ee3424eb720a3ad4b1c5a372bb8160580cbe4d893778660f34213c685627a9", "blobGasUsed": "0x0" }, @@ -49,7 +50,7 @@ "id": 67, "result": { "status": "VALID", - "latestValidHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", + "latestValidHash": "0x57291a8c6fd912648046cae66dcae8b3f3d00b49e679c69566cd11286490458c", "validationError": null } }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json index 188503e6215..a337f15a655 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", - "safeBlockHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", - "finalizedBlockHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae" + "headBlockHash": "0x57291a8c6fd912648046cae66dcae8b3f3d00b49e679c69566cd11286490458c", + "safeBlockHash": "0x57291a8c6fd912648046cae66dcae8b3f3d00b49e679c69566cd11286490458c", + "finalizedBlockHash": "0x57291a8c6fd912648046cae66dcae8b3f3d00b49e679c69566cd11286490458c" }, { "timestamp": "0x30", @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", + "latestValidHash": "0x57291a8c6fd912648046cae66dcae8b3f3d00b49e679c69566cd11286490458c", "validationError": null }, - "payloadId": "0x2826439bac38c031" + "payloadId": "0x282643832633dccf" } }, "statusCode" : 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json index 61d4e0976c8..4031b1c5694 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV4", "params": [ - "0x2826439bac38c031" + "0x282643832633dccf" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", + "parentHash": "0x57291a8c6fd912648046cae66dcae8b3f3d00b49e679c69566cd11286490458c", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xd5d6e8c8d57e328871c5b81f078ab69e02466ab0e487c2c597effb4ffc185384", + "stateRoot": "0xdcd8284a4904f95448a522e4c47d9c2f1b4541c5f6f711b42692fb26e1e0d986", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -27,9 +27,9 @@ "transactions": [], "withdrawals": [], "depositReceipts": [], - "exits": [], + "withdrawalRequests": [], "blockNumber": "0x3", - "blockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "blockHash": "0xbac2080fec3fecfb46b4fa1ce20767021f0e53e85b017d5b6a5f4ec43bdbf18b", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0" }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json index 9a0e933e3e3..96a019ca7ae 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json @@ -4,9 +4,9 @@ "method": "engine_newPayloadV3", "params": [ { - "parentHash": "0x2b3ae3a4c482f3dab43f0606af50dc8fd3ab981ba0659d477fa96955927736ae", + "parentHash": "0x57291a8c6fd912648046cae66dcae8b3f3d00b49e679c69566cd11286490458c", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xd5d6e8c8d57e328871c5b81f078ab69e02466ab0e487c2c597effb4ffc185384", + "stateRoot": "0xdcd8284a4904f95448a522e4c47d9c2f1b4541c5f6f711b42692fb26e1e0d986", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -17,9 +17,9 @@ "transactions": [], "withdrawals": [], "depositReceipts": [], - "exits": [], + "withdrawalRequests": [], "blockNumber": "0x3", - "blockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "blockHash": "0xbac2080fec3fecfb46b4fa1ce20767021f0e53e85b017d5b6a5f4ec43bdbf18b", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "excessBlobGas": "0x0", "blobGasUsed": "0x0" @@ -34,7 +34,7 @@ "id": 67, "result": { "status": "VALID", - "latestValidHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "latestValidHash": "0xbac2080fec3fecfb46b4fa1ce20767021f0e53e85b017d5b6a5f4ec43bdbf18b", "validationError": null } }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json index 28521cd657a..c9facbcc663 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json @@ -2,13 +2,13 @@ "request": { "jsonrpc": "2.0", "method": "eth_sendRawTransaction", - "params": ["0xf8978085e8d4a51000832dc6c0940f1ee3e66777f27a7703400644c6fce41527e01702b08706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243822fdfa01527e82d4155c70f3dc6c1df4ba26f9fb9d7cea03a402a17d630dd5465a82a9aa0378b1a45916be48d98b8ef547df0daf34f2e85037360887d954ccacdc069b222"], + "params": ["0xf8a08085e8d4a51000832dc6c094ed8ea01d70cb49726175bcf2778b9c982912e01702b8388706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf2430000000000000000822fe0a008135b1be1734b1b446de871eba10dbc317437eff377a7444f2ff6c06b5e5345a01bc61e0d4dd6d8e0b1f41d843fd9e07260c8be8c664ec2fa8c364477fa021176"], "id": 67 }, "response": { "jsonrpc": "2.0", "id": 67, - "result": "0xf4aaedb9020f067d720daf555a4ccb6756741365defb4cd9c94c5ba39d64a5e5" + "result": "0x764bfa879d0df4ff3962e32dfd45dc39ea18a35ccbd0dadf0bb58672537b1db2" }, "statusCode": 200 } \ No newline at end of file diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json index 1f2540d97dd..fdcb24d1dc8 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", - "safeBlockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", - "finalizedBlockHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771" + "headBlockHash": "0xbac2080fec3fecfb46b4fa1ce20767021f0e53e85b017d5b6a5f4ec43bdbf18b", + "safeBlockHash": "0xbac2080fec3fecfb46b4fa1ce20767021f0e53e85b017d5b6a5f4ec43bdbf18b", + "finalizedBlockHash": "0xbac2080fec3fecfb46b4fa1ce20767021f0e53e85b017d5b6a5f4ec43bdbf18b" }, { "timestamp": "0x40", @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "latestValidHash": "0xbac2080fec3fecfb46b4fa1ce20767021f0e53e85b017d5b6a5f4ec43bdbf18b", "validationError": null }, - "payloadId": "0x282643bbede61941" + "payloadId": "0x282643f22efc45bf" } }, "statusCode" : 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json index 8cb90d0c357..df041bc8308 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV4", "params": [ - "0x282643bbede61941" + "0x282643f22efc45bf" ], "id": 67 }, @@ -12,35 +12,36 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0x0bd5e56ac3552719a1af061ec3f48248e817fc8ac7306d611d195ae023e9f771", + "parentHash": "0xbac2080fec3fecfb46b4fa1ce20767021f0e53e85b017d5b6a5f4ec43bdbf18b", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0x99b256355fb804ab33458099469f9a2904b4b4e9171d023334b84d3f0e3a8d43", + "stateRoot": "0x4a387af05417b5767993052457ca85b2a5a172b3f809eb5cbcf17f070f398c3f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", - "gasUsed": "0x145b3", + "gasUsed": "0x145d3", "timestamp": "0x40", "extraData": "0x", "baseFeePerGas": "0x7", "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "transactions": [ - "0xf8978085e8d4a51000832dc6c0940f1ee3e66777f27a7703400644c6fce41527e01702b08706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243822fdfa01527e82d4155c70f3dc6c1df4ba26f9fb9d7cea03a402a17d630dd5465a82a9aa0378b1a45916be48d98b8ef547df0daf34f2e85037360887d954ccacdc069b222" + "0xf8a08085e8d4a51000832dc6c094ed8ea01d70cb49726175bcf2778b9c982912e01702b8388706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf2430000000000000000822fe0a008135b1be1734b1b446de871eba10dbc317437eff377a7444f2ff6c06b5e5345a01bc61e0d4dd6d8e0b1f41d843fd9e07260c8be8c664ec2fa8c364477fa021176" ], "withdrawals": [], "depositReceipts": [], - "exits": [ + "withdrawalRequests": [ { "sourceAddress": "0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f", + "amount": "0x0", "validatorPubKey": "0x8706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243" } ], - "receiptsRoot": "0xf2e2f11f0c553ed811be4460880996149ab3947bd0d2c1330457925a11254514", + "receiptsRoot": "0x765bd9d63cc10fa47117d6cc0958f15e55a3bde540d4ed15d220f573fbb82cba", "blobGasUsed": "0x0", - "blockHash": "0xb26d2fa98315d4d4cdcae8e5590964787b3343c11ff64eb548179687a612d467", + "blockHash": "0xe589c7673025f6844ffbaeddcf38d77d652669c60412e8506a2ae62ac80e9de4", "blockNumber": "0x4" }, - "blockValue": "0x12838c23cb1481b", + "blockValue": "0x12855dcd153473b", "blobsBundle": { "commitments": [], "proofs": [], diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseKey.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseKey.java index 249de3f239d..749e96b11e8 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseKey.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseKey.java @@ -39,5 +39,5 @@ public enum JsonRpcResponseKey { BASEFEE, WITHDRAWALS_ROOT, DEPOSITS_ROOT, - EXITS_ROOT + WITHDRAWAL_REQUESTS_ROOT } diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseUtils.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseUtils.java index 6f5881097ae..83bcece600d 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseUtils.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseUtils.java @@ -18,7 +18,6 @@ import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.COINBASE; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.DEPOSITS_ROOT; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.DIFFICULTY; -import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.EXITS_ROOT; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.EXTRA_DATA; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.GAS_LIMIT; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.GAS_USED; @@ -35,6 +34,7 @@ import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.TOTAL_DIFFICULTY; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.TRANSACTION_ROOT; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.WITHDRAWALS_ROOT; +import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.WITHDRAWAL_REQUESTS_ROOT; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.datatypes.Address; @@ -107,7 +107,10 @@ public JsonRpcResponse response( values.containsKey(WITHDRAWALS_ROOT) ? hash(values.get(WITHDRAWALS_ROOT)) : null; final Hash depositsRoot = values.containsKey(DEPOSITS_ROOT) ? hash(values.get(DEPOSITS_ROOT)) : null; - final Hash exitsRoot = values.containsKey(EXITS_ROOT) ? hash(values.get(EXITS_ROOT)) : null; + final Hash withdrawalRequestsRoot = + values.containsKey(WITHDRAWAL_REQUESTS_ROOT) + ? hash(values.get(WITHDRAWAL_REQUESTS_ROOT)) + : null; final List ommers = new ArrayList<>(); final BlockHeader header = @@ -133,7 +136,7 @@ public JsonRpcResponse response( null, // ToDo 4844: set with the value of excess_blob_gas field null, // TODO 4788: set with the value of the parent beacon block root field depositsRoot, - exitsRoot, + withdrawalRequestsRoot, blockHeaderFunctions); return new JsonRpcSuccessResponse( diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java index 4e4da9b2dd6..150f75fc54e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java @@ -21,7 +21,7 @@ import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.ExecutionEngineJsonRpcMethod.EngineStatus.SYNCING; import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.ExecutionEngineJsonRpcMethod.EngineStatus.VALID; import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.DepositsValidatorProvider.getDepositsValidator; -import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.ValidatorExitsValidatorProvider.getValidatorExitsValidator; +import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.WithdrawalRequestValidatorProvider.getWithdrawalRequestValidator; import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.WithdrawalsValidatorProvider.getWithdrawalsValidator; import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType.INVALID_PARAMS; @@ -37,8 +37,8 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.ExecutionEngineJsonRpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.DepositParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.EnginePayloadParameter; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.ValidatorExitParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalParameter; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalRequestParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; @@ -52,8 +52,8 @@ import org.hyperledger.besu.ethereum.core.Deposit; import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Transaction; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.core.encoding.EncodingContext; import org.hyperledger.besu.ethereum.core.encoding.TransactionDecoder; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; @@ -170,15 +170,18 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) return new JsonRpcErrorResponse(reqId, new JsonRpcError(INVALID_PARAMS, "Invalid deposits")); } - final Optional> maybeExits = - Optional.ofNullable(blockParam.getExits()) + final Optional> maybeWithdrawalRequests = + Optional.ofNullable(blockParam.getWithdrawalRequests()) .map( - exits -> - exits.stream().map(ValidatorExitParameter::toValidatorExit).collect(toList())); - if (!getValidatorExitsValidator( + withdrawalRequest -> + withdrawalRequest.stream() + .map(WithdrawalRequestParameter::toWithdrawalRequest) + .collect(toList())); + if (!getWithdrawalRequestValidator( protocolSchedule.get(), blockParam.getTimestamp(), blockParam.getBlockNumber()) - .validateValidatorExitParameter(maybeExits)) { - return new JsonRpcErrorResponse(reqId, new JsonRpcError(INVALID_PARAMS, "Invalid exits")); + .validateWithdrawalRequestParameter(maybeWithdrawalRequests)) { + return new JsonRpcErrorResponse( + reqId, new JsonRpcError(INVALID_PARAMS, "Invalid withdrawal requests")); } if (mergeContext.get().isSyncing()) { @@ -249,7 +252,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) : BlobGas.fromHexString(blockParam.getExcessBlobGas()), maybeParentBeaconBlockRoot.orElse(null), maybeDeposits.map(BodyValidation::depositsRoot).orElse(null), - maybeExits.map(BodyValidation::exitsRoot).orElse(null), + maybeWithdrawalRequests.map(BodyValidation::withdrawalRequestsRoot).orElse(null), headerFunctions); // ensure the block hash matches the blockParam hash @@ -317,7 +320,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) Collections.emptyList(), maybeWithdrawals, maybeDeposits, - maybeExits)); + maybeWithdrawalRequests)); if (maybeParentHeader.isEmpty()) { LOG.atDebug() diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/ValidatorExitsValidatorProvider.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalRequestValidatorProvider.java similarity index 70% rename from ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/ValidatorExitsValidatorProvider.java rename to ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalRequestValidatorProvider.java index 8e3dd2fc736..fdb12d07a39 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/ValidatorExitsValidatorProvider.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalRequestValidatorProvider.java @@ -19,13 +19,14 @@ import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; -import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidator; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator.ProhibitedWithdrawalRequests; import java.util.Optional; -public class ValidatorExitsValidatorProvider { +public class WithdrawalRequestValidatorProvider { - static ValidatorExitsValidator getValidatorExitsValidator( + static WithdrawalRequestValidator getWithdrawalRequestValidator( final ProtocolSchedule protocolSchedule, final long blockTimestamp, final long blockNumber) { final BlockHeader blockHeader = @@ -33,13 +34,13 @@ static ValidatorExitsValidator getValidatorExitsValidator( .timestamp(blockTimestamp) .number(blockNumber) .buildBlockHeader(); - return getValidatorExitsValidator(protocolSchedule.getByBlockHeader(blockHeader)); + return getWithdrawalRequestValidator(protocolSchedule.getByBlockHeader(blockHeader)); } - private static ValidatorExitsValidator getValidatorExitsValidator( + private static WithdrawalRequestValidator getWithdrawalRequestValidator( final ProtocolSpec protocolSchedule) { return Optional.ofNullable(protocolSchedule) - .map(ProtocolSpec::getExitsValidator) - .orElseGet(ValidatorExitsValidator.ProhibitedExits::new); + .map(ProtocolSpec::getWithdrawalRequestValidator) + .orElseGet(ProhibitedWithdrawalRequests::new); } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java index 0e9795126dd..a4dc999949e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java @@ -44,7 +44,7 @@ public class EnginePayloadParameter { private final Long blobGasUsed; private final String excessBlobGas; private final List deposits; - private final List exits; + private final List withdrawalRequests; /** * Creates an instance of EnginePayloadParameter. @@ -67,7 +67,7 @@ public class EnginePayloadParameter { * @param blobGasUsed QUANTITY, 64 Bits * @param excessBlobGas QUANTITY, 64 Bits * @param deposits List of deposit parameters. - * @param exits List of exits parameters. + * @param withdrawalRequestParameters List of withdrawal requests parameters. */ @JsonCreator public EnginePayloadParameter( @@ -89,7 +89,8 @@ public EnginePayloadParameter( @JsonProperty("blobGasUsed") final UnsignedLongParameter blobGasUsed, @JsonProperty("excessBlobGas") final String excessBlobGas, @JsonProperty("depositReceipts") final List deposits, - @JsonProperty("exits") final List exits) { + @JsonProperty("withdrawalRequests") + final List withdrawalRequestParameters) { this.blockHash = blockHash; this.parentHash = parentHash; this.feeRecipient = feeRecipient; @@ -108,7 +109,7 @@ public EnginePayloadParameter( this.blobGasUsed = blobGasUsed == null ? null : blobGasUsed.getValue(); this.excessBlobGas = excessBlobGas; this.deposits = deposits; - this.exits = exits; + this.withdrawalRequests = withdrawalRequestParameters; } public Hash getBlockHash() { @@ -183,7 +184,7 @@ public List getDeposits() { return deposits; } - public List getExits() { - return exits; + public List getWithdrawalRequests() { + return withdrawalRequests; } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameter.java similarity index 60% rename from ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitParameter.java rename to ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameter.java index efa0c809a27..0d7cb45779d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameter.java @@ -16,7 +16,8 @@ import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.BLSPublicKey; -import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.datatypes.GWei; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import java.util.Objects; @@ -25,33 +26,42 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.vertx.core.json.JsonObject; -public class ValidatorExitParameter { +public class WithdrawalRequestParameter { private final String sourceAddress; private final String validatorPubKey; + private final String amount; @JsonCreator - public ValidatorExitParameter( + public WithdrawalRequestParameter( @JsonProperty("sourceAddress") final String sourceAddress, - @JsonProperty("pubkey") final String validatorPubKey) { + @JsonProperty("pubkey") final String validatorPubKey, + @JsonProperty("amount") final String amount) { this.sourceAddress = sourceAddress; this.validatorPubKey = validatorPubKey; + this.amount = amount; } - public static ValidatorExitParameter fromValidatorExit(final ValidatorExit exit) { - return new ValidatorExitParameter( - exit.getSourceAddress().toHexString(), exit.getValidatorPubKey().toHexString()); + public static WithdrawalRequestParameter fromWithdrawalRequest( + final WithdrawalRequest withdrawalRequest) { + return new WithdrawalRequestParameter( + withdrawalRequest.getSourceAddress().toHexString(), + withdrawalRequest.getValidatorPubKey().toHexString(), + withdrawalRequest.getAmount().toShortHexString()); } - public ValidatorExit toValidatorExit() { - return new ValidatorExit( - Address.fromHexString(sourceAddress), BLSPublicKey.fromHexString(validatorPubKey)); + public WithdrawalRequest toWithdrawalRequest() { + return new WithdrawalRequest( + Address.fromHexString(sourceAddress), + BLSPublicKey.fromHexString(validatorPubKey), + GWei.fromHexString(amount)); } public JsonObject asJsonObject() { return new JsonObject() .put("sourceAddress", sourceAddress) - .put("validatorPubKey", validatorPubKey); + .put("validatorPubKey", validatorPubKey) + .put("amount", amount); } @JsonGetter @@ -64,29 +74,38 @@ public String getValidatorPubKey() { return validatorPubKey; } + @JsonGetter + public String getAmount() { + return amount; + } + @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - final ValidatorExitParameter that = (ValidatorExitParameter) o; + final WithdrawalRequestParameter that = (WithdrawalRequestParameter) o; return Objects.equals(sourceAddress, that.sourceAddress) - && Objects.equals(validatorPubKey, that.validatorPubKey); + && Objects.equals(validatorPubKey, that.validatorPubKey) + && Objects.equals(amount, that.amount); } @Override public int hashCode() { - return Objects.hash(sourceAddress, validatorPubKey); + return Objects.hash(sourceAddress, validatorPubKey, amount); } @Override public String toString() { - return "DepositParameter{" + return "WithdrawalRequestParameter{" + "sourceAddress='" + sourceAddress + '\'' + ", validatorPubKey='" + validatorPubKey + '\'' + + ", amount='" + + amount + + '\'' + '}'; } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResultFactory.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResultFactory.java index dc8d90bd46f..b453c76d742 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResultFactory.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResultFactory.java @@ -173,7 +173,7 @@ public EngineGetPayloadResultV4 payloadTransactionCompleteV4( txs, blockWithReceipts.getBlock().getBody().getWithdrawals(), blockWithReceipts.getBlock().getBody().getDeposits(), - blockWithReceipts.getBlock().getBody().getExits(), + blockWithReceipts.getBlock().getBody().getWithdrawalRequests(), Quantity.create(blockValue), blobsBundleV1); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java index de96619853f..aff2abd0aa6 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java @@ -15,12 +15,12 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.DepositParameter; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.ValidatorExitParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalParameter; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalRequestParameter; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.Deposit; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import java.util.List; import java.util.Optional; @@ -43,10 +43,11 @@ public EngineGetPayloadResultV4( final List transactions, final Optional> withdrawals, final Optional> deposits, - final Optional> exits, + final Optional> withdrawalRequests, final String blockValue, final BlobsBundleV1 blobsBundle) { - this.executionPayload = new PayloadResult(header, transactions, withdrawals, deposits, exits); + this.executionPayload = + new PayloadResult(header, transactions, withdrawals, deposits, withdrawalRequests); this.blockValue = blockValue; this.blobsBundle = blobsBundle; this.shouldOverrideBuilder = false; @@ -94,14 +95,14 @@ public static class PayloadResult { protected final List transactions; private final List withdrawals; private final List deposits; - private final List exits; + private final List withdrawalRequests; public PayloadResult( final BlockHeader header, final List transactions, final Optional> withdrawals, final Optional> deposits, - final Optional> exits) { + final Optional> withdrawalRequests) { this.blockNumber = Quantity.create(header.getNumber()); this.blockHash = header.getHash().toString(); this.parentHash = header.getParentHash().toString(); @@ -129,12 +130,12 @@ public PayloadResult( .map( ds -> ds.stream().map(DepositParameter::fromDeposit).collect(Collectors.toList())) .orElse(null); - this.exits = - exits + this.withdrawalRequests = + withdrawalRequests .map( - exit -> - exit.stream() - .map(ValidatorExitParameter::fromValidatorExit) + wr -> + wr.stream() + .map(WithdrawalRequestParameter::fromWithdrawalRequest) .collect(Collectors.toList())) .orElse(null); this.blobGasUsed = header.getBlobGasUsed().map(Quantity::create).orElse(Quantity.HEX_ZERO); @@ -219,9 +220,9 @@ public List getDeposits() { return deposits; } - @JsonGetter(value = "exits") - public List getExits() { - return exits; + @JsonGetter(value = "withdrawalRequests") + public List getWithdrawalRequests() { + return withdrawalRequests; } @JsonGetter(value = "feeRecipient") diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java index e7c1a23ea61..e6712373d28 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java @@ -41,8 +41,8 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.DepositParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.EnginePayloadParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.UnsignedLongParameter; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.ValidatorExitParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalParameter; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalRequestParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; @@ -55,8 +55,8 @@ import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; import org.hyperledger.besu.ethereum.core.Deposit; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; import org.hyperledger.besu.ethereum.mainnet.BodyValidation; import org.hyperledger.besu.ethereum.mainnet.DepositsValidator; @@ -411,7 +411,7 @@ protected EnginePayloadParameter mockEnginePayload( final List txs, final List withdrawals, final List deposits, - final List exits) { + final List withdrawalRequests) { return new EnginePayloadParameter( header.getHash(), header.getParentHash(), @@ -431,16 +431,17 @@ protected EnginePayloadParameter mockEnginePayload( header.getBlobGasUsed().map(UnsignedLongParameter::new).orElse(null), header.getExcessBlobGas().map(BlobGas::toHexString).orElse(null), deposits, - exits); + withdrawalRequests); } protected BlockHeader setupValidPayload( final BlockProcessingResult value, final Optional> maybeWithdrawals, final Optional> maybeDeposits, - final Optional> maybeExits) { + final Optional> maybeWithdrawalRequests) { - BlockHeader mockHeader = createBlockHeader(maybeWithdrawals, maybeDeposits, maybeExits); + BlockHeader mockHeader = + createBlockHeader(maybeWithdrawals, maybeDeposits, maybeWithdrawalRequests); when(blockchain.getBlockByHash(mockHeader.getHash())).thenReturn(Optional.empty()); // when(blockchain.getBlockHeader(mockHeader.getParentHash())) // .thenReturn(Optional.of(mock(BlockHeader.class))); @@ -474,14 +475,15 @@ protected JsonRpcError fromErrorResp(final JsonRpcResponse resp) { protected BlockHeader createBlockHeader( final Optional> maybeWithdrawals, final Optional> maybeDeposits, - final Optional> maybeExits) { - return createBlockHeaderFixture(maybeWithdrawals, maybeDeposits, maybeExits).buildHeader(); + final Optional> maybeWithdrawalRequests) { + return createBlockHeaderFixture(maybeWithdrawals, maybeDeposits, maybeWithdrawalRequests) + .buildHeader(); } protected BlockHeaderTestFixture createBlockHeaderFixture( final Optional> maybeWithdrawals, final Optional> maybeDeposits, - final Optional> maybeExits) { + final Optional> maybeWithdrawalRequests) { BlockHeader parentBlockHeader = new BlockHeaderTestFixture().baseFeePerGas(Wei.ONE).buildHeader(); return new BlockHeaderTestFixture() diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java index 9cfa8954b98..57b73546a18 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java @@ -148,7 +148,7 @@ public void shouldReturnBlockForKnownPayloadId() { final EngineGetPayloadResultV4 res = (EngineGetPayloadResultV4) r.getResult(); assertThat(res.getExecutionPayload().getWithdrawals()).isNotNull(); assertThat(res.getExecutionPayload().getDeposits()).isNotNull(); - assertThat(res.getExecutionPayload().getExits()).isNotNull(); + assertThat(res.getExecutionPayload().getWithdrawalRequests()).isNotNull(); assertThat(res.getExecutionPayload().getHash()) .isEqualTo(header.getHash().toString()); assertThat(res.getBlockValue()).isEqualTo(Quantity.create(0)); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java index 09dded51cab..a6b51ee6eb9 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java @@ -47,8 +47,8 @@ import org.hyperledger.besu.ethereum.core.Deposit; import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.TransactionTestFixture; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.core.encoding.EncodingContext; import org.hyperledger.besu.ethereum.core.encoding.TransactionEncoder; import org.hyperledger.besu.ethereum.mainnet.BodyValidation; @@ -151,7 +151,7 @@ public void shouldValidVersionedHash_whenListIsEmpty() { protected BlockHeader createBlockHeader( final Optional> maybeWithdrawals, final Optional> maybeDeposits, - final Optional> maybeExits) { + final Optional> maybeWithdrawalRequests) { BlockHeader parentBlockHeader = new BlockHeaderTestFixture() .baseFeePerGas(Wei.ONE) diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java index 4695d63dd3b..dd06414e45b 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java @@ -16,7 +16,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.DepositParameterTestFixture.DEPOSIT_PARAM_1; -import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.ValidatorExitTestFixture.VALIDATOR_EXIT_PARAMETER_1; +import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalRequestTestFixture.WITHDRAWAL_REQUEST_PARAMETER_1; import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType.INVALID_PARAMS; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.lenient; @@ -34,18 +34,18 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.DepositParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.EnginePayloadParameter; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.ValidatorExitParameter; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalRequestParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; import org.hyperledger.besu.ethereum.core.Deposit; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.mainnet.BodyValidation; import org.hyperledger.besu.ethereum.mainnet.DepositsValidator; -import org.hyperledger.besu.ethereum.mainnet.PragueValidatorExitsValidator; -import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidator; +import org.hyperledger.besu.ethereum.mainnet.PragueWithdrawalRequestValidator; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator.ProhibitedWithdrawalRequests; import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator; import java.util.Collections; @@ -175,9 +175,9 @@ public void shouldReturnInvalidIfDepositsIsNotNull_WhenDepositsProhibited() { } @Test - public void shouldReturnValidIfExitsIsNull_WhenExitsProhibited() { - when(protocolSpec.getExitsValidator()) - .thenReturn(new ValidatorExitsValidator.ProhibitedExits()); + public void shouldReturnValidIfWithdrawalRequestsIsNull_WhenWithdrawalRequestsAreProhibited() { + when(protocolSpec.getWithdrawalRequestValidator()) + .thenReturn(new ProhibitedWithdrawalRequests()); BlockHeader mockHeader = setupValidPayload( @@ -196,8 +196,9 @@ public void shouldReturnValidIfExitsIsNull_WhenExitsProhibited() { } @Test - public void shouldReturnInvalidIfExitsIsNull_WhenExitsAllowed() { - when(protocolSpec.getExitsValidator()).thenReturn(new PragueValidatorExitsValidator()); + public void shouldReturnInvalidIfWithdrawalRequestsIsNull_WhenWithdrawalRequestsAreAllowed() { + when(protocolSpec.getWithdrawalRequestValidator()) + .thenReturn(new PragueWithdrawalRequestValidator()); var resp = resp( @@ -213,18 +214,20 @@ public void shouldReturnInvalidIfExitsIsNull_WhenExitsAllowed() { } @Test - public void shouldReturnValidIfExitsIsNotNull_WhenExitsAllowed() { - final List validatorExitsParams = List.of(VALIDATOR_EXIT_PARAMETER_1); - final List validatorExits = - List.of(VALIDATOR_EXIT_PARAMETER_1.toValidatorExit()); - when(protocolSpec.getExitsValidator()).thenReturn(new PragueValidatorExitsValidator()); + public void shouldReturnValidIfWithdrawalRequestsIsNotNull_WhenWithdrawalRequestsAreAllowed() { + final List withdrawalRequestsParams = + List.of(WITHDRAWAL_REQUEST_PARAMETER_1); + final List withdrawalRequests = + List.of(WITHDRAWAL_REQUEST_PARAMETER_1.toWithdrawalRequest()); + when(protocolSpec.getWithdrawalRequestValidator()) + .thenReturn(new PragueWithdrawalRequestValidator()); BlockHeader mockHeader = setupValidPayload( new BlockProcessingResult(Optional.of(new BlockProcessingOutputs(null, List.of()))), Optional.empty(), Optional.empty(), - Optional.of(validatorExits)); + Optional.of(withdrawalRequests)); when(blockchain.getBlockHeader(mockHeader.getParentHash())) .thenReturn(Optional.of(mock(BlockHeader.class))); when(mergeCoordinator.getLatestValidAncestor(mockHeader)) @@ -232,16 +235,17 @@ public void shouldReturnValidIfExitsIsNotNull_WhenExitsAllowed() { var resp = resp( mockEnginePayload( - mockHeader, Collections.emptyList(), null, null, validatorExitsParams)); + mockHeader, Collections.emptyList(), null, null, withdrawalRequestsParams)); assertValidResponse(mockHeader, resp); } @Test - public void shouldReturnInvalidIfExitsIsNotNull_WhenExitsProhibited() { - final List validatorExits = List.of(); - when(protocolSpec.getExitsValidator()) - .thenReturn(new ValidatorExitsValidator.ProhibitedExits()); + public void + shouldReturnInvalidIfWithdrawalRequestsIsNotNull_WhenWithdrawalRequestsAreProhibited() { + final List withdrawalRequests = List.of(); + when(protocolSpec.getWithdrawalRequestValidator()) + .thenReturn(new ProhibitedWithdrawalRequests()); var resp = resp( @@ -251,7 +255,7 @@ public void shouldReturnInvalidIfExitsIsNotNull_WhenExitsProhibited() { Collections.emptyList(), null, null, - validatorExits)); + withdrawalRequests)); final JsonRpcError jsonRpcError = fromErrorResp(resp); assertThat(jsonRpcError.getCode()).isEqualTo(INVALID_PARAMS.getCode()); @@ -262,7 +266,7 @@ public void shouldReturnInvalidIfExitsIsNotNull_WhenExitsProhibited() { protected BlockHeader createBlockHeader( final Optional> maybeWithdrawals, final Optional> maybeDeposits, - final Optional> maybeExits) { + final Optional> maybeWithdrawalRequests) { BlockHeader parentBlockHeader = new BlockHeaderTestFixture() .baseFeePerGas(Wei.ONE) @@ -281,7 +285,8 @@ protected BlockHeader createBlockHeader( .excessBlobGas(BlobGas.ZERO) .blobGasUsed(0L) .depositsRoot(maybeDeposits.map(BodyValidation::depositsRoot).orElse(null)) - .exitsRoot(maybeExits.map(BodyValidation::exitsRoot).orElse(null)) + .withdrawalRequestsRoot( + maybeWithdrawalRequests.map(BodyValidation::withdrawalRequestsRoot).orElse(null)) .parentBeaconBlockRoot( maybeParentBeaconBlockRoot.isPresent() ? maybeParentBeaconBlockRoot : null) .buildHeader(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitParameterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameterTest.java similarity index 62% rename from ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitParameterTest.java rename to ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameterTest.java index a3a7c0d615a..041bef13352 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitParameterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameterTest.java @@ -17,35 +17,38 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; import static org.assertj.core.api.Assertions.assertThat; -import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.ValidatorExitTestFixture.VALIDATOR_EXIT_PARAMETER_1; +import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalRequestTestFixture.WITHDRAWAL_REQUEST_PARAMETER_1; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.BLSPublicKey; -import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.datatypes.GWei; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.junit.jupiter.api.Test; -public class ValidatorExitParameterTest { +public class WithdrawalRequestParameterTest { @Test - public void toValidatorExit() { - ValidatorExit expected = - new ValidatorExit( + public void toWithdrawalRequest() { + WithdrawalRequest expected = + new WithdrawalRequest( Address.fromHexString("0x814FaE9f487206471B6B0D713cD51a2D35980000"), BLSPublicKey.fromHexString( - "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e")); - assertThat(VALIDATOR_EXIT_PARAMETER_1.toValidatorExit()).isEqualTo(expected); + "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"), + GWei.ONE); + assertThat(WITHDRAWAL_REQUEST_PARAMETER_1.toWithdrawalRequest()).isEqualTo(expected); } @Test - public void fromValidatorExit() { - ValidatorExit validatorExit = - new ValidatorExit( + public void fromWithdrawalRequest() { + WithdrawalRequest withdrawalRequest = + new WithdrawalRequest( Address.fromHexString("0x814FaE9f487206471B6B0D713cD51a2D35980000"), BLSPublicKey.fromHexString( - "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e")); + "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"), + GWei.ONE); - assertThat(ValidatorExitParameter.fromValidatorExit(validatorExit)) - .isEqualTo(VALIDATOR_EXIT_PARAMETER_1); + assertThat(WithdrawalRequestParameter.fromWithdrawalRequest(withdrawalRequest)) + .isEqualTo(WITHDRAWAL_REQUEST_PARAMETER_1); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitTestFixture.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestTestFixture.java similarity index 65% rename from ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitTestFixture.java rename to ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestTestFixture.java index 6989ef1fb3c..0e234d07949 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/ValidatorExitTestFixture.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestTestFixture.java @@ -15,14 +15,18 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; -public class ValidatorExitTestFixture { +import org.hyperledger.besu.datatypes.GWei; - public static final ValidatorExitParameter VALIDATOR_EXIT_PARAMETER_1 = - new ValidatorExitParameter( +public class WithdrawalRequestTestFixture { + + public static final WithdrawalRequestParameter WITHDRAWAL_REQUEST_PARAMETER_1 = + new WithdrawalRequestParameter( "0x814fae9f487206471b6b0d713cd51a2d35980000", - "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"); - static final ValidatorExitParameter VALIDATOR_EXIT_PARAMETER_2 = - new ValidatorExitParameter( + "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e", + GWei.ONE.toShortHexString()); + static final WithdrawalRequestParameter WITHDRAWAL_REQUEST_PARAMETER_2 = + new WithdrawalRequestParameter( "0x758b8178a9a4b7206d1f648c4a77c515cbac7000", - "0x8706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243"); + "0x8706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243", + GWei.ONE.toShortHexString()); } diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java index aaa6dce2c4c..90bfe3569e8 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java @@ -36,8 +36,8 @@ import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader; import org.hyperledger.besu.ethereum.core.SealableBlockHeader; import org.hyperledger.besu.ethereum.core.Transaction; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.core.encoding.DepositDecoder; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; @@ -50,8 +50,8 @@ import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; -import org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper; -import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidator; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestContractHelper; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator; import org.hyperledger.besu.ethereum.mainnet.WithdrawalsProcessor; import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket; import org.hyperledger.besu.ethereum.mainnet.feemarket.ExcessBlobGasCalculator; @@ -256,11 +256,14 @@ protected BlockCreationResult createBlock( throwIfStopped(); - final ValidatorExitsValidator exitsValidator = newProtocolSpec.getExitsValidator(); - Optional> maybeExits = Optional.empty(); - if (exitsValidator.allowValidatorExits()) { - maybeExits = - Optional.of(ValidatorExitContractHelper.popExitsFromQueue(disposableWorldState)); + final WithdrawalRequestValidator withdrawalRequestsValidator = + newProtocolSpec.getWithdrawalRequestValidator(); + Optional> maybeWithdrawalRequests = Optional.empty(); + if (withdrawalRequestsValidator.allowWithdrawalRequests()) { + maybeWithdrawalRequests = + Optional.of( + WithdrawalRequestContractHelper.popWithdrawalRequestsFromQueue( + disposableWorldState)); } throwIfStopped(); @@ -300,7 +303,8 @@ protected BlockCreationResult createBlock( ? BodyValidation.withdrawalsRoot(maybeWithdrawals.get()) : null) .depositsRoot(maybeDeposits.map(BodyValidation::depositsRoot).orElse(null)) - .exitsRoot(maybeExits.map(BodyValidation::exitsRoot).orElse(null)); + .withdrawalRequestsRoot( + maybeWithdrawalRequests.map(BodyValidation::withdrawalRequestsRoot).orElse(null)); if (usage != null) { builder.blobGasUsed(usage.used.toLong()).excessBlobGas(usage.excessBlobGas); } @@ -317,7 +321,7 @@ protected BlockCreationResult createBlock( ommers, withdrawals, maybeDeposits, - maybeExits); + maybeWithdrawalRequests); final Block block = new Block(blockHeader, blockBody); operationTracer.traceEndBlock(blockHeader, blockBody); diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/GenesisState.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/GenesisState.java index 663f54a9a4b..5b3bf4e4c3a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/GenesisState.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/GenesisState.java @@ -30,8 +30,8 @@ import org.hyperledger.besu.ethereum.core.Deposit; import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.MutableWorldState; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration; @@ -151,10 +151,10 @@ private static BlockBody buildBody(final GenesisConfigFile config) { isShanghaiAtGenesis(config) ? Optional.of(emptyList()) : Optional.empty(); final Optional> deposits = isExperimentalEipsTimeAtGenesis(config) ? Optional.of(emptyList()) : Optional.empty(); - final Optional> exits = + final Optional> withdrawalRequests = isPragueAtGenesis(config) ? Optional.of(emptyList()) : Optional.empty(); - return new BlockBody(emptyList(), emptyList(), withdrawals, deposits, exits); + return new BlockBody(emptyList(), emptyList(), withdrawals, deposits, withdrawalRequests); } public Block getBlock() { diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Block.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Block.java index 4d511fd376e..70265f0de58 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Block.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Block.java @@ -63,7 +63,9 @@ public void writeTo(final RLPOutput out) { out.writeList(body.getOmmers(), BlockHeader::writeTo); body.getWithdrawals().ifPresent(withdrawals -> out.writeList(withdrawals, Withdrawal::writeTo)); body.getDeposits().ifPresent(deposits -> out.writeList(deposits, Deposit::writeTo)); - body.getExits().ifPresent(exits -> out.writeList(exits, ValidatorExit::writeTo)); + body.getWithdrawalRequests() + .ifPresent( + withdrawalRequests -> out.writeList(withdrawalRequests, WithdrawalRequest::writeTo)); out.endList(); } @@ -77,13 +79,14 @@ public static Block readFrom(final RLPInput in, final BlockHeaderFunctions hashF in.isEndOfCurrentList() ? Optional.empty() : Optional.of(in.readList(Withdrawal::readFrom)); final Optional> deposits = in.isEndOfCurrentList() ? Optional.empty() : Optional.of(in.readList(Deposit::readFrom)); - final Optional> exits = + final Optional> withdrawalRequests = in.isEndOfCurrentList() ? Optional.empty() - : Optional.of(in.readList(ValidatorExit::readFrom)); + : Optional.of(in.readList(WithdrawalRequest::readFrom)); in.leaveList(); - return new Block(header, new BlockBody(transactions, ommers, withdrawals, deposits, exits)); + return new Block( + header, new BlockBody(transactions, ommers, withdrawals, deposits, withdrawalRequests)); } @Override diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockBody.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockBody.java index 54ff30b84e0..545a17ac3ef 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockBody.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockBody.java @@ -38,14 +38,14 @@ public class BlockBody implements org.hyperledger.besu.plugin.data.BlockBody { private final List ommers; private final Optional> withdrawals; private final Optional> deposits; - private final Optional> exits; + private final Optional> withdrawalRequests; public BlockBody(final List transactions, final List ommers) { this.transactions = transactions; this.ommers = ommers; this.withdrawals = Optional.empty(); this.deposits = Optional.empty(); - this.exits = Optional.empty(); + this.withdrawalRequests = Optional.empty(); } public BlockBody( @@ -53,12 +53,12 @@ public BlockBody( final List ommers, final Optional> withdrawals, final Optional> deposits, - final Optional> exits) { + final Optional> withdrawalRequests) { this.transactions = transactions; this.ommers = ommers; this.withdrawals = withdrawals; this.deposits = deposits; - this.exits = exits; + this.withdrawalRequests = withdrawalRequests; } public static BlockBody empty() { @@ -92,13 +92,13 @@ public Optional> getWithdrawals() { } /** - * Returns the exits of the block. + * Returns the withdrawal requests of the block. * - * @return The optional list of exits included in the block. + * @return The optional list of withdrawal requests included in the block. */ @Override - public Optional> getExits() { - return exits; + public Optional> getWithdrawalRequests() { + return withdrawalRequests; } /** @@ -127,7 +127,8 @@ public void writeTo(final RLPOutput output) { output.writeList(getOmmers(), BlockHeader::writeTo); withdrawals.ifPresent(withdrawals -> output.writeList(withdrawals, Withdrawal::writeTo)); deposits.ifPresent(deposits -> output.writeList(deposits, Deposit::writeTo)); - exits.ifPresent(exits -> output.writeList(exits, ValidatorExit::writeTo)); + withdrawalRequests.ifPresent( + withdrawalRequests -> output.writeList(withdrawalRequests, WithdrawalRequest::writeTo)); } public static BlockBody readWrappedBodyFrom( @@ -182,7 +183,7 @@ public static BlockBody readFrom( : Optional.of(input.readList(Deposit::readFrom)), input.isEndOfCurrentList() ? Optional.empty() - : Optional.of(input.readList(ValidatorExit::readFrom))); + : Optional.of(input.readList(WithdrawalRequest::readFrom))); } @Override @@ -194,12 +195,12 @@ public boolean equals(final Object o) { && Objects.equals(ommers, blockBody.ommers) && Objects.equals(withdrawals, blockBody.withdrawals) && Objects.equals(deposits, blockBody.deposits) - && Objects.equals(exits, blockBody.exits); + && Objects.equals(withdrawalRequests, blockBody.withdrawalRequests); } @Override public int hashCode() { - return Objects.hash(transactions, ommers, withdrawals, deposits, exits); + return Objects.hash(transactions, ommers, withdrawals, deposits, withdrawalRequests); } public boolean isEmpty() { @@ -207,7 +208,7 @@ public boolean isEmpty() { && ommers.isEmpty() && withdrawals.isEmpty() && deposits.isEmpty() - && exits.isEmpty(); + && withdrawalRequests.isEmpty(); } @Override @@ -221,8 +222,9 @@ public String toString() { + withdrawals + ", deposits=" + deposits - + ", exits=" - + exits + + ", withdrawal_requests=" + + ", withdrawal_requests=" + + withdrawalRequests + '}'; } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java index 51a20996ce2..98e8e280ecb 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java @@ -176,8 +176,8 @@ public void writeTo(final RLPOutput out) { if (depositsRoot != null) { out.writeBytes(depositsRoot); } - if (exitsRoot != null) { - out.writeBytes(exitsRoot); + if (withdrawalRequestsRoot != null) { + out.writeBytes(withdrawalRequestsRoot); } out.endList(); } @@ -289,8 +289,8 @@ public String toString() { if (depositsRoot != null) { sb.append("depositsRoot=").append(depositsRoot); } - if (exitsRoot != null) { - sb.append("exitsRoot=").append(exitsRoot); + if (withdrawalRequestsRoot != null) { + sb.append("exitsRoot=").append(withdrawalRequestsRoot); } return sb.append("}").toString(); } @@ -326,7 +326,10 @@ public static org.hyperledger.besu.ethereum.core.BlockHeader convertPluginBlockH .getDepositsRoot() .map(h -> Hash.fromHexString(h.toHexString())) .orElse(null), - pluginBlockHeader.getExitsRoot().map(h -> Hash.fromHexString(h.toHexString())).orElse(null), + pluginBlockHeader + .getWithdrawalRequestsRoot() + .map(h -> Hash.fromHexString(h.toHexString())) + .orElse(null), blockHeaderFunctions); } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java index 33c1450cd05..68572e93839 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java @@ -46,7 +46,7 @@ public class BlockHeaderBuilder { private Hash withdrawalsRoot = null; private Hash depositsRoot = null; - private Hash exitsRoot = null; + private Hash withdrawalRequests = null; private Hash receiptsRoot; @@ -126,7 +126,7 @@ public static BlockHeaderBuilder fromHeader(final BlockHeader header) { .excessBlobGas(header.getExcessBlobGas().orElse(null)) .parentBeaconBlockRoot(header.getParentBeaconBlockRoot().orElse(null)) .depositsRoot(header.getDepositsRoot().orElse(null)) - .exitsRoot(header.getExitsRoot().orElse(null)); + .withdrawalRequestsRoot(header.getWithdrawalRequestsRoot().orElse(null)); } public static BlockHeaderBuilder fromBuilder(final BlockHeaderBuilder fromBuilder) { @@ -151,7 +151,7 @@ public static BlockHeaderBuilder fromBuilder(final BlockHeaderBuilder fromBuilde .excessBlobGas(fromBuilder.excessBlobGas) .parentBeaconBlockRoot(fromBuilder.parentBeaconBlockRoot) .depositsRoot(fromBuilder.depositsRoot) - .exitsRoot(fromBuilder.exitsRoot) + .withdrawalRequestsRoot(fromBuilder.withdrawalRequests) .blockHeaderFunctions(fromBuilder.blockHeaderFunctions); toBuilder.nonce = fromBuilder.nonce; return toBuilder; @@ -182,7 +182,7 @@ public BlockHeader buildBlockHeader() { excessBlobGas, parentBeaconBlockRoot, depositsRoot, - exitsRoot, + withdrawalRequests, blockHeaderFunctions); } @@ -225,7 +225,7 @@ public SealableBlockHeader buildSealableBlockHeader() { excessBlobGas, parentBeaconBlockRoot, depositsRoot, - exitsRoot); + withdrawalRequests); } private void validateBlockHeader() { @@ -290,7 +290,7 @@ public BlockHeaderBuilder populateFrom(final SealableBlockHeader sealableBlockHe sealableBlockHeader.getExcessBlobGas().ifPresent(this::excessBlobGas); sealableBlockHeader.getParentBeaconBlockRoot().ifPresent(this::parentBeaconBlockRoot); depositsRoot(sealableBlockHeader.getDepositsRoot().orElse(null)); - exitsRoot(sealableBlockHeader.getExitsRoot().orElse(null)); + withdrawalRequestsRoot(sealableBlockHeader.getWithdrawalRequestsRoot().orElse(null)); return this; } @@ -410,8 +410,8 @@ public BlockHeaderBuilder depositsRoot(final Hash hash) { return this; } - public BlockHeaderBuilder exitsRoot(final Hash hash) { - this.exitsRoot = hash; + public BlockHeaderBuilder withdrawalRequestsRoot(final Hash hash) { + this.withdrawalRequests = hash; return this; } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/SealableBlockHeader.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/SealableBlockHeader.java index f11c73eed74..1f07f4a5a87 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/SealableBlockHeader.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/SealableBlockHeader.java @@ -45,7 +45,7 @@ public class SealableBlockHeader extends ProcessableBlockHeader { protected final Hash depositsRoot; - protected final Hash exitsRoot; + protected final Hash withdrawalRequestsRoot; protected final Long blobGasUsed; @@ -72,7 +72,7 @@ protected SealableBlockHeader( final BlobGas excessBlobGas, final Bytes32 parentBeaconBlockRoot, final Hash depositsRoot, - final Hash exitsRoot) { + final Hash withdrawalRequestsRoot) { super( parentHash, coinbase, @@ -89,7 +89,7 @@ protected SealableBlockHeader( this.withdrawalsRoot = withdrawalsRoot; this.depositsRoot = depositsRoot; this.receiptsRoot = receiptsRoot; - this.exitsRoot = exitsRoot; + this.withdrawalRequestsRoot = withdrawalRequestsRoot; this.logsBloom = logsBloom; this.gasUsed = gasUsed; this.extraData = extraData; @@ -178,8 +178,8 @@ public Optional getDepositsRoot() { return Optional.ofNullable(depositsRoot); } - public Optional getExitsRoot() { - return Optional.ofNullable(exitsRoot); + public Optional getWithdrawalRequestsRoot() { + return Optional.ofNullable(withdrawalRequestsRoot); } /** diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ValidatorExit.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/WithdrawalRequest.java similarity index 66% rename from ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ValidatorExit.java rename to ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/WithdrawalRequest.java index d45bb0d465b..c083221e985 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ValidatorExit.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/WithdrawalRequest.java @@ -16,9 +16,10 @@ import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.BLSPublicKey; +import org.hyperledger.besu.datatypes.GWei; import org.hyperledger.besu.datatypes.PublicKey; -import org.hyperledger.besu.ethereum.core.encoding.ValidatorExitDecoder; -import org.hyperledger.besu.ethereum.core.encoding.ValidatorExitEncoder; +import org.hyperledger.besu.ethereum.core.encoding.WithdrawalRequestDecoder; +import org.hyperledger.besu.ethereum.core.encoding.WithdrawalRequestEncoder; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.ethereum.rlp.RLPInput; import org.hyperledger.besu.ethereum.rlp.RLPOutput; @@ -27,26 +28,29 @@ import org.apache.tuweni.bytes.Bytes; -public class ValidatorExit implements org.hyperledger.besu.plugin.data.ValidatorExit { +public class WithdrawalRequest implements org.hyperledger.besu.plugin.data.WithdrawalRequest { private final Address sourceAddress; private final BLSPublicKey validatorPubKey; + private final GWei amount; - public ValidatorExit(final Address sourceAddress, final BLSPublicKey validatorPubKey) { + public WithdrawalRequest( + final Address sourceAddress, final BLSPublicKey validatorPubKey, final GWei amount) { this.sourceAddress = sourceAddress; this.validatorPubKey = validatorPubKey; + this.amount = amount; } - public static ValidatorExit readFrom(final Bytes rlpBytes) { + public static WithdrawalRequest readFrom(final Bytes rlpBytes) { return readFrom(RLP.input(rlpBytes)); } - public static ValidatorExit readFrom(final RLPInput rlpInput) { - return ValidatorExitDecoder.decode(rlpInput); + public static WithdrawalRequest readFrom(final RLPInput rlpInput) { + return WithdrawalRequestDecoder.decode(rlpInput); } public void writeTo(final RLPOutput out) { - ValidatorExitEncoder.encode(this, out); + WithdrawalRequestEncoder.encode(this, out); } @Override @@ -59,13 +63,20 @@ public PublicKey getValidatorPubKey() { return validatorPubKey; } + @Override + public GWei getAmount() { + return amount; + } + @Override public String toString() { - return "ValidatorExit{" + return "WithdrawalRequest{" + "sourceAddress=" + sourceAddress + " validatorPubKey=" + validatorPubKey + + " amount=" + + amount + '}'; } @@ -77,13 +88,14 @@ public boolean equals(final Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final ValidatorExit that = (ValidatorExit) o; + final WithdrawalRequest that = (WithdrawalRequest) o; return Objects.equals(sourceAddress, that.sourceAddress) - && Objects.equals(validatorPubKey, that.validatorPubKey); + && Objects.equals(validatorPubKey, that.validatorPubKey) + && Objects.equals(amount, that.amount); } @Override public int hashCode() { - return Objects.hash(sourceAddress, validatorPubKey); + return Objects.hash(sourceAddress, validatorPubKey, amount); } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoder.java similarity index 74% rename from ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitDecoder.java rename to ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoder.java index 90a80d52782..d9c020cc47d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoder.java @@ -16,17 +16,19 @@ import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.BLSPublicKey; -import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.datatypes.GWei; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.rlp.RLPInput; -public class ValidatorExitDecoder { +public class WithdrawalRequestDecoder { - public static ValidatorExit decode(final RLPInput rlpInput) { + public static WithdrawalRequest decode(final RLPInput rlpInput) { rlpInput.enterList(); final Address sourceAddress = Address.readFrom(rlpInput); final BLSPublicKey validatorPublicKey = BLSPublicKey.readFrom(rlpInput); + final GWei amount = GWei.of(rlpInput.readUInt64Scalar()); rlpInput.leaveList(); - return new ValidatorExit(sourceAddress, validatorPublicKey); + return new WithdrawalRequest(sourceAddress, validatorPublicKey, amount); } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoder.java similarity index 67% rename from ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitEncoder.java rename to ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoder.java index 94903bac1ad..3ec97d66480 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoder.java @@ -14,22 +14,23 @@ */ package org.hyperledger.besu.ethereum.core.encoding; -import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.ethereum.rlp.RLPOutput; import org.apache.tuweni.bytes.Bytes; -public class ValidatorExitEncoder { +public class WithdrawalRequestEncoder { - public static void encode(final ValidatorExit exit, final RLPOutput rlpOutput) { + public static void encode(final WithdrawalRequest withdrawalRequest, final RLPOutput rlpOutput) { rlpOutput.startList(); - rlpOutput.writeBytes(exit.getSourceAddress()); - rlpOutput.writeBytes(exit.getValidatorPubKey()); + rlpOutput.writeBytes(withdrawalRequest.getSourceAddress()); + rlpOutput.writeBytes(withdrawalRequest.getValidatorPubKey()); + rlpOutput.writeUInt64Scalar(withdrawalRequest.getAmount()); rlpOutput.endList(); } - public static Bytes encodeOpaqueBytes(final ValidatorExit exit) { + public static Bytes encodeOpaqueBytes(final WithdrawalRequest exit) { return RLP.encode(rlpOutput -> encode(exit, rlpOutput)); } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java index 8f929542351..f600f07393a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java @@ -196,10 +196,10 @@ public BlockProcessingResult processBlock( } } - final ValidatorExitsValidator exitsValidator = protocolSpec.getExitsValidator(); - if (exitsValidator.allowValidatorExits()) { + final WithdrawalRequestValidator exitsValidator = protocolSpec.getWithdrawalRequestValidator(); + if (exitsValidator.allowWithdrawalRequests()) { // Performing system-call logic - ValidatorExitContractHelper.popExitsFromQueue(worldState); + WithdrawalRequestContractHelper.popWithdrawalRequestsFromQueue(worldState); } if (!rewardCoinbase(worldState, blockHeader, ommers, skipZeroBlockRewards)) { diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java index d7a1611e659..2caacdb25cf 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java @@ -21,13 +21,13 @@ import org.hyperledger.besu.ethereum.core.Deposit; import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.TransactionReceipt; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.core.encoding.DepositEncoder; import org.hyperledger.besu.ethereum.core.encoding.EncodingContext; import org.hyperledger.besu.ethereum.core.encoding.TransactionEncoder; -import org.hyperledger.besu.ethereum.core.encoding.ValidatorExitEncoder; import org.hyperledger.besu.ethereum.core.encoding.WithdrawalEncoder; +import org.hyperledger.besu.ethereum.core.encoding.WithdrawalRequestEncoder; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.ethereum.trie.MerkleTrie; import org.hyperledger.besu.ethereum.trie.patricia.SimpleMerklePatriciaTrie; @@ -106,16 +106,20 @@ public static Hash depositsRoot(final List deposits) { } /** - * Generates the exits root for a list of exits + * Generates the withdrawal request root for a list of withdrawal request * - * @param exits list of exits - * @return the exits root + * @param withdrawalRequests list of withdrawal request + * @return the withdrawal request root */ - public static Hash exitsRoot(final List exits) { + public static Hash withdrawalRequestsRoot(final List withdrawalRequests) { final MerkleTrie trie = trie(); - IntStream.range(0, exits.size()) - .forEach(i -> trie.put(indexKey(i), ValidatorExitEncoder.encodeOpaqueBytes(exits.get(i)))); + IntStream.range(0, withdrawalRequests.size()) + .forEach( + i -> + trie.put( + indexKey(i), + WithdrawalRequestEncoder.encodeOpaqueBytes(withdrawalRequests.get(i)))); return Hash.wrap(trie.getRootHash()); } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidator.java index cb26168f6a9..1a263d808fe 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidator.java @@ -20,7 +20,7 @@ import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.TransactionReceipt; -import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.evm.log.LogsBloomFilter; import java.util.HashSet; @@ -109,8 +109,8 @@ public boolean validateBodyLight( return false; } - if (body.getExits().isPresent()) { - if (!validateExits(block, body.getExits().get())) { + if (body.getWithdrawalRequests().isPresent()) { + if (!validateWithdrawalRequests(block, body.getWithdrawalRequests().get())) { return false; } } @@ -331,9 +331,10 @@ private boolean validateDeposits(final Block block, final List exits) { - final ValidatorExitsValidator exitsValidator = - protocolSchedule.getByBlockHeader(block.getHeader()).getExitsValidator(); - return exitsValidator.validateExitsInBlock(block, exits); + private boolean validateWithdrawalRequests( + final Block block, final List withdrawalRequests) { + final WithdrawalRequestValidator withdrawalRequestValidator = + protocolSchedule.getByBlockHeader(block.getHeader()).getWithdrawalRequestValidator(); + return withdrawalRequestValidator.validateWithdrawalRequestsInBlock(block, withdrawalRequests); } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java index 6483223d9ca..d109499cd12 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java @@ -764,7 +764,7 @@ static ProtocolSpecBuilder pragueDefinition( // use prague precompiled contracts .precompileContractRegistryBuilder(MainnetPrecompiledContractRegistries::prague) .depositsValidator(new DepositsValidator.AllowedDeposits(depositContractAddress)) - .exitsValidator(new PragueValidatorExitsValidator()) + .withdrawalRequestsValidator(new PragueWithdrawalRequestValidator()) .name("Prague"); } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidator.java deleted file mode 100644 index a5fd3bb72cd..00000000000 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidator.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright contributors to Hyperledger Besu. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.ethereum.mainnet; - -import org.hyperledger.besu.datatypes.Hash; -import org.hyperledger.besu.ethereum.core.Block; -import org.hyperledger.besu.ethereum.core.ValidatorExit; - -import java.util.List; -import java.util.Optional; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PragueValidatorExitsValidator implements ValidatorExitsValidator { - - private static final Logger LOG = LoggerFactory.getLogger(PragueValidatorExitsValidator.class); - - @Override - public boolean allowValidatorExits() { - return true; - } - - @Override - public boolean validateValidatorExitParameter( - final Optional> validatorExits) { - return validatorExits.isPresent(); - } - - @Override - public boolean validateExitsInBlock(final Block block, final List expectedExits) { - final Hash blockHash = block.getHash(); - - if (block.getHeader().getExitsRoot().isEmpty()) { - LOG.warn("Block {} must contain exits_root", blockHash); - return false; - } - - if (block.getBody().getExits().isEmpty()) { - LOG.warn("Block {} must contain exits (even if empty list)", blockHash); - return false; - } - - final List exitsInBlock = block.getBody().getExits().get(); - // TODO Do we need to allow for customization? (e.g. if the value changes in the next fork) - if (exitsInBlock.size() > ValidatorExitContractHelper.MAX_EXITS_PER_BLOCK) { - LOG.warn("Block {} has more than the allowed maximum number of exits", blockHash); - return false; - } - - // Validate exits_root - final Hash expectedExitsRoot = BodyValidation.exitsRoot(exitsInBlock); - if (!expectedExitsRoot.equals(block.getHeader().getExitsRoot().get())) { - LOG.warn( - "Block {} exits_root does not match expected hash root for exits in block", blockHash); - return false; - } - - // Validate exits - final boolean expectedExitsMatch = expectedExits.equals(exitsInBlock); - if (!expectedExitsMatch) { - LOG.warn( - "Block {} has a mismatch between its exits and expected exits (in_block = {}, expected = {})", - blockHash, - exitsInBlock, - expectedExits); - return false; - } - - return true; - } -} diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidator.java new file mode 100644 index 00000000000..5272812e382 --- /dev/null +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidator.java @@ -0,0 +1,94 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.hyperledger.besu.ethereum.mainnet; + +import org.hyperledger.besu.datatypes.Hash; +import org.hyperledger.besu.ethereum.core.Block; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; + +import java.util.List; +import java.util.Optional; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class PragueWithdrawalRequestValidator implements WithdrawalRequestValidator { + + private static final Logger LOG = LoggerFactory.getLogger(PragueWithdrawalRequestValidator.class); + + @Override + public boolean allowWithdrawalRequests() { + return true; + } + + @Override + public boolean validateWithdrawalRequestParameter( + final Optional> withdrawalRequests) { + return withdrawalRequests.isPresent(); + } + + @Override + public boolean validateWithdrawalRequestsInBlock( + final Block block, final List withdrawalRequests) { + final Hash blockHash = block.getHash(); + + if (block.getHeader().getWithdrawalRequestsRoot().isEmpty()) { + LOG.warn("Block {} must contain withdrawal_requests_root", blockHash); + return false; + } + + if (block.getBody().getWithdrawalRequests().isEmpty()) { + LOG.warn("Block {} must contain withdrawal requests (even if empty list)", blockHash); + return false; + } + + final List withdrawalRequestsInBlock = + block.getBody().getWithdrawalRequests().get(); + // TODO Do we need to allow for customization? (e.g. if the value changes in the next fork) + if (withdrawalRequestsInBlock.size() + > WithdrawalRequestContractHelper.MAX_WITHDRAWAL_REQUESTS_PER_BLOCK) { + LOG.warn( + "Block {} has more than the allowed maximum number of withdrawal requests", blockHash); + return false; + } + + // Validate exits_root + final Hash expectedWithdrawalsRequestRoot = + BodyValidation.withdrawalRequestsRoot(withdrawalRequestsInBlock); + if (!expectedWithdrawalsRequestRoot.equals( + block.getHeader().getWithdrawalRequestsRoot().get())) { + LOG.warn( + "Block {} withdrawal_requests_root does not match expected hash root for withdrawal requests in block", + blockHash); + return false; + } + + // Validate exits + final boolean expectedWithdrawalRequestMatch = + withdrawalRequests.equals(withdrawalRequestsInBlock); + if (!expectedWithdrawalRequestMatch) { + LOG.warn( + "Block {} has a mismatch between its withdrawal requests and expected withdrawal requests (in_block = {}, " + + "expected = {})", + blockHash, + withdrawalRequestsInBlock, + withdrawalRequests); + return false; + } + + return true; + } +} diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java index e2ed95f8390..0bd129a111e 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java @@ -76,7 +76,7 @@ public class ProtocolSpec { private final WithdrawalsValidator withdrawalsValidator; private final Optional withdrawalsProcessor; private final DepositsValidator depositsValidator; - private final ValidatorExitsValidator exitsValidator; + private final WithdrawalRequestValidator withdrawalRequestValidator; private final boolean isPoS; private final boolean isReplayProtectionSupported; @@ -139,7 +139,7 @@ public ProtocolSpec( final WithdrawalsValidator withdrawalsValidator, final Optional withdrawalsProcessor, final DepositsValidator depositsValidator, - final ValidatorExitsValidator exitsValidator, + final WithdrawalRequestValidator withdrawalRequestValidator, final boolean isPoS, final boolean isReplayProtectionSupported) { this.name = name; @@ -167,7 +167,7 @@ public ProtocolSpec( this.withdrawalsValidator = withdrawalsValidator; this.withdrawalsProcessor = withdrawalsProcessor; this.depositsValidator = depositsValidator; - this.exitsValidator = exitsValidator; + this.withdrawalRequestValidator = withdrawalRequestValidator; this.isPoS = isPoS; this.isReplayProtectionSupported = isReplayProtectionSupported; } @@ -373,8 +373,8 @@ public DepositsValidator getDepositsValidator() { return depositsValidator; } - public ValidatorExitsValidator getExitsValidator() { - return exitsValidator; + public WithdrawalRequestValidator getWithdrawalRequestValidator() { + return withdrawalRequestValidator; } /** diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpecBuilder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpecBuilder.java index 8f2e1583e82..9efd6244167 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpecBuilder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpecBuilder.java @@ -26,6 +26,7 @@ import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.core.BlockImporter; import org.hyperledger.besu.ethereum.core.PrivacyParameters; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator.ProhibitedWithdrawalRequests; import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.FlexiblePrivacyPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPluginPrecompiledContract; @@ -75,7 +76,8 @@ public class ProtocolSpecBuilder { new WithdrawalsValidator.ProhibitedWithdrawals(); private WithdrawalsProcessor withdrawalsProcessor; private DepositsValidator depositsValidator = new DepositsValidator.ProhibitedDeposits(); - private ValidatorExitsValidator exitsValidator = new ValidatorExitsValidator.ProhibitedExits(); + private WithdrawalRequestValidator withdrawalRequestValidator = + new ProhibitedWithdrawalRequests(); private FeeMarket feeMarket = FeeMarket.legacy(); private BadBlockManager badBlockManager; private PoWHasher powHasher = PoWHasher.ETHASH_LIGHT; @@ -265,8 +267,9 @@ public ProtocolSpecBuilder depositsValidator(final DepositsValidator depositsVal return this; } - public ProtocolSpecBuilder exitsValidator(final ValidatorExitsValidator exitsValidator) { - this.exitsValidator = exitsValidator; + public ProtocolSpecBuilder withdrawalRequestsValidator( + final WithdrawalRequestValidator withdrawalRequestValidator) { + this.withdrawalRequestValidator = withdrawalRequestValidator; return this; } @@ -389,7 +392,7 @@ public ProtocolSpec build(final ProtocolSchedule protocolSchedule) { withdrawalsValidator, Optional.ofNullable(withdrawalsProcessor), depositsValidator, - exitsValidator, + withdrawalRequestValidator, isPoS, isReplayProtectionSupported); } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelper.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelper.java deleted file mode 100644 index 52e41a641c8..00000000000 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelper.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright Hyperledger Besu Contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.ethereum.mainnet; - -import org.hyperledger.besu.datatypes.Address; -import org.hyperledger.besu.datatypes.BLSPublicKey; -import org.hyperledger.besu.datatypes.Hash; -import org.hyperledger.besu.ethereum.core.MutableWorldState; -import org.hyperledger.besu.ethereum.core.ValidatorExit; -import org.hyperledger.besu.evm.account.Account; -import org.hyperledger.besu.evm.account.MutableAccount; -import org.hyperledger.besu.evm.worldstate.WorldUpdater; - -import java.util.ArrayList; -import java.util.List; - -import com.google.common.annotations.VisibleForTesting; -import org.apache.tuweni.bytes.Bytes; -import org.apache.tuweni.units.bigints.UInt256; - -/** - * Helper for interacting with the Validator Exit Contract (https://eips.ethereum.org/EIPS/eip-7002) - * - *

TODO: Please note that this is not the spec-way of interacting with the Validator Exit - * contract. See https://github.com/hyperledger/besu/issues/6918 for more information. - */ -public class ValidatorExitContractHelper { - - public static final Address VALIDATOR_EXIT_ADDRESS = - Address.fromHexString("0x0f1ee3e66777F27a7703400644C6fCE41527E017"); - - @VisibleForTesting - // Storage slot to store the difference between number of exits since last block and target exits - // per block - static final UInt256 EXCESS_EXITS_STORAGE_SLOT = UInt256.valueOf(0L); - - @VisibleForTesting - // Storage slot to store the number of exits added since last block - static final UInt256 EXIT_COUNT_STORAGE_SLOT = UInt256.valueOf(1L); - - @VisibleForTesting - static final UInt256 EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT = UInt256.valueOf(2L); - - @VisibleForTesting - static final UInt256 EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT = UInt256.valueOf(3L); - - private static final UInt256 EXIT_MESSAGE_QUEUE_STORAGE_OFFSET = UInt256.valueOf(4L); - // How many slots each exit occupies in the account state - private static final int EXIT_MESSAGE_STORAGE_SLOT_SIZE = 3; - @VisibleForTesting static final int MAX_EXITS_PER_BLOCK = 16; - private static final int TARGET_EXITS_PER_BLOCK = 2; - - /* - Pop the expected list of exits from the validator exit smart contract, updating the queue pointers and other - control variables in the contract state. - */ - public static List popExitsFromQueue(final MutableWorldState mutableWorldState) { - final WorldUpdater worldUpdater = mutableWorldState.updater(); - final MutableAccount account = worldUpdater.getAccount(VALIDATOR_EXIT_ADDRESS); - if (Hash.EMPTY.equals(account.getCodeHash())) { - return List.of(); - } - - final List exits = dequeueExits(account); - updateExcessExits(account); - resetExitCount(account); - - worldUpdater.commit(); - - return exits; - } - - private static List dequeueExits(final MutableAccount account) { - final UInt256 queueHeadIndex = account.getStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT); - final UInt256 queueTailIndex = account.getStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT); - - final List exits = peekExpectedExits(account, queueHeadIndex, queueTailIndex); - - final UInt256 newQueueHeadIndex = queueHeadIndex.plus(exits.size()); - if (newQueueHeadIndex.equals(queueTailIndex)) { - // Queue is empty, reset queue pointers - account.setStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, UInt256.valueOf(0L)); - account.setStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT, UInt256.valueOf(0L)); - } else { - account.setStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, newQueueHeadIndex); - } - - return exits; - } - - private static List peekExpectedExits( - final Account account, final UInt256 queueHeadIndex, final UInt256 queueTailIndex) { - final long numExitsInQueue = queueTailIndex.subtract(queueHeadIndex).toLong(); - final long numExitsDequeued = Long.min(numExitsInQueue, MAX_EXITS_PER_BLOCK); - - final List exits = new ArrayList<>(); - - for (int i = 0; i < numExitsDequeued; i++) { - final UInt256 queueStorageSlot = - EXIT_MESSAGE_QUEUE_STORAGE_OFFSET.plus( - queueHeadIndex.plus(i).multiply(EXIT_MESSAGE_STORAGE_SLOT_SIZE)); - final Address sourceAddress = - Address.wrap(account.getStorageValue(queueStorageSlot).toBytes().slice(12, 20)); - final BLSPublicKey validatorPubKey = - BLSPublicKey.wrap( - Bytes.concatenate( - account - .getStorageValue(queueStorageSlot.plus(1)) - .toBytes() - .slice(0, 32), // no need to slice - account.getStorageValue(queueStorageSlot.plus(2)).toBytes().slice(0, 16))); - - exits.add(new ValidatorExit(sourceAddress, validatorPubKey)); - } - - return exits; - } - - private static void updateExcessExits(final MutableAccount account) { - final UInt256 previousExcessExits = account.getStorageValue(EXCESS_EXITS_STORAGE_SLOT); - final UInt256 exitCount = account.getStorageValue(EXIT_COUNT_STORAGE_SLOT); - - UInt256 newExcessExits = UInt256.valueOf(0L); - if (previousExcessExits.plus(exitCount).toLong() > TARGET_EXITS_PER_BLOCK) { - newExcessExits = previousExcessExits.plus(exitCount).subtract(TARGET_EXITS_PER_BLOCK); - } - - account.setStorageValue(EXCESS_EXITS_STORAGE_SLOT, newExcessExits); - } - - private static void resetExitCount(final MutableAccount account) { - account.setStorageValue(EXIT_COUNT_STORAGE_SLOT, UInt256.valueOf(0L)); - } -} diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidator.java deleted file mode 100644 index 762947597ba..00000000000 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidator.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright contributors to Hyperledger Besu - * - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.ethereum.mainnet; - -import org.hyperledger.besu.ethereum.core.Block; -import org.hyperledger.besu.ethereum.core.ValidatorExit; - -import java.util.List; -import java.util.Optional; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public interface ValidatorExitsValidator { - - boolean allowValidatorExits(); - - boolean validateValidatorExitParameter(Optional> validatorExits); - - boolean validateExitsInBlock(Block block, List validatorExits); - - /** Used before Prague */ - class ProhibitedExits implements ValidatorExitsValidator { - - private static final Logger LOG = LoggerFactory.getLogger(ProhibitedExits.class); - - @Override - public boolean allowValidatorExits() { - return false; - } - - /** - * Before Prague we do not expect to have execution layer triggered exits, so it is expected the - * optional parameter will be empty - * - * @param validatorExits Optional list of exits - * @return true, if valid, false otherwise - */ - @Override - public boolean validateValidatorExitParameter( - final Optional> validatorExits) { - return validatorExits.isEmpty(); - } - - @Override - public boolean validateExitsInBlock( - final Block block, final List validatorExits) { - final Optional> maybeExits = block.getBody().getExits(); - if (maybeExits.isPresent()) { - LOG.warn("Block {} contains exits but exits are prohibited", block.getHash()); - return false; - } - - if (block.getHeader().getExitsRoot().isPresent()) { - LOG.warn("Block {} header contains exits_root but exits are prohibited", block.getHash()); - return false; - } - - return true; - } - } -} diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelper.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelper.java new file mode 100644 index 00000000000..2eef89c4075 --- /dev/null +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelper.java @@ -0,0 +1,186 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.mainnet; + +import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.BLSPublicKey; +import org.hyperledger.besu.datatypes.GWei; +import org.hyperledger.besu.datatypes.Hash; +import org.hyperledger.besu.ethereum.core.MutableWorldState; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; +import org.hyperledger.besu.evm.account.Account; +import org.hyperledger.besu.evm.account.MutableAccount; +import org.hyperledger.besu.evm.worldstate.WorldUpdater; + +import java.util.ArrayList; +import java.util.List; + +import com.google.common.annotations.VisibleForTesting; +import org.apache.tuweni.bytes.Bytes; +import org.apache.tuweni.units.bigints.UInt256; +import org.apache.tuweni.units.bigints.UInt64; + +/** + * Helper for interacting with the Validator Withdrawal Request Contract + * (https://eips.ethereum.org/EIPS/eip-7002) + * + *

TODO: Please note that this is not the spec-way of interacting with the Validator Withdrawal + * Request contract. See https://github.com/hyperledger/besu/issues/6918 for more information. + */ +public class WithdrawalRequestContractHelper { + + public static final Address WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS = + Address.fromHexString("0xEd8EA01d70Cb49726175BCf2778B9C982912e017"); + + @VisibleForTesting + // Storage slot to store the difference between number of withdrawal requests since last block and + // target withdrawal requests + // per block + static final UInt256 EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT = UInt256.valueOf(0L); + + @VisibleForTesting + // Storage slot to store the number of withdrawal requests added since last block + static final UInt256 WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT = UInt256.valueOf(1L); + + @VisibleForTesting + static final UInt256 WITHDRAWAL_REQUEST_QUEUE_HEAD_STORAGE_SLOT = UInt256.valueOf(2L); + + @VisibleForTesting + static final UInt256 WITHDRAWAL_REQUEST_QUEUE_TAIL_STORAGE_SLOT = UInt256.valueOf(3L); + + private static final UInt256 WITHDRAWAL_REQUEST_QUEUE_STORAGE_OFFSET = UInt256.valueOf(4L); + + // How many slots each withdrawal request occupies in the account state + private static final int WITHDRAWAL_REQUEST_STORAGE_SLOT_SIZE = 3; + + @VisibleForTesting static final int MAX_WITHDRAWAL_REQUESTS_PER_BLOCK = 16; + + private static final int TARGET_WITHDRAWAL_REQUESTS_PER_BLOCK = 2; + + // TODO-lucas Add MIN_WITHDRAWAL_REQUEST_FEE and WITHDRAWAL_REQUEST_FEE_UPDATE_FRACTION + + /* + Pop the expected list of withdrawal requests from the smart contract, updating the queue pointers and other + control variables in the contract state. + */ + public static List popWithdrawalRequestsFromQueue( + final MutableWorldState mutableWorldState) { + final WorldUpdater worldUpdater = mutableWorldState.updater(); + final MutableAccount account = worldUpdater.getAccount(WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS); + if (Hash.EMPTY.equals(account.getCodeHash())) { + return List.of(); + } + + final List withdrawalRequests = dequeueWithdrawalRequests(account); + updateExcessWithdrawalRequests(account); + resetWithdrawalRequestsCount(account); + + worldUpdater.commit(); + + return withdrawalRequests; + } + + private static List dequeueWithdrawalRequests(final MutableAccount account) { + final UInt256 queueHeadIndex = + account.getStorageValue(WITHDRAWAL_REQUEST_QUEUE_HEAD_STORAGE_SLOT); + final UInt256 queueTailIndex = + account.getStorageValue(WITHDRAWAL_REQUEST_QUEUE_TAIL_STORAGE_SLOT); + + final List withdrawalRequests = + peekExpectedWithdrawalRequests(account, queueHeadIndex, queueTailIndex); + + final UInt256 newQueueHeadIndex = queueHeadIndex.plus(withdrawalRequests.size()); + if (newQueueHeadIndex.equals(queueTailIndex)) { + // Queue is empty, reset queue pointers + account.setStorageValue(WITHDRAWAL_REQUEST_QUEUE_HEAD_STORAGE_SLOT, UInt256.valueOf(0L)); + account.setStorageValue(WITHDRAWAL_REQUEST_QUEUE_TAIL_STORAGE_SLOT, UInt256.valueOf(0L)); + } else { + account.setStorageValue(WITHDRAWAL_REQUEST_QUEUE_HEAD_STORAGE_SLOT, newQueueHeadIndex); + } + + return withdrawalRequests; + } + + /* + ;; Each stack element has the following layout: + ;; + ;; A: addr + ;; 0x00 | 00 00 00 00 00 00 00 00 00 00 00 00 aa aa aa aa + ;; 0x10 | aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa + ;; + ;; B: pk[0:32] + ;; 0x00 | bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb + ;; 0x10 | bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb + ;; + ;; C: pk[32:48] ++ am[0:8] -> pk2_am + ;; 0x00 | cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc + ;; 0x10 | dd dd dd dd dd dd dd dd 00 00 00 00 00 00 00 00 + ;; + ;; To get these three stack elements into the correct contiguous format, it is + ;; necessary to combine them in the follow form: + ;; + ;; (A[12:32] ++ B[0:12], B[12:32] ++ C[0:12], C[12:24]) + */ + private static List peekExpectedWithdrawalRequests( + final Account account, final UInt256 queueHeadIndex, final UInt256 queueTailIndex) { + final long numRequestsInQueue = queueTailIndex.subtract(queueHeadIndex).toLong(); + final long numRequestsDequeued = + Long.min(numRequestsInQueue, MAX_WITHDRAWAL_REQUESTS_PER_BLOCK); + + final List withdrawalRequests = new ArrayList<>(); + + for (int i = 0; i < numRequestsDequeued; i++) { + final UInt256 queueStorageSlot = + WITHDRAWAL_REQUEST_QUEUE_STORAGE_OFFSET.plus( + queueHeadIndex.plus(i).multiply(WITHDRAWAL_REQUEST_STORAGE_SLOT_SIZE)); + final Address sourceAddress = + Address.wrap(account.getStorageValue(queueStorageSlot).toBytes().slice(12, 20)); + final BLSPublicKey validatorPubKey = + BLSPublicKey.wrap( + Bytes.concatenate( + account + .getStorageValue(queueStorageSlot.plus(1)) + .toBytes() + .slice(0, 32), // no need to slice + account.getStorageValue(queueStorageSlot.plus(2)).toBytes().slice(0, 16))); + final UInt64 amount = + UInt64.fromBytes(account.getStorageValue(queueStorageSlot.plus(2)).slice(16, 8)); + + withdrawalRequests.add( + new WithdrawalRequest(sourceAddress, validatorPubKey, GWei.of(amount))); + } + + return withdrawalRequests; + } + + private static void updateExcessWithdrawalRequests(final MutableAccount account) { + final UInt256 previousExcessRequests = + account.getStorageValue(EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT); + final UInt256 requestsCount = account.getStorageValue(WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT); + + UInt256 newExcessRequests = UInt256.valueOf(0L); + if (previousExcessRequests.plus(requestsCount).toLong() + > TARGET_WITHDRAWAL_REQUESTS_PER_BLOCK) { + newExcessRequests = + previousExcessRequests.plus(requestsCount).subtract(TARGET_WITHDRAWAL_REQUESTS_PER_BLOCK); + } + + account.setStorageValue(EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT, newExcessRequests); + } + + private static void resetWithdrawalRequestsCount(final MutableAccount account) { + account.setStorageValue(WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT, UInt256.valueOf(0L)); + } +} diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidator.java new file mode 100644 index 00000000000..ce1a61588ec --- /dev/null +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidator.java @@ -0,0 +1,82 @@ +/* + * Copyright contributors to Hyperledger Besu + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.hyperledger.besu.ethereum.mainnet; + +import org.hyperledger.besu.ethereum.core.Block; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; + +import java.util.List; +import java.util.Optional; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public interface WithdrawalRequestValidator { + + boolean allowWithdrawalRequests(); + + boolean validateWithdrawalRequestParameter(Optional> withdrawalRequests); + + boolean validateWithdrawalRequestsInBlock( + Block block, List withdrawalRequests); + + /** Used before Prague */ + class ProhibitedWithdrawalRequests implements WithdrawalRequestValidator { + + private static final Logger LOG = LoggerFactory.getLogger(ProhibitedWithdrawalRequests.class); + + @Override + public boolean allowWithdrawalRequests() { + return false; + } + + /** + * Before Prague we do not expect to have execution layer withdrawal requests, so it is expected + * the optional parameter will be empty + * + * @param withdrawalRequests Optional list of withdrawal requests + * @return true, if valid, false otherwise + */ + @Override + public boolean validateWithdrawalRequestParameter( + final Optional> withdrawalRequests) { + return withdrawalRequests.isEmpty(); + } + + @Override + public boolean validateWithdrawalRequestsInBlock( + final Block block, final List withdrawalRequests) { + final Optional> maybeWithdrawalRequests = + block.getBody().getWithdrawalRequests(); + if (maybeWithdrawalRequests.isPresent()) { + LOG.warn( + "Block {} contains withdrawal requests but withdrawal requests are prohibited", + block.getHash()); + return false; + } + + if (block.getHeader().getWithdrawalRequestsRoot().isPresent()) { + LOG.warn( + "Block {} header contains withdrawal_requests_root but withdrawal requests are prohibited", + block.getHash()); + return false; + } + + return true; + } + } +} diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java index 7b88503c926..cafe8bb82e6 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java @@ -304,7 +304,7 @@ public BlockHeader header(final long number, final BlockBody body, final BlockOp .nonce(blockNonce) .withdrawalsRoot(options.getWithdrawalsRoot(null)) .depositsRoot(options.getDepositsRoot(null)) - .exitsRoot(options.getExitsRoot(null)) + .withdrawalRequestsRoot(options.getWithdrawalRequestsRoot(null)) .blockHeaderFunctions( options.getBlockHeaderFunctions(new MainnetBlockHeaderFunctions())); options.getBaseFee(Optional.of(Wei.of(uint256(2)))).ifPresent(blockHeaderBuilder::baseFee); @@ -334,7 +334,7 @@ public BlockBody body(final BlockOptions options) { ommers, options.getWithdrawals(Optional.empty()), options.getDeposits(Optional.empty()), - options.getExits(Optional.empty())); + options.getWithdrawalRequests(Optional.empty())); } private BlockHeader ommer() { @@ -641,7 +641,7 @@ public static class BlockOptions { private Optional>> withdrawals = Optional.empty(); private Optional>> deposits = Optional.empty(); - private Optional>> exits = Optional.empty(); + private Optional>> withdrawalRequests = Optional.empty(); private Optional extraData = Optional.empty(); private Optional blockHeaderFunctions = Optional.empty(); private Optional receiptsRoot = Optional.empty(); @@ -658,7 +658,7 @@ public static class BlockOptions { private Optional withdrawalsRoot = Optional.empty(); private Optional depositsRoot = Optional.empty(); - private Optional exitsRoot = Optional.empty(); + private Optional withdrawalRequestsRoot = Optional.empty(); private Optional> maybeMaxFeePerBlobGas = Optional.empty(); @@ -735,13 +735,13 @@ public Optional> getDeposits(final Optional> default return deposits.orElse(defaultValue); } - public Hash getExitsRoot(final Hash defaultValue) { - return exitsRoot.orElse(defaultValue); + public Hash getWithdrawalRequestsRoot(final Hash defaultValue) { + return withdrawalRequestsRoot.orElse(defaultValue); } - public Optional> getExits( - final Optional> defaultValue) { - return exits.orElse(defaultValue); + public Optional> getWithdrawalRequests( + final Optional> defaultValue) { + return withdrawalRequests.orElse(defaultValue); } public boolean hasTransactions() { @@ -776,8 +776,9 @@ public BlockOptions setDeposits(final Optional> deposits) { return this; } - public BlockOptions setExits(final Optional> exits) { - this.exits = Optional.of(exits); + public BlockOptions setWithdrawalRequests( + final Optional> withdrawalRequests) { + this.withdrawalRequests = Optional.of(withdrawalRequests); return this; } @@ -874,8 +875,8 @@ public BlockOptions setDepositsRoot(final Hash depositsRoot) { return this; } - public BlockOptions setExitsRoot(final Hash exitsRoot) { - this.exitsRoot = Optional.of(exitsRoot); + public BlockOptions setWithdrawalRequestsRoot(final Hash withdrawalRequestsRoot) { + this.withdrawalRequestsRoot = Optional.of(withdrawalRequestsRoot); return this; } diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockHeaderTestFixture.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockHeaderTestFixture.java index 4a135b33b8c..d2faa8ef033 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockHeaderTestFixture.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockHeaderTestFixture.java @@ -51,7 +51,7 @@ public class BlockHeaderTestFixture { private long nonce = 0; private Optional withdrawalsRoot = Optional.empty(); private Optional depositsRoot = Optional.empty(); - private Optional exitsRoot = Optional.empty(); + private Optional withdrawalsRequestRoot = Optional.empty(); private BlockHeaderFunctions blockHeaderFunctions = new MainnetBlockHeaderFunctions(); private Optional excessBlobGas = Optional.empty(); private Optional blobGasUsed = Optional.empty(); @@ -80,7 +80,7 @@ public BlockHeader buildHeader() { excessBlobGas.ifPresent(builder::excessBlobGas); blobGasUsed.ifPresent(builder::blobGasUsed); depositsRoot.ifPresent(builder::depositsRoot); - exitsRoot.ifPresent(builder::exitsRoot); + withdrawalsRequestRoot.ifPresent(builder::withdrawalRequestsRoot); parentBeaconBlockRoot.ifPresent(builder::parentBeaconBlockRoot); builder.blockHeaderFunctions(blockHeaderFunctions); @@ -182,8 +182,8 @@ public BlockHeaderTestFixture depositsRoot(final Hash depositsRoot) { return this; } - public BlockHeaderTestFixture exitsRoot(final Hash exitsRoot) { - this.exitsRoot = Optional.ofNullable(exitsRoot); + public BlockHeaderTestFixture withdrawalRequestsRoot(final Hash withdrawalRequestsRoot) { + this.withdrawalsRequestRoot = Optional.ofNullable(withdrawalRequestsRoot); return this; } diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/NonBesuBlockHeader.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/NonBesuBlockHeader.java index f818de80870..3c4397b3990 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/NonBesuBlockHeader.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/NonBesuBlockHeader.java @@ -120,7 +120,7 @@ public Optional getDepositsRoot() { } @Override - public Optional getExitsRoot() { + public Optional getWithdrawalRequestsRoot() { return Optional.empty(); } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java index 01d9359a6a5..2fb5a598a16 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java @@ -40,7 +40,7 @@ import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; -import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidator; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator.ProhibitedWithdrawalRequests; import org.hyperledger.besu.ethereum.storage.StorageProvider; import org.hyperledger.besu.ethereum.trie.diffbased.bonsai.BonsaiWorldStateProvider; import org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage.BonsaiWorldStateKeyValueStorage; @@ -110,8 +110,8 @@ public void setup() { when(protocolContext.getBlockchain()).thenReturn(blockchain); when(protocolContext.getWorldStateArchive()).thenReturn(worldStateArchive); when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); - when(protocolSpec.getExitsValidator()) - .thenReturn(new ValidatorExitsValidator.ProhibitedExits()); + when(protocolSpec.getWithdrawalRequestValidator()) + .thenReturn(new ProhibitedWithdrawalRequests()); mainnetBlockValidator = new MainnetBlockValidator( blockHeaderValidator, blockBodyValidator, blockProcessor, badBlockManager); diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitDecoderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoderTest.java similarity index 66% rename from ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitDecoderTest.java rename to ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoderTest.java index 2bdb7e779de..0de468ec5da 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitDecoderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoderTest.java @@ -16,29 +16,31 @@ import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.BLSPublicKey; -import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.datatypes.GWei; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput; import org.hyperledger.besu.ethereum.rlp.RLP; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; -class ValidatorExitDecoderTest { +class WithdrawalRequestDecoderTest { @Test - public void shouldDecodeValidatorExit() { - final ValidatorExit expectedValidatorExit = - new ValidatorExit( + public void shouldDecodeWithdrawalRequest() { + final WithdrawalRequest expectedWithdrawalRequest = + new WithdrawalRequest( Address.fromHexString("0x814FaE9f487206471B6B0D713cD51a2D35980000"), BLSPublicKey.fromHexString( - "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e")); + "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"), + GWei.of(5)); final BytesValueRLPOutput out = new BytesValueRLPOutput(); - expectedValidatorExit.writeTo(out); + expectedWithdrawalRequest.writeTo(out); - final ValidatorExit decodedValidatorExit = - ValidatorExitDecoder.decode(RLP.input(out.encoded())); + final WithdrawalRequest decodedWithdrawalRequest = + WithdrawalRequestDecoder.decode(RLP.input(out.encoded())); - Assertions.assertThat(decodedValidatorExit).isEqualTo(expectedValidatorExit); + Assertions.assertThat(decodedWithdrawalRequest).isEqualTo(expectedWithdrawalRequest); } } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitEncoderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoderTest.java similarity index 70% rename from ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitEncoderTest.java rename to ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoderTest.java index f8dbc8e4471..a70d4a7fc95 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/ValidatorExitEncoderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoderTest.java @@ -18,25 +18,27 @@ import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.BLSPublicKey; -import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.datatypes.GWei; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -class ValidatorExitEncoderTest { +class WithdrawalRequestEncoderTest { @Test - void shouldEncodeExit() { - final ValidatorExit exit = - new ValidatorExit( + void shouldEncodeWithdrawalRequest() { + final WithdrawalRequest withdrawalRequest = + new WithdrawalRequest( Address.fromHexString("0x763c396673F9c391DCe3361A9A71C8E161388000"), BLSPublicKey.fromHexString( - "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e")); + "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"), + GWei.of(5)); - final Bytes encoded = ValidatorExitEncoder.encodeOpaqueBytes(exit); + final Bytes encoded = WithdrawalRequestEncoder.encodeOpaqueBytes(withdrawalRequest); assertThat(encoded) .isEqualTo( Bytes.fromHexString( - "0xf84694763c396673f9c391dce3361a9a71c8e161388000b0b10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e")); + "0xf84794763c396673f9c391dce3361a9a71c8e161388000b0b10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e05")); } } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java index 030db38139f..ebcdb1bc006 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java @@ -32,6 +32,7 @@ import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator.ProhibitedWithdrawalRequests; import org.hyperledger.besu.ethereum.referencetests.ReferenceTestBlockchain; import org.hyperledger.besu.ethereum.referencetests.ReferenceTestWorldState; @@ -67,8 +68,8 @@ abstract class AbstractBlockProcessorTest { void baseSetup() { lenient().when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); lenient() - .when(protocolSpec.getExitsValidator()) - .thenReturn(new ValidatorExitsValidator.ProhibitedExits()); + .when(protocolSpec.getWithdrawalRequestValidator()) + .thenReturn(new ProhibitedWithdrawalRequests()); blockProcessor = new TestBlockProcessor( transactionProcessor, diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java index fa97168e30e..3106d0dbf85 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java @@ -52,7 +52,7 @@ class MainnetBlockBodyValidatorTest { @Mock private ProtocolSpec protocolSpec; @Mock private WithdrawalsValidator withdrawalsValidator; @Mock private DepositsValidator depositsValidator; - @Mock private ValidatorExitsValidator exitsValidator; + @Mock private WithdrawalRequestValidator exitsValidator; @BeforeEach public void setUp() { @@ -66,8 +66,8 @@ public void setUp() { lenient().when(depositsValidator.validateDeposits(any(), any())).thenReturn(true); lenient().when(depositsValidator.validateDepositsRoot(any())).thenReturn(true); - lenient().when(protocolSpec.getExitsValidator()).thenReturn(exitsValidator); - lenient().when(exitsValidator.validateExitsInBlock(any(), any())).thenReturn(true); + lenient().when(protocolSpec.getWithdrawalRequestValidator()).thenReturn(exitsValidator); + lenient().when(exitsValidator.validateWithdrawalRequestsInBlock(any(), any())).thenReturn(true); } @Test @@ -155,10 +155,10 @@ public void validationFailsIfExitsValidationFails() { .setReceiptsRoot(BodyValidation.receiptsRoot(emptyList())) .setLogsBloom(LogsBloomFilter.empty()) .setParentHash(blockchainSetupUtil.getBlockchain().getChainHeadHash()) - .setExits(Optional.of(List.of()))); + .setWithdrawalRequests(Optional.of(List.of()))); blockchainSetupUtil.getBlockchain().appendBlock(block, Collections.emptyList()); - when(exitsValidator.validateExitsInBlock(any(), any())).thenReturn(false); + when(exitsValidator.validateWithdrawalRequestsInBlock(any(), any())).thenReturn(false); assertThat( new MainnetBlockBodyValidator(protocolSchedule) diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockProcessorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockProcessorTest.java index 34fe31731d3..d2825d85067 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockProcessorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockProcessorTest.java @@ -27,6 +27,7 @@ import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; import org.hyperledger.besu.ethereum.core.MutableWorldState; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator.ProhibitedWithdrawalRequests; import org.hyperledger.besu.ethereum.referencetests.ReferenceTestBlockchain; import org.hyperledger.besu.ethereum.referencetests.ReferenceTestWorldState; @@ -48,8 +49,8 @@ public class MainnetBlockProcessorTest extends AbstractBlockProcessorTest { @BeforeEach public void setup() { when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec); - when(protocolSpec.getExitsValidator()) - .thenReturn(new ValidatorExitsValidator.ProhibitedExits()); + when(protocolSpec.getWithdrawalRequestValidator()) + .thenReturn(new ProhibitedWithdrawalRequests()); } @Test diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidatorTest.java deleted file mode 100644 index df888f88a89..00000000000 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueValidatorExitsValidatorTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright contributors to Hyperledger Besu. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.ethereum.mainnet; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsAndExitsRoot; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsMismatch; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsRootMismatch; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsWithoutExitsRoot; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithMoreThanMaximumExits; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithoutExitsAndExitsRoot; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithoutExitsWithExitsRoot; - -import org.hyperledger.besu.ethereum.core.ValidatorExit; -import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.ValidateExitTestParameter; - -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - -class PragueValidatorExitsValidatorTest { - - @ParameterizedTest(name = "{index}: {0}") - @MethodSource("paramsForValidateValidatorExitParameter") - public void validateValidatorExitParameter( - final String description, - final Optional> maybeExits, - final boolean expectedValidity) { - assertThat(new PragueValidatorExitsValidator().validateValidatorExitParameter(maybeExits)) - .isEqualTo(expectedValidity); - } - - private static Stream paramsForValidateValidatorExitParameter() { - return Stream.of( - Arguments.of("Allowed exits - validating empty exits", Optional.empty(), false), - Arguments.of("Allowed exits - validating present exits", Optional.of(List.of()), true)); - } - - @ParameterizedTest(name = "{index}: {0}") - @MethodSource("validateExitsInBlockParamsForPrague") - public void validateExitsInBlock_WhenPrague( - final ValidateExitTestParameter param, final boolean expectedValidity) { - assertThat( - new PragueValidatorExitsValidator() - .validateExitsInBlock(param.block, param.expectedExits)) - .isEqualTo(expectedValidity); - } - - private static Stream validateExitsInBlockParamsForPrague() { - return Stream.of( - Arguments.of(blockWithExitsAndExitsRoot(), true), - Arguments.of(blockWithExitsWithoutExitsRoot(), false), - Arguments.of(blockWithoutExitsWithExitsRoot(), false), - Arguments.of(blockWithoutExitsAndExitsRoot(), false), - Arguments.of(blockWithExitsRootMismatch(), false), - Arguments.of(blockWithExitsMismatch(), false), - Arguments.of(blockWithMoreThanMaximumExits(), false)); - } - - @Test - public void allowExitsShouldReturnTrue() { - assertThat(new PragueValidatorExitsValidator().allowValidatorExits()).isTrue(); - } -} diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidatorTest.java new file mode 100644 index 00000000000..afdd1a89ac2 --- /dev/null +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidatorTest.java @@ -0,0 +1,82 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.mainnet; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithMoreThanMaximumWithdrawalRequests; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithWithdrawalRequestsAndWithdrawalRequestsRoot; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithWithdrawalRequestsMismatch; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithWithdrawalRequestsRootMismatch; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithWithdrawalRequestsWithoutWithdrawalRequestsRoot; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithoutWithdrawalRequestsAndWithdrawalRequestsRoot; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithoutWithdrawalRequestsWithWithdrawalRequestsRoot; + +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.WithdrawalRequestTestParameter; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class PragueWithdrawalRequestValidatorTest { + + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("paramsForValidateWithdrawalRequestParameter") + public void validateWithdrawalRequestParameter( + final String description, + final Optional> maybeExits, + final boolean expectedValidity) { + assertThat( + new PragueWithdrawalRequestValidator().validateWithdrawalRequestParameter(maybeExits)) + .isEqualTo(expectedValidity); + } + + private static Stream paramsForValidateWithdrawalRequestParameter() { + return Stream.of( + Arguments.of("Allowed exits - validating empty exits", Optional.empty(), false), + Arguments.of("Allowed exits - validating present exits", Optional.of(List.of()), true)); + } + + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("validateWithdrawalRequestsInBlockParamsForPrague") + public void validateWithdrawalRequestsInBlock_WhenPrague( + final WithdrawalRequestTestParameter param, final boolean expectedValidity) { + assertThat( + new PragueWithdrawalRequestValidator() + .validateWithdrawalRequestsInBlock(param.block, param.expectedWithdrawalRequest)) + .isEqualTo(expectedValidity); + } + + private static Stream validateWithdrawalRequestsInBlockParamsForPrague() { + return Stream.of( + Arguments.of(blockWithWithdrawalRequestsAndWithdrawalRequestsRoot(), true), + Arguments.of(blockWithWithdrawalRequestsWithoutWithdrawalRequestsRoot(), false), + Arguments.of(blockWithoutWithdrawalRequestsWithWithdrawalRequestsRoot(), false), + Arguments.of(blockWithoutWithdrawalRequestsAndWithdrawalRequestsRoot(), false), + Arguments.of(blockWithWithdrawalRequestsRootMismatch(), false), + Arguments.of(blockWithWithdrawalRequestsMismatch(), false), + Arguments.of(blockWithMoreThanMaximumWithdrawalRequests(), false)); + } + + @Test + public void allowExitsShouldReturnTrue() { + assertThat(new PragueWithdrawalRequestValidator().allowWithdrawalRequests()).isTrue(); + } +} diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidationTestUtils.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidationTestUtils.java index 2010f09f6a5..7eac8488dee 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidationTestUtils.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidationTestUtils.java @@ -19,8 +19,8 @@ import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.Deposit; import org.hyperledger.besu.ethereum.core.Transaction; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.rlp.BytesValueRLPInput; import org.hyperledger.besu.ethereum.rlp.RLPInput; @@ -64,11 +64,11 @@ public static BlockBody readBody(final long num) throws IOException { input.isEndOfCurrentList() ? Optional.empty() : Optional.of(input.readList(Deposit::readFrom)); - final Optional> exits = + final Optional> withdrawalRequests = input.isEndOfCurrentList() ? Optional.empty() - : Optional.of(input.readList(ValidatorExit::readFrom)); - return new BlockBody(transactions, ommers, withdrawals, deposits, exits); + : Optional.of(input.readList(WithdrawalRequest::readFrom)); + return new BlockBody(transactions, ommers, withdrawals, deposits, withdrawalRequests); } public static Block readBlock(final long num) throws IOException { diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTest.java deleted file mode 100644 index d4ccf7474df..00000000000 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright Hyperledger Besu Contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.hyperledger.besu.ethereum.mainnet; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsAndExitsRoot; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithExitsWithoutExitsRoot; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithoutExitsAndExitsRoot; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.blockWithoutExitsWithExitsRoot; - -import org.hyperledger.besu.ethereum.core.ValidatorExit; -import org.hyperledger.besu.ethereum.mainnet.ValidatorExitsValidatorTestFixtures.ValidateExitTestParameter; - -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - -class ValidatorExitsValidatorTest { - - @ParameterizedTest(name = "{index}: {0}") - @MethodSource("paramsForValidateValidatorExitParameter") - public void validateValidatorExitParameter( - final String description, - final Optional> maybeExits, - final boolean expectedValidity) { - assertThat( - new ValidatorExitsValidator.ProhibitedExits() - .validateValidatorExitParameter(maybeExits)) - .isEqualTo(expectedValidity); - } - - private static Stream paramsForValidateValidatorExitParameter() { - return Stream.of( - Arguments.of("Prohibited exits - validating empty exits", Optional.empty(), true), - Arguments.of("Prohibited exits - validating present exits", Optional.of(List.of()), false)); - } - - @ParameterizedTest(name = "{index}: {0}") - @MethodSource("validateExitsInBlockParamsForProhibited") - public void validateExitsInBlock_WhenProhibited( - final ValidateExitTestParameter param, final boolean expectedValidity) { - assertThat( - new ValidatorExitsValidator.ProhibitedExits() - .validateExitsInBlock(param.block, param.expectedExits)) - .isEqualTo(expectedValidity); - } - - private static Stream validateExitsInBlockParamsForProhibited() { - return Stream.of( - Arguments.of(blockWithExitsAndExitsRoot(), false), - Arguments.of(blockWithExitsWithoutExitsRoot(), false), - Arguments.of(blockWithoutExitsWithExitsRoot(), false), - Arguments.of(blockWithoutExitsAndExitsRoot(), true)); - } - - @Test - public void allowExitsShouldReturnFalse() { - assertThat(new ValidatorExitsValidator.ProhibitedExits().allowValidatorExits()).isFalse(); - } -} diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTestFixtures.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTestFixtures.java deleted file mode 100644 index f030a574163..00000000000 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitsValidatorTestFixtures.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright contributors to Hyperledger Besu. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.hyperledger.besu.ethereum.mainnet; - -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.MAX_EXITS_PER_BLOCK; - -import org.hyperledger.besu.datatypes.Address; -import org.hyperledger.besu.datatypes.BLSPublicKey; -import org.hyperledger.besu.datatypes.Hash; -import org.hyperledger.besu.ethereum.core.Block; -import org.hyperledger.besu.ethereum.core.BlockDataGenerator; -import org.hyperledger.besu.ethereum.core.ValidatorExit; - -import java.util.List; -import java.util.Optional; -import java.util.stream.IntStream; - -import org.apache.tuweni.bytes.Bytes32; -import org.apache.tuweni.bytes.Bytes48; - -public class ValidatorExitsValidatorTestFixtures { - - private static final BlockDataGenerator blockDataGenerator = new BlockDataGenerator(); - - static ValidateExitTestParameter blockWithExitsAndExitsRoot() { - final Optional> maybeExits = Optional.of(List.of(createExit())); - - final BlockDataGenerator.BlockOptions blockOptions = - BlockDataGenerator.BlockOptions.create() - .setExitsRoot(BodyValidation.exitsRoot(maybeExits.get())) - .setExits(maybeExits); - final Block block = blockDataGenerator.block(blockOptions); - - return new ValidateExitTestParameter("Block with exits and exits_root", block, maybeExits); - } - - static ValidateExitTestParameter blockWithoutExitsWithExitsRoot() { - final Optional> maybeExits = Optional.empty(); - - final BlockDataGenerator.BlockOptions blockOptions = - BlockDataGenerator.BlockOptions.create().setExitsRoot(Hash.EMPTY).setExits(maybeExits); - final Block block = blockDataGenerator.block(blockOptions); - - return new ValidateExitTestParameter( - "Block with exits_root but without exits", block, maybeExits); - } - - static ValidateExitTestParameter blockWithExitsWithoutExitsRoot() { - final Optional> maybeExits = Optional.of(List.of(createExit())); - - final BlockDataGenerator.BlockOptions blockOptions = - BlockDataGenerator.BlockOptions.create().setExits(maybeExits); - final Block block = blockDataGenerator.block(blockOptions); - - return new ValidateExitTestParameter( - "Block with exits but without exits_root", block, maybeExits); - } - - static ValidateExitTestParameter blockWithoutExitsAndExitsRoot() { - final Optional> maybeExits = Optional.empty(); - - final BlockDataGenerator.BlockOptions blockOptions = - BlockDataGenerator.BlockOptions.create().setExits(maybeExits); - final Block block = blockDataGenerator.block(blockOptions); - - return new ValidateExitTestParameter("Block without exits and exits_root", block, maybeExits); - } - - static ValidateExitTestParameter blockWithExitsRootMismatch() { - final Optional> maybeExits = Optional.of(List.of(createExit())); - - final BlockDataGenerator.BlockOptions blockOptions = - BlockDataGenerator.BlockOptions.create().setExitsRoot(Hash.EMPTY).setExits(maybeExits); - final Block block = blockDataGenerator.block(blockOptions); - - return new ValidateExitTestParameter("Block with exits_root mismatch", block, maybeExits); - } - - static ValidateExitTestParameter blockWithExitsMismatch() { - final Optional> maybeExits = - Optional.of(List.of(createExit(), createExit())); - - final BlockDataGenerator.BlockOptions blockOptions = - BlockDataGenerator.BlockOptions.create() - .setExitsRoot(BodyValidation.exitsRoot(maybeExits.get())) - .setExits(maybeExits); - final Block block = blockDataGenerator.block(blockOptions); - - return new ValidateExitTestParameter( - "Block with exits mismatch", block, maybeExits, List.of(createExit())); - } - - static ValidateExitTestParameter blockWithMoreThanMaximumExits() { - final List validatorExits = - IntStream.range(0, MAX_EXITS_PER_BLOCK + 1).mapToObj(__ -> createExit()).toList(); - final Optional> maybeExits = Optional.of(validatorExits); - - final BlockDataGenerator.BlockOptions blockOptions = - BlockDataGenerator.BlockOptions.create() - .setExitsRoot(BodyValidation.exitsRoot(maybeExits.get())) - .setExits(maybeExits); - final Block block = blockDataGenerator.block(blockOptions); - - return new ValidateExitTestParameter("Block with more than maximum exits", block, maybeExits); - } - - static ValidatorExit createExit() { - return new ValidatorExit( - Address.extract(Bytes32.random()), BLSPublicKey.wrap(Bytes48.random())); - } - - static class ValidateExitTestParameter { - - String description; - Block block; - Optional> maybeExits; - List expectedExits; - - public ValidateExitTestParameter( - final String description, - final Block block, - final Optional> maybeExits) { - this(description, block, maybeExits, maybeExits.orElseGet(List::of)); - } - - public ValidateExitTestParameter( - final String description, - final Block block, - final Optional> maybeExits, - final List expectedExits) { - this.description = description; - this.block = block; - this.maybeExits = maybeExits; - this.expectedExits = expectedExits; - } - - @Override - public String toString() { - return description; - } - } -} diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelperTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelperTest.java similarity index 56% rename from ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelperTest.java rename to ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelperTest.java index daf6c48fb95..5eeff4397d8 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ValidatorExitContractHelperTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelperTest.java @@ -16,16 +16,17 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider.createInMemoryWorldStateArchive; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.EXCESS_EXITS_STORAGE_SLOT; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.EXIT_COUNT_STORAGE_SLOT; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT; -import static org.hyperledger.besu.ethereum.mainnet.ValidatorExitContractHelper.VALIDATOR_EXIT_ADDRESS; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestContractHelper.EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestContractHelper.WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestContractHelper.WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestContractHelper.WITHDRAWAL_REQUEST_QUEUE_HEAD_STORAGE_SLOT; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestContractHelper.WITHDRAWAL_REQUEST_QUEUE_TAIL_STORAGE_SLOT; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.BLSPublicKey; +import org.hyperledger.besu.datatypes.GWei; import org.hyperledger.besu.ethereum.core.MutableWorldState; -import org.hyperledger.besu.ethereum.core.ValidatorExit; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.evm.account.MutableAccount; import org.hyperledger.besu.evm.worldstate.WorldUpdater; @@ -40,7 +41,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -class ValidatorExitContractHelperTest { +class WithdrawalRequestContractHelperTest { private MutableWorldState worldState; private MutableAccount contract; @@ -51,93 +52,96 @@ public void setUp() { } @Test - public void popExitsFromQueue_ReadExitsCorrectly() { - final List validatorExits = List.of(createExit(), createExit(), createExit()); + public void popExitsFromQueue_ReadWithdrawalRequestsCorrectly() { + final List validatorExits = + List.of(createExit(), createExit(), createExit()); loadContractStorage(worldState, validatorExits); - final List poppedExits = - ValidatorExitContractHelper.popExitsFromQueue(worldState); + final List poppedExits = + WithdrawalRequestContractHelper.popWithdrawalRequestsFromQueue(worldState); assertThat(poppedExits).isEqualTo(validatorExits); } @Test - public void popExitsFromQueue_whenContractCodeIsEmpty_ReturnsEmptyListOfExits() { + public void popExitsFromQueue_whenContractCodeIsEmpty_ReturnsEmptyListOfWithdrawalRequests() { // Create account with empty code final WorldUpdater updater = worldState.updater(); - updater.createAccount(VALIDATOR_EXIT_ADDRESS); + updater.createAccount(WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS); updater.commit(); - assertThat(ValidatorExitContractHelper.popExitsFromQueue(worldState)).isEmpty(); + assertThat(WithdrawalRequestContractHelper.popWithdrawalRequestsFromQueue(worldState)) + .isEmpty(); } @Test - public void popExitsFromQueue_WhenMoreExits_UpdatesQueuePointers() { + public void popExitsFromQueue_WhenMoreWithdrawalRequests_UpdatesQueuePointers() { // Loading contract with more than 16 exits - final List validatorExits = + final List validatorExits = IntStream.range(0, 30).mapToObj(__ -> createExit()).collect(Collectors.toList()); loadContractStorage(worldState, validatorExits); // After loading the contract, the exit count since last block should match the size of the list - assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, validatorExits.size()); + assertContractStorageValue(WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT, validatorExits.size()); - final List poppedExits = - ValidatorExitContractHelper.popExitsFromQueue(worldState); + final List poppedExits = + WithdrawalRequestContractHelper.popWithdrawalRequestsFromQueue(worldState); assertThat(poppedExits).hasSize(16); // Check that queue pointers were updated successfully (head advanced to index 16) - assertContractStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, 16); - assertContractStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT, 30); + assertContractStorageValue(WITHDRAWAL_REQUEST_QUEUE_HEAD_STORAGE_SLOT, 16); + assertContractStorageValue(WITHDRAWAL_REQUEST_QUEUE_TAIL_STORAGE_SLOT, 30); // We had 30 exits in the queue, and target per block is 2, so we have 28 excess - assertContractStorageValue(EXCESS_EXITS_STORAGE_SLOT, 28); + assertContractStorageValue(EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT, 28); // We always reset the exit count after processing the queue - assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, 0); + assertContractStorageValue(WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT, 0); } @Test - public void popExitsFromQueue_WhenNoMoreExits_ZeroQueuePointers() { - final List validatorExits = List.of(createExit(), createExit(), createExit()); + public void popExitsFromQueue_WhenNoMoreWithdrawalRequests_ZeroQueuePointers() { + final List validatorExits = + List.of(createExit(), createExit(), createExit()); loadContractStorage(worldState, validatorExits); // After loading the contract, the exit count since last block should match the size of the list - assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, validatorExits.size()); + assertContractStorageValue(WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT, validatorExits.size()); - final List poppedExits = - ValidatorExitContractHelper.popExitsFromQueue(worldState); + final List poppedExits = + WithdrawalRequestContractHelper.popWithdrawalRequestsFromQueue(worldState); assertThat(poppedExits).hasSize(3); // Check that queue pointers were updated successfully (head and tail zero because queue is // empty) - assertContractStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, 0); - assertContractStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT, 0); + assertContractStorageValue(WITHDRAWAL_REQUEST_QUEUE_HEAD_STORAGE_SLOT, 0); + assertContractStorageValue(WITHDRAWAL_REQUEST_QUEUE_TAIL_STORAGE_SLOT, 0); // We had 3 exits in the queue, target per block is 2, so we have 1 excess - assertContractStorageValue(EXCESS_EXITS_STORAGE_SLOT, 1); + assertContractStorageValue(EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT, 1); // We always reset the exit count after processing the queue - assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, 0); + assertContractStorageValue(WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT, 0); } @Test - public void popExitsFromQueue_WhenNoExits_DoesNothing() { + public void popExitsFromQueue_WhenNoWithdrawalRequests_DoesNothing() { // Loading contract with 0 exits loadContractStorage(worldState, List.of()); // After loading storage, we have the exit count as zero because no exits were aded - assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, 0); + assertContractStorageValue(WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT, 0); - final List poppedExits = - ValidatorExitContractHelper.popExitsFromQueue(worldState); + final List poppedExits = + WithdrawalRequestContractHelper.popWithdrawalRequestsFromQueue(worldState); assertThat(poppedExits).hasSize(0); // Check that queue pointers are correct (head and tail are zero) - assertContractStorageValue(EXIT_MESSAGE_QUEUE_HEAD_STORAGE_SLOT, 0); - assertContractStorageValue(EXIT_MESSAGE_QUEUE_TAIL_STORAGE_SLOT, 0); + assertContractStorageValue(WITHDRAWAL_REQUEST_QUEUE_HEAD_STORAGE_SLOT, 0); + assertContractStorageValue(WITHDRAWAL_REQUEST_QUEUE_TAIL_STORAGE_SLOT, 0); // We had 0 exits in the queue, and target per block is 2, so we have 0 excess - assertContractStorageValue(EXCESS_EXITS_STORAGE_SLOT, 0); + assertContractStorageValue(EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT, 0); // We always reset the exit count after processing the queue - assertContractStorageValue(EXIT_COUNT_STORAGE_SLOT, 0); + assertContractStorageValue(WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT, 0); } private void assertContractStorageValue(final UInt256 slot, final int expectedValue) { @@ -145,53 +149,54 @@ private void assertContractStorageValue(final UInt256 slot, final int expectedVa } private void assertContractStorageValue(final UInt256 slot, final UInt256 expectedValue) { - assertThat(worldState.get(VALIDATOR_EXIT_ADDRESS).getStorageValue(slot)) + assertThat(worldState.get(WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS).getStorageValue(slot)) .isEqualTo(expectedValue); } private void loadContractStorage( - final MutableWorldState worldState, final List exits) { + final MutableWorldState worldState, final List withdrawalRequests) { final WorldUpdater updater = worldState.updater(); - contract = updater.getOrCreate(VALIDATOR_EXIT_ADDRESS); + contract = updater.getOrCreate(WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS); contract.setCode( Bytes.fromHexString( "0x61013680600a5f395ff33373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b36603014156101325760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061013257600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460ed5780604402838201600302600401805490600101805490600101549160601b8160a01c17835260601b8160a01c17826020015260601b906040015260010160a6565b910180921460fe5790600255610109565b90505f6002555f6003555b5f546001546002828201116101205750505f610126565b01600290035b5f555f6001556044025ff35b5f5ffd")); - // excess exits + // excess requests contract.setStorageValue(UInt256.valueOf(0), UInt256.valueOf(0)); - // exits count - contract.setStorageValue(UInt256.valueOf(1), UInt256.valueOf(exits.size())); - // exits queue head pointer + // requests count + contract.setStorageValue(UInt256.valueOf(1), UInt256.valueOf(withdrawalRequests.size())); + // requests queue head pointer contract.setStorageValue(UInt256.valueOf(2), UInt256.valueOf(0)); - // exits queue tail pointer - contract.setStorageValue(UInt256.valueOf(3), UInt256.valueOf(exits.size())); + // requests queue tail pointer + contract.setStorageValue(UInt256.valueOf(3), UInt256.valueOf(withdrawalRequests.size())); int offset = 4; - for (int i = 0; i < exits.size(); i++) { - final ValidatorExit exit = exits.get(i); + for (int i = 0; i < withdrawalRequests.size(); i++) { + final WithdrawalRequest request = withdrawalRequests.get(i); // source_account contract.setStorageValue( // set account to slot, with 12 bytes padding on the left UInt256.valueOf(offset++), UInt256.fromBytes( Bytes.concatenate( - Bytes.fromHexString("0x000000000000000000000000"), exit.getSourceAddress()))); + Bytes.fromHexString("0x000000000000000000000000"), request.getSourceAddress()))); // validator_pubkey contract.setStorageValue( - UInt256.valueOf(offset++), UInt256.fromBytes(exit.getValidatorPubKey().slice(0, 32))); + UInt256.valueOf(offset++), UInt256.fromBytes(request.getValidatorPubKey().slice(0, 32))); contract.setStorageValue( // set public key to slot, with 16 bytes padding on the right UInt256.valueOf(offset++), UInt256.fromBytes( Bytes.concatenate( - exit.getValidatorPubKey().slice(32, 16), - Bytes.fromHexString("0x00000000000000000000000000000000")))); + request.getValidatorPubKey().slice(32, 16), + request.getAmount().toBytes(), // 8 bytes for amount + Bytes.fromHexString("0x0000000000000000")))); } updater.commit(); } - private ValidatorExit createExit() { - return new ValidatorExit( - Address.extract(Bytes32.random()), BLSPublicKey.wrap(Bytes48.random())); + private WithdrawalRequest createExit() { + return new WithdrawalRequest( + Address.extract(Bytes32.random()), BLSPublicKey.wrap(Bytes48.random()), GWei.ONE); } } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTest.java new file mode 100644 index 00000000000..b5e091ddc2a --- /dev/null +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTest.java @@ -0,0 +1,76 @@ +/* + * Copyright Hyperledger Besu Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.mainnet; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithWithdrawalRequestsAndWithdrawalRequestsRoot; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithWithdrawalRequestsWithoutWithdrawalRequestsRoot; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithoutWithdrawalRequestsAndWithdrawalRequestsRoot; +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.blockWithoutWithdrawalRequestsWithWithdrawalRequestsRoot; + +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidator.ProhibitedWithdrawalRequests; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestValidatorTestFixtures.WithdrawalRequestTestParameter; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class WithdrawalRequestValidatorTest { + + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("paramsForValidateWithdrawalRequestParameter") + public void validateWithdrawalRequestParameter( + final String description, + final Optional> maybeExits, + final boolean expectedValidity) { + assertThat(new ProhibitedWithdrawalRequests().validateWithdrawalRequestParameter(maybeExits)) + .isEqualTo(expectedValidity); + } + + private static Stream paramsForValidateWithdrawalRequestParameter() { + return Stream.of( + Arguments.of("Prohibited exits - validating empty exits", Optional.empty(), true), + Arguments.of("Prohibited exits - validating present exits", Optional.of(List.of()), false)); + } + + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("validateWithdrawalRequestsInBlockParamsForProhibited") + public void validateWithdrawalRequestsInBlock_WhenProhibited( + final WithdrawalRequestTestParameter param, final boolean expectedValidity) { + assertThat( + new ProhibitedWithdrawalRequests() + .validateWithdrawalRequestsInBlock(param.block, param.expectedWithdrawalRequest)) + .isEqualTo(expectedValidity); + } + + private static Stream validateWithdrawalRequestsInBlockParamsForProhibited() { + return Stream.of( + Arguments.of(blockWithWithdrawalRequestsAndWithdrawalRequestsRoot(), false), + Arguments.of(blockWithWithdrawalRequestsWithoutWithdrawalRequestsRoot(), false), + Arguments.of(blockWithoutWithdrawalRequestsWithWithdrawalRequestsRoot(), false), + Arguments.of(blockWithoutWithdrawalRequestsAndWithdrawalRequestsRoot(), true)); + } + + @Test + public void allowExitsShouldReturnFalse() { + assertThat(new ProhibitedWithdrawalRequests().allowWithdrawalRequests()).isFalse(); + } +} diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTestFixtures.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTestFixtures.java new file mode 100644 index 00000000000..ed132a87ed4 --- /dev/null +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTestFixtures.java @@ -0,0 +1,175 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.hyperledger.besu.ethereum.mainnet; + +import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestContractHelper.MAX_WITHDRAWAL_REQUESTS_PER_BLOCK; + +import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.BLSPublicKey; +import org.hyperledger.besu.datatypes.GWei; +import org.hyperledger.besu.datatypes.Hash; +import org.hyperledger.besu.ethereum.core.Block; +import org.hyperledger.besu.ethereum.core.BlockDataGenerator; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; + +import java.util.List; +import java.util.Optional; +import java.util.stream.IntStream; + +import org.apache.tuweni.bytes.Bytes32; +import org.apache.tuweni.bytes.Bytes48; + +public class WithdrawalRequestValidatorTestFixtures { + + private static final BlockDataGenerator blockDataGenerator = new BlockDataGenerator(); + + static WithdrawalRequestTestParameter blockWithWithdrawalRequestsAndWithdrawalRequestsRoot() { + final Optional> maybeWithdrawalRequests = + Optional.of(List.of(createWithdrawalRequest())); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create() + .setWithdrawalRequestsRoot( + BodyValidation.withdrawalRequestsRoot(maybeWithdrawalRequests.get())) + .setWithdrawalRequests(maybeWithdrawalRequests); + final Block block = blockDataGenerator.block(blockOptions); + + return new WithdrawalRequestTestParameter( + "Block with withdrawal requests and withdrawal_requests_root", + block, + maybeWithdrawalRequests); + } + + static WithdrawalRequestTestParameter blockWithoutWithdrawalRequestsWithWithdrawalRequestsRoot() { + final Optional> maybeExits = Optional.empty(); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create() + .setWithdrawalRequestsRoot(Hash.EMPTY) + .setWithdrawalRequests(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new WithdrawalRequestTestParameter( + "Block with withdrawal_requests_root but without withdrawal requests", block, maybeExits); + } + + static WithdrawalRequestTestParameter blockWithWithdrawalRequestsWithoutWithdrawalRequestsRoot() { + final Optional> maybeExits = + Optional.of(List.of(createWithdrawalRequest())); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create().setWithdrawalRequests(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new WithdrawalRequestTestParameter( + "Block with withdrawal requests but without withdrawal_requests_root", block, maybeExits); + } + + static WithdrawalRequestTestParameter blockWithoutWithdrawalRequestsAndWithdrawalRequestsRoot() { + final Optional> maybeExits = Optional.empty(); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create().setWithdrawalRequests(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new WithdrawalRequestTestParameter( + "Block without withdrawal requests and withdrawal_requests_root", block, maybeExits); + } + + static WithdrawalRequestTestParameter blockWithWithdrawalRequestsRootMismatch() { + final Optional> maybeExits = + Optional.of(List.of(createWithdrawalRequest())); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create() + .setWithdrawalRequestsRoot(Hash.EMPTY) + .setWithdrawalRequests(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new WithdrawalRequestTestParameter( + "Block with withdrawal_requests_root mismatch", block, maybeExits); + } + + static WithdrawalRequestTestParameter blockWithWithdrawalRequestsMismatch() { + final Optional> maybeExits = + Optional.of(List.of(createWithdrawalRequest(), createWithdrawalRequest())); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create() + .setWithdrawalRequestsRoot(BodyValidation.withdrawalRequestsRoot(maybeExits.get())) + .setWithdrawalRequests(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new WithdrawalRequestTestParameter( + "Block with withdrawal requests mismatch", + block, + maybeExits, + List.of(createWithdrawalRequest())); + } + + static WithdrawalRequestTestParameter blockWithMoreThanMaximumWithdrawalRequests() { + final List validatorExits = + IntStream.range(0, MAX_WITHDRAWAL_REQUESTS_PER_BLOCK + 1) + .mapToObj(__ -> createWithdrawalRequest()) + .toList(); + final Optional> maybeExits = Optional.of(validatorExits); + + final BlockDataGenerator.BlockOptions blockOptions = + BlockDataGenerator.BlockOptions.create() + .setWithdrawalRequestsRoot(BodyValidation.withdrawalRequestsRoot(maybeExits.get())) + .setWithdrawalRequests(maybeExits); + final Block block = blockDataGenerator.block(blockOptions); + + return new WithdrawalRequestTestParameter( + "Block with more than maximum withdrawal requests", block, maybeExits); + } + + static WithdrawalRequest createWithdrawalRequest() { + return new WithdrawalRequest( + Address.extract(Bytes32.random()), BLSPublicKey.wrap(Bytes48.random()), GWei.ONE); + } + + static class WithdrawalRequestTestParameter { + + String description; + Block block; + Optional> maybeWithdrawalRequest; + List expectedWithdrawalRequest; + + public WithdrawalRequestTestParameter( + final String description, + final Block block, + final Optional> maybeWithdrawalRequest) { + this(description, block, maybeWithdrawalRequest, maybeWithdrawalRequest.orElseGet(List::of)); + } + + public WithdrawalRequestTestParameter( + final String description, + final Block block, + final Optional> maybeWithdrawalRequest, + final List expectedWithdrawalRequest) { + this.description = description; + this.block = block; + this.maybeWithdrawalRequest = maybeWithdrawalRequest; + this.expectedWithdrawalRequest = expectedWithdrawalRequest; + } + + @Override + public String toString() { + return description; + } + } +} diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTask.java index c908837db61..7c6b275a7bd 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTask.java @@ -22,8 +22,8 @@ import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.Deposit; import org.hyperledger.besu.ethereum.core.Transaction; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthPeer; import org.hyperledger.besu.ethereum.eth.manager.PendingPeerRequest; @@ -153,19 +153,19 @@ static class BodyIdentifier { private final Bytes32 ommersHash; private final Bytes32 withdrawalsRoot; private final Bytes32 depositsRoot; - private final Bytes32 exitsRoot; + private final Bytes32 withdrawalRequestsRoot; public BodyIdentifier( final Bytes32 transactionsRoot, final Bytes32 ommersHash, final Bytes32 withdrawalsRoot, final Bytes32 depositsRoot, - final Bytes32 exitsRoot) { + final Bytes32 withdrawalRequestsRoot) { this.transactionsRoot = transactionsRoot; this.ommersHash = ommersHash; this.withdrawalsRoot = withdrawalsRoot; this.depositsRoot = depositsRoot; - this.exitsRoot = exitsRoot; + this.withdrawalRequestsRoot = withdrawalRequestsRoot; } public BodyIdentifier(final BlockBody body) { @@ -174,7 +174,7 @@ public BodyIdentifier(final BlockBody body) { body.getOmmers(), body.getWithdrawals(), body.getDeposits(), - body.getExits()); + body.getWithdrawalRequests()); } public BodyIdentifier( @@ -182,13 +182,13 @@ public BodyIdentifier( final List ommers, final Optional> withdrawals, final Optional> deposits, - final Optional> exits) { + final Optional> withdrawalRequests) { this( BodyValidation.transactionsRoot(transactions), BodyValidation.ommersHash(ommers), withdrawals.map(BodyValidation::withdrawalsRoot).orElse(null), deposits.map(BodyValidation::depositsRoot).orElse(null), - exits.map(BodyValidation::exitsRoot).orElse(null)); + withdrawalRequests.map(BodyValidation::withdrawalRequestsRoot).orElse(null)); } public BodyIdentifier(final BlockHeader header) { @@ -197,7 +197,7 @@ public BodyIdentifier(final BlockHeader header) { header.getOmmersHash(), header.getWithdrawalsRoot().orElse(null), header.getDepositsRoot().orElse(null), - header.getExitsRoot().orElse(null)); + header.getWithdrawalRequestsRoot().orElse(null)); } @Override @@ -209,12 +209,13 @@ public boolean equals(final Object o) { && Objects.equals(ommersHash, that.ommersHash) && Objects.equals(withdrawalsRoot, that.withdrawalsRoot) && Objects.equals(depositsRoot, that.depositsRoot) - && Objects.equals(exitsRoot, that.exitsRoot); + && Objects.equals(withdrawalRequestsRoot, that.withdrawalRequestsRoot); } @Override public int hashCode() { - return Objects.hash(transactionsRoot, ommersHash, withdrawalsRoot, depositsRoot, exitsRoot); + return Objects.hash( + transactionsRoot, ommersHash, withdrawalsRoot, depositsRoot, withdrawalRequestsRoot); } } } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTaskTest.java index afadea61c0c..6fd6378983c 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTaskTest.java @@ -25,8 +25,8 @@ import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.Deposit; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.eth.manager.ethtaskutils.PeerMessageTaskTest; import java.util.ArrayList; @@ -124,11 +124,12 @@ public void assertBodyIdentifierUsesDepositsToGenerateBodyIdentifiers() { @Test public void assertBodyIdentifierUsesExitsToGenerateBodyIdentifiers() { - final ValidatorExit validatorExit = - new ValidatorExit( + final WithdrawalRequest validatorExit = + new WithdrawalRequest( Address.fromHexString("0x763c396673F9c391DCe3361A9A71C8E161388000"), BLSPublicKey.fromHexString( - "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e")); + "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"), + GWei.ONE); // Empty body block final BlockBody emptyBodyBlock = BlockBody.empty(); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java index ee816ea4ea0..ff9fd0d3de5 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java @@ -90,7 +90,7 @@ public static BlockHeader prepareWrongParentHash(final BlockHeader blockHeader) blockHeader.getExcessBlobGas().orElse(null), blockHeader.getParentBeaconBlockRoot().orElse(null), blockHeader.getDepositsRoot().orElse(null), - blockHeader.getExitsRoot().orElse(null), + blockHeader.getWithdrawalRequestsRoot().orElse(null), new MainnetBlockHeaderFunctions()); } diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java index e8cd62e9f4a..a8466f4528c 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java @@ -34,8 +34,8 @@ import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.ParsedExtraData; import org.hyperledger.besu.ethereum.core.Transaction; -import org.hyperledger.besu.ethereum.core.ValidatorExit; import org.hyperledger.besu.ethereum.core.Withdrawal; +import org.hyperledger.besu.ethereum.core.WithdrawalRequest; import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions; import org.hyperledger.besu.ethereum.rlp.BytesValueRLPInput; import org.hyperledger.besu.ethereum.rlp.RLPInput; @@ -167,7 +167,7 @@ public ReferenceTestBlockHeader( @JsonProperty("nonce") final String nonce, @JsonProperty("withdrawalsRoot") final String withdrawalsRoot, @JsonProperty("depositsRoot") final String depositsRoot, - @JsonProperty("exitsRoot") final String exitsRoot, + @JsonProperty("withdrawalRequestsRoot") final String withdrawalRequestsRoot, @JsonProperty("dataGasUsed") final String dataGasUsed, // TODO: remove once reference tests have been updated @JsonProperty("excessDataGas") @@ -206,7 +206,7 @@ public ReferenceTestBlockHeader( : excessBlobGas != null ? BlobGas.fromHexString(excessBlobGas) : null, parentBeaconBlockRoot != null ? Bytes32.fromHexString(parentBeaconBlockRoot) : null, depositsRoot != null ? Hash.fromHexString(depositsRoot) : null, - exitsRoot != null ? Hash.fromHexString(exitsRoot) : null, + withdrawalRequestsRoot != null ? Hash.fromHexString(withdrawalRequestsRoot) : null, new BlockHeaderFunctions() { @Override public Hash hash(final BlockHeader header) { @@ -297,7 +297,7 @@ public Block getBlock() { : Optional.of(input.readList(Deposit::readFrom)), input.isEndOfCurrentList() ? Optional.empty() - : Optional.of(input.readList(ValidatorExit::readFrom))); + : Optional.of(input.readList(WithdrawalRequest::readFrom))); return new Block(header, body); } } diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java index 4fb35f9724f..81d8d340bf3 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java @@ -145,7 +145,7 @@ public ReferenceTestEnv( currentExcessBlobGas == null ? null : BlobGas.of(Long.decode(currentExcessBlobGas)), beaconRoot == null ? null : Bytes32.fromHexString(beaconRoot), null, // depositsRoot - null, // exitsRoot + null, // withdrawalRequestsRoot new MainnetBlockHeaderFunctions()); this.parentDifficulty = parentDifficulty; this.parentBaseFee = parentBaseFee; diff --git a/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/NoRewardProtocolScheduleWrapper.java b/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/NoRewardProtocolScheduleWrapper.java index dd6350bfaa1..4335320cd22 100644 --- a/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/NoRewardProtocolScheduleWrapper.java +++ b/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/NoRewardProtocolScheduleWrapper.java @@ -89,7 +89,7 @@ public ProtocolSpec getByBlockHeader(final ProcessableBlockHeader blockHeader) { original.getWithdrawalsValidator(), original.getWithdrawalsProcessor(), original.getDepositsValidator(), - original.getExitsValidator(), + original.getWithdrawalRequestValidator(), original.isPoS(), original.isReplayProtectionSupported()); } diff --git a/plugin-api/build.gradle b/plugin-api/build.gradle index 8e2d8b726df..7795c5b2ca1 100644 --- a/plugin-api/build.gradle +++ b/plugin-api/build.gradle @@ -69,7 +69,7 @@ Calculated : ${currentHash} tasks.register('checkAPIChanges', FileStateChecker) { description = "Checks that the API for the Plugin-API project does not change without deliberate thought" files = sourceSets.main.allJava.files - knownHash = '78xbZ20PDB9CDcaSVY92VA8cXWGu4GwaZkvegWgep24=' + knownHash = 'wGHrCxNllf6j/YOB/6UzH5QXYcwwB2AEmYC4GkQVUuE=' } check.dependsOn('checkAPIChanges') diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockBody.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockBody.java index b227e967a07..9f37d3308f1 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockBody.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockBody.java @@ -59,10 +59,10 @@ public interface BlockBody { Optional> getDeposits(); /** - * Returns the list of exits of the block. + * Returns the list of withdrawal requests of the block. * - * @return The list of exits of the block. + * @return The list of withdrawal requests of the block. */ @Unstable - Optional> getExits(); + Optional> getWithdrawalRequests(); } diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockHeader.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockHeader.java index ef41f85a7fb..90d6ab89443 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockHeader.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockHeader.java @@ -131,14 +131,14 @@ public interface BlockHeader extends ProcessableBlockHeader { Optional getDepositsRoot(); /** - * The Keccak 256-bit hash of the root node of the trie structure populated with each exit in the - * exits list portion of the block. + * The Keccak 256-bit hash of the root node of the trie structure populated with each withdrawal + * request in the withdrawal request list portion of the block. * - * @return The Keccak 256-bit hash of the root node of the trie structure populated with each exit - * in the exits list portion of the block. + * @return The Keccak 256-bit hash of the root node of the trie structure populated with each + * withdrawal request in the withdrawal request list portion of the block. */ @Unstable - Optional getExitsRoot(); + Optional getWithdrawalRequestsRoot(); /** * The excess_blob_gas of this header. diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/ValidatorExit.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/WithdrawalRequest.java similarity index 69% rename from plugin-api/src/main/java/org/hyperledger/besu/plugin/data/ValidatorExit.java rename to plugin-api/src/main/java/org/hyperledger/besu/plugin/data/WithdrawalRequest.java index 57177b08f94..79abaf60acd 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/ValidatorExit.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/WithdrawalRequest.java @@ -15,27 +15,35 @@ package org.hyperledger.besu.plugin.data; import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.GWei; import org.hyperledger.besu.datatypes.PublicKey; import org.hyperledger.besu.plugin.Unstable; /** - * A deposit is a system-level operation to support validator exitys that are pushed from the EVM to - * beacon chain. + * A withdrawal request is an operation sent to the Beacon Node for processing validator withdrawal + * requests (partial or complete) */ @Unstable -public interface ValidatorExit { +public interface WithdrawalRequest { /** - * Withdrawal credential (0x01) associated with the validator to be exited + * Withdrawal credential (0x01) associated with the validator * * @return withdrawal credential address */ Address getSourceAddress(); /** - * Public key of the validator that is going to exit + * Public key of the validator that is going to request a withdrawal * * @return public key of validator */ PublicKey getValidatorPubKey(); + + /** + * The amount for withdrawal + * + * @return withdrawal amount + */ + GWei getAmount(); } From eb6c3495e37013662c94b7128c2e57e045840016 Mon Sep 17 00:00:00 2001 From: knowmost <167442703+knowmost@users.noreply.github.com> Date: Wed, 1 May 2024 05:58:56 +0800 Subject: [PATCH 33/59] chore: fix some typos in comments (#7005) Signed-off-by: knowmost Co-authored-by: Sally MacFarlane --- .../besu/ethereum/blockcreation/AbstractBlockCreator.java | 2 +- .../besu/ethereum/privacy/PrivateTransactionLocatorTest.java | 2 +- .../hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java | 2 +- .../java/org/hyperledger/besu/collections/undo/Undoable.java | 2 +- evm/src/main/java/org/hyperledger/besu/evm/EVM.java | 2 +- .../besu/evm/precompile/ECRECPrecompiledContract.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java index 90bfe3569e8..7ee51222d4f 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java @@ -127,7 +127,7 @@ protected AbstractBlockCreator( * body, and will supply an empty Ommers list. * *

Once transactions have been selected and applied to a disposable/temporary world state, the - * block reward is paid to the relevant coinbase, and a sealable header is constucted. + * block reward is paid to the relevant coinbase, and a sealable header is constructed. * *

The sealableHeader is then provided to child instances for sealing (i.e. proof of work or * otherwise). diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionLocatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionLocatorTest.java index 31ca945549e..10985a2be84 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionLocatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionLocatorTest.java @@ -206,7 +206,7 @@ public void locateBesuPrivateTransactionNotFoundInAddBlob() { } /* - Overrride enclave so it returns 404 when searching for a single tx (first call) and when + Override enclave so it returns 404 when searching for a single tx (first call) and when searching for the add blob (second call) */ private void mockEnlaveNoSingleTxOrAddBlob() { diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java index ccc9152f757..8beab2f7c86 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java @@ -146,7 +146,7 @@ public static GasCalculator gasCalculatorForFork(final String fork) { /** * Run the benchmarks * - * @param output stream to print results to (typicall System.out) + * @param output stream to print results to (typically System.out) * @param attemptNative Should the benchmark attempt to us native libraries? (null use the * default, false disabled, true enabled) * @param fork the fork name to run the benchmark against. diff --git a/evm/src/main/java/org/hyperledger/besu/collections/undo/Undoable.java b/evm/src/main/java/org/hyperledger/besu/collections/undo/Undoable.java index 274bbc2297b..607b93c4b16 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/undo/Undoable.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/undo/Undoable.java @@ -49,7 +49,7 @@ static long incrementMarkStatic() { } /** - * The last time this object was updated. Any undo requrests greater than this mark will result in + * The last time this object was updated. Any undo requests greater than this mark will result in * no changes. * * @return The most recent mark. diff --git a/evm/src/main/java/org/hyperledger/besu/evm/EVM.java b/evm/src/main/java/org/hyperledger/besu/evm/EVM.java index ea490d9ff50..debdb5e9b14 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/EVM.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/EVM.java @@ -138,7 +138,7 @@ public int getMaxEOFVersion() { /** * Returns the non-fork related configuration parameters of the EVM. * - * @return the EVM coniguration. + * @return the EVM configuration. */ public EvmConfiguration getEvmConfiguration() { return evmConfiguration; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/ECRECPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/ECRECPrecompiledContract.java index 94920abca06..f129cc85141 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/ECRECPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/ECRECPrecompiledContract.java @@ -47,7 +47,7 @@ public ECRECPrecompiledContract(final GasCalculator gasCalculator) { } /** - * Configure a new ECRecover precompile with a specific signature algorith and gas. + * Configure a new ECRecover precompile with a specific signature algorithm and gas. * * @param gasCalculator the gas calculator * @param signatureAlgorithm the algorithm (such as secp256k1 or secp256r1) From 4dc08d40a596082a341c07a4c930e5b32c50a31a Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 08:56:56 +1000 Subject: [PATCH 34/59] build - Preparing spotless license header option and adding license templates (#7015) Preparing spotless license header option and adding license templates Signed-off-by: Usman Saleem --- build.gradle | 6 ++++++ .../exception/UnsupportedForkException.java | 1 - gradle/spotless/java.current.license | 14 ++++++++++++++ gradle/spotless/java.former.date.license | 14 ++++++++++++++ gradle/spotless/java.former.license | 14 ++++++++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 gradle/spotless/java.current.license create mode 100644 gradle/spotless/java.former.date.license create mode 100644 gradle/spotless/java.former.license diff --git a/build.gradle b/build.gradle index 31eec61f219..3e408573d66 100644 --- a/build.gradle +++ b/build.gradle @@ -207,6 +207,12 @@ allprojects { importOrder 'org.hyperledger', 'java', '' trimTrailingWhitespace() endWithNewline() + // apply appropriate license header files. + // TODO: Remove checkSpdxLicense task and buildSrc when all files are formatted and updated via multiple PRs + // TODO: Uncomment following when all files are formatted and updated via multiple PRs + // licenseHeaderFile("${rootDir}/gradle/spotless/java.former.license").named("older").onlyIfContentMatches("^/\\*\\r?\\n.*Copyright ConsenSys AG\\.") + licenseHeaderFile("${rootDir}/gradle/spotless/java.former.date.license").named("older.year").onlyIfContentMatches("^/\\*\\r?\\n.* Copyright \\d{4} ConsenSys AG\\.") + // licenseHeaderFile("${rootDir}/gradle/spotless/java.current.license").named("current").onlyIfContentMatches("^(?!/\\*\\r?\\n \\*.*ConsenSys AG\\.)") } groovyGradle { target '*.gradle' diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/exception/UnsupportedForkException.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/exception/UnsupportedForkException.java index 284fe890909..96209689854 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/exception/UnsupportedForkException.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/exception/UnsupportedForkException.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool.exception; diff --git a/gradle/spotless/java.current.license b/gradle/spotless/java.current.license new file mode 100644 index 00000000000..fb92e548e28 --- /dev/null +++ b/gradle/spotless/java.current.license @@ -0,0 +1,14 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ \ No newline at end of file diff --git a/gradle/spotless/java.former.date.license b/gradle/spotless/java.former.date.license new file mode 100644 index 00000000000..cc53a42a8c1 --- /dev/null +++ b/gradle/spotless/java.former.date.license @@ -0,0 +1,14 @@ +/* + * Copyright $YEAR ConsenSys AG. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ \ No newline at end of file diff --git a/gradle/spotless/java.former.license b/gradle/spotless/java.former.license new file mode 100644 index 00000000000..c936fcf470e --- /dev/null +++ b/gradle/spotless/java.former.license @@ -0,0 +1,14 @@ +/* + * Copyright ConsenSys AG. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ \ No newline at end of file From 07765b57a88a6fbfea3cafea4ffef67fb7e5d12f Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 09:53:13 +1000 Subject: [PATCH 35/59] build - Update license headers formatting (2) (#7016) * Preparing spotless license header option and adding license templates --------- Signed-off-by: Usman Saleem --- .../acceptance/dsl/condition/admin/ExpectHasPeer.java | 1 - .../dsl/condition/admin/ExpectNotHavePeer.java | 1 - .../dsl/node/configuration/BesuNodeFactory.java | 9 +++------ .../dsl/transaction/admin/AdminPeersTransaction.java | 1 - .../tests/acceptance/plugins/BadCLIOptionsPlugin.java | 1 - .../acceptance/plugins/TestPermissioningPlugin.java | 1 - .../plugins/privacy/TestPrivacyGroupGenesisProvider.java | 1 - .../privacy/TestPrivacyPluginPayloadProvider.java | 1 - .../tests/acceptance/AbstractPreexistingNodeTest.java | 2 -- .../acceptance/backup/BackupRoundTripAcceptanceTest.java | 2 -- .../tests/acceptance/crypto/SECP256R1AcceptanceTest.java | 1 - .../database/DatabaseMigrationAcceptanceTest.java | 1 - .../acceptance/plugins/BadCLIOptionsPluginTest.java | 1 - .../acceptance/plugins/PermissioningPluginTest.java | 1 - .../besu/cli/options/stable/DataStorageOptions.java | 2 -- .../cli/options/unstable/PkiBlockCreationOptions.java | 1 - .../besu/cli/subcommands/operator/BackupState.java | 2 -- .../cli/subcommands/operator/GenerateLogBloomCache.java | 2 -- .../besu/cli/subcommands/operator/RestoreState.java | 2 -- .../besu/controller/BftBesuControllerBuilder.java | 1 - .../besu/services/PermissioningServiceImpl.java | 1 - .../org/hyperledger/besu/ForkIdsNetworkConfigTest.java | 2 -- .../main/java/org/hyperledger/besu/config/QbftFork.java | 1 - .../besu/consensus/clique/CliqueBlockChoiceTests.java | 2 -- .../besu/consensus/common/bft/BftExecutors.java | 1 - .../besu/consensus/qbft/pki/KeyStoreWrapperProvider.java | 1 - .../qbft/pki/PkiBlockCreationConfiguration.java | 1 - .../qbft/pki/PkiBlockCreationConfigurationProvider.java | 1 - .../besu/consensus/qbft/pki/PkiQbftBlockHashing.java | 1 - .../consensus/qbft/pki/PkiQbftBlockHeaderFunctions.java | 1 - .../besu/consensus/qbft/pki/PkiQbftExtraData.java | 1 - .../besu/consensus/qbft/pki/PkiQbftExtraDataCodec.java | 9 +++------ .../statemachine/CreateBlockForProposalBehaviour.java | 1 - .../qbft/validator/ForkingValidatorProvider.java | 1 - .../besu/consensus/qbft/QbftExtraDataCodecTestUtils.java | 1 - .../qbft/validator/ForkingValidatorProviderTest.java | 1 - 36 files changed, 6 insertions(+), 54 deletions(-) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/admin/ExpectHasPeer.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/admin/ExpectHasPeer.java index 58f91c8e0a3..6632f16b855 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/admin/ExpectHasPeer.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/admin/ExpectHasPeer.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.tests.acceptance.dsl.condition.admin; import static org.assertj.core.api.Assertions.assertThat; diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/admin/ExpectNotHavePeer.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/admin/ExpectNotHavePeer.java index 64f06bec4c1..2b6189b6bfe 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/admin/ExpectNotHavePeer.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/admin/ExpectNotHavePeer.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.tests.acceptance.dsl.condition.admin; import static org.assertj.core.api.Assertions.assertThat; diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java index 51244ea9f31..6ed5ee55f33 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java @@ -1,16 +1,13 @@ /* * Copyright ConsenSys AG. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/admin/AdminPeersTransaction.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/admin/AdminPeersTransaction.java index dffd700b93b..d2a5364dab4 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/admin/AdminPeersTransaction.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/admin/AdminPeersTransaction.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.tests.acceptance.dsl.transaction.admin; import static org.assertj.core.api.Assertions.assertThat; diff --git a/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/BadCLIOptionsPlugin.java b/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/BadCLIOptionsPlugin.java index a3fe06c572c..d9bde19b1ea 100644 --- a/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/BadCLIOptionsPlugin.java +++ b/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/BadCLIOptionsPlugin.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.tests.acceptance.plugins; diff --git a/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/TestPermissioningPlugin.java b/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/TestPermissioningPlugin.java index 2964e76229f..44afeeadaa5 100644 --- a/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/TestPermissioningPlugin.java +++ b/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/TestPermissioningPlugin.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.tests.acceptance.plugins; import org.hyperledger.besu.plugin.BesuContext; diff --git a/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/privacy/TestPrivacyGroupGenesisProvider.java b/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/privacy/TestPrivacyGroupGenesisProvider.java index d763683ba7f..24d32e759a3 100644 --- a/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/privacy/TestPrivacyGroupGenesisProvider.java +++ b/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/privacy/TestPrivacyGroupGenesisProvider.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.tests.acceptance.plugins.privacy; diff --git a/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/privacy/TestPrivacyPluginPayloadProvider.java b/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/privacy/TestPrivacyPluginPayloadProvider.java index 2a26218a6b8..c375946c98b 100644 --- a/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/privacy/TestPrivacyPluginPayloadProvider.java +++ b/acceptance-tests/test-plugins/src/main/java/org/hyperledger/besu/tests/acceptance/plugins/privacy/TestPrivacyPluginPayloadProvider.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.tests.acceptance.plugins.privacy; diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/AbstractPreexistingNodeTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/AbstractPreexistingNodeTest.java index a407b389e44..fe148921002 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/AbstractPreexistingNodeTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/AbstractPreexistingNodeTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.tests.acceptance; import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/backup/BackupRoundTripAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/backup/BackupRoundTripAcceptanceTest.java index aa58ffb2fdf..56560247435 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/backup/BackupRoundTripAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/backup/BackupRoundTripAcceptanceTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.tests.acceptance.backup; import static java.util.Collections.singletonList; diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/crypto/SECP256R1AcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/crypto/SECP256R1AcceptanceTest.java index 7164de0b7aa..7488b0603e8 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/crypto/SECP256R1AcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/crypto/SECP256R1AcceptanceTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.tests.acceptance.crypto; diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/database/DatabaseMigrationAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/database/DatabaseMigrationAcceptanceTest.java index b2166a1cc58..428803544ce 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/database/DatabaseMigrationAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/database/DatabaseMigrationAcceptanceTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.tests.acceptance.database; import static java.util.Collections.singletonList; diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/BadCLIOptionsPluginTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/BadCLIOptionsPluginTest.java index 733fdc6a7c2..fb35aaacf54 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/BadCLIOptionsPluginTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/BadCLIOptionsPluginTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.tests.acceptance.plugins; diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/PermissioningPluginTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/PermissioningPluginTest.java index 60047c16579..86756a42082 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/PermissioningPluginTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/PermissioningPluginTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.tests.acceptance.plugins; import org.hyperledger.besu.datatypes.Hash; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/DataStorageOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/DataStorageOptions.java index 3d9bb759d73..c380fb6c2cf 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/DataStorageOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/DataStorageOptions.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.cli.options.stable; import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/PkiBlockCreationOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/PkiBlockCreationOptions.java index e3673a1ab8e..b73597c1033 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/PkiBlockCreationOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/PkiBlockCreationOptions.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.cli.options.unstable; import static java.util.Arrays.asList; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/BackupState.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/BackupState.java index 62621328b46..03e55676440 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/BackupState.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/BackupState.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.cli.subcommands.operator; import static com.google.common.base.Preconditions.checkArgument; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/GenerateLogBloomCache.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/GenerateLogBloomCache.java index c1a813183ff..c13718f0ecd 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/GenerateLogBloomCache.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/GenerateLogBloomCache.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.cli.subcommands.operator; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/RestoreState.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/RestoreState.java index 8013bb0899f..78d07544b4e 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/RestoreState.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/RestoreState.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.cli.subcommands.operator; import static org.hyperledger.besu.cli.DefaultCommandValues.MANDATORY_LONG_FORMAT_HELP; diff --git a/besu/src/main/java/org/hyperledger/besu/controller/BftBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/BftBesuControllerBuilder.java index 4e15a3829c3..1a0ab97e140 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/BftBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/BftBesuControllerBuilder.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.controller; import org.hyperledger.besu.consensus.common.bft.BftBlockInterface; diff --git a/besu/src/main/java/org/hyperledger/besu/services/PermissioningServiceImpl.java b/besu/src/main/java/org/hyperledger/besu/services/PermissioningServiceImpl.java index a44e70843bc..7c046d47c4a 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/PermissioningServiceImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/PermissioningServiceImpl.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.services; import org.hyperledger.besu.plugin.services.PermissioningService; diff --git a/besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java b/besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java index bd396228ade..46d792f34ee 100644 --- a/besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java +++ b/besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu; import static org.assertj.core.api.Assertions.assertThat; diff --git a/config/src/main/java/org/hyperledger/besu/config/QbftFork.java b/config/src/main/java/org/hyperledger/besu/config/QbftFork.java index 3461a7eedf6..14d49e9ac2f 100644 --- a/config/src/main/java/org/hyperledger/besu/config/QbftFork.java +++ b/config/src/main/java/org/hyperledger/besu/config/QbftFork.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.config; import java.util.Arrays; diff --git a/consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/CliqueBlockChoiceTests.java b/consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/CliqueBlockChoiceTests.java index 3b8a7e15379..2bdb89c8f14 100644 --- a/consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/CliqueBlockChoiceTests.java +++ b/consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/CliqueBlockChoiceTests.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.consensus.clique; import static org.assertj.core.api.Assertions.assertThat; diff --git a/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftExecutors.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftExecutors.java index fc06275f61e..30038add3d4 100644 --- a/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftExecutors.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftExecutors.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.common.bft; import org.hyperledger.besu.ethereum.eth.manager.MonitoredExecutors; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/KeyStoreWrapperProvider.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/KeyStoreWrapperProvider.java index 9fd7adde0c5..d6801a3c2da 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/KeyStoreWrapperProvider.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/KeyStoreWrapperProvider.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.pki; import org.hyperledger.besu.pki.keystore.KeyStoreWrapper; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfiguration.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfiguration.java index 399886119bf..eb03d10b48d 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfiguration.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfiguration.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.pki; import org.hyperledger.besu.pki.keystore.KeyStoreWrapper; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfigurationProvider.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfigurationProvider.java index 8dfb6048a1a..a1f0633f20b 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfigurationProvider.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiBlockCreationConfigurationProvider.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.pki; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHashing.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHashing.java index f3640d4d508..35741f75238 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHashing.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHashing.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.pki; import org.hyperledger.besu.consensus.common.bft.BftBlockHashing; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHeaderFunctions.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHeaderFunctions.java index 9dbc1f032b5..936e1868d8e 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHeaderFunctions.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftBlockHeaderFunctions.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.pki; import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraData.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraData.java index 9de2247c2f7..8d047c79e6b 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraData.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraData.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.pki; import org.hyperledger.besu.consensus.common.bft.BftExtraData; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraDataCodec.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraDataCodec.java index 1493f1d0a2a..570e5017547 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraDataCodec.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/pki/PkiQbftExtraDataCodec.java @@ -1,16 +1,13 @@ /* * Copyright ConsenSys AG. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/CreateBlockForProposalBehaviour.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/CreateBlockForProposalBehaviour.java index 806c3bcdfd7..2a29e8452e3 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/CreateBlockForProposalBehaviour.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/CreateBlockForProposalBehaviour.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.statemachine; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validator/ForkingValidatorProvider.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validator/ForkingValidatorProvider.java index d24e61d75da..40d139e7d2e 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validator/ForkingValidatorProvider.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validator/ForkingValidatorProvider.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.validator; import org.hyperledger.besu.config.QbftConfigOptions; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/QbftExtraDataCodecTestUtils.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/QbftExtraDataCodecTestUtils.java index 29903385111..9137ec55780 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/QbftExtraDataCodecTestUtils.java +++ b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/QbftExtraDataCodecTestUtils.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft; public class QbftExtraDataCodecTestUtils { diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validator/ForkingValidatorProviderTest.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validator/ForkingValidatorProviderTest.java index 023e195e350..b61e33ae2c0 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validator/ForkingValidatorProviderTest.java +++ b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validator/ForkingValidatorProviderTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.consensus.qbft.validator; import static java.util.Collections.emptyList; From 4c3f4b37a2b4e9e469648629d7027ee7a9f8a9e6 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 10:36:34 +1000 Subject: [PATCH 36/59] build - Update license headers formatting (#7017) Fix headers formatting under: enclave/ evm/ nat/ pki/ util/ --------- Signed-off-by: Usman Saleem --- .../org/hyperledger/besu/enclave/TlsCertificateDefinition.java | 1 - .../org/hyperledger/besu/enclave/TlsEnabledEnclaveTest.java | 1 - .../hyperledger/besu/enclave/TlsEnabledHttpServerFactory.java | 1 - .../java/org/hyperledger/besu/enclave/TlsHelpers.java | 1 - .../besu/evm/gascalculator/ByzantiumGasCalculator.java | 1 - .../org/hyperledger/besu/evm/operation/VirtualOperation.java | 1 - .../besu/evm/precompile/AbstractAltBnPrecompiledContract.java | 1 - .../besu/evm/precompile/AbstractBLS12PrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12G1AddPrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12G1MulPrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12G1MultiExpPrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12G2AddPrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12G2MulPrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12G2MultiExpPrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12MapFpToG1PrecompiledContract.java | 1 - .../besu/evm/precompile/BLS12PairingPrecompiledContract.java | 1 - .../org/hyperledger/besu/evm/worldstate/JournaledAccount.java | 2 -- .../hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java | 2 -- .../besu/evm/precompile/BLS12G1AddPrecompiledContractTest.java | 1 - .../besu/evm/precompile/BLS12G1MulPrecompiledContractTest.java | 1 - .../evm/precompile/BLS12G1MultiExpPrecompiledContractTest.java | 1 - .../besu/evm/precompile/BLS12G2AddPrecompiledContractTest.java | 1 - .../besu/evm/precompile/BLS12G2MulPrecompiledContractTest.java | 1 - .../evm/precompile/BLS12G2MultiExpPrecompiledContractTest.java | 1 - .../evm/precompile/BLS12MapFp2ToG2PrecompiledContractTest.java | 1 - .../evm/precompile/BLS12MapFpToG1PrecompiledContractTest.java | 1 - .../evm/precompile/BLS12PairingPrecompiledContractTest.java | 1 - .../java/org/hyperledger/besu/evm/precompile/Benchmarks.java | 2 -- nat/src/main/java/org/hyperledger/besu/nat/core/IpDetector.java | 1 - .../java/org/hyperledger/besu/nat/core/NatMethodDetector.java | 1 - .../org/hyperledger/besu/nat/core/domain/NatPortMapping.java | 1 - .../org/hyperledger/besu/nat/core/domain/NatServiceType.java | 1 - .../org/hyperledger/besu/nat/core/domain/NetworkProtocol.java | 1 - .../java/org/hyperledger/besu/nat/docker/DockerDetector.java | 1 - .../java/org/hyperledger/besu/nat/docker/DockerNatManager.java | 1 - .../org/hyperledger/besu/nat/docker/HostBasedIpDetector.java | 1 - .../org/hyperledger/besu/nat/kubernetes/KubernetesDetector.java | 1 - .../hyperledger/besu/nat/kubernetes/KubernetesNatManager.java | 1 - nat/src/test/java/org/hyperledger/besu/nat/NatServiceTest.java | 1 - .../org/hyperledger/besu/nat/core/AbstractNatManagerTest.java | 1 - .../org/hyperledger/besu/pki/util/TestCertificateUtils.java | 1 - .../java/org/hyperledger/besu/util/io/RollingFileReader.java | 2 -- .../java/org/hyperledger/besu/util/io/RollingFileWriter.java | 2 -- 44 files changed, 49 deletions(-) diff --git a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsCertificateDefinition.java b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsCertificateDefinition.java index 4f09831b003..ad1271e9200 100644 --- a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsCertificateDefinition.java +++ b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsCertificateDefinition.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.enclave; import java.io.File; diff --git a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsEnabledEnclaveTest.java b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsEnabledEnclaveTest.java index fc99551577d..b5947793060 100644 --- a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsEnabledEnclaveTest.java +++ b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsEnabledEnclaveTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.enclave; import static org.assertj.core.api.Assertions.assertThat; diff --git a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsEnabledHttpServerFactory.java b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsEnabledHttpServerFactory.java index 6538c4a4a91..7c67aeb7b9e 100644 --- a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsEnabledHttpServerFactory.java +++ b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsEnabledHttpServerFactory.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.enclave; import static org.hyperledger.besu.enclave.TlsHelpers.populateFingerprintFile; diff --git a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsHelpers.java b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsHelpers.java index 89ecddba272..09002f81151 100644 --- a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsHelpers.java +++ b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/TlsHelpers.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.enclave; import org.hyperledger.besu.crypto.MessageDigestFactory; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ByzantiumGasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ByzantiumGasCalculator.java index 2bc25458e96..bc17bdf81d1 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ByzantiumGasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ByzantiumGasCalculator.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.gascalculator; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/VirtualOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/VirtualOperation.java index fdb61bff490..309ede2d9d5 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/VirtualOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/VirtualOperation.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.evm.operation; import org.hyperledger.besu.evm.EVM; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractAltBnPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractAltBnPrecompiledContract.java index c02b484eb27..84ce6c6cf99 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractAltBnPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractAltBnPrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractBLS12PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractBLS12PrecompiledContract.java index 159e4d39962..21eab01f979 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractBLS12PrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractBLS12PrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1AddPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1AddPrecompiledContract.java index c15f5748305..0be201f1a53 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1AddPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1AddPrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1MulPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1MulPrecompiledContract.java index 42e90a9f478..baf1ed35fc6 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1MulPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1MulPrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1MultiExpPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1MultiExpPrecompiledContract.java index 536ff56d606..e3366f491d8 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1MultiExpPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G1MultiExpPrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2AddPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2AddPrecompiledContract.java index 906fc62fd08..08d1159c279 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2AddPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2AddPrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2MulPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2MulPrecompiledContract.java index 4b7fef54b11..9e4ce9988e6 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2MulPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2MulPrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2MultiExpPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2MultiExpPrecompiledContract.java index c5ce2856218..21ed12dad2e 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2MultiExpPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12G2MultiExpPrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContract.java index e56517253c0..603b7e887b3 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12MapFpToG1PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12MapFpToG1PrecompiledContract.java index c0cd00b2e63..a512b24966e 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12MapFpToG1PrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12MapFpToG1PrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12PairingPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12PairingPrecompiledContract.java index 309b3e377ae..e6ccd98227a 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12PairingPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLS12PairingPrecompiledContract.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/JournaledAccount.java b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/JournaledAccount.java index e527e5301d9..052a0663c38 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/JournaledAccount.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/JournaledAccount.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.worldstate; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java index a8c697a21f6..abe33a88601 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/UpdateTrackingAccount.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.worldstate; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1AddPrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1AddPrecompiledContractTest.java index 293976e7f8b..a46d33fced3 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1AddPrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1AddPrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1MulPrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1MulPrecompiledContractTest.java index bb5a2e1cb80..e938d369fac 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1MulPrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1MulPrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1MultiExpPrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1MultiExpPrecompiledContractTest.java index b4d21661f11..ee470df4982 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1MultiExpPrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G1MultiExpPrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2AddPrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2AddPrecompiledContractTest.java index b2865c57ebf..d685dd4b528 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2AddPrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2AddPrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2MulPrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2MulPrecompiledContractTest.java index b33cfb73cea..07557379697 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2MulPrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2MulPrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2MultiExpPrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2MultiExpPrecompiledContractTest.java index 21f9084d570..bb08b6725f0 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2MultiExpPrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12G2MultiExpPrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContractTest.java index c90e2a1eb41..584e6ed56a6 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12MapFp2ToG2PrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12MapFpToG1PrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12MapFpToG1PrecompiledContractTest.java index 6f269b7880f..ba5f6bf8f50 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12MapFpToG1PrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12MapFpToG1PrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12PairingPrecompiledContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12PairingPrecompiledContractTest.java index a1e3b49fc25..db4855786e8 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12PairingPrecompiledContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/BLS12PairingPrecompiledContractTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.precompile; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/Benchmarks.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/Benchmarks.java index e25701d6d0d..458f0c95587 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/Benchmarks.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/Benchmarks.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.precompile; import static java.nio.charset.StandardCharsets.UTF_8; diff --git a/nat/src/main/java/org/hyperledger/besu/nat/core/IpDetector.java b/nat/src/main/java/org/hyperledger/besu/nat/core/IpDetector.java index 55e5861d2ec..faff6398638 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/core/IpDetector.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/core/IpDetector.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.core; import java.util.Optional; diff --git a/nat/src/main/java/org/hyperledger/besu/nat/core/NatMethodDetector.java b/nat/src/main/java/org/hyperledger/besu/nat/core/NatMethodDetector.java index 08cee0dd5b3..73c161b2455 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/core/NatMethodDetector.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/core/NatMethodDetector.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.core; import org.hyperledger.besu.nat.NatMethod; diff --git a/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NatPortMapping.java b/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NatPortMapping.java index 3b1ea6a14e2..d980c90bd47 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NatPortMapping.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NatPortMapping.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.core.domain; /** This class describes a NAT configuration. */ diff --git a/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NatServiceType.java b/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NatServiceType.java index 2702254cadd..666ba9b2880 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NatServiceType.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NatServiceType.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.core.domain; /** diff --git a/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NetworkProtocol.java b/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NetworkProtocol.java index a8ab4939bab..bc2f0fb39d8 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NetworkProtocol.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/core/domain/NetworkProtocol.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.core.domain; /** diff --git a/nat/src/main/java/org/hyperledger/besu/nat/docker/DockerDetector.java b/nat/src/main/java/org/hyperledger/besu/nat/docker/DockerDetector.java index e7f1cf2328b..4ac6656573c 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/docker/DockerDetector.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/docker/DockerDetector.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.docker; import org.hyperledger.besu.nat.NatMethod; diff --git a/nat/src/main/java/org/hyperledger/besu/nat/docker/DockerNatManager.java b/nat/src/main/java/org/hyperledger/besu/nat/docker/DockerNatManager.java index da2fd0e1a7d..002fe7b4ec4 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/docker/DockerNatManager.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/docker/DockerNatManager.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.docker; import org.hyperledger.besu.nat.NatMethod; diff --git a/nat/src/main/java/org/hyperledger/besu/nat/docker/HostBasedIpDetector.java b/nat/src/main/java/org/hyperledger/besu/nat/docker/HostBasedIpDetector.java index a7cd1c656aa..42b2019e29e 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/docker/HostBasedIpDetector.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/docker/HostBasedIpDetector.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.docker; import org.hyperledger.besu.nat.core.IpDetector; diff --git a/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesDetector.java b/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesDetector.java index 4176216869c..755f52b9e23 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesDetector.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesDetector.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.kubernetes; import org.hyperledger.besu.nat.NatMethod; diff --git a/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java b/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java index e60b7788642..0cf6bc4f765 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.kubernetes; import org.hyperledger.besu.nat.NatMethod; diff --git a/nat/src/test/java/org/hyperledger/besu/nat/NatServiceTest.java b/nat/src/test/java/org/hyperledger/besu/nat/NatServiceTest.java index ae51ab6a352..62bc8834914 100644 --- a/nat/src/test/java/org/hyperledger/besu/nat/NatServiceTest.java +++ b/nat/src/test/java/org/hyperledger/besu/nat/NatServiceTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat; import static org.assertj.core.api.Assertions.assertThat; diff --git a/nat/src/test/java/org/hyperledger/besu/nat/core/AbstractNatManagerTest.java b/nat/src/test/java/org/hyperledger/besu/nat/core/AbstractNatManagerTest.java index 768d2a2bd01..330a21dba08 100644 --- a/nat/src/test/java/org/hyperledger/besu/nat/core/AbstractNatManagerTest.java +++ b/nat/src/test/java/org/hyperledger/besu/nat/core/AbstractNatManagerTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.nat.core; import static org.assertj.core.api.Assertions.assertThat; diff --git a/pki/src/test/java/org/hyperledger/besu/pki/util/TestCertificateUtils.java b/pki/src/test/java/org/hyperledger/besu/pki/util/TestCertificateUtils.java index 190e90213c9..e9502e30e66 100644 --- a/pki/src/test/java/org/hyperledger/besu/pki/util/TestCertificateUtils.java +++ b/pki/src/test/java/org/hyperledger/besu/pki/util/TestCertificateUtils.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.pki.util; import org.hyperledger.besu.pki.cms.CmsCreator; diff --git a/util/src/main/java/org/hyperledger/besu/util/io/RollingFileReader.java b/util/src/main/java/org/hyperledger/besu/util/io/RollingFileReader.java index c7cf98edda3..e9d3ee807a6 100644 --- a/util/src/main/java/org/hyperledger/besu/util/io/RollingFileReader.java +++ b/util/src/main/java/org/hyperledger/besu/util/io/RollingFileReader.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.util.io; import java.io.Closeable; diff --git a/util/src/main/java/org/hyperledger/besu/util/io/RollingFileWriter.java b/util/src/main/java/org/hyperledger/besu/util/io/RollingFileWriter.java index 93e7e1d6f0c..81e1e5e8d70 100644 --- a/util/src/main/java/org/hyperledger/besu/util/io/RollingFileWriter.java +++ b/util/src/main/java/org/hyperledger/besu/util/io/RollingFileWriter.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.util.io; import java.io.Closeable; From a98dfff4f66b384e8ec2ae260972970a1a9e8695 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 11:10:25 +1000 Subject: [PATCH 37/59] build - Update license headers formatting (#7018) Fix license headers formatting under: ethereum/ --------- Signed-off-by: Usman Saleem --- .../methods/EthGetBlockByNumberLatestDesyncIntegrationTest.java | 1 - .../org/hyperledger/besu/ethereum/api/ApiConfiguration.java | 2 -- .../jsonrpc/internal/methods/AdminGenerateLogBloomCache.java | 2 -- .../jsonrpc/internal/methods/EthGetMinerDataByBlockHash.java | 1 - .../jsonrpc/internal/methods/EthGetMinerDataByBlockNumber.java | 1 - .../api/jsonrpc/internal/privacy/methods/priv/PrivUtil.java | 1 - .../ethereum/api/jsonrpc/internal/results/ProtocolsResult.java | 2 -- .../api/jsonrpc/internal/results/tracing/diff/AccountDiff.java | 2 -- .../api/jsonrpc/internal/results/tracing/diff/DiffNode.java | 2 -- .../internal/results/tracing/diff/StateDiffGenerator.java | 2 -- .../jsonrpc/internal/results/tracing/diff/StateDiffTrace.java | 2 -- .../ethereum/api/query/cache/TransactionLogBloomCacher.java | 2 -- .../besu/ethereum/api/tls/TlsClientAuthConfiguration.java | 1 - .../org/hyperledger/besu/ethereum/api/tls/TlsConfiguration.java | 1 - .../besu/ethereum/api/tls/TlsConfigurationException.java | 1 - .../besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java | 1 - .../api/jsonrpc/LimitConnectionsJsonRpcHttpServiceTest.java | 1 - .../api/jsonrpc/MaxBatchSizeJsonRpcHttpServiceTest.java | 1 - .../internal/methods/EthGetMinerDataByBlockHashTest.java | 1 - .../internal/methods/EthGetMinerDataByBlockNumberTest.java | 1 - .../besu/ethereum/api/query/BlockchainQueriesLogCacheTest.java | 2 -- .../org/hyperledger/besu/ethereum/api/query/LogsQueryTest.java | 2 -- .../besu/ethereum/api/query/StateBackupServiceTest.java | 2 -- .../ethereum/api/query/cache/TransactionLogBloomCacherTest.java | 2 -- .../besu/ethereum/blockcreation/NoopMiningCoordinator.java | 1 - .../org/hyperledger/besu/ethereum/core/GasAndAccessedState.java | 1 - .../besu/ethereum/privacy/PrivateTransactionEvent.java | 1 - .../besu/ethereum/privacy/PrivateTransactionObserver.java | 1 - .../besu/ethereum/trie/common/GenesisWorldStateProvider.java | 2 -- .../besu/ethereum/trie/diffbased/bonsai/BonsaiAccount.java | 2 -- .../trie/diffbased/bonsai/worldview/BonsaiWorldState.java | 2 -- .../ethereum/trie/diffbased/common/trielog/TrieLogLayer.java | 2 -- .../besu/ethereum/worldstate/DataStorageConfiguration.java | 2 -- .../hyperledger/besu/ethereum/core/ProtocolScheduleFixture.java | 1 - .../hyperledger/besu/ethereum/core/TransactionBuilderTest.java | 1 - .../mainnet/MainnetPrecompiledContractRegistriesTest.java | 1 - .../mainnet/precompiles/AbstractPrecompiledContractTest.java | 2 -- .../besu/ethereum/privacy/PrivateWorldStateReaderTest.java | 1 - .../trie/diffbased/bonsai/BonsaiWorldStateProviderTest.java | 1 - .../besu/ethereum/trie/diffbased/bonsai/LogRollingTests.java | 2 -- .../besu/ethereum/trie/diffbased/bonsai/RollingImport.java | 2 -- .../besu/ethereum/eth/manager/ChainHeadEstimate.java | 1 - .../besu/ethereum/eth/manager/ChainStateSnapshot.java | 1 - .../hyperledger/besu/ethereum/eth/sync/state/InSyncTracker.java | 1 - .../ethereum/eth/sync/worldstate/WorldStateDownloadStatus.java | 2 -- .../java/org/hyperledger/besu/evmtool/BlockchainModule.java | 1 - .../main/java/org/hyperledger/besu/evmtool/DataStoreModule.java | 1 - .../src/main/java/org/hyperledger/besu/evmtool/EvmTool.java | 1 - .../main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java | 1 - .../hyperledger/besu/evmtool/EvmToolCommandOptionsModule.java | 2 -- .../java/org/hyperledger/besu/evmtool/GenesisFileModule.java | 1 - .../org/hyperledger/besu/evmtool/MainnetGenesisFileModule.java | 1 - .../main/java/org/hyperledger/besu/evmtool/ProtocolModule.java | 1 - .../java/org/hyperledger/besu/evmtool/StateTestSubCommand.java | 2 -- .../main/java/org/hyperledger/besu/evmtool/VersionProvider.java | 1 - .../besu/ethereum/p2p/discovery/internal/DevP2PException.java | 1 - .../ethereum/p2p/rlpx/connections/netty/TLSConfiguration.java | 1 - .../referencetests/BlockchainReferenceTestCaseSpec.java | 1 - .../besu/ethereum/referencetests/EnvironmentInformation.java | 1 - .../ethereum/referencetests/GeneralStateTestCaseEipSpec.java | 1 - .../besu/ethereum/referencetests/GeneralStateTestCaseSpec.java | 1 - .../besu/ethereum/referencetests/ReferenceTestBlockchain.java | 1 - .../besu/ethereum/referencetests/ReferenceTestEnv.java | 2 -- .../ethereum/referencetests/ReferenceTestProtocolSchedules.java | 1 - .../besu/ethereum/referencetests/ReferenceTestWorldState.java | 1 - .../referencetests/StateTestAccessListDeserializer.java | 1 - .../ethereum/referencetests/StateTestVersionedTransaction.java | 1 - .../besu/ethereum/referencetests/VMReferenceTestCaseSpec.java | 1 - .../hyperledger/besu/ethereum/retesteth/DummySynchronizer.java | 1 - .../besu/ethereum/retesteth/methods/TestImportRawBlockTest.java | 2 -- 70 files changed, 95 deletions(-) diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthGetBlockByNumberLatestDesyncIntegrationTest.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthGetBlockByNumberLatestDesyncIntegrationTest.java index 927aff6404c..088eff85007 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthGetBlockByNumberLatestDesyncIntegrationTest.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthGetBlockByNumberLatestDesyncIntegrationTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.methods; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/ApiConfiguration.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/ApiConfiguration.java index 42a7f8f62e0..66663ce4fd8 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/ApiConfiguration.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/ApiConfiguration.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api; import java.util.function.LongSupplier; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AdminGenerateLogBloomCache.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AdminGenerateLogBloomCache.java index c9989ced427..fd197110b68 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AdminGenerateLogBloomCache.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AdminGenerateLogBloomCache.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHash.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHash.java index 1d3d647e3f2..0e868d89870 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHash.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHash.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; import org.hyperledger.besu.datatypes.Hash; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockNumber.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockNumber.java index 64a89c89194..83ca008890d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockNumber.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockNumber.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; import org.hyperledger.besu.datatypes.Hash; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivUtil.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivUtil.java index 08a3e3a04c5..8db4b73bdb4 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivUtil.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivUtil.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/ProtocolsResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/ProtocolsResult.java index a412f4287b3..8a21424012d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/ProtocolsResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/ProtocolsResult.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; import org.hyperledger.besu.ethereum.eth.manager.ChainState.BestBlock; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/AccountDiff.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/AccountDiff.java index cabf33c8470..44ae5e788bf 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/AccountDiff.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/AccountDiff.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.diff; import java.util.Map; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/DiffNode.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/DiffNode.java index 46b4252bb47..e952f9b2912 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/DiffNode.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/DiffNode.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.diff; import java.io.IOException; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/StateDiffGenerator.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/StateDiffGenerator.java index ffc816db736..8656c8e0c1b 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/StateDiffGenerator.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/StateDiffGenerator.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.diff; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/StateDiffTrace.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/StateDiffTrace.java index 1a2ecc3d696..7e4213780ed 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/StateDiffTrace.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/diff/StateDiffTrace.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.diff; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.Trace; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/cache/TransactionLogBloomCacher.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/cache/TransactionLogBloomCacher.java index 69a9edc82f5..270f4d63de4 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/cache/TransactionLogBloomCacher.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/cache/TransactionLogBloomCacher.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.query.cache; import static com.google.common.base.Preconditions.checkArgument; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsClientAuthConfiguration.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsClientAuthConfiguration.java index c32b6e4c0b8..f765405bcaf 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsClientAuthConfiguration.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsClientAuthConfiguration.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.tls; import java.nio.file.Path; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsConfiguration.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsConfiguration.java index 9fa86722e08..9f9122a8b10 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsConfiguration.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsConfiguration.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.tls; import static java.util.Objects.requireNonNull; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsConfigurationException.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsConfigurationException.java index 05cf3b04c6d..3aa8e8ccf34 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsConfigurationException.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/tls/TlsConfigurationException.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.tls; public class TlsConfigurationException extends RuntimeException { diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java index 159e99b0bfb..f8c9dbc18fb 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc; import static org.mockito.Mockito.mock; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/LimitConnectionsJsonRpcHttpServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/LimitConnectionsJsonRpcHttpServiceTest.java index 625e3fe5687..b1618a0dcf3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/LimitConnectionsJsonRpcHttpServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/LimitConnectionsJsonRpcHttpServiceTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/MaxBatchSizeJsonRpcHttpServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/MaxBatchSizeJsonRpcHttpServiceTest.java index 3c206fa2235..2e283a65b97 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/MaxBatchSizeJsonRpcHttpServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/MaxBatchSizeJsonRpcHttpServiceTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHashTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHashTest.java index 653f6835f35..08737d0546c 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHashTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHashTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockNumberTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockNumberTest.java index 5c0dc630bc2..ca65fcf42ab 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockNumberTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockNumberTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueriesLogCacheTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueriesLogCacheTest.java index 7a543093dc6..41abccf54b7 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueriesLogCacheTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueriesLogCacheTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.query; import static org.hyperledger.besu.ethereum.api.query.cache.TransactionLogBloomCacher.BLOCKS_PER_BLOOM_CACHE; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/LogsQueryTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/LogsQueryTest.java index 95a5103546e..748222d2feb 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/LogsQueryTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/LogsQueryTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.query; import static java.util.Collections.singletonList; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/StateBackupServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/StateBackupServiceTest.java index d8103963fc3..ee5d0f347d1 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/StateBackupServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/StateBackupServiceTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.query; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/cache/TransactionLogBloomCacherTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/cache/TransactionLogBloomCacherTest.java index cc39639243a..293c0b176ea 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/cache/TransactionLogBloomCacherTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/cache/TransactionLogBloomCacherTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.query.cache; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/NoopMiningCoordinator.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/NoopMiningCoordinator.java index ea4f2c756f2..b0b49ed0e8f 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/NoopMiningCoordinator.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/NoopMiningCoordinator.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.blockcreation; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/GasAndAccessedState.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/GasAndAccessedState.java index 3ef9dcd4053..c7a834ce263 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/GasAndAccessedState.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/GasAndAccessedState.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.core; import static java.util.Collections.emptySet; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionEvent.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionEvent.java index aa28a3e8baf..1ea854ebbfd 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionEvent.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionEvent.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.privacy; public class PrivateTransactionEvent { diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionObserver.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionObserver.java index 9168d45e735..8d3ca436839 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionObserver.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionObserver.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.privacy; @FunctionalInterface diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/common/GenesisWorldStateProvider.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/common/GenesisWorldStateProvider.java index 7f89ff7185c..79855c1e52c 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/common/GenesisWorldStateProvider.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/common/GenesisWorldStateProvider.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.common; import org.hyperledger.besu.ethereum.core.MutableWorldState; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiAccount.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiAccount.java index 7ca6ef2b693..b83f9e8b7cd 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiAccount.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiAccount.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai; import org.hyperledger.besu.datatypes.AccountValue; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldState.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldState.java index 3b3af540d7b..30b3d8440bc 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldState.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldState.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.worldview; import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.TRIE_BRANCH_STORAGE; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogLayer.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogLayer.java index ff6ef226ef7..fffbe5c373a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogLayer.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogLayer.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.trielog; import static com.google.common.base.Preconditions.checkState; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java index 7ad5362aeff..12be8fc471d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.worldstate; import org.hyperledger.besu.plugin.services.storage.DataStorageFormat; diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/ProtocolScheduleFixture.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/ProtocolScheduleFixture.java index 0df40c56da3..a4c6556ea34 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/ProtocolScheduleFixture.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/ProtocolScheduleFixture.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.core; import static org.hyperledger.besu.config.JsonUtil.normalizeKeys; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/TransactionBuilderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/TransactionBuilderTest.java index 91d19c28dce..e56b9bc0e8a 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/TransactionBuilderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/TransactionBuilderTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.core; import static java.util.stream.Collectors.toUnmodifiableSet; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetPrecompiledContractRegistriesTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetPrecompiledContractRegistriesTest.java index 0bee331d17b..8bedaad0c77 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetPrecompiledContractRegistriesTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetPrecompiledContractRegistriesTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/AbstractPrecompiledContractTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/AbstractPrecompiledContractTest.java index eb4cc5cc670..f51a550eadb 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/AbstractPrecompiledContractTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/AbstractPrecompiledContractTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.mainnet.precompiles; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateWorldStateReaderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateWorldStateReaderTest.java index acc5313cd84..3f7bc81d3c1 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateWorldStateReaderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateWorldStateReaderTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.privacy; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiWorldStateProviderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiWorldStateProviderTest.java index 879183ecc38..4ac99377ef0 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiWorldStateProviderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiWorldStateProviderTest.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/LogRollingTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/LogRollingTests.java index e26436c4271..e89747d5e3e 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/LogRollingTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/LogRollingTests.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/RollingImport.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/RollingImport.java index 134d094a4dd..0c2c1898927 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/RollingImport.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/RollingImport.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai; import static com.google.common.base.Preconditions.checkArgument; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/ChainHeadEstimate.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/ChainHeadEstimate.java index 7e92c1c0a53..3b109d97ca3 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/ChainHeadEstimate.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/ChainHeadEstimate.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.manager; import org.hyperledger.besu.ethereum.chain.ChainHead; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/ChainStateSnapshot.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/ChainStateSnapshot.java index fa7baa7c0a3..b486de027d8 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/ChainStateSnapshot.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/ChainStateSnapshot.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.manager; import org.hyperledger.besu.ethereum.core.Difficulty; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/state/InSyncTracker.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/state/InSyncTracker.java index 5b7189cf787..2be996877dd 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/state/InSyncTracker.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/state/InSyncTracker.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.state; import org.hyperledger.besu.ethereum.chain.ChainHead; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/worldstate/WorldStateDownloadStatus.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/worldstate/WorldStateDownloadStatus.java index 9c38b0e18b8..d54d5253d88 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/worldstate/WorldStateDownloadStatus.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/worldstate/WorldStateDownloadStatus.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.eth.sync.worldstate; import java.util.Optional; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainModule.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainModule.java index 9ff360cd549..b3a1531133a 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainModule.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainModule.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/DataStoreModule.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/DataStoreModule.java index 05dff094191..28b212024c5 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/DataStoreModule.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/DataStoreModule.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmTool.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmTool.java index 00582c9503d..43c1a666d6a 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmTool.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmTool.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java index 59a72f28254..9e322c61d08 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommandOptionsModule.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommandOptionsModule.java index 9ef1036ee40..017320aca1a 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommandOptionsModule.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommandOptionsModule.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evmtool; import static org.hyperledger.besu.cli.DefaultCommandValues.getDefaultBesuDataPath; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/GenesisFileModule.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/GenesisFileModule.java index 596c9eddc7f..506c3911d8f 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/GenesisFileModule.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/GenesisFileModule.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/MainnetGenesisFileModule.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/MainnetGenesisFileModule.java index 5b5f2e0fb8b..af7ed1fc8c8 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/MainnetGenesisFileModule.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/MainnetGenesisFileModule.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/ProtocolModule.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/ProtocolModule.java index 14702bc5e8d..13ec7d877bd 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/ProtocolModule.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/ProtocolModule.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java index 3368c458e14..3e1b0270a0b 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evmtool; import static java.nio.charset.StandardCharsets.UTF_8; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/VersionProvider.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/VersionProvider.java index f20e8d21087..d97fded8825 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/VersionProvider.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/VersionProvider.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/DevP2PException.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/DevP2PException.java index b5f80faa8e1..8a8d7551dcc 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/DevP2PException.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/DevP2PException.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.p2p.discovery.internal; public class DevP2PException extends RuntimeException { diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/TLSConfiguration.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/TLSConfiguration.java index 52771bc4212..2bcb6ddbc65 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/TLSConfiguration.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/TLSConfiguration.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty; import static java.util.Objects.requireNonNull; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java index a8466f4528c..c8686a8881e 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/EnvironmentInformation.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/EnvironmentInformation.java index d0dc94b4ab6..7f2f327b31a 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/EnvironmentInformation.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/EnvironmentInformation.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/GeneralStateTestCaseEipSpec.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/GeneralStateTestCaseEipSpec.java index def8c14f17e..d9ed46c336b 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/GeneralStateTestCaseEipSpec.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/GeneralStateTestCaseEipSpec.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/GeneralStateTestCaseSpec.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/GeneralStateTestCaseSpec.java index 59f0a86fe09..73735fdb0e0 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/GeneralStateTestCaseSpec.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/GeneralStateTestCaseSpec.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestBlockchain.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestBlockchain.java index f73e271396d..3773c8d1f05 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestBlockchain.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestBlockchain.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java index 81d8d340bf3..1b981391baa 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.referencetests; import static java.nio.charset.StandardCharsets.UTF_8; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java index 2f3c2c2c347..683e15e0674 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestWorldState.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestWorldState.java index ae446a7607c..8549a2dd150 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestWorldState.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestWorldState.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/StateTestAccessListDeserializer.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/StateTestAccessListDeserializer.java index 470fe2e5f37..0c14829c4c1 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/StateTestAccessListDeserializer.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/StateTestAccessListDeserializer.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/StateTestVersionedTransaction.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/StateTestVersionedTransaction.java index fa18dea1a09..3334c926eec 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/StateTestVersionedTransaction.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/StateTestVersionedTransaction.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/VMReferenceTestCaseSpec.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/VMReferenceTestCaseSpec.java index ba1a9e00602..b39e28010e4 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/VMReferenceTestCaseSpec.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/VMReferenceTestCaseSpec.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.referencetests; diff --git a/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/DummySynchronizer.java b/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/DummySynchronizer.java index 6b10f2c6807..b8d90e9974a 100644 --- a/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/DummySynchronizer.java +++ b/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/DummySynchronizer.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.retesteth; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/retesteth/src/test/java/org/hyperledger/besu/ethereum/retesteth/methods/TestImportRawBlockTest.java b/ethereum/retesteth/src/test/java/org/hyperledger/besu/ethereum/retesteth/methods/TestImportRawBlockTest.java index e8ec55e2d61..76496235386 100644 --- a/ethereum/retesteth/src/test/java/org/hyperledger/besu/ethereum/retesteth/methods/TestImportRawBlockTest.java +++ b/ethereum/retesteth/src/test/java/org/hyperledger/besu/ethereum/retesteth/methods/TestImportRawBlockTest.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.retesteth.methods; import static org.assertj.core.api.Assertions.assertThat; From 9a1f6842ef3eab097d6f61f995995b1d4eefc865 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 11:50:05 +1000 Subject: [PATCH 38/59] build - Update license headers formatting (5) (#7019) Apply license headers formatting under: plugin-api/ plugins/ --------- Signed-off-by: Usman Saleem Co-authored-by: Sally MacFarlane --- plugin-api/build.gradle | 2 +- .../main/java/org/hyperledger/besu/plugin/data/BlockBody.java | 2 -- .../java/org/hyperledger/besu/plugin/services/BesuService.java | 1 - .../besu/plugin/services/PluginVersionsProvider.java | 1 - .../permissioning/NodeMessagePermissioningProvider.java | 1 - .../besu/plugin/services/storage/rocksdb/RocksDbIterator.java | 1 - .../org/hyperledger/besu/plugin/services/helper/Conditions.java | 1 - .../storage/rocksdb/configuration/DatabaseMetadataTest.java | 1 - 8 files changed, 1 insertion(+), 9 deletions(-) diff --git a/plugin-api/build.gradle b/plugin-api/build.gradle index 7795c5b2ca1..4d7774af162 100644 --- a/plugin-api/build.gradle +++ b/plugin-api/build.gradle @@ -69,7 +69,7 @@ Calculated : ${currentHash} tasks.register('checkAPIChanges', FileStateChecker) { description = "Checks that the API for the Plugin-API project does not change without deliberate thought" files = sourceSets.main.allJava.files - knownHash = 'wGHrCxNllf6j/YOB/6UzH5QXYcwwB2AEmYC4GkQVUuE=' + knownHash = 'rCBv4jTpL47h0qSX64edjML55NkqEhq1NRlWwsOZy1Q=' } check.dependsOn('checkAPIChanges') diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockBody.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockBody.java index 9f37d3308f1..0432fb4d77e 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockBody.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockBody.java @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.plugin.data; import org.hyperledger.besu.datatypes.Transaction; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BesuService.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BesuService.java index 19b48d0a45b..62340dd59d6 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BesuService.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BesuService.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services; import org.hyperledger.besu.plugin.BesuContext; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/PluginVersionsProvider.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/PluginVersionsProvider.java index 26604a6488f..63b9a524b1a 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/PluginVersionsProvider.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/PluginVersionsProvider.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services; import java.util.Collection; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/permissioning/NodeMessagePermissioningProvider.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/permissioning/NodeMessagePermissioningProvider.java index dc6d8071fe1..88efdad8a1c 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/permissioning/NodeMessagePermissioningProvider.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/permissioning/NodeMessagePermissioningProvider.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.permissioning; import org.hyperledger.besu.plugin.data.EnodeURL; diff --git a/plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/RocksDbIterator.java b/plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/RocksDbIterator.java index 9a5f9c4a184..ef7f10e6c4e 100644 --- a/plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/RocksDbIterator.java +++ b/plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/RocksDbIterator.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.storage.rocksdb; import static com.google.common.base.Preconditions.checkState; diff --git a/plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/helper/Conditions.java b/plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/helper/Conditions.java index 085e9313536..41f1b294af4 100644 --- a/plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/helper/Conditions.java +++ b/plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/helper/Conditions.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.helper; import java.io.IOException; diff --git a/plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/storage/rocksdb/configuration/DatabaseMetadataTest.java b/plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/storage/rocksdb/configuration/DatabaseMetadataTest.java index 8ceea5b329f..56f5f768625 100644 --- a/plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/storage/rocksdb/configuration/DatabaseMetadataTest.java +++ b/plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/storage/rocksdb/configuration/DatabaseMetadataTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.storage.rocksdb.configuration; import static org.assertj.core.api.Assertions.assertThat; From 70813fc0cae844ca61a373d82f6774c070e27857 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 12:39:44 +1000 Subject: [PATCH 39/59] build - Update license headers formatting (6) (#7020) Fix license headers formatting under: ethereum/ services/ --------- Signed-off-by: Usman Saleem Co-authored-by: Sally MacFarlane --- .../mainnet/DefaultProtocolSchedule.java | 23 ++++++++----------- .../PrivacySupportingProtocolSchedule.java | 22 ++++++++---------- .../transaction/TransactionInvalidReason.java | 23 ++++++++----------- .../AbstractPeerBlockValidator.java | 22 ++++++++---------- .../RequiredBlocksPeerValidator.java | 22 ++++++++---------- .../AbstractPeerBlockValidatorTest.java | 23 ++++++++----------- .../RequiredBlocksPeerValidatorTest.java | 22 ++++++++---------- .../backwardsync/BackwardSyncAlgSpec.java | 23 ++++++++----------- .../backwardsync/BackwardSyncContextTest.java | 23 ++++++++----------- .../backwardsync/ForwardSyncStepTest.java | 23 ++++++++----------- .../services/tasks/TasksPriorityProvider.java | 23 ++++++++----------- 11 files changed, 110 insertions(+), 139 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/DefaultProtocolSchedule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/DefaultProtocolSchedule.java index 4c209ac096d..e868abf2aed 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/DefaultProtocolSchedule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/DefaultProtocolSchedule.java @@ -1,20 +1,17 @@ /* + * Copyright contributors to Hyperledger Besu. * - * * Copyright Hyperledger Besu Contributors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import static com.google.common.base.Preconditions.checkArgument; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacySupportingProtocolSchedule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacySupportingProtocolSchedule.java index e882c672fc6..953280a57ae 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacySupportingProtocolSchedule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacySupportingProtocolSchedule.java @@ -1,18 +1,16 @@ /* + * Copyright contributors to Hyperledger Besu. * - * * Copyright Hyperledger Besu Contributors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ package org.hyperledger.besu.ethereum.mainnet; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionInvalidReason.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionInvalidReason.java index c2d5bc3d8ab..8659b9d8374 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionInvalidReason.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionInvalidReason.java @@ -1,20 +1,17 @@ /* + * Copyright ConsenSys AG. * - * * Copyright ConsenSys AG. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.transaction; public enum TransactionInvalidReason { diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/AbstractPeerBlockValidator.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/AbstractPeerBlockValidator.java index 4483e14cdfa..9de0a77144b 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/AbstractPeerBlockValidator.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/AbstractPeerBlockValidator.java @@ -1,18 +1,16 @@ /* + * Copyright 2019 ConsenSys AG. * - * * Copyright 2019 ConsenSys AG. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ package org.hyperledger.besu.ethereum.eth.peervalidation; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/RequiredBlocksPeerValidator.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/RequiredBlocksPeerValidator.java index de5a6f359fa..bf8716c328b 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/RequiredBlocksPeerValidator.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/RequiredBlocksPeerValidator.java @@ -1,18 +1,16 @@ /* + * Copyright ConsenSys AG. * - * * Copyright ConsenSys AG. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ package org.hyperledger.besu.ethereum.eth.peervalidation; diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/peervalidation/AbstractPeerBlockValidatorTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/peervalidation/AbstractPeerBlockValidatorTest.java index 4ebdcb69d4b..b7258de5b7e 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/peervalidation/AbstractPeerBlockValidatorTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/peervalidation/AbstractPeerBlockValidatorTest.java @@ -1,20 +1,17 @@ /* + * Copyright 2019 ConsenSys AG. * - * * Copyright 2019 ConsenSys AG. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.peervalidation; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/peervalidation/RequiredBlocksPeerValidatorTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/peervalidation/RequiredBlocksPeerValidatorTest.java index 87b3c7077cc..4fdb679880b 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/peervalidation/RequiredBlocksPeerValidatorTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/peervalidation/RequiredBlocksPeerValidatorTest.java @@ -1,18 +1,16 @@ /* + * Copyright ConsenSys AG. * - * * Copyright ConsenSys AG. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ package org.hyperledger.besu.ethereum.eth.peervalidation; diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncAlgSpec.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncAlgSpec.java index 438433c5181..56e3324b7f6 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncAlgSpec.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncAlgSpec.java @@ -1,20 +1,17 @@ /* + * Copyright contributors to Hyperledger Besu. * - * * Copyright Hyperledger Besu Contributors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java index ce4640ae93f..783d8775302 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java @@ -1,20 +1,17 @@ /* + * Copyright contributors to Hyperledger Besu. * - * * Copyright Hyperledger Besu Contributors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStepTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStepTest.java index cb5cb0aed16..5fb47a557ac 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStepTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStepTest.java @@ -1,20 +1,17 @@ /* + * Copyright contributors to Hyperledger Besu. * - * * Copyright Hyperledger Besu Contributors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; diff --git a/services/tasks/src/main/java/org/hyperledger/besu/services/tasks/TasksPriorityProvider.java b/services/tasks/src/main/java/org/hyperledger/besu/services/tasks/TasksPriorityProvider.java index 95153058a93..41adf96cd64 100644 --- a/services/tasks/src/main/java/org/hyperledger/besu/services/tasks/TasksPriorityProvider.java +++ b/services/tasks/src/main/java/org/hyperledger/besu/services/tasks/TasksPriorityProvider.java @@ -1,20 +1,17 @@ /* + * Copyright contributors to Hyperledger Besu. * - * * Copyright Hyperledger Besu Contributors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * * specific language governing permissions and limitations under the License. - * * - * * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.services.tasks; /** The interface Tasks priority provider. */ From 5d33af812a1e4fc58328cd6da87ca4fcd671b2f5 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 15:49:17 +1000 Subject: [PATCH 40/59] build - Update license headers formatting (#7021) Fix copyright headers under besu module. --------- Signed-off-by: Usman Saleem --- besu/src/main/java/org/hyperledger/besu/Besu.java | 2 +- .../besu/cli/ConfigurationOverviewBuilder.java | 2 +- .../besu/cli/NetworkDeprecationMessage.java | 2 +- .../org/hyperledger/besu/cli/config/ProfileName.java | 2 +- .../besu/cli/converter/DurationMillisConverter.java | 2 +- .../besu/cli/converter/PluginInfoConverter.java | 2 +- .../besu/cli/converter/PositiveNumberConverter.java | 2 +- .../besu/cli/converter/TypeFormatter.java | 2 +- .../exception/DurationConversionException.java | 2 +- .../exception/PositiveNumberConversionException.java | 2 +- .../cli/error/BesuExecutionExceptionHandler.java | 2 +- .../hyperledger/besu/cli/options/MiningOptions.java | 2 +- .../besu/cli/options/TransactionPoolOptions.java | 2 +- .../cli/options/stable/ApiConfigurationOptions.java | 2 +- .../besu/cli/options/stable/GraphQlOptions.java | 2 +- .../besu/cli/options/stable/JsonRpcHttpOptions.java | 2 +- .../besu/cli/options/stable/PermissionsOptions.java | 2 +- .../options/stable/PluginsConfigurationOptions.java | 2 +- .../besu/cli/options/stable/RpcWebsocketOptions.java | 2 +- .../cli/options/unstable/ChainPruningOptions.java | 3 +-- .../besu/cli/options/unstable/EvmOptions.java | 1 - .../besu/cli/subcommands/TxParseSubCommand.java | 2 +- .../cli/subcommands/blocks/BlocksSubCommand.java | 2 +- .../storage/RevertMetadataSubCommand.java | 2 +- .../besu/cli/subcommands/storage/RocksDbHelper.java | 1 - .../cli/subcommands/storage/RocksDbSubCommand.java | 2 +- .../cli/subcommands/storage/StorageSubCommand.java | 2 +- .../besu/cli/subcommands/storage/TrieLogHelper.java | 1 - .../cli/subcommands/storage/TrieLogSubCommand.java | 2 +- .../besu/cli/util/AbstractConfigurationFinder.java | 2 +- .../cli/util/ConfigDefaultValueProviderStrategy.java | 2 +- .../hyperledger/besu/cli/util/ConfigFileFinder.java | 2 +- .../org/hyperledger/besu/cli/util/ProfileFinder.java | 2 +- .../besu/components/BesuCommandModule.java | 3 +-- .../hyperledger/besu/components/BesuComponent.java | 4 +--- .../besu/components/BesuPluginContextModule.java | 3 +-- .../ConsensusScheduleBesuControllerBuilder.java | 12 ++++-------- .../besu/controller/MergeBesuControllerBuilder.java | 2 +- .../besu/controller/MiningParameterOverrides.java | 2 +- .../controller/TransitionBesuControllerBuilder.java | 2 +- .../besu/services/BlockchainServiceImpl.java | 3 +-- .../besu/services/RpcEndpointServiceImpl.java | 2 +- .../hyperledger/besu/services/TraceServiceImpl.java | 2 +- .../services/TransactionSimulationServiceImpl.java | 2 +- .../java/org/hyperledger/besu/RawForkIdTest.java | 3 +-- .../besu/cli/BesuCommandWithRequiredOptionsTest.java | 2 +- .../besu/cli/CascadingDefaultProviderTest.java | 2 +- .../besu/cli/CommandLineUtilsDefaultsTest.java | 3 +-- .../besu/cli/ConfigurationOverviewBuilderTest.java | 2 +- .../besu/cli/HostAllowlistOptionsTest.java | 2 +- .../org/hyperledger/besu/cli/NatOptionsTest.java | 2 +- .../besu/cli/NetworkDeprecationMessageTest.java | 2 +- .../org/hyperledger/besu/cli/PkiOptionsTest.java | 2 +- .../org/hyperledger/besu/cli/PrivacyOptionsTest.java | 2 +- .../java/org/hyperledger/besu/cli/ProfilesTest.java | 2 +- .../org/hyperledger/besu/cli/TxPoolOptionsTest.java | 2 +- .../cli/options/ApiConfigurationOptionsTest.java | 2 +- .../besu/cli/options/GraphQlOptionsTest.java | 2 +- .../besu/cli/options/JsonRpcHttpOptionsTest.java | 2 +- .../besu/cli/options/MiningOptionsTest.java | 2 +- .../besu/cli/options/PermissionsOptionsTest.java | 2 +- .../besu/cli/options/RpcWebsocketOptionsTest.java | 2 +- .../besu/cli/options/TransactionPoolOptionsTest.java | 2 +- .../cli/options/stable/DataStorageOptionsTest.java | 1 - .../besu/cli/subcommands/TxParseSubCommandTest.java | 2 +- .../subcommands/storage/StorageSubCommandTest.java | 2 +- .../cli/subcommands/storage/TrieLogHelperTest.java | 1 - .../util/ConfigDefaultValueProviderStrategyTest.java | 2 +- .../AbstractBftBesuControllerBuilderTest.java | 2 +- .../besu/controller/BesuControllerTest.java | 12 ++++-------- .../controller/CliqueBesuControllerBuilderTest.java | 2 +- .../ConsensusScheduleBesuControllerBuilderTest.java | 11 ++++------- .../controller/IbftBesuControllerBuilderTest.java | 2 +- .../controller/MergeBesuControllerBuilderTest.java | 2 +- .../controller/QbftBesuControllerBuilderTest.java | 2 +- .../controller/TransitionControllerBuilderTest.java | 2 +- .../besu/services/TraceServiceImplTest.java | 2 +- 77 files changed, 81 insertions(+), 105 deletions(-) diff --git a/besu/src/main/java/org/hyperledger/besu/Besu.java b/besu/src/main/java/org/hyperledger/besu/Besu.java index 6bdd87d0cff..14c95cc867c 100644 --- a/besu/src/main/java/org/hyperledger/besu/Besu.java +++ b/besu/src/main/java/org/hyperledger/besu/Besu.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java b/besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java index 2b3dfd7dd51..119bdf9fd1f 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/NetworkDeprecationMessage.java b/besu/src/main/java/org/hyperledger/besu/cli/NetworkDeprecationMessage.java index 10c97d6a5ad..6f8060ec5a1 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/NetworkDeprecationMessage.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/NetworkDeprecationMessage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/config/ProfileName.java b/besu/src/main/java/org/hyperledger/besu/cli/config/ProfileName.java index 111261d5c80..37e96bca78b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/config/ProfileName.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/config/ProfileName.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/converter/DurationMillisConverter.java b/besu/src/main/java/org/hyperledger/besu/cli/converter/DurationMillisConverter.java index bfaffa8826a..46a2066d80a 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/converter/DurationMillisConverter.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/converter/DurationMillisConverter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/converter/PluginInfoConverter.java b/besu/src/main/java/org/hyperledger/besu/cli/converter/PluginInfoConverter.java index 9dd5e21c8db..9264ce365be 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/converter/PluginInfoConverter.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/converter/PluginInfoConverter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/converter/PositiveNumberConverter.java b/besu/src/main/java/org/hyperledger/besu/cli/converter/PositiveNumberConverter.java index 2b45f35ffe5..283af9f02ab 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/converter/PositiveNumberConverter.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/converter/PositiveNumberConverter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/converter/TypeFormatter.java b/besu/src/main/java/org/hyperledger/besu/cli/converter/TypeFormatter.java index 59658d135ac..965cac9b6cf 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/converter/TypeFormatter.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/converter/TypeFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/converter/exception/DurationConversionException.java b/besu/src/main/java/org/hyperledger/besu/cli/converter/exception/DurationConversionException.java index cd56d06188c..a2000c5d65b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/converter/exception/DurationConversionException.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/converter/exception/DurationConversionException.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/converter/exception/PositiveNumberConversionException.java b/besu/src/main/java/org/hyperledger/besu/cli/converter/exception/PositiveNumberConversionException.java index c9f0d9e934b..26689aba8e3 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/converter/exception/PositiveNumberConversionException.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/converter/exception/PositiveNumberConversionException.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/error/BesuExecutionExceptionHandler.java b/besu/src/main/java/org/hyperledger/besu/cli/error/BesuExecutionExceptionHandler.java index 77b458eb78c..55d60efec82 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/error/BesuExecutionExceptionHandler.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/error/BesuExecutionExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/MiningOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/MiningOptions.java index bcde10077bb..ba4d99bc830 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/MiningOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/MiningOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/TransactionPoolOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/TransactionPoolOptions.java index b6aa2bc645f..6f5381a968f 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/TransactionPoolOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/TransactionPoolOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/ApiConfigurationOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/ApiConfigurationOptions.java index 269e1424f20..632c7bad442 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/ApiConfigurationOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/ApiConfigurationOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/GraphQlOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/GraphQlOptions.java index c384ad2cff0..5fe31ad0a7c 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/GraphQlOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/GraphQlOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/JsonRpcHttpOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/JsonRpcHttpOptions.java index 51b6a59f1cb..65e4458fb2e 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/JsonRpcHttpOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/JsonRpcHttpOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PermissionsOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PermissionsOptions.java index 3f16432750e..fd6cfd9eb0d 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PermissionsOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PermissionsOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java index abf9085b1f8..84d5387f469 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/RpcWebsocketOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/RpcWebsocketOptions.java index cdc77a3f655..dccbeee72e5 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/RpcWebsocketOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/RpcWebsocketOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/ChainPruningOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/ChainPruningOptions.java index 66d6b15f22f..46dd7922ab1 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/ChainPruningOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/ChainPruningOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.cli.options.unstable; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/EvmOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/EvmOptions.java index 4e61b82fef8..8b14b1bad81 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/EvmOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/EvmOptions.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.cli.options.unstable; import org.hyperledger.besu.cli.options.CLIOptions; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/TxParseSubCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/TxParseSubCommand.java index 221675c9dc5..51542a361b4 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/TxParseSubCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/TxParseSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommand.java index ea8bfab8d14..3d1630013bf 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RevertMetadataSubCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RevertMetadataSubCommand.java index ee239d4aef1..5dd048bc13b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RevertMetadataSubCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RevertMetadataSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RocksDbHelper.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RocksDbHelper.java index 2b122979830..e4b7e3ac7c0 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RocksDbHelper.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RocksDbHelper.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.cli.subcommands.storage; import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RocksDbSubCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RocksDbSubCommand.java index 9ca55cbc38b..d29ba298aaf 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RocksDbSubCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/RocksDbSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/StorageSubCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/StorageSubCommand.java index e26a097d1fd..e06e24f0c28 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/StorageSubCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/StorageSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelper.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelper.java index d94c19d8bdb..8efb0b59d76 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelper.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelper.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.cli.subcommands.storage; import static com.google.common.base.Preconditions.checkArgument; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogSubCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogSubCommand.java index 0ee2e4532c6..7ed0cd3f1c3 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogSubCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/util/AbstractConfigurationFinder.java b/besu/src/main/java/org/hyperledger/besu/cli/util/AbstractConfigurationFinder.java index 69e02887775..18550c31827 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/util/AbstractConfigurationFinder.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/util/AbstractConfigurationFinder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategy.java b/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategy.java index d3ff29dbc66..04ae8b2aff7 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategy.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigFileFinder.java b/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigFileFinder.java index a17ef0b1a6a..73addfc9b18 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigFileFinder.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/util/ConfigFileFinder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/cli/util/ProfileFinder.java b/besu/src/main/java/org/hyperledger/besu/cli/util/ProfileFinder.java index 8df7382db70..1c718f273d5 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/util/ProfileFinder.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/util/ProfileFinder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/components/BesuCommandModule.java b/besu/src/main/java/org/hyperledger/besu/components/BesuCommandModule.java index b418153521d..8c29464cf05 100644 --- a/besu/src/main/java/org/hyperledger/besu/components/BesuCommandModule.java +++ b/besu/src/main/java/org/hyperledger/besu/components/BesuCommandModule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.components; import org.hyperledger.besu.Besu; diff --git a/besu/src/main/java/org/hyperledger/besu/components/BesuComponent.java b/besu/src/main/java/org/hyperledger/besu/components/BesuComponent.java index 65ba2d931d2..ba31fccb2bb 100644 --- a/besu/src/main/java/org/hyperledger/besu/components/BesuComponent.java +++ b/besu/src/main/java/org/hyperledger/besu/components/BesuComponent.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.components; import org.hyperledger.besu.cli.BesuCommand; diff --git a/besu/src/main/java/org/hyperledger/besu/components/BesuPluginContextModule.java b/besu/src/main/java/org/hyperledger/besu/components/BesuPluginContextModule.java index ddbb4c2a6e0..3785f1c9a22 100644 --- a/besu/src/main/java/org/hyperledger/besu/components/BesuPluginContextModule.java +++ b/besu/src/main/java/org/hyperledger/besu/components/BesuPluginContextModule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.components; diff --git a/besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java index 6e02086590d..a7c1cfe35b1 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java @@ -1,21 +1,17 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.controller; import static org.hyperledger.besu.ethereum.core.BlockHeader.GENESIS_BLOCK_NUMBER; diff --git a/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java index 623aa2918f5..20cb1084462 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/controller/MiningParameterOverrides.java b/besu/src/main/java/org/hyperledger/besu/controller/MiningParameterOverrides.java index a00186ea0c2..e4cebc0d648 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/MiningParameterOverrides.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/MiningParameterOverrides.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java index 3529797d57a..dab6ff55790 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/services/BlockchainServiceImpl.java b/besu/src/main/java/org/hyperledger/besu/services/BlockchainServiceImpl.java index aa1c6a2128b..c6d37ad6ae9 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/BlockchainServiceImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/BlockchainServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.services; import org.hyperledger.besu.datatypes.Hash; diff --git a/besu/src/main/java/org/hyperledger/besu/services/RpcEndpointServiceImpl.java b/besu/src/main/java/org/hyperledger/besu/services/RpcEndpointServiceImpl.java index 34e5b78a6af..d1e832a7062 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/RpcEndpointServiceImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/RpcEndpointServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java b/besu/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java index 0a4cc74f50f..6a0804b6f46 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/main/java/org/hyperledger/besu/services/TransactionSimulationServiceImpl.java b/besu/src/main/java/org/hyperledger/besu/services/TransactionSimulationServiceImpl.java index 0981e1ae34c..54cce205a36 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/TransactionSimulationServiceImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/TransactionSimulationServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/RawForkIdTest.java b/besu/src/test/java/org/hyperledger/besu/RawForkIdTest.java index fac1095424e..ae9de89b5f9 100644 --- a/besu/src/test/java/org/hyperledger/besu/RawForkIdTest.java +++ b/besu/src/test/java/org/hyperledger/besu/RawForkIdTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu; diff --git a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandWithRequiredOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandWithRequiredOptionsTest.java index 6b97646248b..9198e199112 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandWithRequiredOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandWithRequiredOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java b/besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java index bb3849f4492..3cc421440f8 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsDefaultsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsDefaultsTest.java index 836d7fb3c4e..27f3773959e 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsDefaultsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/CommandLineUtilsDefaultsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.cli; import static org.assertj.core.api.Assertions.assertThat; diff --git a/besu/src/test/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilderTest.java index 55b1c95a7f2..07e440430a5 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java index 27d8a4f5201..c1f867f4892 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/HostAllowlistOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/NatOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/NatOptionsTest.java index b884a966633..f5fb8cf9543 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/NatOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/NatOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/NetworkDeprecationMessageTest.java b/besu/src/test/java/org/hyperledger/besu/cli/NetworkDeprecationMessageTest.java index f40dde9313d..fb4d51e09d8 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/NetworkDeprecationMessageTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/NetworkDeprecationMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/PkiOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/PkiOptionsTest.java index b6197409c3c..12da66342b7 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/PkiOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/PkiOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/PrivacyOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/PrivacyOptionsTest.java index c214fae32d6..af43535a8ff 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/PrivacyOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/PrivacyOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/ProfilesTest.java b/besu/src/test/java/org/hyperledger/besu/cli/ProfilesTest.java index 3c1a5f75cf5..cdfe09964ff 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/ProfilesTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/ProfilesTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/TxPoolOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/TxPoolOptionsTest.java index 41ea34af28a..a5ca07484a0 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/TxPoolOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/TxPoolOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/ApiConfigurationOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/ApiConfigurationOptionsTest.java index c12a718cb0f..6e6c17f4dda 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/ApiConfigurationOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/ApiConfigurationOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/GraphQlOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/GraphQlOptionsTest.java index f6ec3586c80..8c0e32fb2f5 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/GraphQlOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/GraphQlOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/JsonRpcHttpOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/JsonRpcHttpOptionsTest.java index 83da0246036..afb53bac934 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/JsonRpcHttpOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/JsonRpcHttpOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java index 55777e16d42..e06d711be60 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/PermissionsOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/PermissionsOptionsTest.java index e93f712c6f2..59f2c1acd00 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/PermissionsOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/PermissionsOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/RpcWebsocketOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/RpcWebsocketOptionsTest.java index 0583afd7cc0..64483462ca6 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/RpcWebsocketOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/RpcWebsocketOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java index 3c17661f639..c029983a33e 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/TransactionPoolOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/stable/DataStorageOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/stable/DataStorageOptionsTest.java index 94eba18ad87..4508f6c4e59 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/stable/DataStorageOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/stable/DataStorageOptionsTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.cli.options.stable; import static org.assertj.core.api.Assertions.assertThat; diff --git a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/TxParseSubCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/TxParseSubCommandTest.java index 85839cc5b78..ced46b41231 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/TxParseSubCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/TxParseSubCommandTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/StorageSubCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/StorageSubCommandTest.java index 17344e667e6..149b88a390f 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/StorageSubCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/StorageSubCommandTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelperTest.java b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelperTest.java index d4a6dd2dc71..f8fba8d7002 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelperTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelperTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.cli.subcommands.storage; import static java.util.Collections.singletonList; diff --git a/besu/src/test/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategyTest.java b/besu/src/test/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategyTest.java index a2ea92e48b2..e1acbb67b89 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategyTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/util/ConfigDefaultValueProviderStrategyTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java index f0f8b571c0e..dfc843f083c 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/controller/BesuControllerTest.java b/besu/src/test/java/org/hyperledger/besu/controller/BesuControllerTest.java index 2f3a98a6733..69ee9c9bde4 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/BesuControllerTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/BesuControllerTest.java @@ -1,21 +1,17 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.controller; import static org.assertj.core.api.Assertions.assertThat; diff --git a/besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java index 6bd6f5d2ec0..c4cce7f4c54 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java index cf98ec49add..c410ac9ec55 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java @@ -1,16 +1,13 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 diff --git a/besu/src/test/java/org/hyperledger/besu/controller/IbftBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/IbftBesuControllerBuilderTest.java index a819a140311..63d2bba9c0c 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/IbftBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/IbftBesuControllerBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java index e9c22a82be8..0e4948ddd5c 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java index e3e99285b66..50f17fd8a61 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/controller/TransitionControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/TransitionControllerBuilderTest.java index 9b2011612a1..40d72e4ed19 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/TransitionControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/TransitionControllerBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/besu/src/test/java/org/hyperledger/besu/services/TraceServiceImplTest.java b/besu/src/test/java/org/hyperledger/besu/services/TraceServiceImplTest.java index 6909d985864..0e339f2f4f3 100644 --- a/besu/src/test/java/org/hyperledger/besu/services/TraceServiceImplTest.java +++ b/besu/src/test/java/org/hyperledger/besu/services/TraceServiceImplTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From c8e80f701b943f4cade24a7a2af5ee2906777cb8 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 17:36:12 +1000 Subject: [PATCH 41/59] build - Update license headers formatting (#7024) Apply license header changes to following sub projects: :datatypes :config --------- Signed-off-by: Usman Saleem --- .../besu/config/CheckpointConfigOptions.java | 2 +- .../hyperledger/besu/config/CliqueConfigOptions.java | 3 +-- .../java/org/hyperledger/besu/config/CliqueFork.java | 2 +- .../main/java/org/hyperledger/besu/config/Fork.java | 3 +-- .../besu/config/JsonBftConfigOptions.java | 2 +- .../besu/config/JsonCliqueConfigOptions.java | 2 +- .../besu/config/JsonQbftConfigOptions.java | 2 +- .../org/hyperledger/besu/config/BFTForkTest.java | 2 +- .../besu/config/JsonQbftConfigOptionsTest.java | 12 ++++-------- .../hyperledger/besu/datatypes/AccessListEntry.java | 2 +- .../org/hyperledger/besu/datatypes/AccountValue.java | 2 +- .../java/org/hyperledger/besu/datatypes/Address.java | 2 +- .../org/hyperledger/besu/datatypes/BLSPublicKey.java | 2 +- .../org/hyperledger/besu/datatypes/BLSSignature.java | 2 +- .../java/org/hyperledger/besu/datatypes/Blob.java | 2 +- .../java/org/hyperledger/besu/datatypes/BlobGas.java | 2 +- .../besu/datatypes/BlobsWithCommitments.java | 2 +- .../java/org/hyperledger/besu/datatypes/GWei.java | 2 +- .../java/org/hyperledger/besu/datatypes/Hash.java | 2 +- .../hyperledger/besu/datatypes/KZGCommitment.java | 2 +- .../org/hyperledger/besu/datatypes/KZGProof.java | 2 +- .../besu/datatypes/PendingTransaction.java | 2 +- .../org/hyperledger/besu/datatypes/PublicKey.java | 2 +- .../org/hyperledger/besu/datatypes/Sha256Hash.java | 3 +-- .../hyperledger/besu/datatypes/StorageSlotKey.java | 2 +- .../hyperledger/besu/datatypes/VersionedHash.java | 3 +-- .../java/org/hyperledger/besu/datatypes/Wei.java | 2 +- .../besu/datatypes/BlobsWithCommitmentsTest.java | 3 +-- .../org/hyperledger/besu/datatypes/GWeiTest.java | 2 +- .../besu/datatypes/VersionedHashTest.java | 3 +-- .../java/org/hyperledger/besu/datatypes/WeiTest.java | 2 +- 31 files changed, 34 insertions(+), 44 deletions(-) diff --git a/config/src/main/java/org/hyperledger/besu/config/CheckpointConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/CheckpointConfigOptions.java index 360a0bf002f..c5ac9a8d7db 100644 --- a/config/src/main/java/org/hyperledger/besu/config/CheckpointConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/CheckpointConfigOptions.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/config/src/main/java/org/hyperledger/besu/config/CliqueConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/CliqueConfigOptions.java index 6b8cb77eb16..08ac0ef0fee 100644 --- a/config/src/main/java/org/hyperledger/besu/config/CliqueConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/CliqueConfigOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.config; import java.util.Map; diff --git a/config/src/main/java/org/hyperledger/besu/config/CliqueFork.java b/config/src/main/java/org/hyperledger/besu/config/CliqueFork.java index 9b2dd212220..00f65572f21 100644 --- a/config/src/main/java/org/hyperledger/besu/config/CliqueFork.java +++ b/config/src/main/java/org/hyperledger/besu/config/CliqueFork.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/config/src/main/java/org/hyperledger/besu/config/Fork.java b/config/src/main/java/org/hyperledger/besu/config/Fork.java index 442dca3079f..77ef6d10423 100644 --- a/config/src/main/java/org/hyperledger/besu/config/Fork.java +++ b/config/src/main/java/org/hyperledger/besu/config/Fork.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.config; /** A "custom hard fork" used for Proof of Authority network Transitions */ diff --git a/config/src/main/java/org/hyperledger/besu/config/JsonBftConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/JsonBftConfigOptions.java index a3791a6e584..95f2d9f7ce7 100644 --- a/config/src/main/java/org/hyperledger/besu/config/JsonBftConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/JsonBftConfigOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/config/src/main/java/org/hyperledger/besu/config/JsonCliqueConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/JsonCliqueConfigOptions.java index 977542b877c..e57d7edb8f8 100644 --- a/config/src/main/java/org/hyperledger/besu/config/JsonCliqueConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/JsonCliqueConfigOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/config/src/main/java/org/hyperledger/besu/config/JsonQbftConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/JsonQbftConfigOptions.java index 9f1d94ecaf2..3db29e5b764 100644 --- a/config/src/main/java/org/hyperledger/besu/config/JsonQbftConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/JsonQbftConfigOptions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/config/src/test/java/org/hyperledger/besu/config/BFTForkTest.java b/config/src/test/java/org/hyperledger/besu/config/BFTForkTest.java index 2c3499601f1..e40b3a370fd 100644 --- a/config/src/test/java/org/hyperledger/besu/config/BFTForkTest.java +++ b/config/src/test/java/org/hyperledger/besu/config/BFTForkTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/config/src/test/java/org/hyperledger/besu/config/JsonQbftConfigOptionsTest.java b/config/src/test/java/org/hyperledger/besu/config/JsonQbftConfigOptionsTest.java index 448a5c18adc..8fd4bd64d74 100644 --- a/config/src/test/java/org/hyperledger/besu/config/JsonQbftConfigOptionsTest.java +++ b/config/src/test/java/org/hyperledger/besu/config/JsonQbftConfigOptionsTest.java @@ -1,21 +1,17 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See - * the License for the + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.config; import static org.assertj.core.api.Assertions.assertThat; diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccessListEntry.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccessListEntry.java index b11c213a9d5..33d2d8677a9 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccessListEntry.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccessListEntry.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountValue.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountValue.java index b41d5b51e13..4cab94e25cb 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountValue.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountValue.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java index f07caf442d7..bea562ee1f4 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BLSPublicKey.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BLSPublicKey.java index 32e29cfdf71..809834ffcd8 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BLSPublicKey.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BLSPublicKey.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BLSSignature.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BLSSignature.java index 050205c1738..fa8b5827ba5 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BLSSignature.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BLSSignature.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Blob.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Blob.java index b753f2dc160..098bf4e5b58 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Blob.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Blob.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobGas.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobGas.java index 134e9cb4145..a64e79b19dd 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobGas.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobGas.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobsWithCommitments.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobsWithCommitments.java index 281d3ada681..86380a7aa69 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobsWithCommitments.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobsWithCommitments.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/GWei.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/GWei.java index 75bba998b04..05dcf6bd480 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/GWei.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/GWei.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Hash.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Hash.java index a80811ff4c9..a53843a247f 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Hash.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Hash.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/KZGCommitment.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/KZGCommitment.java index d9d2e477dae..2a1d3eabaa6 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/KZGCommitment.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/KZGCommitment.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/KZGProof.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/KZGProof.java index 7d8b3aa186d..5f880640a3f 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/KZGProof.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/KZGProof.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/PendingTransaction.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/PendingTransaction.java index e19fb13f1d1..fd62c866e1c 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/PendingTransaction.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/PendingTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/PublicKey.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/PublicKey.java index 9fce4c1c233..212c42325e5 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/PublicKey.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/PublicKey.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Sha256Hash.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Sha256Hash.java index 9dbfeacc974..37864ec51c7 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Sha256Hash.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Sha256Hash.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.datatypes; import org.apache.tuweni.bytes.Bytes; diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/StorageSlotKey.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/StorageSlotKey.java index 3f4b25215f9..a8bf7c9afd1 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/StorageSlotKey.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/StorageSlotKey.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/VersionedHash.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/VersionedHash.java index 21f296e0ae1..8495c708a05 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/VersionedHash.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/VersionedHash.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.datatypes; import java.util.Objects; diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Wei.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Wei.java index de13c8847d4..7b097a9dd1a 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Wei.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Wei.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/test/java/org/hyperledger/besu/datatypes/BlobsWithCommitmentsTest.java b/datatypes/src/test/java/org/hyperledger/besu/datatypes/BlobsWithCommitmentsTest.java index a3eb7bbe0f6..8ff81422dac 100644 --- a/datatypes/src/test/java/org/hyperledger/besu/datatypes/BlobsWithCommitmentsTest.java +++ b/datatypes/src/test/java/org/hyperledger/besu/datatypes/BlobsWithCommitmentsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.datatypes; import static org.assertj.core.api.Assertions.assertThat; diff --git a/datatypes/src/test/java/org/hyperledger/besu/datatypes/GWeiTest.java b/datatypes/src/test/java/org/hyperledger/besu/datatypes/GWeiTest.java index a605da4d3b1..d11ec0198d0 100644 --- a/datatypes/src/test/java/org/hyperledger/besu/datatypes/GWeiTest.java +++ b/datatypes/src/test/java/org/hyperledger/besu/datatypes/GWeiTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/datatypes/src/test/java/org/hyperledger/besu/datatypes/VersionedHashTest.java b/datatypes/src/test/java/org/hyperledger/besu/datatypes/VersionedHashTest.java index ce3b264b3b8..ebb8a6cd652 100644 --- a/datatypes/src/test/java/org/hyperledger/besu/datatypes/VersionedHashTest.java +++ b/datatypes/src/test/java/org/hyperledger/besu/datatypes/VersionedHashTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.datatypes; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/datatypes/src/test/java/org/hyperledger/besu/datatypes/WeiTest.java b/datatypes/src/test/java/org/hyperledger/besu/datatypes/WeiTest.java index 1d1b38819a7..7162f98b026 100644 --- a/datatypes/src/test/java/org/hyperledger/besu/datatypes/WeiTest.java +++ b/datatypes/src/test/java/org/hyperledger/besu/datatypes/WeiTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From 9006658b04363f882652f9da623a0d56562f4ada Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 1 May 2024 18:10:36 +1000 Subject: [PATCH 42/59] build - Update license headers formatting (#7025) * Apply Hyperledger license header to evm sub-module --------- Signed-off-by: Usman Saleem --- .../org/hyperledger/besu/collections/trie/BytesTrieSet.java | 3 +-- .../java/org/hyperledger/besu/collections/undo/UndoList.java | 3 +-- .../java/org/hyperledger/besu/collections/undo/UndoMap.java | 3 +-- .../hyperledger/besu/collections/undo/UndoNavigableMap.java | 3 +-- .../org/hyperledger/besu/collections/undo/UndoScalar.java | 3 +-- .../java/org/hyperledger/besu/collections/undo/UndoSet.java | 3 +-- .../java/org/hyperledger/besu/collections/undo/UndoTable.java | 3 +-- .../java/org/hyperledger/besu/collections/undo/Undoable.java | 3 +-- evm/src/main/java/org/hyperledger/besu/evm/ClassicEVMs.java | 2 +- .../main/java/org/hyperledger/besu/evm/EvmSpecVersion.java | 3 +-- .../main/java/org/hyperledger/besu/evm/code/CodeFactory.java | 4 +--- .../main/java/org/hyperledger/besu/evm/code/CodeInvalid.java | 4 +--- .../main/java/org/hyperledger/besu/evm/code/CodeSection.java | 4 +--- evm/src/main/java/org/hyperledger/besu/evm/code/CodeV0.java | 4 +--- evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1.java | 4 +--- .../java/org/hyperledger/besu/evm/code/CodeV1Validation.java | 4 +--- .../main/java/org/hyperledger/besu/evm/code/EOFLayout.java | 4 +--- .../besu/evm/contractvalidation/CachedInvalidCodeRule.java | 4 +--- .../besu/evm/contractvalidation/EOFValidationCodeRule.java | 2 +- .../java/org/hyperledger/besu/evm/fluent/EVMExecutor.java | 2 +- .../java/org/hyperledger/besu/evm/fluent/SimpleAccount.java | 3 +-- .../org/hyperledger/besu/evm/fluent/SimpleBlockValues.java | 3 +-- .../java/org/hyperledger/besu/evm/fluent/SimpleWorld.java | 3 +-- .../main/java/org/hyperledger/besu/evm/frame/BlockValues.java | 2 +- .../main/java/org/hyperledger/besu/evm/frame/TxValues.java | 2 +- .../besu/evm/gascalculator/CancunGasCalculator.java | 2 +- .../org/hyperledger/besu/evm/gascalculator/GasCalculator.java | 2 +- .../besu/evm/gascalculator/HomesteadGasCalculator.java | 2 +- .../besu/evm/gascalculator/PragueGasCalculator.java | 2 +- .../besu/evm/gascalculator/ShanghaiGasCalculator.java | 3 +-- .../java/org/hyperledger/besu/evm/internal/CodeCache.java | 1 - .../java/org/hyperledger/besu/evm/internal/CodeScale.java | 3 +-- .../org/hyperledger/besu/evm/internal/EvmConfiguration.java | 1 - .../java/org/hyperledger/besu/evm/internal/FixedStack.java | 2 +- .../java/org/hyperledger/besu/evm/internal/FlexStack.java | 2 +- .../java/org/hyperledger/besu/evm/internal/MemoryEntry.java | 3 +-- .../java/org/hyperledger/besu/evm/internal/OperandStack.java | 4 +--- .../org/hyperledger/besu/evm/internal/OverflowException.java | 2 +- .../java/org/hyperledger/besu/evm/internal/ReturnStack.java | 2 +- .../java/org/hyperledger/besu/evm/internal/StorageEntry.java | 3 +-- .../org/hyperledger/besu/evm/internal/UnderflowException.java | 2 +- .../main/java/org/hyperledger/besu/evm/internal/Words.java | 2 +- .../hyperledger/besu/evm/operation/AbstractCallOperation.java | 2 +- .../besu/evm/operation/AbstractCreateOperation.java | 2 +- .../besu/evm/operation/AbstractFixedCostOperation.java | 4 +--- .../org/hyperledger/besu/evm/operation/AbstractOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/AddModOperation.java | 2 +- .../java/org/hyperledger/besu/evm/operation/AddOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/AddressOperation.java | 2 +- .../java/org/hyperledger/besu/evm/operation/AndOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/BalanceOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/BaseFeeOperation.java | 2 +- .../hyperledger/besu/evm/operation/BlobBaseFeeOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/BlobHashOperation.java | 2 +- .../hyperledger/besu/evm/operation/BlockHashOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/ByteOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/CallCodeOperation.java | 2 +- .../hyperledger/besu/evm/operation/CallDataCopyOperation.java | 2 +- .../hyperledger/besu/evm/operation/CallDataLoadOperation.java | 2 +- .../hyperledger/besu/evm/operation/CallDataSizeOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/CallFOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/CallOperation.java | 2 +- .../hyperledger/besu/evm/operation/CallValueOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/CallerOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/ChainIdOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/CodeCopyOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/CodeSizeOperation.java | 2 +- .../hyperledger/besu/evm/operation/DifficultyOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/JumpFOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/MCopyOperation.java | 2 +- .../hyperledger/besu/evm/operation/PrevRanDaoOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/Push0Operation.java | 2 +- .../besu/evm/operation/RelativeJumpIfOperation.java | 3 +-- .../hyperledger/besu/evm/operation/RelativeJumpOperation.java | 3 +-- .../besu/evm/operation/RelativeJumpVectorOperation.java | 3 +-- .../org/hyperledger/besu/evm/operation/RetFOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/TLoadOperation.java | 2 +- .../org/hyperledger/besu/evm/operation/TStoreOperation.java | 2 +- .../besu/evm/precompile/AbstractPrecompiledContract.java | 2 +- .../besu/evm/precompile/KZGPointEvalPrecompiledContract.java | 2 +- .../besu/evm/precompile/MainnetPrecompiledContracts.java | 2 +- .../org/hyperledger/besu/evm/tracing/StandardJsonTracer.java | 4 +--- .../org/hyperledger/besu/evm/worldstate/JournaledUpdater.java | 2 +- .../org/hyperledger/besu/evm/worldstate/StackedUpdater.java | 2 +- .../hyperledger/besu/collections/trie/BytesTrieSetTest.java | 3 +-- .../org/hyperledger/besu/collections/undo/UndoListTest.java | 3 +-- .../org/hyperledger/besu/collections/undo/UndoMapTest.java | 3 +-- .../org/hyperledger/besu/collections/undo/UndoSetTest.java | 3 +-- .../java/org/hyperledger/besu/evm/StandardJsonTracerTest.java | 4 +--- .../java/org/hyperledger/besu/evm/code/CodeFactoryTest.java | 3 +-- .../test/java/org/hyperledger/besu/evm/code/CodeV0Test.java | 4 +--- .../test/java/org/hyperledger/besu/evm/code/CodeV1Test.java | 4 +--- .../java/org/hyperledger/besu/evm/code/EOFLayoutTest.java | 4 +--- .../java/org/hyperledger/besu/evm/fluent/EVMExecutorTest.java | 2 +- .../java/org/hyperledger/besu/evm/frame/MessageFrameTest.java | 2 +- .../besu/evm/gascalculator/CancunGasCalculatorTest.java | 2 +- .../java/org/hyperledger/besu/evm/internal/CodeCacheTest.java | 3 +-- .../java/org/hyperledger/besu/evm/internal/WordsTest.java | 4 +--- .../besu/evm/operation/AbstractCreateOperationTest.java | 3 +-- .../besu/evm/operations/BlobHashOperationTest.java | 3 +-- .../hyperledger/besu/evm/operations/CallFOperationTest.java | 2 +- .../hyperledger/besu/evm/operations/CreateOperationTest.java | 3 +-- .../hyperledger/besu/evm/operations/JumpFOperationTest.java | 2 +- .../hyperledger/besu/evm/operations/MCopyOperationTest.java | 2 +- .../besu/evm/operations/PrevRanDaoOperationTest.java | 2 +- .../hyperledger/besu/evm/operations/Push0OperationTest.java | 2 +- .../besu/evm/operations/RelativeJumpOperationTest.java | 3 +-- .../hyperledger/besu/evm/operations/RetFOperationTest.java | 2 +- .../besu/evm/operations/SelfDestructOperationTest.java | 2 +- .../hyperledger/besu/evm/operations/TStoreOperationTest.java | 2 +- .../evm/precompile/KZGPointEvalPrecompileContractTest.java | 2 +- .../besu/evm/processor/AbstractMessageProcessorTest.java | 2 +- .../besu/evm/processor/MessageCallProcessorTest.java | 2 +- .../org/hyperledger/besu/evm/testutils/ByteCodeBuilder.java | 2 +- evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToy.java | 3 +-- .../test/java/org/hyperledger/besu/evm/toy/EvmToyCommand.java | 3 +-- .../test/java/org/hyperledger/besu/evm/toy/ToyAccount.java | 3 +-- .../java/org/hyperledger/besu/evm/toy/ToyBlockValues.java | 3 +-- evm/src/test/java/org/hyperledger/besu/evm/toy/ToyWorld.java | 3 +-- .../besu/evm/tracing/ExtendedOperationTracerTest.java | 2 +- 120 files changed, 118 insertions(+), 186 deletions(-) diff --git a/evm/src/main/java/org/hyperledger/besu/collections/trie/BytesTrieSet.java b/evm/src/main/java/org/hyperledger/besu/collections/trie/BytesTrieSet.java index 20e2d49af5c..a005d4eedab 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/trie/BytesTrieSet.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/trie/BytesTrieSet.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.trie; diff --git a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoList.java b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoList.java index 72cdc56fee1..22898dba89a 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoList.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoList.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoMap.java b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoMap.java index 08a20b447ca..8b5da7c98f2 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoMap.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoMap.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoNavigableMap.java b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoNavigableMap.java index 3bbdc242e1e..1378a9d5dbc 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoNavigableMap.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoNavigableMap.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoScalar.java b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoScalar.java index 55e3a84e0b6..ff06a9e5e72 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoScalar.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoScalar.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoSet.java b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoSet.java index d1f018ac14f..01a3d8363a9 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoSet.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoSet.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoTable.java b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoTable.java index 0109ccdc8f7..327cf9819d0 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoTable.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/undo/UndoTable.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/main/java/org/hyperledger/besu/collections/undo/Undoable.java b/evm/src/main/java/org/hyperledger/besu/collections/undo/Undoable.java index 607b93c4b16..e92154ee42b 100644 --- a/evm/src/main/java/org/hyperledger/besu/collections/undo/Undoable.java +++ b/evm/src/main/java/org/hyperledger/besu/collections/undo/Undoable.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/ClassicEVMs.java b/evm/src/main/java/org/hyperledger/besu/evm/ClassicEVMs.java index 0a7034199aa..97cd40dfd5c 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/ClassicEVMs.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/ClassicEVMs.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/EvmSpecVersion.java b/evm/src/main/java/org/hyperledger/besu/evm/EvmSpecVersion.java index 329349e1e43..3743c82c485 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/EvmSpecVersion.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/EvmSpecVersion.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeFactory.java b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeFactory.java index 23b074e4334..a85754fb5bd 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeFactory.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeFactory.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import org.hyperledger.besu.evm.Code; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeInvalid.java b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeInvalid.java index c28adb1b4a4..9b92613f4b5 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeInvalid.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeInvalid.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import org.hyperledger.besu.datatypes.Hash; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeSection.java b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeSection.java index 0ae6f7509fb..cf28a26e22e 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeSection.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeSection.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import java.util.Objects; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV0.java b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV0.java index c2263b42ac6..5281d0aa616 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV0.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV0.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import org.hyperledger.besu.datatypes.Hash; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1.java b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1.java index f45cab025e3..948fdd6128d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import static com.google.common.base.Preconditions.checkArgument; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1Validation.java b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1Validation.java index e16498c7834..b6f6173d7ec 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1Validation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1Validation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import static org.hyperledger.besu.evm.internal.Words.readBigEndianI16; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/code/EOFLayout.java b/evm/src/main/java/org/hyperledger/besu/evm/code/EOFLayout.java index 236b0d41ded..8e5853120ce 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/code/EOFLayout.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/code/EOFLayout.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import java.io.ByteArrayInputStream; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/CachedInvalidCodeRule.java b/evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/CachedInvalidCodeRule.java index 34c14ec8a7a..39431d785a9 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/CachedInvalidCodeRule.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/CachedInvalidCodeRule.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.contractvalidation; import org.hyperledger.besu.evm.Code; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/EOFValidationCodeRule.java b/evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/EOFValidationCodeRule.java index 3481035ee0f..19adcc3bf23 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/EOFValidationCodeRule.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/contractvalidation/EOFValidationCodeRule.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/fluent/EVMExecutor.java b/evm/src/main/java/org/hyperledger/besu/evm/fluent/EVMExecutor.java index 81b3e9b0cee..f91f228db66 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/fluent/EVMExecutor.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/fluent/EVMExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleAccount.java b/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleAccount.java index edc3edd1a43..b699ec731e3 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleAccount.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleAccount.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.fluent; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleBlockValues.java b/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleBlockValues.java index 8099e27babd..e4d44b86042 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleBlockValues.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleBlockValues.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.fluent; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleWorld.java b/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleWorld.java index 3f17f1e3b9f..f52e788babf 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleWorld.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/fluent/SimpleWorld.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.fluent; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/frame/BlockValues.java b/evm/src/main/java/org/hyperledger/besu/evm/frame/BlockValues.java index aade1f98437..cfa7079857d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/frame/BlockValues.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/frame/BlockValues.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/frame/TxValues.java b/evm/src/main/java/org/hyperledger/besu/evm/frame/TxValues.java index eba208d5b5d..5089dc607a9 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/frame/TxValues.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/frame/TxValues.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/CancunGasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/CancunGasCalculator.java index f858959564b..79165e5c210 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/CancunGasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/CancunGasCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/GasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/GasCalculator.java index 11489056812..06f24c534e8 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/GasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/GasCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/HomesteadGasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/HomesteadGasCalculator.java index 092dce26b0b..d3c8d30abf4 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/HomesteadGasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/HomesteadGasCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/PragueGasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/PragueGasCalculator.java index 5d7eab4d0a9..8aadbe5ffcd 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/PragueGasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/PragueGasCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ShanghaiGasCalculator.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ShanghaiGasCalculator.java index c4bc5ad743d..a44300f06a3 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ShanghaiGasCalculator.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/ShanghaiGasCalculator.java @@ -1,5 +1,3 @@ -package org.hyperledger.besu.evm.gascalculator; - /* * Copyright contributors to Hyperledger Besu. * @@ -14,6 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ +package org.hyperledger.besu.evm.gascalculator; import static org.hyperledger.besu.evm.internal.Words.clampedAdd; import static org.hyperledger.besu.evm.internal.Words.numWords; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/CodeCache.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/CodeCache.java index 25014b093bf..a7ce5abf2e5 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/CodeCache.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/CodeCache.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.evm.internal; import org.hyperledger.besu.datatypes.Hash; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/CodeScale.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/CodeScale.java index cd736c3d572..a4180895b4b 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/CodeScale.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/CodeScale.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.evm.internal; import org.hyperledger.besu.datatypes.Hash; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/EvmConfiguration.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/EvmConfiguration.java index c3ad7ba17aa..0a1c7a9c6ba 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/EvmConfiguration.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/EvmConfiguration.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.evm.internal; /** The Evm configuration. */ diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/FixedStack.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/FixedStack.java index 21b913f363c..9c9b47e32ca 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/FixedStack.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/FixedStack.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/FlexStack.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/FlexStack.java index 861cfbce8f9..dedd5c953e1 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/FlexStack.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/FlexStack.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/MemoryEntry.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/MemoryEntry.java index 6e0fbb098e8..193ed03dfe4 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/MemoryEntry.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/MemoryEntry.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.evm.internal; import org.apache.tuweni.bytes.Bytes; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/OperandStack.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/OperandStack.java index df27579a297..a88c0e65ca5 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/OperandStack.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/OperandStack.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.internal; import org.apache.tuweni.bytes.Bytes; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/OverflowException.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/OverflowException.java index f2e4efba353..9b2b8228b82 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/OverflowException.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/OverflowException.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/ReturnStack.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/ReturnStack.java index 5c0906c628c..9c752fa1a67 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/ReturnStack.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/ReturnStack.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/StorageEntry.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/StorageEntry.java index 7e68f75770d..21f85920b43 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/StorageEntry.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/StorageEntry.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.evm.internal; import org.apache.tuweni.bytes.Bytes; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/UnderflowException.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/UnderflowException.java index 5b794faa6c9..97fe4ad0c2c 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/UnderflowException.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/UnderflowException.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java b/evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java index 1f53c4ba2d3..e3fa184a1a9 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCallOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCallOperation.java index 3e038de65ef..db16346c327 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCallOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCallOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java index 1cac2ceee86..ba345ed8615 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractCreateOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractFixedCostOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractFixedCostOperation.java index 5a5ecd53008..bc9058c7f73 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractFixedCostOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractFixedCostOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.operation; import org.hyperledger.besu.evm.EVM; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractOperation.java index 58ebc5b43e0..bd2c0c17624 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AddModOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AddModOperation.java index 5d3586d7d88..d8e6d4aef85 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AddModOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AddModOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AddOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AddOperation.java index fd1f0ffe941..976e30c1d5d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AddOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AddOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AddressOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AddressOperation.java index 6f517639764..2a159ea9de2 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AddressOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AddressOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/AndOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/AndOperation.java index 726a2df7d12..21047b78c2f 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/AndOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/AndOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/BalanceOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/BalanceOperation.java index 18538413355..3f1ce5611df 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/BalanceOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/BalanceOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/BaseFeeOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/BaseFeeOperation.java index e65f7f139c4..e403fafdb72 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/BaseFeeOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/BaseFeeOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/BlobBaseFeeOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/BlobBaseFeeOperation.java index a7168473882..f4a87c8da76 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/BlobBaseFeeOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/BlobBaseFeeOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/BlobHashOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/BlobHashOperation.java index 3fe212b8b35..8b00d2fc35c 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/BlobHashOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/BlobHashOperation.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/BlockHashOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/BlockHashOperation.java index a9bb5c08363..498c635ac9c 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/BlockHashOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/BlockHashOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/ByteOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/ByteOperation.java index d8f67570a10..e615c20ec2a 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/ByteOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/ByteOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallCodeOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallCodeOperation.java index 3832a171efd..471da16906d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallCodeOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallCodeOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataCopyOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataCopyOperation.java index 3cdbd4f4b5c..f863d1b64af 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataCopyOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataCopyOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataLoadOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataLoadOperation.java index f3c63db1fc3..b1ea8f781a9 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataLoadOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataLoadOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataSizeOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataSizeOperation.java index 49f8693279b..4fc0ba5295e 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataSizeOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallDataSizeOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallFOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallFOperation.java index c9b51e88b17..a56099a0313 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallFOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallFOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallOperation.java index 69dd21eafe8..ea0abca1ae8 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallValueOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallValueOperation.java index 0cde3d8336a..f54da6f03c6 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallValueOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallValueOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallerOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallerOperation.java index 384a980ad1b..635bec22b48 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CallerOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CallerOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/ChainIdOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/ChainIdOperation.java index f807d745979..c4836c00f6d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/ChainIdOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/ChainIdOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CodeCopyOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CodeCopyOperation.java index f135880c2f4..02da96a428f 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CodeCopyOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CodeCopyOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/CodeSizeOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/CodeSizeOperation.java index 690b5692f88..d6dbb9ca36f 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/CodeSizeOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/CodeSizeOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/DifficultyOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/DifficultyOperation.java index c6ecfc8c0e0..b2a9c0913b5 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/DifficultyOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/DifficultyOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/JumpFOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/JumpFOperation.java index c0abcaffce5..86c6f906607 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/JumpFOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/JumpFOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/MCopyOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/MCopyOperation.java index a36c0f060a4..21c2737f363 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/MCopyOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/MCopyOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/PrevRanDaoOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/PrevRanDaoOperation.java index 0785d121448..3b3f805941f 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/PrevRanDaoOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/PrevRanDaoOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/Push0Operation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/Push0Operation.java index b9d4b048ff4..a9748994eb4 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/Push0Operation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/Push0Operation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpIfOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpIfOperation.java index d6aaae5cbbd..839b8612fe2 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpIfOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpIfOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.operation; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpOperation.java index 9f7b912f21e..e96d747ff17 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.operation; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpVectorOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpVectorOperation.java index 1657d325c3c..7304ffa8bb0 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpVectorOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/RelativeJumpVectorOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.operation; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/RetFOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/RetFOperation.java index 763a21d2a4a..1e5155fb81c 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/RetFOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/RetFOperation.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/TLoadOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/TLoadOperation.java index 7187e5d12b1..2511492a1a0 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/TLoadOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/TLoadOperation.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/TStoreOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/TStoreOperation.java index d8b8730cd5f..9eac70f58a9 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/TStoreOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/TStoreOperation.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractPrecompiledContract.java index ed2a4ad585b..b09c1b91042 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractPrecompiledContract.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java index 0774c09794d..b88f614c440 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java index 3f9f567dc2d..c099a270acb 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java b/evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java index b20004ce89a..86abd3ba06d 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.tracing; import static com.google.common.base.Strings.padStart; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/JournaledUpdater.java b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/JournaledUpdater.java index bdec559e071..9987a5be752 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/JournaledUpdater.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/JournaledUpdater.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/StackedUpdater.java b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/StackedUpdater.java index 471a807e700..3adcc9fd752 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/worldstate/StackedUpdater.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/worldstate/StackedUpdater.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/collections/trie/BytesTrieSetTest.java b/evm/src/test/java/org/hyperledger/besu/collections/trie/BytesTrieSetTest.java index dc92cc47d72..54efb9d685b 100644 --- a/evm/src/test/java/org/hyperledger/besu/collections/trie/BytesTrieSetTest.java +++ b/evm/src/test/java/org/hyperledger/besu/collections/trie/BytesTrieSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.trie; diff --git a/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoListTest.java b/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoListTest.java index 1ca96c470a8..5c1bb4d495e 100644 --- a/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoListTest.java +++ b/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoListTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoMapTest.java b/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoMapTest.java index b2eb030eab9..eebf984cd0d 100644 --- a/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoMapTest.java +++ b/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoMapTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoSetTest.java b/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoSetTest.java index 545cb68df12..d76c3c9ecac 100644 --- a/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoSetTest.java +++ b/evm/src/test/java/org/hyperledger/besu/collections/undo/UndoSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.collections.undo; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java b/evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java index 70043e22a4d..4f18f582d1a 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm; import static org.assertj.core.api.Assertions.assertThat; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/code/CodeFactoryTest.java b/evm/src/test/java/org/hyperledger/besu/evm/code/CodeFactoryTest.java index 79ddeb12429..adcf5b3585f 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/code/CodeFactoryTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/code/CodeFactoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.code; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/code/CodeV0Test.java b/evm/src/test/java/org/hyperledger/besu/evm/code/CodeV0Test.java index 07f0f17040c..36416329d12 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/code/CodeV0Test.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/code/CodeV0Test.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import static org.hyperledger.besu.evm.frame.MessageFrame.Type.MESSAGE_CALL; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/code/CodeV1Test.java b/evm/src/test/java/org/hyperledger/besu/evm/code/CodeV1Test.java index 7f8547d6643..5f06bb48727 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/code/CodeV1Test.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/code/CodeV1Test.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import static org.assertj.core.api.Assertions.assertThat; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/code/EOFLayoutTest.java b/evm/src/test/java/org/hyperledger/besu/evm/code/EOFLayoutTest.java index a0f83ddd9e0..d25d1bcdf81 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/code/EOFLayoutTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/code/EOFLayoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.code; import static org.assertj.core.api.Assertions.assertThat; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/fluent/EVMExecutorTest.java b/evm/src/test/java/org/hyperledger/besu/evm/fluent/EVMExecutorTest.java index 44ba849b4ce..97a2a4b8367 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/fluent/EVMExecutorTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/fluent/EVMExecutorTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/frame/MessageFrameTest.java b/evm/src/test/java/org/hyperledger/besu/evm/frame/MessageFrameTest.java index 9d175ff6f9a..b41883f2a9c 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/frame/MessageFrameTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/frame/MessageFrameTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/gascalculator/CancunGasCalculatorTest.java b/evm/src/test/java/org/hyperledger/besu/evm/gascalculator/CancunGasCalculatorTest.java index f8e53703b25..917b95b6880 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/gascalculator/CancunGasCalculatorTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/gascalculator/CancunGasCalculatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/internal/CodeCacheTest.java b/evm/src/test/java/org/hyperledger/besu/evm/internal/CodeCacheTest.java index 8c40a1a53a4..c18bef8889b 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/internal/CodeCacheTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/internal/CodeCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.evm.internal; import static org.assertj.core.api.Assertions.assertThat; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/internal/WordsTest.java b/evm/src/test/java/org/hyperledger/besu/evm/internal/WordsTest.java index 3b5e8a97fe9..30e651436d9 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/internal/WordsTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/internal/WordsTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evm.internal; import static org.assertj.core.api.Assertions.assertThat; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operation/AbstractCreateOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operation/AbstractCreateOperationTest.java index a471c45b010..a749a9188ff 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operation/AbstractCreateOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operation/AbstractCreateOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.operation; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/BlobHashOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/BlobHashOperationTest.java index 0f789a94477..cebffeb9105 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/BlobHashOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/BlobHashOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.evm.operations; import static org.assertj.core.api.Assertions.assertThat; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/CallFOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/CallFOperationTest.java index c5ea477db80..cc896f010d4 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/CallFOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/CallFOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/CreateOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/CreateOperationTest.java index a274b9c0dc8..e8d7f3c1fdd 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/CreateOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/CreateOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.operations; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/JumpFOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/JumpFOperationTest.java index a6157e52a84..7efbb8e9281 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/JumpFOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/JumpFOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/MCopyOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/MCopyOperationTest.java index bdae1238d5c..a30375723a1 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/MCopyOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/MCopyOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/PrevRanDaoOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/PrevRanDaoOperationTest.java index 8030cacc855..25a2682e87d 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/PrevRanDaoOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/PrevRanDaoOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/Push0OperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/Push0OperationTest.java index 439f4144f07..3309fccce81 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/Push0OperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/Push0OperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/RelativeJumpOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/RelativeJumpOperationTest.java index e576b196978..f55b7629ba3 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/RelativeJumpOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/RelativeJumpOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.operations; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/RetFOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/RetFOperationTest.java index fb375902260..193900ede7d 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/RetFOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/RetFOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/SelfDestructOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/SelfDestructOperationTest.java index 913ffd92bc9..66598ab5c7d 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/SelfDestructOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/SelfDestructOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/operations/TStoreOperationTest.java b/evm/src/test/java/org/hyperledger/besu/evm/operations/TStoreOperationTest.java index fed95ec0820..c73a4544f9f 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/operations/TStoreOperationTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/operations/TStoreOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompileContractTest.java b/evm/src/test/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompileContractTest.java index b368ce48d24..fb7ce9d397c 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompileContractTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompileContractTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/processor/AbstractMessageProcessorTest.java b/evm/src/test/java/org/hyperledger/besu/evm/processor/AbstractMessageProcessorTest.java index 016f3f6da37..6af3026f1f8 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/processor/AbstractMessageProcessorTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/processor/AbstractMessageProcessorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/processor/MessageCallProcessorTest.java b/evm/src/test/java/org/hyperledger/besu/evm/processor/MessageCallProcessorTest.java index 9d593c97b38..c3f04c07c58 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/processor/MessageCallProcessorTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/processor/MessageCallProcessorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/testutils/ByteCodeBuilder.java b/evm/src/test/java/org/hyperledger/besu/evm/testutils/ByteCodeBuilder.java index 19276d1afae..582da7e9ca1 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/testutils/ByteCodeBuilder.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/testutils/ByteCodeBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright Besu Contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToy.java b/evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToy.java index 58957758315..851afab807f 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToy.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToy.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.toy; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToyCommand.java b/evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToyCommand.java index 54060c9f341..3205c012bef 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToyCommand.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToyCommand.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.toy; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyAccount.java b/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyAccount.java index 64e2b7ae07e..7e47ed8cc4b 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyAccount.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyAccount.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.toy; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyBlockValues.java b/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyBlockValues.java index 300014d3878..9f347084d85 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyBlockValues.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyBlockValues.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.toy; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyWorld.java b/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyWorld.java index 06aa833bcd2..e1e9c4c3ad3 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyWorld.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/toy/ToyWorld.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evm.toy; diff --git a/evm/src/test/java/org/hyperledger/besu/evm/tracing/ExtendedOperationTracerTest.java b/evm/src/test/java/org/hyperledger/besu/evm/tracing/ExtendedOperationTracerTest.java index 9b57bd938f4..c0db4bfbf62 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/tracing/ExtendedOperationTracerTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/tracing/ExtendedOperationTracerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From afea4e0057a660535f6e061905835ee381e97c2e Mon Sep 17 00:00:00 2001 From: garyschulte Date: Wed, 1 May 2024 08:14:20 -0700 Subject: [PATCH 43/59] Allow API configuration to override supplied gasLimit (#6978) * allow gasLimit configuration for transaction simulation * revise unit test to reflect new behavior of rpcGasCap Signed-off-by: Karim Taam Signed-off-by: garyschulte Co-authored-by: Karim Taam --- .../besu/ethereum/transaction/TransactionSimulator.java | 7 ++----- .../ethereum/transaction/TransactionSimulatorTest.java | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java index c073ac4148c..070c1dcf771 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java @@ -235,11 +235,8 @@ public Optional processWithWorldUpdater( ? callParams.getGasLimit() : blockHeaderToProcess.getGasLimit(); if (rpcGasCap > 0) { - final long gasCap = rpcGasCap; - if (gasCap < gasLimit) { - gasLimit = gasCap; - LOG.info("Capping gasLimit to " + gasCap); - } + gasLimit = rpcGasCap; + LOG.info("Capping gasLimit to " + rpcGasCap); } final Wei value = callParams.getValue() != null ? callParams.getValue() : Wei.ZERO; final Bytes payload = callParams.getPayload() != null ? callParams.getPayload() : Bytes.EMPTY; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java index 7142d8830e5..2595284822d 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java @@ -565,8 +565,9 @@ public void shouldCapGasLimitWhenOriginalTransactionExceedsGasCap() { } @Test - public void shouldKeepOriginalGasLimitWhenCapIsHigherThanOriginalValue() { - // generate a transaction with a gas limit that is lower than the gas cap + public void shouldUseRpcGasCapWhenCapIsHigherThanGasLimit() { + // generate a transaction with a gas limit that is lower than the gas cap, + // expect the gas cap to override parameter gas limit final CallParameter callParameter = eip1559TransactionCallParameter(Wei.ZERO, Wei.ZERO, GASCAP - 1); @@ -589,6 +590,7 @@ public void shouldKeepOriginalGasLimitWhenCapIsHigherThanOriginalValue() { .value(callParameter.getValue()) .payload(callParameter.getPayload()) .signature(FAKE_SIGNATURE) + .gasLimit(GASCAP) .build(); // call process with original transaction From 1ce3f8dec9637a68fd0403e5f7a840628d5772b2 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Thu, 2 May 2024 15:52:10 +1000 Subject: [PATCH 44/59] attempt to fix flaky test (#7008) Signed-off-by: Sally MacFarlane Co-authored-by: Simon Dudley --- ...ContractPermissioningOutOfSyncAcceptanceTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java index 4315151473b..935db106ca5 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java @@ -46,14 +46,18 @@ public void addNodeToClusterAndVerifyNonBootNodePeerConnectionWorksAfterSync() { final long blockchainHeight = 25L; waitForBlockHeight(permissionedNodeA, blockchainHeight); - // Add Node B + // verify Node A is in sync with bootnode + final var minerChainHead = bootnode.execute(ethTransactions.block()); + permissionedNodeA.verify(blockchain.minimumHeight(minerChainHead.getNumber().longValue())); + + // check that connection is forbidden (before node b is permitted) permissionedCluster.addNode(permissionedNodeB); + permissionedNodeB.verify(connectionIsForbidden(permissionedNodeA, permissionedNodeB)); + + // Permit Node B permissionedNodeA.execute(allowNode(permissionedNodeB)); permissionedNodeA.verify(admin.addPeer(permissionedNodeB)); - // check that connection is forbidden (while node b is syncing) - permissionedNodeB.verify(connectionIsForbidden(permissionedNodeA, permissionedNodeB)); - // connection should be allowed after node B syncs waitForBlockHeight(permissionedNodeB, blockchainHeight); permissionedNodeB.verify(connectionIsAllowed(permissionedNodeA, permissionedNodeB)); From 9d27c509befb495d01ff59148c16f5dba37982ad Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Thu, 2 May 2024 20:12:43 +1000 Subject: [PATCH 45/59] Apply Hyperledger license header (#7029) -- plugin-api/ util/ Signed-off-by: Usman Saleem --- plugin-api/build.gradle | 2 +- .../java/org/hyperledger/besu/plugin/data/BadBlockCause.java | 3 +-- .../java/org/hyperledger/besu/plugin/data/BlockContext.java | 2 +- .../org/hyperledger/besu/plugin/data/BlockTraceResult.java | 2 +- .../main/java/org/hyperledger/besu/plugin/data/Deposit.java | 2 +- .../main/java/org/hyperledger/besu/plugin/data/Signature.java | 2 +- .../besu/plugin/data/TransactionProcessingResult.java | 2 +- .../besu/plugin/data/TransactionSelectionResult.java | 3 +-- .../besu/plugin/data/TransactionSimulationResult.java | 2 +- .../hyperledger/besu/plugin/data/TransactionTraceResult.java | 2 +- .../main/java/org/hyperledger/besu/plugin/data/Withdrawal.java | 2 +- .../org/hyperledger/besu/plugin/data/WithdrawalRequest.java | 2 +- .../hyperledger/besu/plugin/services/BlockchainService.java | 2 +- .../hyperledger/besu/plugin/services/RpcEndpointService.java | 2 +- .../org/hyperledger/besu/plugin/services/TraceService.java | 2 +- .../besu/plugin/services/TransactionPoolValidatorService.java | 3 +-- .../besu/plugin/services/TransactionSelectionService.java | 3 +-- .../besu/plugin/services/TransactionSimulationService.java | 2 +- .../org/hyperledger/besu/plugin/services/TrieLogService.java | 3 +-- .../plugin/services/exception/PluginRpcEndpointException.java | 2 +- .../hyperledger/besu/plugin/services/rpc/RpcMethodError.java | 2 +- .../besu/plugin/services/storage/DataStorageConfiguration.java | 3 +-- .../besu/plugin/services/storage/DataStorageFormat.java | 2 +- .../besu/plugin/services/storage/SnappableKeyValueStorage.java | 3 +-- .../besu/plugin/services/storage/SnappedKeyValueStorage.java | 3 +-- .../besu/plugin/services/tracer/BlockAwareOperationTracer.java | 2 +- .../org/hyperledger/besu/plugin/services/trielogs/TrieLog.java | 2 +- .../besu/plugin/services/trielogs/TrieLogAccumulator.java | 2 +- .../besu/plugin/services/trielogs/TrieLogEvent.java | 2 +- .../besu/plugin/services/trielogs/TrieLogFactory.java | 2 +- .../besu/plugin/services/trielogs/TrieLogProvider.java | 2 +- .../plugin/services/txselection/PluginTransactionSelector.java | 3 +-- .../services/txselection/PluginTransactionSelectorFactory.java | 3 +-- .../services/txselection/TransactionEvaluationContext.java | 2 +- .../services/txvalidator/PluginTransactionPoolValidator.java | 3 +-- .../txvalidator/PluginTransactionPoolValidatorFactory.java | 3 +-- .../java/org/hyperledger/besu/util/log/FramedLogMessage.java | 2 +- util/src/main/java/org/hyperledger/besu/util/log/LogUtil.java | 2 +- .../main/java/org/hyperledger/besu/util/number/ByteUnits.java | 3 +-- .../test/java/org/hyperledger/besu/util/log/LogUtilTest.java | 2 +- .../org/hyperledger/besu/util/number/PositiveNumberTest.java | 2 +- 41 files changed, 41 insertions(+), 54 deletions(-) diff --git a/plugin-api/build.gradle b/plugin-api/build.gradle index 4d7774af162..6567bf075ea 100644 --- a/plugin-api/build.gradle +++ b/plugin-api/build.gradle @@ -69,7 +69,7 @@ Calculated : ${currentHash} tasks.register('checkAPIChanges', FileStateChecker) { description = "Checks that the API for the Plugin-API project does not change without deliberate thought" files = sourceSets.main.allJava.files - knownHash = 'rCBv4jTpL47h0qSX64edjML55NkqEhq1NRlWwsOZy1Q=' + knownHash = 'lRmKnDTcM8T+0wZqTBQYIK9SLnyxgUNQ9Cue93VMgwE=' } check.dependsOn('checkAPIChanges') diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BadBlockCause.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BadBlockCause.java index 66c813b92a6..b9f41a34a14 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BadBlockCause.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BadBlockCause.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.plugin.data; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockContext.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockContext.java index caacc741f4d..a2fdc2819c1 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockContext.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockContext.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockTraceResult.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockTraceResult.java index 1ee4779cc0c..923788da452 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockTraceResult.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/BlockTraceResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Deposit.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Deposit.java index 50e67898d75..6ad30217ac7 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Deposit.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Deposit.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Signature.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Signature.java index 034581c6114..5d354fb6156 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Signature.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Signature.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionProcessingResult.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionProcessingResult.java index ac398788e40..58d7372bd3a 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionProcessingResult.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionProcessingResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionSelectionResult.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionSelectionResult.java index 91dc7b14a67..112df57a498 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionSelectionResult.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionSelectionResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.data; import java.util.Objects; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionSimulationResult.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionSimulationResult.java index 1f2e6a8ab82..9c878be71d6 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionSimulationResult.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionSimulationResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionTraceResult.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionTraceResult.java index 8b6619de285..41471d40210 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionTraceResult.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/TransactionTraceResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Withdrawal.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Withdrawal.java index ab4594eb308..cbb3b559953 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Withdrawal.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Withdrawal.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/WithdrawalRequest.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/WithdrawalRequest.java index 79abaf60acd..7f9f5d15e09 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/WithdrawalRequest.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/WithdrawalRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BlockchainService.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BlockchainService.java index 76f66aba6ca..af6d14f546c 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BlockchainService.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BlockchainService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/RpcEndpointService.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/RpcEndpointService.java index 73f43a1017a..a1b69a7c7fe 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/RpcEndpointService.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/RpcEndpointService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TraceService.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TraceService.java index b084d3712c7..cf9dc841768 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TraceService.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TraceService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionPoolValidatorService.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionPoolValidatorService.java index 2d210c13e41..0dfe0f31240 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionPoolValidatorService.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionPoolValidatorService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services; import org.hyperledger.besu.plugin.Unstable; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSelectionService.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSelectionService.java index b780015f0be..daa07930d8c 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSelectionService.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSelectionService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services; import org.hyperledger.besu.plugin.Unstable; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSimulationService.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSimulationService.java index 77d5822c93c..dffdb0cfe51 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSimulationService.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSimulationService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TrieLogService.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TrieLogService.java index f3180c6db14..2c5c38c5498 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TrieLogService.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TrieLogService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.plugin.services; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/exception/PluginRpcEndpointException.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/exception/PluginRpcEndpointException.java index 4ac1c96a146..51b1e1e0078 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/exception/PluginRpcEndpointException.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/exception/PluginRpcEndpointException.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/rpc/RpcMethodError.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/rpc/RpcMethodError.java index c257febbc24..b8d6791ecec 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/rpc/RpcMethodError.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/rpc/RpcMethodError.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageConfiguration.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageConfiguration.java index 80abc936982..22fdf922f3e 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageConfiguration.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.storage; import org.hyperledger.besu.plugin.Unstable; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageFormat.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageFormat.java index 69df2717b3b..8e056abc49a 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageFormat.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageFormat.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/SnappableKeyValueStorage.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/SnappableKeyValueStorage.java index 18486ff02fd..acbb879497b 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/SnappableKeyValueStorage.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/SnappableKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.plugin.services.storage; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/SnappedKeyValueStorage.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/SnappedKeyValueStorage.java index 64f762eb772..f5aaf8a070f 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/SnappedKeyValueStorage.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/SnappedKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.plugin.services.storage; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/tracer/BlockAwareOperationTracer.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/tracer/BlockAwareOperationTracer.java index f7dcc6113cb..b84c4b69f32 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/tracer/BlockAwareOperationTracer.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/tracer/BlockAwareOperationTracer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLog.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLog.java index e9d80759755..68b44918e6a 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLog.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLog.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogAccumulator.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogAccumulator.java index 384a327166d..d85ce2a714a 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogAccumulator.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogAccumulator.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogEvent.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogEvent.java index dc5e60761d9..e383a6cedde 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogEvent.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogEvent.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogFactory.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogFactory.java index 143bb880950..41defb707de 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogFactory.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogFactory.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogProvider.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogProvider.java index 5df4f73c453..86a9906cf08 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogProvider.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogProvider.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/PluginTransactionSelector.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/PluginTransactionSelector.java index 4f3d6c45367..e0bf1cf3130 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/PluginTransactionSelector.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/PluginTransactionSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.txselection; import static org.hyperledger.besu.plugin.data.TransactionSelectionResult.SELECTED; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/PluginTransactionSelectorFactory.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/PluginTransactionSelectorFactory.java index dc6311bb557..e0b7acc5840 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/PluginTransactionSelectorFactory.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/PluginTransactionSelectorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.txselection; import org.hyperledger.besu.plugin.Unstable; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/TransactionEvaluationContext.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/TransactionEvaluationContext.java index 83aa7b91e7c..93eae92dc7b 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/TransactionEvaluationContext.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txselection/TransactionEvaluationContext.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txvalidator/PluginTransactionPoolValidator.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txvalidator/PluginTransactionPoolValidator.java index 02fcd9b21f7..0aa22f9b9c1 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txvalidator/PluginTransactionPoolValidator.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txvalidator/PluginTransactionPoolValidator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.txvalidator; import org.hyperledger.besu.datatypes.Transaction; diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txvalidator/PluginTransactionPoolValidatorFactory.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txvalidator/PluginTransactionPoolValidatorFactory.java index 3163667b86e..8dec48c49d9 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txvalidator/PluginTransactionPoolValidatorFactory.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/services/txvalidator/PluginTransactionPoolValidatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.plugin.services.txvalidator; import org.hyperledger.besu.plugin.Unstable; diff --git a/util/src/main/java/org/hyperledger/besu/util/log/FramedLogMessage.java b/util/src/main/java/org/hyperledger/besu/util/log/FramedLogMessage.java index f68c3ed7fe0..a67b12b415f 100644 --- a/util/src/main/java/org/hyperledger/besu/util/log/FramedLogMessage.java +++ b/util/src/main/java/org/hyperledger/besu/util/log/FramedLogMessage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/util/src/main/java/org/hyperledger/besu/util/log/LogUtil.java b/util/src/main/java/org/hyperledger/besu/util/log/LogUtil.java index f626ba4e46a..794acaea641 100644 --- a/util/src/main/java/org/hyperledger/besu/util/log/LogUtil.java +++ b/util/src/main/java/org/hyperledger/besu/util/log/LogUtil.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/util/src/main/java/org/hyperledger/besu/util/number/ByteUnits.java b/util/src/main/java/org/hyperledger/besu/util/number/ByteUnits.java index 461c5543634..70e58c44aeb 100644 --- a/util/src/main/java/org/hyperledger/besu/util/number/ByteUnits.java +++ b/util/src/main/java/org/hyperledger/besu/util/number/ByteUnits.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.util.number; /** The Byte units. */ diff --git a/util/src/test/java/org/hyperledger/besu/util/log/LogUtilTest.java b/util/src/test/java/org/hyperledger/besu/util/log/LogUtilTest.java index 25ed58c33c9..89397c900ef 100644 --- a/util/src/test/java/org/hyperledger/besu/util/log/LogUtilTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/log/LogUtilTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java b/util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java index 5e51e79e801..022966d71b4 100644 --- a/util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From 0d6b38ee656e73c520af7c6adc70e00c6083dc7b Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Thu, 2 May 2024 21:12:44 +1000 Subject: [PATCH 46/59] Apply Hyperledger license header to `ethereum/blockcreation/` (#7033) Signed-off-by: Usman Saleem --- .../besu/ethereum/blockcreation/AbstractBlockCreator.java | 2 +- .../besu/ethereum/blockcreation/BlockCreationTiming.java | 2 +- .../blockcreation/txselection/BlockSelectionContext.java | 2 +- .../blockcreation/txselection/BlockTransactionSelector.java | 2 +- .../blockcreation/txselection/TransactionEvaluationContext.java | 2 +- .../blockcreation/txselection/TransactionSelectionResults.java | 2 +- .../txselection/selectors/AbstractTransactionSelector.java | 2 +- .../txselection/selectors/BlobPriceTransactionSelector.java | 2 +- .../txselection/selectors/BlockSizeTransactionSelector.java | 2 +- .../selectors/MinPriorityFeePerGasTransactionSelector.java | 2 +- .../txselection/selectors/PriceTransactionSelector.java | 2 +- .../selectors/ProcessingResultTransactionSelector.java | 2 +- .../besu/ethereum/blockcreation/AbstractBlockCreatorTest.java | 2 +- .../blockcreation/AbstractBlockTransactionSelectorTest.java | 2 +- .../LegacyFeeMarketBlockTransactionSelectorTest.java | 2 +- .../LondonFeeMarketBlockTransactionSelectorTest.java | 2 +- .../MinPriorityFeePerGasTransactionSelectorTest.java | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java index 7ee51222d4f..071cfa37043 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockCreationTiming.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockCreationTiming.java index 711fa691413..e5fe3e679d1 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockCreationTiming.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockCreationTiming.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockSelectionContext.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockSelectionContext.java index 8204b3d9e43..699f7268190 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockSelectionContext.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockSelectionContext.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java index ea49aac8b23..a2b14911e11 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/BlockTransactionSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/TransactionEvaluationContext.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/TransactionEvaluationContext.java index 20609ebdc84..0a17812b0f9 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/TransactionEvaluationContext.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/TransactionEvaluationContext.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/TransactionSelectionResults.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/TransactionSelectionResults.java index 4c3fc43beb0..5977b2f7b3e 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/TransactionSelectionResults.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/TransactionSelectionResults.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/AbstractTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/AbstractTransactionSelector.java index 0e7f610a1f3..afb426e90b6 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/AbstractTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/AbstractTransactionSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlobPriceTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlobPriceTransactionSelector.java index 96135bea214..57d4e7dcafa 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlobPriceTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlobPriceTransactionSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlockSizeTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlockSizeTransactionSelector.java index 168107f5950..7f0b13e8b99 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlockSizeTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlockSizeTransactionSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/MinPriorityFeePerGasTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/MinPriorityFeePerGasTransactionSelector.java index 1a46242ffe2..fc32a5c08ca 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/MinPriorityFeePerGasTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/MinPriorityFeePerGasTransactionSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/PriceTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/PriceTransactionSelector.java index d677ea9358f..707b1c48633 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/PriceTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/PriceTransactionSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/ProcessingResultTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/ProcessingResultTransactionSelector.java index bb89b965a39..85d97bdf460 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/ProcessingResultTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/ProcessingResultTransactionSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreatorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreatorTest.java index 560c149877e..77270065763 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreatorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java index 2eddaf7fa52..36b965697d8 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LegacyFeeMarketBlockTransactionSelectorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LegacyFeeMarketBlockTransactionSelectorTest.java index 0235d8c1d46..91b58fab8d1 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LegacyFeeMarketBlockTransactionSelectorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LegacyFeeMarketBlockTransactionSelectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LondonFeeMarketBlockTransactionSelectorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LondonFeeMarketBlockTransactionSelectorTest.java index 8250039b2b9..5fb915fd095 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LondonFeeMarketBlockTransactionSelectorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LondonFeeMarketBlockTransactionSelectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/MinPriorityFeePerGasTransactionSelectorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/MinPriorityFeePerGasTransactionSelectorTest.java index 94d3abb105c..72fc5ac3d77 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/MinPriorityFeePerGasTransactionSelectorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/MinPriorityFeePerGasTransactionSelectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From 482498177c950401c09fa84e3b6208c3a4992c1a Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Thu, 2 May 2024 22:09:21 +1000 Subject: [PATCH 47/59] Apply Hyperledger license header to `ethereum/eth/` (#7035) * Apply Hyperledger license header to `ethereum/eth/` --------- Signed-off-by: Usman Saleem --- .../hyperledger/besu/consensus/merge/ForkchoiceEvent.java | 2 +- .../hyperledger/besu/consensus/merge/MergeStateHandler.java | 6 ++---- .../besu/consensus/merge/UnverifiedForkchoiceListener.java | 6 ++---- .../java/org/hyperledger/besu/ethereum/eth/EthProtocol.java | 2 +- .../hyperledger/besu/ethereum/eth/EthProtocolVersion.java | 2 +- .../besu/ethereum/eth/manager/EthProtocolLogger.java | 2 +- .../besu/ethereum/eth/manager/EthProtocolManager.java | 2 +- .../besu/ethereum/eth/manager/MergePeerFilter.java | 6 ++---- .../eth/manager/snap/GetAccountRangeFromPeerTask.java | 2 +- .../ethereum/eth/manager/snap/GetBytecodeFromPeerTask.java | 2 +- .../eth/manager/snap/GetStorageRangeFromPeerTask.java | 2 +- .../ethereum/eth/manager/snap/GetTrieNodeFromPeerTask.java | 2 +- .../manager/snap/RetryingGetAccountRangeFromPeerTask.java | 2 +- .../eth/manager/snap/RetryingGetBytecodeFromPeerTask.java | 2 +- .../manager/snap/RetryingGetStorageRangeFromPeerTask.java | 2 +- .../eth/manager/snap/RetryingGetTrieNodeFromPeerTask.java | 2 +- .../besu/ethereum/eth/manager/snap/SnapProtocolManager.java | 2 +- .../besu/ethereum/eth/manager/snap/SnapServer.java | 2 +- .../eth/manager/task/AbstractRetryingSwitchingPeerTask.java | 2 +- .../eth/manager/task/RetryingGetBlockFromPeersTask.java | 2 +- .../eth/manager/task/RetryingGetBlocksFromPeersTask.java | 2 +- .../task/RetryingGetHeadersEndingAtFromPeerByHashTask.java | 3 +-- .../ethereum/eth/messages/snap/AccountRangeMessage.java | 2 +- .../besu/ethereum/eth/messages/snap/ByteCodesMessage.java | 2 +- .../ethereum/eth/messages/snap/GetByteCodesMessage.java | 2 +- .../ethereum/eth/messages/snap/GetStorageRangeMessage.java | 2 +- .../ethereum/eth/messages/snap/GetTrieNodesMessage.java | 2 +- .../hyperledger/besu/ethereum/eth/messages/snap/SnapV1.java | 2 +- .../ethereum/eth/messages/snap/StorageRangeMessage.java | 2 +- .../besu/ethereum/eth/messages/snap/TrieNodesMessage.java | 2 +- .../eth/peervalidation/CheckpointBlocksPeerValidator.java | 2 +- .../besu/ethereum/eth/sync/PivotBlockSelector.java | 2 +- .../besu/ethereum/eth/sync/backwardsync/BackwardChain.java | 3 +-- .../eth/sync/backwardsync/BackwardSyncAlgorithm.java | 4 +--- .../ethereum/eth/sync/backwardsync/BackwardSyncContext.java | 2 +- .../eth/sync/backwardsync/BackwardSyncException.java | 2 +- .../ethereum/eth/sync/backwardsync/BackwardSyncStep.java | 2 +- .../ethereum/eth/sync/backwardsync/BadChainListener.java | 2 +- .../ethereum/eth/sync/backwardsync/BlocksConvertor.java | 3 +-- .../eth/sync/backwardsync/BlocksHeadersConvertor.java | 3 +-- .../eth/sync/backwardsync/FinalBlockConfirmation.java | 5 +---- .../ethereum/eth/sync/backwardsync/ForwardSyncStep.java | 2 +- .../eth/sync/backwardsync/GenericKeyValueStorageFacade.java | 3 +-- .../besu/ethereum/eth/sync/backwardsync/HashConvertor.java | 5 +---- .../besu/ethereum/eth/sync/backwardsync/KeyConvertor.java | 3 +-- .../eth/sync/backwardsync/ProcessKnownAncestorsStep.java | 5 +---- .../besu/ethereum/eth/sync/backwardsync/SyncStepStep.java | 5 +---- .../besu/ethereum/eth/sync/backwardsync/ValueConvertor.java | 3 +-- .../eth/sync/checkpointsync/CheckpointBlockImportStep.java | 2 +- .../sync/checkpointsync/CheckpointDownloadBlockStep.java | 2 +- .../sync/checkpointsync/CheckpointDownloaderFactory.java | 2 +- .../ethereum/eth/sync/checkpointsync/CheckpointSource.java | 2 +- .../eth/sync/checkpointsync/CheckpointSyncActions.java | 2 +- .../sync/checkpointsync/CheckpointSyncChainDownloader.java | 5 +++-- .../CheckpointSyncDownloadPipelineFactory.java | 2 +- .../ethereum/eth/sync/fastsync/PivotSelectorFromPeers.java | 2 +- .../eth/sync/fastsync/PivotSelectorFromSafeBlock.java | 2 +- .../besu/ethereum/eth/sync/fastsync/SyncTargetManager.java | 2 +- .../ethereum/eth/sync/fastsync/checkpoint/Checkpoint.java | 2 +- .../fastsync/worldstate/AccountTrieNodeDataRequest.java | 2 +- .../eth/sync/fastsync/worldstate/TrieNodeDataRequest.java | 2 +- .../besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java | 2 +- .../eth/sync/snapsync/DynamicPivotBlockSelector.java | 2 +- .../besu/ethereum/eth/sync/snapsync/LoadLocalDataStep.java | 2 +- .../besu/ethereum/eth/sync/snapsync/PersistDataStep.java | 2 +- .../besu/ethereum/eth/sync/snapsync/RequestDataStep.java | 2 +- .../besu/ethereum/eth/sync/snapsync/RequestType.java | 2 +- .../ethereum/eth/sync/snapsync/SnapDownloaderFactory.java | 2 +- .../ethereum/eth/sync/snapsync/SnapSyncConfiguration.java | 2 +- .../besu/ethereum/eth/sync/snapsync/SnapSyncDownloader.java | 2 +- .../ethereum/eth/sync/snapsync/SnapSyncMetricsManager.java | 2 +- .../ethereum/eth/sync/snapsync/SnapSyncProcessState.java | 2 +- .../ethereum/eth/sync/snapsync/SnapWorldDownloadState.java | 2 +- .../eth/sync/snapsync/SnapWorldStateDownloadProcess.java | 2 +- .../eth/sync/snapsync/SnapWorldStateDownloader.java | 2 +- .../besu/ethereum/eth/sync/snapsync/StackTrie.java | 2 +- .../snapsync/context/SnapSyncStatePersistenceManager.java | 2 +- .../eth/sync/snapsync/request/AccountRangeDataRequest.java | 2 +- .../ethereum/eth/sync/snapsync/request/BytecodeRequest.java | 2 +- .../ethereum/eth/sync/snapsync/request/SnapDataRequest.java | 2 +- .../eth/sync/snapsync/request/StorageRangeDataRequest.java | 2 +- .../heal/AccountFlatDatabaseHealingRangeRequest.java | 2 +- .../request/heal/AccountTrieNodeHealingRequest.java | 2 +- .../heal/StorageFlatDatabaseHealingRangeRequest.java | 2 +- .../request/heal/StorageTrieNodeHealingRequest.java | 2 +- .../sync/snapsync/request/heal/TrieNodeHealingRequest.java | 2 +- .../eth/sync/tasks/RetryingGetHeaderFromPeerByHashTask.java | 2 +- .../besu/ethereum/eth/transactions/BlobCache.java | 3 +-- .../besu/ethereum/eth/transactions/BlobCacheModule.java | 3 +-- .../eth/transactions/DisabledPendingTransactions.java | 2 +- .../besu/ethereum/eth/transactions/PendingTransaction.java | 2 +- .../besu/ethereum/eth/transactions/PendingTransactions.java | 2 +- .../ethereum/eth/transactions/TransactionAddedResult.java | 2 +- .../ethereum/eth/transactions/TransactionBroadcaster.java | 2 +- .../eth/transactions/TransactionPoolEvictionService.java | 2 +- .../ethereum/eth/transactions/TransactionPoolMetrics.java | 2 +- .../layered/AbstractPrioritizedTransactions.java | 2 +- .../layered/AbstractSequentialTransactionsLayer.java | 2 +- .../eth/transactions/layered/AbstractTransactionsLayer.java | 2 +- .../layered/BaseFeePrioritizedTransactions.java | 2 +- .../besu/ethereum/eth/transactions/layered/EndLayer.java | 2 +- .../layered/GasPricePrioritizedTransactions.java | 2 +- .../transactions/layered/LayeredPendingTransactions.java | 2 +- .../eth/transactions/layered/ReadyTransactions.java | 2 +- .../eth/transactions/layered/SparseTransactions.java | 2 +- .../eth/transactions/layered/TransactionsLayer.java | 2 +- .../sorter/AbstractPendingTransactionsSorter.java | 2 +- .../transactions/sorter/PendingTransactionsForSender.java | 2 +- .../org/hyperledger/besu/ethereum/eth/EthPeerTestUtil.java | 2 +- .../besu/ethereum/eth/manager/EthProtocolManagerTest.java | 2 +- .../ethtaskutils/RetryingSwitchingPeerMessageTaskTest.java | 2 +- .../besu/ethereum/eth/manager/snap/SnapServerTest.java | 2 +- .../eth/manager/task/AbstractRetryingPeerTaskTest.java | 2 +- .../eth/manager/task/RetryingGetBlockFromPeersTaskTest.java | 2 +- .../ethereum/eth/messages/snap/AccountRangeMessageTest.java | 2 +- .../ethereum/eth/messages/snap/BytecodeMessageTest.java | 2 +- .../eth/messages/snap/GetAccountRangeMessageTest.java | 2 +- .../ethereum/eth/messages/snap/GetBytecodeMessageTest.java | 2 +- .../eth/messages/snap/GetStorageRangeMessageTest.java | 2 +- .../ethereum/eth/messages/snap/GetTrieNodeMessageTest.java | 2 +- .../ethereum/eth/messages/snap/StorageRangeMessageTest.java | 2 +- .../ethereum/eth/messages/snap/TrieNodeMessageTest.java | 2 +- .../eth/sync/backwardsync/BackwardSyncStepTest.java | 2 +- .../ethereum/eth/sync/backwardsync/ChainForTestCreator.java | 2 +- .../eth/sync/backwardsync/InMemoryBackwardChainTest.java | 2 +- .../sync/checkpointsync/CheckPointBlockImportStepTest.java | 2 +- .../eth/sync/checkpointsync/CheckPointSourceTest.java | 2 +- .../checkpointsync/CheckPointSyncChainDownloaderTest.java | 2 +- .../fastsync/FastImportBlocksPercentageCalculationTest.java | 2 +- .../fastsync/worldstate/FastWorldStateDownloaderTest.java | 2 +- .../eth/sync/fastsync/worldstate/PersistDataStepTest.java | 2 +- .../eth/sync/snapsync/AccountHealingTrackingTest.java | 2 +- .../ethereum/eth/sync/snapsync/CompleteTaskStepTest.java | 2 +- .../eth/sync/snapsync/DynamicPivotBlockManagerTest.java | 2 +- .../ethereum/eth/sync/snapsync/LoadLocalDataStepTest.java | 2 +- .../ethereum/eth/sync/snapsync/PersistDataStepTest.java | 2 +- .../besu/ethereum/eth/sync/snapsync/RangeManagerTest.java | 2 +- .../eth/sync/snapsync/SnapWorldDownloadStateTest.java | 2 +- .../besu/ethereum/eth/sync/snapsync/StackTrieTest.java | 2 +- .../besu/ethereum/eth/sync/snapsync/StubTask.java | 2 +- .../besu/ethereum/eth/sync/snapsync/TaskGenerator.java | 2 +- .../heal/AccountFlatDatabaseHealingRangeRequestTest.java | 2 +- .../heal/StorageFlatDatabaseHealingRangeRequestTest.java | 2 +- .../request/heal/StorageTrieNodeHealingRequestTest.java | 2 +- .../eth/transactions/AbstractTransactionPoolTest.java | 2 +- .../transactions/AbstractTransactionReplacementTest.java | 2 +- .../PendingTransactionEstimatedMemorySizeTest.java | 2 +- .../eth/transactions/TransactionBroadcasterTest.java | 2 +- .../TransactionReplacementByFeeMarketRuleTest.java | 2 +- .../TransactionReplacementByGasPriceRuleTest.java | 2 +- .../layered/AbstractLayeredTransactionPoolTest.java | 2 +- .../layered/AbstractPrioritizedTransactionsTestBase.java | 2 +- .../layered/BaseFeePrioritizedTransactionsTest.java | 2 +- .../eth/transactions/layered/BaseTransactionPoolTest.java | 2 +- .../eth/transactions/layered/EvictCollectorLayer.java | 2 +- .../layered/GasPricePrioritizedTransactionsTest.java | 2 +- .../layered/LayeredPendingTransactionsTest.java | 2 +- .../layered/LayeredTransactionPoolBaseFeeTest.java | 2 +- .../layered/LayeredTransactionPoolGasPriceTest.java | 2 +- .../besu/ethereum/eth/transactions/layered/ReplayTest.java | 2 +- .../sorter/AbstractPendingTransactionsTestBase.java | 2 +- .../transactions/sorter/BaseFeePendingTransactionsTest.java | 2 +- .../sorter/GasPricePendingTransactionsTest.java | 2 +- .../sorter/LegacyTransactionPoolBaseFeeTest.java | 2 +- .../sorter/LegacyTransactionPoolGasPriceTest.java | 2 +- 165 files changed, 170 insertions(+), 198 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/ForkchoiceEvent.java b/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/ForkchoiceEvent.java index 8207e13f759..ddb0ec5efd7 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/ForkchoiceEvent.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/ForkchoiceEvent.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/MergeStateHandler.java b/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/MergeStateHandler.java index d668e13698e..99d7f2af4e1 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/MergeStateHandler.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/MergeStateHandler.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.consensus.merge; import org.hyperledger.besu.ethereum.core.Difficulty; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/UnverifiedForkchoiceListener.java b/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/UnverifiedForkchoiceListener.java index ccbe8949baa..14081d6b205 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/UnverifiedForkchoiceListener.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/consensus/merge/UnverifiedForkchoiceListener.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.consensus.merge; /** The interface Unverified forkchoice listener. */ diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/EthProtocol.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/EthProtocol.java index e633d3b99ce..9af1ee1aa61 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/EthProtocol.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/EthProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/EthProtocolVersion.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/EthProtocolVersion.java index 39e6596738a..239333da431 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/EthProtocolVersion.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/EthProtocolVersion.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolLogger.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolLogger.java index 0b57488b193..c4a613c2e0a 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolLogger.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolLogger.java @@ -1,5 +1,5 @@ /* - * Copyright Contributors to Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java index df1ee33d480..c8781e73e3c 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/MergePeerFilter.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/MergePeerFilter.java index 338e4dc3667..a5e0b8c5e51 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/MergePeerFilter.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/MergePeerFilter.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.eth.manager; import org.hyperledger.besu.consensus.merge.ForkchoiceEvent; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetAccountRangeFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetAccountRangeFromPeerTask.java index c52758eeb94..75a6183eb4e 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetAccountRangeFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetAccountRangeFromPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetBytecodeFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetBytecodeFromPeerTask.java index 357157484a0..d57acc590c9 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetBytecodeFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetBytecodeFromPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetStorageRangeFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetStorageRangeFromPeerTask.java index 48b3426ae42..bcc8f23ebdd 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetStorageRangeFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetStorageRangeFromPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetTrieNodeFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetTrieNodeFromPeerTask.java index 56c7d9a2357..6b2e8cc6b00 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetTrieNodeFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/GetTrieNodeFromPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetAccountRangeFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetAccountRangeFromPeerTask.java index 7512bdd03a9..103172b0870 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetAccountRangeFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetAccountRangeFromPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetBytecodeFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetBytecodeFromPeerTask.java index 7d23ec944d3..9b340c8cdd4 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetBytecodeFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetBytecodeFromPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetStorageRangeFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetStorageRangeFromPeerTask.java index 7a095de9292..cbda1a5fb07 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetStorageRangeFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetStorageRangeFromPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetTrieNodeFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetTrieNodeFromPeerTask.java index ebfd8856898..ca1c70f59b5 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetTrieNodeFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/RetryingGetTrieNodeFromPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapProtocolManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapProtocolManager.java index 854915e4764..57b4d2c71a3 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapProtocolManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapProtocolManager.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServer.java index ef26fba34a4..c2fa186489c 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServer.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingSwitchingPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingSwitchingPeerTask.java index 9411fac081a..88fe3bb6a73 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingSwitchingPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingSwitchingPeerTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlockFromPeersTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlockFromPeersTask.java index f7266f9c88e..e4e472f4f4c 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlockFromPeersTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlockFromPeersTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlocksFromPeersTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlocksFromPeersTask.java index 52ff2c4025a..ed2c1756257 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlocksFromPeersTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlocksFromPeersTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java index 6d00162d961..5ded06e023b 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.manager.task; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/AccountRangeMessage.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/AccountRangeMessage.java index c9b93734a5b..8e1b1a31a54 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/AccountRangeMessage.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/AccountRangeMessage.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/ByteCodesMessage.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/ByteCodesMessage.java index b86fcdb41ae..9012b6c6f98 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/ByteCodesMessage.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/ByteCodesMessage.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetByteCodesMessage.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetByteCodesMessage.java index 25302084d1b..658a8775842 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetByteCodesMessage.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetByteCodesMessage.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetStorageRangeMessage.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetStorageRangeMessage.java index f047d38ff20..1c912b3ae0d 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetStorageRangeMessage.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetStorageRangeMessage.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetTrieNodesMessage.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetTrieNodesMessage.java index 1d184231edf..6ee9cf37eb0 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetTrieNodesMessage.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetTrieNodesMessage.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/SnapV1.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/SnapV1.java index 219d81031ce..784a7e1964d 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/SnapV1.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/SnapV1.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/StorageRangeMessage.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/StorageRangeMessage.java index d89718f0fd5..6167583c02d 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/StorageRangeMessage.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/StorageRangeMessage.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/TrieNodesMessage.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/TrieNodesMessage.java index 15208e7b420..5890d4a414a 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/TrieNodesMessage.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/snap/TrieNodesMessage.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/CheckpointBlocksPeerValidator.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/CheckpointBlocksPeerValidator.java index 2e36566d209..a66cc16785d 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/CheckpointBlocksPeerValidator.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/peervalidation/CheckpointBlocksPeerValidator.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/PivotBlockSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/PivotBlockSelector.java index b19727cb4d0..fdb6df140ea 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/PivotBlockSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/PivotBlockSelector.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java index ee4718b0613..713cb7179e7 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import static org.slf4j.LoggerFactory.getLogger; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncAlgorithm.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncAlgorithm.java index 951e8586687..506b360730e 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncAlgorithm.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncAlgorithm.java @@ -1,6 +1,5 @@ /* - * - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.eth.sync.backwardsync; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java index 273dd56c78d..bef62ec927e 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncException.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncException.java index 9464a911ede..413c01b25ce 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncException.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncException.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStep.java index 9903cc44666..748c71fc6f6 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStep.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BadChainListener.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BadChainListener.java index 1e88f6d659c..e766e043f17 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BadChainListener.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BadChainListener.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksConvertor.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksConvertor.java index dc17914345d..3a186ee91c1 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksConvertor.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksConvertor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import org.hyperledger.besu.ethereum.core.Block; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksHeadersConvertor.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksHeadersConvertor.java index 0655ec0a938..23ed93b591c 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksHeadersConvertor.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BlocksHeadersConvertor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import org.hyperledger.besu.ethereum.core.BlockHeader; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/FinalBlockConfirmation.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/FinalBlockConfirmation.java index 078220c535e..2ad136ac831 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/FinalBlockConfirmation.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/FinalBlockConfirmation.java @@ -1,6 +1,5 @@ /* - * - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import org.hyperledger.besu.ethereum.chain.MutableBlockchain; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java index c71a97a5f49..c1ce88398e4 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncStep.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/GenericKeyValueStorageFacade.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/GenericKeyValueStorageFacade.java index c6c929d0d26..af8fb183052 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/GenericKeyValueStorageFacade.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/GenericKeyValueStorageFacade.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import org.hyperledger.besu.plugin.services.exception.StorageException; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/HashConvertor.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/HashConvertor.java index 98fe808894b..bedfbc0ad4f 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/HashConvertor.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/HashConvertor.java @@ -1,6 +1,5 @@ /* - * - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import org.hyperledger.besu.datatypes.Hash; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/KeyConvertor.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/KeyConvertor.java index bf7ed0c482f..e880b0c0183 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/KeyConvertor.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/KeyConvertor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; public interface KeyConvertor { diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ProcessKnownAncestorsStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ProcessKnownAncestorsStep.java index 77fb01524ba..9878957a326 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ProcessKnownAncestorsStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ProcessKnownAncestorsStep.java @@ -1,6 +1,5 @@ /* - * - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import static org.slf4j.LoggerFactory.getLogger; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/SyncStepStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/SyncStepStep.java index 78586030516..1f7bc8979b9 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/SyncStepStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/SyncStepStep.java @@ -1,6 +1,5 @@ /* - * - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; import static org.slf4j.LoggerFactory.getLogger; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ValueConvertor.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ValueConvertor.java index a6054e14530..11a5d3b5323 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ValueConvertor.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ValueConvertor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.sync.backwardsync; public interface ValueConvertor { diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointBlockImportStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointBlockImportStep.java index de5076900cd..2ebbe678973 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointBlockImportStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointBlockImportStep.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloadBlockStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloadBlockStep.java index 8fbe8127b26..b4bdf585410 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloadBlockStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloadBlockStep.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloaderFactory.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloaderFactory.java index 1177fe42f8b..8668f2beffc 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloaderFactory.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloaderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSource.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSource.java index 2f3fa2f4306..4df5e39958b 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSource.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSource.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncActions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncActions.java index 7319e9e44f7..bfe6a308a21 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncActions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncActions.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncChainDownloader.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncChainDownloader.java index 1b53c25004f..aaafac5ac99 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncChainDownloader.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncChainDownloader.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,8 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - */ package org.hyperledger.besu.ethereum.eth.sync.checkpointsync; + */ +package org.hyperledger.besu.ethereum.eth.sync.checkpointsync; import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncDownloadPipelineFactory.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncDownloadPipelineFactory.java index 8c853717f5c..45f3f243d8c 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncDownloadPipelineFactory.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointSyncDownloadPipelineFactory.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromPeers.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromPeers.java index 2618d3f6413..6402b58d1fd 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromPeers.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromPeers.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromSafeBlock.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromSafeBlock.java index 052bee29fa3..d84190aca6f 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromSafeBlock.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromSafeBlock.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/SyncTargetManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/SyncTargetManager.java index b23297c8e17..5c6091936a2 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/SyncTargetManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/SyncTargetManager.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/checkpoint/Checkpoint.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/checkpoint/Checkpoint.java index 46f8e3d39df..883417c942b 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/checkpoint/Checkpoint.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/checkpoint/Checkpoint.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/AccountTrieNodeDataRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/AccountTrieNodeDataRequest.java index 71855a997f4..366cfd50f51 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/AccountTrieNodeDataRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/AccountTrieNodeDataRequest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/TrieNodeDataRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/TrieNodeDataRequest.java index c9ea51ce0f4..4d989d81ba9 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/TrieNodeDataRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/TrieNodeDataRequest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java index 3a2ffa35065..5af6d2f30d9 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStep.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/DynamicPivotBlockSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/DynamicPivotBlockSelector.java index 1e3d6bb2a5e..60748d0d758 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/DynamicPivotBlockSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/DynamicPivotBlockSelector.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/LoadLocalDataStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/LoadLocalDataStep.java index 394023aba06..943fb614703 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/LoadLocalDataStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/LoadLocalDataStep.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStep.java index e9fb43ffeaf..890db52a072 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStep.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java index f2df979baac..f11914fd6b0 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestType.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestType.java index 6b7e932e000..2c7359288ac 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestType.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestType.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapDownloaderFactory.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapDownloaderFactory.java index 44077ade5b1..5b40fceb083 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapDownloaderFactory.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapDownloaderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncConfiguration.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncConfiguration.java index 170470ac0a8..5d96a447376 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncConfiguration.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncDownloader.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncDownloader.java index 581905b44b3..00c571f9840 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncDownloader.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncDownloader.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncMetricsManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncMetricsManager.java index b8e907b2eb7..1091c766bd7 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncMetricsManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncMetricsManager.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncProcessState.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncProcessState.java index 344631763aa..a80ba2aa6e7 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncProcessState.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncProcessState.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadState.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadState.java index 1b6567588b2..a6d6077375f 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadState.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadState.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloadProcess.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloadProcess.java index ddab9688043..74d53b78aa0 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloadProcess.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloadProcess.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloader.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloader.java index 0e0e1b1ac30..8d1d50e56f7 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloader.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldStateDownloader.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StackTrie.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StackTrie.java index ef397ead75f..d83ab20cc5d 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StackTrie.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StackTrie.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/context/SnapSyncStatePersistenceManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/context/SnapSyncStatePersistenceManager.java index 6a54dbcdfe0..f31b77274e7 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/context/SnapSyncStatePersistenceManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/context/SnapSyncStatePersistenceManager.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/AccountRangeDataRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/AccountRangeDataRequest.java index b01722240d4..213912a1ac3 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/AccountRangeDataRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/AccountRangeDataRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/BytecodeRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/BytecodeRequest.java index 47add2ff8f8..3b434d45296 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/BytecodeRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/BytecodeRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/SnapDataRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/SnapDataRequest.java index d9442c94c9b..7bcf08fe6c3 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/SnapDataRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/SnapDataRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/StorageRangeDataRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/StorageRangeDataRequest.java index c3d8c53c45f..14f92e2c3f9 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/StorageRangeDataRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/StorageRangeDataRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountFlatDatabaseHealingRangeRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountFlatDatabaseHealingRangeRequest.java index f2514b34055..7e66fa7d88a 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountFlatDatabaseHealingRangeRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountFlatDatabaseHealingRangeRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountTrieNodeHealingRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountTrieNodeHealingRequest.java index 30350f1dbc8..be6060d52ef 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountTrieNodeHealingRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountTrieNodeHealingRequest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageFlatDatabaseHealingRangeRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageFlatDatabaseHealingRangeRequest.java index 4d8fd028b25..03df0e5e731 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageFlatDatabaseHealingRangeRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageFlatDatabaseHealingRangeRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequest.java index d1cea17684a..e38c9c3849c 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/TrieNodeHealingRequest.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/TrieNodeHealingRequest.java index e114ebb426a..7e206232c57 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/TrieNodeHealingRequest.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/TrieNodeHealingRequest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/RetryingGetHeaderFromPeerByHashTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/RetryingGetHeaderFromPeerByHashTask.java index b1db7940d61..e2e76c030b5 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/RetryingGetHeaderFromPeerByHashTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/RetryingGetHeaderFromPeerByHashTask.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/BlobCache.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/BlobCache.java index 980f01ed7a2..50cc23977c4 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/BlobCache.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/BlobCache.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.transactions; import org.hyperledger.besu.datatypes.BlobsWithCommitments; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/BlobCacheModule.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/BlobCacheModule.java index 29ca246232e..fd5bc456013 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/BlobCacheModule.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/BlobCacheModule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.eth.transactions; import javax.inject.Singleton; diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/DisabledPendingTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/DisabledPendingTransactions.java index c52876ced75..ce79cf2855f 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/DisabledPendingTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/DisabledPendingTransactions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransaction.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransaction.java index 09723c10ec2..79e8c368e06 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransaction.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java index dbb95edd828..c66f0e1df12 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionAddedResult.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionAddedResult.java index a4b8279f19f..aa169c0e334 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionAddedResult.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionAddedResult.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcaster.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcaster.java index 69c30211a31..c60c064c4c2 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcaster.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcaster.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolEvictionService.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolEvictionService.java index c572f5847a1..fb72f303955 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolEvictionService.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolEvictionService.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolMetrics.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolMetrics.java index 5848296ce3c..812e7de9f4e 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolMetrics.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java index b728ed08638..8e36d56f2f4 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractSequentialTransactionsLayer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractSequentialTransactionsLayer.java index 0afba82470f..1586217795e 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractSequentialTransactionsLayer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractSequentialTransactionsLayer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java index 2885edc42a3..48078c7fe28 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java index a308b84f604..7c6d9e203c1 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EndLayer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EndLayer.java index d511a89c557..0f5d9a6d15d 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EndLayer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EndLayer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/GasPricePrioritizedTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/GasPricePrioritizedTransactions.java index e6a939d660e..0515ed46a0d 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/GasPricePrioritizedTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/GasPricePrioritizedTransactions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java index 0192f1cd668..9e304a4f0f5 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReadyTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReadyTransactions.java index 570099d3392..42aebdceee3 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReadyTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReadyTransactions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java index cc0d4d9f4d8..c1c103e35de 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/SparseTransactions.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/TransactionsLayer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/TransactionsLayer.java index 0630ec1f934..46c756226d2 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/TransactionsLayer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/TransactionsLayer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsSorter.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsSorter.java index f6f352f85cd..0e1737d65be 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsSorter.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsSorter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/PendingTransactionsForSender.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/PendingTransactionsForSender.java index 634727b9df2..2ac0ca609c0 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/PendingTransactionsForSender.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/PendingTransactionsForSender.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/EthPeerTestUtil.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/EthPeerTestUtil.java index aae559040fa..129942644e4 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/EthPeerTestUtil.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/EthPeerTestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTest.java index 8601aa75e4b..ff5d655cc61 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/RetryingSwitchingPeerMessageTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/RetryingSwitchingPeerMessageTaskTest.java index e4da19cd9b7..374c217a605 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/RetryingSwitchingPeerMessageTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/RetryingSwitchingPeerMessageTaskTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServerTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServerTest.java index c27ff8fd33b..c15056d66cc 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServerTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTaskTest.java index e180420a4f5..989ae2b4cdf 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTaskTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlockFromPeersTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlockFromPeersTaskTest.java index 9996842bd2d..d1594d46f07 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlockFromPeersTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetBlockFromPeersTaskTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/AccountRangeMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/AccountRangeMessageTest.java index 11d16a61e0b..bd715b64597 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/AccountRangeMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/AccountRangeMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/BytecodeMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/BytecodeMessageTest.java index 05c63f71f2d..9f9bf5c48a8 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/BytecodeMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/BytecodeMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetAccountRangeMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetAccountRangeMessageTest.java index a486608eff1..3399bcbe16e 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetAccountRangeMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetAccountRangeMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetBytecodeMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetBytecodeMessageTest.java index 8091015d68d..bd4dc9cb5bd 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetBytecodeMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetBytecodeMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetStorageRangeMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetStorageRangeMessageTest.java index 2492528a89b..c831fc32676 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetStorageRangeMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetStorageRangeMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetTrieNodeMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetTrieNodeMessageTest.java index 625c96931bb..074795edef9 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetTrieNodeMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/GetTrieNodeMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/StorageRangeMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/StorageRangeMessageTest.java index da14098d05b..81f54a4a8bf 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/StorageRangeMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/StorageRangeMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/TrieNodeMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/TrieNodeMessageTest.java index 6223102bf9b..6f00a9dd401 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/TrieNodeMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/snap/TrieNodeMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStepTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStepTest.java index a506e7fa3f7..ecb72881ed4 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStepTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncStepTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java index ff9fd0d3de5..931105faa4c 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/InMemoryBackwardChainTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/InMemoryBackwardChainTest.java index c8bffb95793..318773c372e 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/InMemoryBackwardChainTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/InMemoryBackwardChainTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointBlockImportStepTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointBlockImportStepTest.java index 4813cf84dd7..7e79fb60bbc 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointBlockImportStepTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointBlockImportStepTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointSourceTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointSourceTest.java index 1fde5dfee16..eeb5ec51a71 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointSourceTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointSourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointSyncChainDownloaderTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointSyncChainDownloaderTest.java index e5c8ce55583..09761081a1d 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointSyncChainDownloaderTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckPointSyncChainDownloaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastImportBlocksPercentageCalculationTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastImportBlocksPercentageCalculationTest.java index ed5303897ae..7b89387e26d 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastImportBlocksPercentageCalculationTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastImportBlocksPercentageCalculationTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/FastWorldStateDownloaderTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/FastWorldStateDownloaderTest.java index 938cf020af5..3a29a444a45 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/FastWorldStateDownloaderTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/FastWorldStateDownloaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/PersistDataStepTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/PersistDataStepTest.java index 17a7dc831b3..e103b9e79b4 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/PersistDataStepTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/PersistDataStepTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/AccountHealingTrackingTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/AccountHealingTrackingTest.java index 03aa292fabf..70bdbf8b801 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/AccountHealingTrackingTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/AccountHealingTrackingTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStepTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStepTest.java index 214070d9684..2bfc58a3b8a 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStepTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/CompleteTaskStepTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/DynamicPivotBlockManagerTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/DynamicPivotBlockManagerTest.java index 2fa778ad5d4..e119b8de4c8 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/DynamicPivotBlockManagerTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/DynamicPivotBlockManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/LoadLocalDataStepTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/LoadLocalDataStepTest.java index 43d945a4daa..9027538ce51 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/LoadLocalDataStepTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/LoadLocalDataStepTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStepTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStepTest.java index 0de00f5ab2d..0364dc75814 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStepTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStepTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RangeManagerTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RangeManagerTest.java index 8ee3784d2cf..c5427b7e0d7 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RangeManagerTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RangeManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadStateTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadStateTest.java index 35c5de5daca..19b1130c520 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadStateTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StackTrieTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StackTrieTest.java index 4fcb21d9252..4e1a86e4db7 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StackTrieTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StackTrieTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StubTask.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StubTask.java index 6c5dd72f3ae..6d2e9cd6ef5 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StubTask.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/StubTask.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/TaskGenerator.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/TaskGenerator.java index 81b9d385763..0e3915bc777 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/TaskGenerator.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/TaskGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountFlatDatabaseHealingRangeRequestTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountFlatDatabaseHealingRangeRequestTest.java index dba37b5afa3..ffa50401aee 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountFlatDatabaseHealingRangeRequestTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/AccountFlatDatabaseHealingRangeRequestTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageFlatDatabaseHealingRangeRequestTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageFlatDatabaseHealingRangeRequestTest.java index da5354f71bf..fb8dd742857 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageFlatDatabaseHealingRangeRequestTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageFlatDatabaseHealingRangeRequestTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequestTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequestTest.java index 5cec07c152f..f36a64c8760 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequestTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequestTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/AbstractTransactionPoolTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/AbstractTransactionPoolTest.java index debe743e949..caf16aac5c0 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/AbstractTransactionPoolTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/AbstractTransactionPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/AbstractTransactionReplacementTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/AbstractTransactionReplacementTest.java index 96969fa17eb..e6aa0b53ce1 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/AbstractTransactionReplacementTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/AbstractTransactionReplacementTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java index 23d2c6f7c38..af54f668fe8 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcasterTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcasterTest.java index 0615a25f5ad..b6faf666976 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcasterTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcasterTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionReplacementByFeeMarketRuleTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionReplacementByFeeMarketRuleTest.java index 021ca5e71ca..527b26e2512 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionReplacementByFeeMarketRuleTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionReplacementByFeeMarketRuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionReplacementByGasPriceRuleTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionReplacementByGasPriceRuleTest.java index 5b0b6ade211..d4f851e1907 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionReplacementByGasPriceRuleTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionReplacementByGasPriceRuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractLayeredTransactionPoolTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractLayeredTransactionPoolTest.java index ee45b4998e1..e3151d6fa1b 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractLayeredTransactionPoolTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractLayeredTransactionPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactionsTestBase.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactionsTestBase.java index 095516487f0..d247ca1e8b0 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactionsTestBase.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactionsTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java index 877c3c7d049..dfe8a297972 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java index 8f5399e29eb..d4aa8bb7bed 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseTransactionPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EvictCollectorLayer.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EvictCollectorLayer.java index 27f478d172c..4b39f26cb24 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EvictCollectorLayer.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/EvictCollectorLayer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/GasPricePrioritizedTransactionsTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/GasPricePrioritizedTransactionsTest.java index c3aa720a618..2e59f766e25 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/GasPricePrioritizedTransactionsTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/GasPricePrioritizedTransactionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactionsTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactionsTest.java index 196baffa3a9..ff0262ceee7 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactionsTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredTransactionPoolBaseFeeTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredTransactionPoolBaseFeeTest.java index 61d513e447b..e8830fca581 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredTransactionPoolBaseFeeTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredTransactionPoolBaseFeeTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredTransactionPoolGasPriceTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredTransactionPoolGasPriceTest.java index 296219c90fc..29b2c0b5399 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredTransactionPoolGasPriceTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredTransactionPoolGasPriceTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReplayTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReplayTest.java index 63367b2fda0..d73f8e637cd 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReplayTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/layered/ReplayTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsTestBase.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsTestBase.java index 9f85e583186..89e278318ea 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsTestBase.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsTest.java index 41bf8763811..413a778d5b5 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/GasPricePendingTransactionsTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/GasPricePendingTransactionsTest.java index 569e8102a91..0e7f413cdc1 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/GasPricePendingTransactionsTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/GasPricePendingTransactionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/LegacyTransactionPoolBaseFeeTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/LegacyTransactionPoolBaseFeeTest.java index 688cc23d32e..15754abbdeb 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/LegacyTransactionPoolBaseFeeTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/LegacyTransactionPoolBaseFeeTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/LegacyTransactionPoolGasPriceTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/LegacyTransactionPoolGasPriceTest.java index d6f644bb7e1..27cac0f352c 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/LegacyTransactionPoolGasPriceTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/LegacyTransactionPoolGasPriceTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From 60b6b7d76e03745cd29d7d35da1aeb8a4f9f92d8 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Thu, 2 May 2024 22:53:38 +1000 Subject: [PATCH 48/59] Apply Hyperledger license header `ethereum/api/` (#7031) * Apply Hyperledger license header -- ethereum/api/ Signed-off-by: Usman Saleem * Fix license headers Signed-off-by: Usman Saleem * Fix license headers Signed-off-by: Usman Saleem --------- Signed-off-by: Usman Saleem --- .../besu/ethereum/api/graphql/GraphQLContextType.java | 2 +- .../internal/pojoadapter/AccessListEntryAdapter.java | 2 +- .../api/graphql/internal/pojoadapter/WithdrawalAdapter.java | 2 +- .../besu/ethereum/api/jsonrpc/EngineJsonRpcService.java | 2 +- .../besu/ethereum/api/jsonrpc/JsonResponseStreamer.java | 2 +- .../api/jsonrpc/authentication/AuthenticationService.java | 6 ++---- .../api/jsonrpc/authentication/AuthenticationUtils.java | 2 +- .../authentication/DefaultAuthenticationService.java | 2 +- .../api/jsonrpc/authentication/EngineAuthService.java | 6 ++---- .../api/jsonrpc/authentication/JWTAuthOptionsFactory.java | 2 +- .../ethereum/api/jsonrpc/authentication/JwtAlgorithm.java | 2 +- .../authentication/UnsecurableEngineApiException.java | 6 ++---- .../ethereum/api/jsonrpc/internal/DebugReplayBlock.java | 2 +- .../jsonrpc/internal/exception/Logging403ErrorHandler.java | 6 ++---- .../api/jsonrpc/internal/methods/AbstractTraceByBlock.java | 2 +- .../api/jsonrpc/internal/methods/AbstractTraceByHash.java | 2 +- .../api/jsonrpc/internal/methods/AbstractTraceCall.java | 2 +- .../api/jsonrpc/internal/methods/DebugGetRawBlock.java | 2 +- .../api/jsonrpc/internal/methods/DebugGetRawHeader.java | 2 +- .../api/jsonrpc/internal/methods/DebugGetRawReceipts.java | 2 +- .../jsonrpc/internal/methods/DebugGetRawTransaction.java | 2 +- .../api/jsonrpc/internal/methods/DebugResyncWorldstate.java | 2 +- .../ethereum/api/jsonrpc/internal/methods/DebugSetHead.java | 2 +- .../api/jsonrpc/internal/methods/DebugTraceCall.java | 2 +- .../api/jsonrpc/internal/methods/EthBlobBaseFee.java | 2 +- .../api/jsonrpc/internal/methods/EthGetBlockReceipts.java | 2 +- .../jsonrpc/internal/methods/ExecuteTransactionStep.java | 2 +- .../internal/methods/ExecutionEngineJsonRpcMethod.java | 2 +- .../api/jsonrpc/internal/methods/JsonCallParameterUtil.java | 2 +- .../api/jsonrpc/internal/methods/PluginJsonRpcMethod.java | 2 +- .../ethereum/api/jsonrpc/internal/methods/TraceCall.java | 2 +- .../api/jsonrpc/internal/methods/TraceCallMany.java | 2 +- .../api/jsonrpc/internal/methods/TraceFilterSource.java | 1 - .../internal/methods/TraceReplayTransactionStep.java | 2 +- .../methods/engine/AbstractEngineForkchoiceUpdated.java | 2 +- .../internal/methods/engine/AbstractEngineGetPayload.java | 2 +- .../internal/methods/engine/AbstractEngineNewPayload.java | 2 +- .../internal/methods/engine/DepositsValidatorProvider.java | 3 +-- .../jsonrpc/internal/methods/engine/EngineCallListener.java | 2 +- .../internal/methods/engine/EngineExchangeCapabilities.java | 2 +- .../engine/EngineExchangeTransitionConfiguration.java | 2 +- .../internal/methods/engine/EngineForkchoiceUpdatedV1.java | 2 +- .../internal/methods/engine/EngineForkchoiceUpdatedV2.java | 2 +- .../internal/methods/engine/EngineForkchoiceUpdatedV3.java | 2 +- .../methods/engine/EngineGetPayloadBodiesByHashV1.java | 2 +- .../methods/engine/EngineGetPayloadBodiesByRangeV1.java | 2 +- .../jsonrpc/internal/methods/engine/EngineGetPayloadV1.java | 2 +- .../jsonrpc/internal/methods/engine/EngineGetPayloadV2.java | 2 +- .../jsonrpc/internal/methods/engine/EngineGetPayloadV3.java | 2 +- .../jsonrpc/internal/methods/engine/EngineGetPayloadV4.java | 2 +- .../jsonrpc/internal/methods/engine/EngineNewPayloadV1.java | 2 +- .../jsonrpc/internal/methods/engine/EngineNewPayloadV2.java | 2 +- .../jsonrpc/internal/methods/engine/EngineNewPayloadV3.java | 2 +- .../jsonrpc/internal/methods/engine/EngineNewPayloadV4.java | 2 +- .../internal/methods/engine/EnginePreparePayloadDebug.java | 2 +- .../api/jsonrpc/internal/methods/engine/EngineQosTimer.java | 2 +- .../methods/engine/WithdrawalRequestValidatorProvider.java | 3 +-- .../methods/engine/WithdrawalsValidatorProvider.java | 3 +-- .../jsonrpc/internal/methods/miner/MinerGetMinGasPrice.java | 2 +- .../internal/methods/miner/MinerGetMinPriorityFee.java | 2 +- .../jsonrpc/internal/methods/miner/MinerSetMinGasPrice.java | 2 +- .../internal/methods/miner/MinerSetMinPriorityFee.java | 2 +- .../api/jsonrpc/internal/parameters/DepositParameter.java | 2 +- .../EngineExchangeTransitionConfigurationParameter.java | 2 +- .../parameters/EngineForkchoiceUpdatedParameter.java | 2 +- .../parameters/EnginePayloadAttributesParameter.java | 2 +- .../jsonrpc/internal/parameters/EnginePayloadParameter.java | 2 +- .../internal/parameters/EnginePreparePayloadParameter.java | 2 +- .../jsonrpc/internal/parameters/TraceCallManyParameter.java | 2 +- .../internal/parameters/TraceCallParameterTuple.java | 2 +- .../jsonrpc/internal/parameters/WithdrawalParameter.java | 2 +- .../internal/parameters/WithdrawalRequestParameter.java | 2 +- .../privacy/methods/privx/PrivxFindOnchainPrivacyGroup.java | 2 +- .../ethereum/api/jsonrpc/internal/processor/Tracer.java | 3 +-- .../api/jsonrpc/internal/response/RpcErrorType.java | 2 +- .../api/jsonrpc/internal/results/BlobsBundleV1.java | 3 +-- .../api/jsonrpc/internal/results/BlockReceiptsResult.java | 2 +- .../EngineExchangeTransitionConfigurationResult.java | 2 +- .../internal/results/EngineGetPayloadBodiesResultV1.java | 2 +- .../jsonrpc/internal/results/EngineGetPayloadResultV1.java | 2 +- .../jsonrpc/internal/results/EngineGetPayloadResultV2.java | 2 +- .../jsonrpc/internal/results/EngineGetPayloadResultV3.java | 2 +- .../jsonrpc/internal/results/EngineGetPayloadResultV4.java | 2 +- .../jsonrpc/internal/results/EnginePayloadStatusResult.java | 2 +- .../internal/results/EnginePreparePayloadResult.java | 2 +- .../internal/results/EngineUpdateForkchoiceResult.java | 2 +- .../api/jsonrpc/internal/results/TraceCallResult.java | 2 +- .../api/jsonrpc/internal/results/TraceReplayResult.java | 2 +- .../results/tracing/flat/MixInIgnoreRevertReason.java | 2 +- .../ethereum/api/jsonrpc/methods/EthJsonRpcMethods.java | 2 +- .../api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java | 2 +- .../api/jsonrpc/websocket/JsonResponseStreamer.java | 2 +- .../org/hyperledger/besu/ethereum/api/query/LogsQuery.java | 2 -- .../besu/ethereum/api/query/StateBackupService.java | 4 +--- .../besu/ethereum/api/query/TransactionWithMetadata.java | 2 -- .../besu/ethereum/api/util/ArrayNodeWrapper.java | 2 +- .../besu/ethereum/api/tls/KnownClientFileUtil.java | 2 -- .../besu/ethereum/api/tls/SelfSignedP12Certificate.java | 2 -- .../ethereum/api/graphql/TransactionDataFetcherTest.java | 2 +- .../besu/ethereum/api/jsonrpc/JsonResponseStreamerTest.java | 2 +- .../ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java | 2 +- .../api/jsonrpc/JsonRpcHttpServiceParameterizedTest.java | 2 +- .../besu/ethereum/api/jsonrpc/PluginJsonRpcMethodTest.java | 2 +- .../api/jsonrpc/authentication/EngineAuthServiceTest.java | 6 ++---- .../api/jsonrpc/internal/methods/AdminRemovePeerTest.java | 2 +- .../api/jsonrpc/internal/methods/EthBlobBaseFeeTest.java | 2 +- .../jsonrpc/internal/methods/EthGetBlockByNumberTest.java | 2 +- .../jsonrpc/internal/methods/EthGetBlockReceiptsTest.java | 2 +- .../api/jsonrpc/internal/methods/EthGetLogsTest.java | 2 +- .../internal/methods/EthGetTransactionByHashTest.java | 2 +- .../api/jsonrpc/internal/methods/TraceFilterTest.java | 2 +- .../methods/engine/AbstractEngineForkchoiceUpdatedTest.java | 2 +- .../methods/engine/AbstractEngineGetPayloadTest.java | 2 +- .../methods/engine/AbstractEngineNewPayloadTest.java | 2 +- .../internal/methods/engine/AbstractScheduledApiTest.java | 3 +-- .../methods/engine/EngineExchangeCapabilitiesTest.java | 2 +- .../engine/EngineExchangeTransitionConfigurationTest.java | 2 +- .../methods/engine/EngineForkchoiceUpdatedV1Test.java | 2 +- .../methods/engine/EngineForkchoiceUpdatedV2Test.java | 2 +- .../methods/engine/EngineGetPayloadBodiesByHashV1Test.java | 2 +- .../methods/engine/EngineGetPayloadBodiesByRangeV1Test.java | 2 +- .../internal/methods/engine/EngineGetPayloadV1Test.java | 2 +- .../internal/methods/engine/EngineGetPayloadV2Test.java | 2 +- .../internal/methods/engine/EngineGetPayloadV3Test.java | 2 +- .../internal/methods/engine/EngineGetPayloadV4Test.java | 2 +- .../internal/methods/engine/EngineNewPayloadV1Test.java | 2 +- .../internal/methods/engine/EngineNewPayloadV2Test.java | 2 +- .../internal/methods/engine/EngineNewPayloadV3Test.java | 2 +- .../internal/methods/engine/EngineNewPayloadV4Test.java | 2 +- .../methods/engine/EnginePreparePayloadDebugTest.java | 2 +- .../jsonrpc/internal/methods/engine/EngineQosTimerTest.java | 2 +- .../internal/methods/miner/MinerGetMinGasPriceTest.java | 2 +- .../internal/methods/miner/MinerGetMinPriorityFeeTest.java | 2 +- .../internal/methods/miner/MinerSetMinGasPriceTest.java | 2 +- .../internal/methods/miner/MinerSetMinPriorityFeeTest.java | 2 +- .../api/jsonrpc/internal/parameters/BlockParameterTest.java | 2 +- .../jsonrpc/internal/parameters/DepositParameterTest.java | 4 +--- .../internal/parameters/DepositParameterTestFixture.java | 3 +-- .../parameters/EnginePayloadAttributesParameterTest.java | 3 +-- .../internal/parameters/WithdrawalParameterTest.java | 3 +-- .../internal/parameters/WithdrawalParameterTestFixture.java | 3 +-- .../internal/parameters/WithdrawalRequestParameterTest.java | 4 +--- .../internal/parameters/WithdrawalRequestTestFixture.java | 3 +-- .../internal/response/MutableJsonRpcSuccessResponse.java | 2 +- .../api/jsonrpc/internal/results/BlobsBundleV1Test.java | 3 +-- .../api/jsonrpc/parameters/TraceCallManyParameterTest.java | 2 +- .../api/jsonrpc/websocket/JsonResponseStreamerTest.java | 2 +- .../besu/ethereum/api/jsonrpc/websocket/JsonRpcJWTTest.java | 2 +- .../api/jsonrpc/websocket/WebSocketServiceLoginTest.java | 2 +- .../besu/ethereum/api/query/BlockchainQueriesTest.java | 2 -- .../ethereum/api/tls/FileBasedPasswordProviderTest.java | 2 -- .../besu/ethereum/api/util/DomainObjectDecodeUtilsTest.java | 2 -- .../besu/ethereum/api/util/TestJsonRpcMethodsUtil.java | 3 +-- 153 files changed, 150 insertions(+), 194 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/GraphQLContextType.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/GraphQLContextType.java index d7975335657..05752f813b6 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/GraphQLContextType.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/GraphQLContextType.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/AccessListEntryAdapter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/AccessListEntryAdapter.java index dca799ce59d..10451dcc35a 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/AccessListEntryAdapter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/AccessListEntryAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/WithdrawalAdapter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/WithdrawalAdapter.java index 86782b6afcb..e8454fcdb5b 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/WithdrawalAdapter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/WithdrawalAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/EngineJsonRpcService.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/EngineJsonRpcService.java index e0279f6b7ce..b9f98f3b66c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/EngineJsonRpcService.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/EngineJsonRpcService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonResponseStreamer.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonResponseStreamer.java index 563538d22fa..b3b4f9af3f3 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonResponseStreamer.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonResponseStreamer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationService.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationService.java index ae8fd605dec..1e016dbd6e9 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationService.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationService.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.authentication; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationUtils.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationUtils.java index 9a14b6bf2f1..7ad16b2ed0c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationUtils.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationUtils.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/DefaultAuthenticationService.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/DefaultAuthenticationService.java index 89f747d1710..935a46a84db 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/DefaultAuthenticationService.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/DefaultAuthenticationService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/EngineAuthService.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/EngineAuthService.java index db388567c2d..942079ab8dd 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/EngineAuthService.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/EngineAuthService.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.authentication; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/JWTAuthOptionsFactory.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/JWTAuthOptionsFactory.java index 071fc2920ab..854368453a5 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/JWTAuthOptionsFactory.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/JWTAuthOptionsFactory.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/JwtAlgorithm.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/JwtAlgorithm.java index 4e5341a28e6..ef5f0826338 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/JwtAlgorithm.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/JwtAlgorithm.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/UnsecurableEngineApiException.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/UnsecurableEngineApiException.java index 3dfc371f78b..da19e8d258b 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/UnsecurableEngineApiException.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/UnsecurableEngineApiException.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.authentication; /* diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/DebugReplayBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/DebugReplayBlock.java index fc8c3d0656e..e55a8c4785c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/DebugReplayBlock.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/DebugReplayBlock.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/exception/Logging403ErrorHandler.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/exception/Logging403ErrorHandler.java index dcd6d8873df..6cec9294fba 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/exception/Logging403ErrorHandler.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/exception/Logging403ErrorHandler.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception; import io.vertx.core.Handler; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceByBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceByBlock.java index 92bfa099c9c..4fd98cd4fed 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceByBlock.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceByBlock.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceByHash.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceByHash.java index fcfe4dc052e..545d8f76ae3 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceByHash.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceByHash.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceCall.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceCall.java index 1aa6316b04b..cb691bbaa53 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceCall.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceCall.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawBlock.java index 0dc79dfd419..cec275e5a62 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawBlock.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawBlock.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawHeader.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawHeader.java index cd283d67c81..05ef0eb53db 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawHeader.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawHeader.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawReceipts.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawReceipts.java index ba71ae0b330..7965480c6fb 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawReceipts.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawReceipts.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawTransaction.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawTransaction.java index c4c40ffcc22..ab1230ca961 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawTransaction.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetRawTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugResyncWorldstate.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugResyncWorldstate.java index 99decbb5426..ea4dc4b7fc0 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugResyncWorldstate.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugResyncWorldstate.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugSetHead.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugSetHead.java index b3d70344318..7d26eaca25e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugSetHead.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugSetHead.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java index 72aa575b0cb..0243398833e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthBlobBaseFee.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthBlobBaseFee.java index b1108e815a8..eed0476b46c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthBlobBaseFee.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthBlobBaseFee.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java index 92b3eb54542..54a37332860 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceipts.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecuteTransactionStep.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecuteTransactionStep.java index b2b48e1a42e..6551a3be151 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecuteTransactionStep.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecuteTransactionStep.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu.. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecutionEngineJsonRpcMethod.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecutionEngineJsonRpcMethod.java index 42d83a10d13..6e216d46936 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecutionEngineJsonRpcMethod.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/ExecutionEngineJsonRpcMethod.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonCallParameterUtil.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonCallParameterUtil.java index 4af10b63fdf..b2df8c0676b 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonCallParameterUtil.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonCallParameterUtil.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/PluginJsonRpcMethod.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/PluginJsonRpcMethod.java index ad239b60162..5b15e9555c2 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/PluginJsonRpcMethod.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/PluginJsonRpcMethod.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCall.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCall.java index 06559af1efa..c50525cef82 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCall.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCall.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCallMany.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCallMany.java index 611ebee8b04..3e3b0c9343c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCallMany.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCallMany.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterSource.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterSource.java index faee7dce962..c5fb5e7c9b6 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterSource.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterSource.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceReplayTransactionStep.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceReplayTransactionStep.java index 651e0b4798e..6dc9c1ae512 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceReplayTransactionStep.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceReplayTransactionStep.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdated.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdated.java index 0aac956d416..ec65ebe7a9e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdated.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdated.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineGetPayload.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineGetPayload.java index 2513dbeadf5..d6544b6b66c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineGetPayload.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineGetPayload.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java index 150f75fc54e..205ba8cf534 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/DepositsValidatorProvider.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/DepositsValidatorProvider.java index 36c29bd26a1..51e23770684 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/DepositsValidatorProvider.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/DepositsValidatorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine; import org.hyperledger.besu.ethereum.core.BlockHeader; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineCallListener.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineCallListener.java index 1020bca0dfa..77979bc4893 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineCallListener.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineCallListener.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilities.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilities.java index f59681a3854..0431898c78e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilities.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilities.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeTransitionConfiguration.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeTransitionConfiguration.java index 92eb2ef715c..fdb94df9d67 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeTransitionConfiguration.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeTransitionConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1.java index e38ae835027..6397afdda3c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2.java index 98c5cc7280e..747c63c162f 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV3.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV3.java index 05b4fa29780..60ba8990a13 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV3.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV3.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1.java index dbbbeaec66c..b5644502464 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByRangeV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByRangeV1.java index 94576978097..5fdd1657f67 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByRangeV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByRangeV1.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV1.java index 2484ac961e3..ba691b44a44 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV1.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2.java index 4749d4233be..54328f37d08 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV3.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV3.java index 2e8ed52e4d0..29dea77d90b 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV3.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV3.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4.java index feebfebd3d7..860c4af96e2 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV1.java index 9675fb01195..4230457b6d0 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV1.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2.java index 65133718ada..08a6b6b3d0a 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3.java index dff7174b49d..8f7a32899ee 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4.java index 07315535c2d..83d406106fd 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EnginePreparePayloadDebug.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EnginePreparePayloadDebug.java index 7f18250ec27..26f8e99edd7 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EnginePreparePayloadDebug.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EnginePreparePayloadDebug.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineQosTimer.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineQosTimer.java index 6b9c46dddba..e5332b09b4b 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineQosTimer.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineQosTimer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalRequestValidatorProvider.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalRequestValidatorProvider.java index fdb12d07a39..77261a70e53 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalRequestValidatorProvider.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalRequestValidatorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine; import org.hyperledger.besu.ethereum.core.BlockHeader; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalsValidatorProvider.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalsValidatorProvider.java index 1ab4b78204f..a1e83fbde9f 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalsValidatorProvider.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/WithdrawalsValidatorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine; import org.hyperledger.besu.ethereum.core.BlockHeader; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPrice.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPrice.java index bbd53d2a18b..07e8fdc9b63 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPrice.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPrice.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFee.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFee.java index daf134e3d0f..d99d13de2ce 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFee.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFee.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPrice.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPrice.java index 3bb6678d9f0..c72e5c95c73 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPrice.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPrice.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFee.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFee.java index 25a47c0abbf..f3dd52f906a 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFee.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFee.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameter.java index 288c998977d..e2a3a4d207d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameter.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EngineExchangeTransitionConfigurationParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EngineExchangeTransitionConfigurationParameter.java index 3833fa80c4f..2f8e2be8e00 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EngineExchangeTransitionConfigurationParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EngineExchangeTransitionConfigurationParameter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EngineForkchoiceUpdatedParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EngineForkchoiceUpdatedParameter.java index 7b3e50a07e1..dd3e829d56d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EngineForkchoiceUpdatedParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EngineForkchoiceUpdatedParameter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadAttributesParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadAttributesParameter.java index 655047573a0..0168531c4f8 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadAttributesParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadAttributesParameter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java index a4dc999949e..c1601a98afb 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePreparePayloadParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePreparePayloadParameter.java index 049ae4608d3..2ce52341028 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePreparePayloadParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePreparePayloadParameter.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceCallManyParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceCallManyParameter.java index 4b0b618f7a4..74c5d2e203d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceCallManyParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceCallManyParameter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceCallParameterTuple.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceCallParameterTuple.java index 360a554e5c0..b02c5dc185c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceCallParameterTuple.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceCallParameterTuple.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameter.java index 80bce6e31e0..823de897422 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameter.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameter.java index 0d7cb45779d..e3751099795 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameter.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/privx/PrivxFindOnchainPrivacyGroup.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/privx/PrivxFindOnchainPrivacyGroup.java index 4df3daeafd1..e09c72464e2 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/privx/PrivxFindOnchainPrivacyGroup.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/privx/PrivxFindOnchainPrivacyGroup.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/Tracer.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/Tracer.java index c6bbeceb741..d1ee0872ae5 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/Tracer.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/Tracer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java index e19c2d95b6d..e4644128bc6 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlobsBundleV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlobsBundleV1.java index 3377aa63cce..c397c7aab38 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlobsBundleV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlobsBundleV1.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; import org.hyperledger.besu.datatypes.Blob; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockReceiptsResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockReceiptsResult.java index 2a239bdd3cb..5fe19030bc2 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockReceiptsResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockReceiptsResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineExchangeTransitionConfigurationResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineExchangeTransitionConfigurationResult.java index 7f790268715..f25c7c8b2b3 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineExchangeTransitionConfigurationResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineExchangeTransitionConfigurationResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadBodiesResultV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadBodiesResultV1.java index f4e9a12e27d..8e2afcd918f 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadBodiesResultV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadBodiesResultV1.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV1.java index 0b21d15ef62..2435283dd3c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV1.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV2.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV2.java index e3919517f3b..39251120c1a 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV2.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV2.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV3.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV3.java index 6d18cbed0bc..1f1b19d88a1 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV3.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV3.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java index aff2abd0aa6..9a7cbcf3627 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EnginePayloadStatusResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EnginePayloadStatusResult.java index 6ea417ca11e..4912f81e498 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EnginePayloadStatusResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EnginePayloadStatusResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EnginePreparePayloadResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EnginePreparePayloadResult.java index 650ad973875..510c8ff396e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EnginePreparePayloadResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EnginePreparePayloadResult.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineUpdateForkchoiceResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineUpdateForkchoiceResult.java index f560d295094..16ab0077f2c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineUpdateForkchoiceResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineUpdateForkchoiceResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/TraceCallResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/TraceCallResult.java index 699c3d4721a..298053d9645 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/TraceCallResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/TraceCallResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/TraceReplayResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/TraceReplayResult.java index 67256973c95..cd03d8bca4c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/TraceReplayResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/TraceReplayResult.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/flat/MixInIgnoreRevertReason.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/flat/MixInIgnoreRevertReason.java index 1d24c6264ee..c967febd6bd 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/flat/MixInIgnoreRevertReason.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/flat/MixInIgnoreRevertReason.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthJsonRpcMethods.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthJsonRpcMethods.java index 827aa57c642..c84b6897174 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthJsonRpcMethods.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthJsonRpcMethods.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java index 0c090419cb1..ca66926656e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonResponseStreamer.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonResponseStreamer.java index bc216c7fc2a..dbec85a8f7e 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonResponseStreamer.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonResponseStreamer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/LogsQuery.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/LogsQuery.java index 79d5f0246c5..a604721f832 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/LogsQuery.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/LogsQuery.java @@ -1,5 +1,4 @@ /* - * * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.api.query; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/StateBackupService.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/StateBackupService.java index 95a4923d4ff..63f51016498 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/StateBackupService.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/StateBackupService.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.query; import static com.google.common.base.Preconditions.checkArgument; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionWithMetadata.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionWithMetadata.java index 637b0f8f5ce..50318b5ac15 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionWithMetadata.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionWithMetadata.java @@ -1,5 +1,4 @@ /* - * * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.api.query; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/util/ArrayNodeWrapper.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/util/ArrayNodeWrapper.java index b304d2a8d6e..bc0688d4d7f 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/util/ArrayNodeWrapper.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/util/ArrayNodeWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test-support/java/org/hyperledger/besu/ethereum/api/tls/KnownClientFileUtil.java b/ethereum/api/src/test-support/java/org/hyperledger/besu/ethereum/api/tls/KnownClientFileUtil.java index cd0ebf78f38..c2aa680d9db 100644 --- a/ethereum/api/src/test-support/java/org/hyperledger/besu/ethereum/api/tls/KnownClientFileUtil.java +++ b/ethereum/api/src/test-support/java/org/hyperledger/besu/ethereum/api/tls/KnownClientFileUtil.java @@ -1,5 +1,4 @@ /* - * * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.api.tls; diff --git a/ethereum/api/src/test-support/java/org/hyperledger/besu/ethereum/api/tls/SelfSignedP12Certificate.java b/ethereum/api/src/test-support/java/org/hyperledger/besu/ethereum/api/tls/SelfSignedP12Certificate.java index c5644037abf..7f104b27068 100644 --- a/ethereum/api/src/test-support/java/org/hyperledger/besu/ethereum/api/tls/SelfSignedP12Certificate.java +++ b/ethereum/api/src/test-support/java/org/hyperledger/besu/ethereum/api/tls/SelfSignedP12Certificate.java @@ -1,5 +1,4 @@ /* - * * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.api.tls; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/TransactionDataFetcherTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/TransactionDataFetcherTest.java index aa780d42ccd..362216b9042 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/TransactionDataFetcherTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/TransactionDataFetcherTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonResponseStreamerTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonResponseStreamerTest.java index 67e692de2e7..04863cbd63f 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonResponseStreamerTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonResponseStreamerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java index 2b8b1ae3475..6ae5d37a0fc 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceParameterizedTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceParameterizedTest.java index cbbd478100a..a93575aa8f5 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceParameterizedTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceParameterizedTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/PluginJsonRpcMethodTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/PluginJsonRpcMethodTest.java index 4f7e45b3885..897029afcd2 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/PluginJsonRpcMethodTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/PluginJsonRpcMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/EngineAuthServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/EngineAuthServiceTest.java index 4c2fc787ff5..d31ea931bcd 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/EngineAuthServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/EngineAuthServiceTest.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.api.jsonrpc.authentication; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AdminRemovePeerTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AdminRemovePeerTest.java index b2245b51b86..3bbe50684b9 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AdminRemovePeerTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AdminRemovePeerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthBlobBaseFeeTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthBlobBaseFeeTest.java index 3e613cc9955..61f12c78aa3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthBlobBaseFeeTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthBlobBaseFeeTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockByNumberTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockByNumberTest.java index 8eafb35f730..166d238caa0 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockByNumberTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockByNumberTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceiptsTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceiptsTest.java index dad5099ee7c..a36af3755ed 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceiptsTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceiptsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogsTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogsTest.java index a33abc71dd1..5af104335d3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogsTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogsTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetTransactionByHashTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetTransactionByHashTest.java index 42018f2aebc..b376ef1ef84 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetTransactionByHashTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetTransactionByHashTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java index 99db8851141..6a9d4da03d0 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdatedTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdatedTest.java index 8391ede830e..4cb4c81cc9e 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdatedTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdatedTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineGetPayloadTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineGetPayloadTest.java index 777ecaeefc7..683373be326 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineGetPayloadTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineGetPayloadTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java index e6712373d28..e3165ff2f3b 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractScheduledApiTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractScheduledApiTest.java index 9fd546dca5b..9da345dbcdc 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractScheduledApiTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractScheduledApiTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine; import static org.mockito.ArgumentMatchers.argThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilitiesTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilitiesTest.java index 41a024c09c6..e3a3268aa62 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilitiesTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilitiesTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeTransitionConfigurationTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeTransitionConfigurationTest.java index eadea3fa05a..f5928091c16 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeTransitionConfigurationTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeTransitionConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1Test.java index a6f78d145c8..d38d3994415 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2Test.java index b4fbccf1c72..550e1380d27 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1Test.java index 154c25df45b..be0a336f9f4 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByHashV1Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByRangeV1Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByRangeV1Test.java index da3fca2e455..614aa169c20 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByRangeV1Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadBodiesByRangeV1Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV1Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV1Test.java index 5fbf89413f2..f0888409620 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV1Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV1Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2Test.java index d9f7f9b4291..72f89c79c3a 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV2Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV3Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV3Test.java index 9813502d47a..094e54bac25 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV3Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV3Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java index 57b73546a18..64b473caffc 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV1Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV1Test.java index 0ad39def5ac..0973c7db4e7 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV1Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV1Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java index b05fa5042b2..1d794170216 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java index a6b51ee6eb9..67e3709b91d 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java index dd06414e45b..c06134af014 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EnginePreparePayloadDebugTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EnginePreparePayloadDebugTest.java index 0611813696c..4de9f8bb56e 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EnginePreparePayloadDebugTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EnginePreparePayloadDebugTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineQosTimerTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineQosTimerTest.java index b25fd7e3d0b..f344e57c34f 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineQosTimerTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineQosTimerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPriceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPriceTest.java index ebb8035b5f7..f73229f0e0f 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPriceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPriceTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFeeTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFeeTest.java index 4022e10244f..78fb85b94b7 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFeeTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFeeTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPriceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPriceTest.java index 824b8f8fb81..a5cb18a2dff 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPriceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPriceTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFeeTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFeeTest.java index 0634274bc75..cc69c1e7c49 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFeeTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFeeTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/BlockParameterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/BlockParameterTest.java index 015a217bc28..9e6ee0d37d7 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/BlockParameterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/BlockParameterTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameterTest.java index 3d59adbf2c1..56dfed3fd4b 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameterTest.java @@ -1,6 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu - * + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameterTestFixture.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameterTestFixture.java index ef9ef57b832..575b73c73b3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameterTestFixture.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameterTestFixture.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; public class DepositParameterTestFixture { diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadAttributesParameterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadAttributesParameterTest.java index 46f46f3bbd4..bec9bd12143 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadAttributesParameterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadAttributesParameterTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameterTest.java index 80aa67fdea7..3a0e10f15e9 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameterTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameterTestFixture.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameterTestFixture.java index 189b09ff8a5..bd51db6226a 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameterTestFixture.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalParameterTestFixture.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; import org.hyperledger.besu.datatypes.GWei; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameterTest.java index 041bef13352..e3e136cb7a4 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestParameterTest.java @@ -1,6 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu - * + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestTestFixture.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestTestFixture.java index 0e234d07949..2256cc31956 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestTestFixture.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/WithdrawalRequestTestFixture.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters; import org.hyperledger.besu.datatypes.GWei; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/MutableJsonRpcSuccessResponse.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/MutableJsonRpcSuccessResponse.java index fc51f5209e4..7e61830ce67 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/MutableJsonRpcSuccessResponse.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/MutableJsonRpcSuccessResponse.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlobsBundleV1Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlobsBundleV1Test.java index f38a3265046..86db821262e 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlobsBundleV1Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlobsBundleV1Test.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/parameters/TraceCallManyParameterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/parameters/TraceCallManyParameterTest.java index 4e236a12c1d..d114aec369d 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/parameters/TraceCallManyParameterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/parameters/TraceCallManyParameterTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonResponseStreamerTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonResponseStreamerTest.java index 4ad036c2952..bbeed01481e 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonResponseStreamerTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonResponseStreamerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonRpcJWTTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonRpcJWTTest.java index f44b490b82f..55913f18a0d 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonRpcJWTTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonRpcJWTTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java index bedd7aa4c36..5fa137e312c 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueriesTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueriesTest.java index e4539b19904..11fc9f9bef8 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueriesTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueriesTest.java @@ -1,5 +1,4 @@ /* - * * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.api.query; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/tls/FileBasedPasswordProviderTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/tls/FileBasedPasswordProviderTest.java index dd9d75778e8..7d77f9e430e 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/tls/FileBasedPasswordProviderTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/tls/FileBasedPasswordProviderTest.java @@ -1,5 +1,4 @@ /* - * * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.api.tls; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/util/DomainObjectDecodeUtilsTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/util/DomainObjectDecodeUtilsTest.java index 763182da5c5..af48e26823c 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/util/DomainObjectDecodeUtilsTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/util/DomainObjectDecodeUtilsTest.java @@ -1,5 +1,4 @@ /* - * * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.api.util; diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/util/TestJsonRpcMethodsUtil.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/util/TestJsonRpcMethodsUtil.java index ada9e87c937..5273192b18f 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/util/TestJsonRpcMethodsUtil.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/util/TestJsonRpcMethodsUtil.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.api.util; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; From 690a2ea81e2bf62508ff16675cd7dbaeb006fa83 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Thu, 2 May 2024 15:47:59 +0200 Subject: [PATCH 49/59] Refactor genesis config file and options (#7012) Signed-off-by: Fabio Di Fabio --- .../dsl/node/ThreadBesuNodeRunner.java | 9 +- .../org/hyperledger/besu/RunnerBuilder.java | 10 +- .../org/hyperledger/besu/cli/BesuCommand.java | 150 ++++++++-------- .../besu/cli/config/EthNetworkConfig.java | 153 +++++------------ .../besu/controller/BesuController.java | 51 ++---- .../controller/BesuControllerBuilder.java | 64 +++---- .../CliqueBesuControllerBuilder.java | 6 +- ...onsensusScheduleBesuControllerBuilder.java | 11 +- .../controller/IbftBesuControllerBuilder.java | 12 +- .../MainnetBesuControllerBuilder.java | 5 +- .../MergeBesuControllerBuilder.java | 16 +- .../controller/QbftBesuControllerBuilder.java | 10 +- .../TransitionBesuControllerBuilder.java | 11 +- .../hyperledger/besu/PrivacyReorgTest.java | 5 +- .../org/hyperledger/besu/PrivacyTest.java | 5 +- .../hyperledger/besu/RunnerBuilderTest.java | 8 +- .../java/org/hyperledger/besu/RunnerTest.java | 11 +- .../chainexport/RlpBlockExporterTest.java | 5 +- .../chainimport/JsonBlockImporterTest.java | 2 +- .../chainimport/RlpBlockImporterTest.java | 12 +- .../hyperledger/besu/cli/BesuCommandTest.java | 161 +++++++++--------- .../cli/CascadingDefaultProviderTest.java | 26 +-- .../besu/cli/CommandTestAbstract.java | 7 +- .../besu/cli/config/EthNetworkConfigTest.java | 51 +++--- .../besu/cli/options/MiningOptionsTest.java | 2 +- .../blocks/BlocksSubCommandTest.java | 2 +- .../AbstractBftBesuControllerBuilderTest.java | 4 +- .../besu/controller/BesuControllerTest.java | 53 +++--- ...nsusScheduleBesuControllerBuilderTest.java | 3 +- .../IbftBesuControllerBuilderTest.java | 2 +- .../QbftBesuControllerBuilderTest.java | 2 +- ...rmissioningConfigurationValidatorTest.java | 4 +- .../besu/config/GenesisConfigFile.java | 98 ++++++----- .../besu/config/JsonGenesisConfigOptions.java | 15 ++ .../org/hyperledger/besu/config/JsonUtil.java | 28 ++- .../besu/config/GenesisConfigFileTest.java | 22 +-- .../hyperledger/besu/config/JsonUtilTest.java | 22 +++ .../MergeGenesisConfigHelper.java | 8 +- .../qbft/support/TestContextBuilder.java | 7 +- .../AbstractBlockTransactionSelectorTest.java | 2 +- ...FeeMarketBlockTransactionSelectorTest.java | 3 +- ...FeeMarketBlockTransactionSelectorTest.java | 3 +- .../ethereum/core/BlockchainSetupUtil.java | 12 +- .../fixed/FixedProtocolScheduleTest.java | 2 +- .../mainnet/MainnetProtocolScheduleTest.java | 10 +- .../bonsai/AbstractIsolationTests.java | 6 +- .../eth/messages/BlockBodiesMessageTest.java | 2 +- .../eth/messages/BlockHeadersMessageTest.java | 2 +- .../eth/sync/ChainHeadTrackerTest.java | 2 +- .../ethereum/eth/transactions/TestNode.java | 4 +- ...rtContractPermissioningControllerTest.java | 10 +- 51 files changed, 513 insertions(+), 618 deletions(-) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java index 1493df6f0f5..073e0bd1d1b 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java @@ -74,7 +74,6 @@ import java.io.File; import java.nio.file.Path; import java.time.Clock; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -213,14 +212,16 @@ public void startNode(final BesuNode node) { final EthNetworkConfig.Builder networkConfigBuilder = new EthNetworkConfig.Builder(EthNetworkConfig.getNetworkConfig(network)) .setBootNodes(bootnodes); - node.getConfiguration().getGenesisConfig().ifPresent(networkConfigBuilder::setGenesisConfig); + node.getConfiguration() + .getGenesisConfig() + .map(GenesisConfigFile::fromConfig) + .ifPresent(networkConfigBuilder::setGenesisConfigFile); final EthNetworkConfig ethNetworkConfig = networkConfigBuilder.build(); final SynchronizerConfiguration synchronizerConfiguration = new SynchronizerConfiguration.Builder().build(); final BesuControllerBuilder builder = new BesuController.Builder() - .fromEthNetworkConfig( - ethNetworkConfig, Collections.emptyMap(), synchronizerConfiguration.getSyncMode()); + .fromEthNetworkConfig(ethNetworkConfig, synchronizerConfiguration.getSyncMode()); final KeyValueStorageProvider storageProvider = new KeyValueStorageProviderBuilder() diff --git a/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java b/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java index 6379e2c1a64..f38d362fde2 100644 --- a/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java @@ -603,15 +603,15 @@ public Runner build() { .setAdvertisedHost(p2pAdvertisedHost); if (discovery) { final List bootstrap; - if (ethNetworkConfig.getBootNodes() == null) { - bootstrap = EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET).getBootNodes(); + if (ethNetworkConfig.bootNodes() == null) { + bootstrap = EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET).bootNodes(); } else { - bootstrap = ethNetworkConfig.getBootNodes(); + bootstrap = ethNetworkConfig.bootNodes(); } discoveryConfiguration.setBootnodes(bootstrap); LOG.info("Resolved {} bootnodes.", bootstrap.size()); LOG.debug("Bootnodes = {}", bootstrap); - discoveryConfiguration.setDnsDiscoveryURL(ethNetworkConfig.getDnsDiscoveryUrl()); + discoveryConfiguration.setDnsDiscoveryURL(ethNetworkConfig.dnsDiscoveryUrl()); discoveryConfiguration.setDiscoveryV5Enabled( networkingConfiguration.getDiscovery().isDiscoveryV5Enabled()); discoveryConfiguration.setFilterOnEnrForkId( @@ -1209,7 +1209,7 @@ private Map jsonRpcMethods( new JsonRpcMethodsFactory() .methods( BesuInfo.nodeName(identityString), - ethNetworkConfig.getNetworkId(), + ethNetworkConfig.networkId(), besuController.getGenesisConfigOptions(), network, blockchainQueries, diff --git a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java index 2d147be517b..e3419f594c4 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java @@ -16,7 +16,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; -import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.hyperledger.besu.cli.DefaultCommandValues.getDefaultBesuDataPath; @@ -207,6 +206,7 @@ import java.net.InetAddress; import java.net.SocketException; import java.net.URI; +import java.net.URL; import java.net.UnknownHostException; import java.nio.file.Path; import java.time.Clock; @@ -231,7 +231,6 @@ import com.google.common.base.Strings; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableMap; -import com.google.common.io.Resources; import io.vertx.core.Vertx; import io.vertx.core.VertxOptions; import io.vertx.core.json.DecodeException; @@ -324,7 +323,10 @@ public class BesuCommand implements DefaultCommandValues, Runnable { private final Set allocatedPorts = new HashSet<>(); private final PkiBlockCreationConfigurationProvider pkiBlockCreationConfigProvider; - private GenesisConfigOptions genesisConfigOptions; + private final Supplier genesisConfigFileSupplier = + Suppliers.memoize(this::readGenesisConfigFile); + private final Supplier genesisConfigOptionsSupplier = + Suppliers.memoize(this::readGenesisConfigOptions); private RocksDBPlugin rocksDBPlugin; @@ -1130,10 +1132,6 @@ public void run() { try { configureLogging(true); - if (genesisFile != null) { - genesisConfigOptions = readGenesisConfigOptions(); - } - // set merge config on the basis of genesis config setMergeConfigOptions(); @@ -1292,8 +1290,6 @@ private SecurityModule defaultSecurityModule() { return new KeyPairSecurityModule(loadKeyPair(nodePrivateKeyFileOption.getNodePrivateKeyFile())); } - // loadKeyPair() is public because it is accessed by subcommands - /** * Load key pair from private key. Visible to be accessed by subcommands. * @@ -1473,8 +1469,8 @@ private void configureNativeLibs() { logger.info("Using the Java implementation of the blake2bf algorithm"); } - if (getActualGenesisConfigOptions().getCancunTime().isPresent() - || getActualGenesisConfigOptions().getPragueTime().isPresent()) { + if (genesisConfigOptionsSupplier.get().getCancunTime().isPresent() + || genesisConfigOptionsSupplier.get().getPragueTime().isPresent()) { if (kzgTrustedSetupFile != null) { KZGPointEvalPrecompiledContract.init(kzgTrustedSetupFile); } else { @@ -1504,16 +1500,33 @@ private void validateOptions() { validateDataStorageOptions(); validateGraphQlOptions(); validateApiOptions(); + validateConsensusSyncCompatibilityOptions(); p2pTLSConfigOptions.checkP2PTLSOptionsDependencies(logger, commandLine); pkiBlockCreationOptions.checkPkiBlockCreationOptionsDependencies(logger, commandLine); } + private void validateConsensusSyncCompatibilityOptions() { + // snap and checkpoint can't be used with BFT but can for clique + if (genesisConfigOptionsSupplier.get().isIbftLegacy() + || genesisConfigOptionsSupplier.get().isIbft2() + || genesisConfigOptionsSupplier.get().isQbft()) { + final String errorSuffix = "can't be used with BFT networks"; + if (SyncMode.CHECKPOINT.equals(syncMode) || SyncMode.X_CHECKPOINT.equals(syncMode)) { + throw new ParameterException( + commandLine, String.format("%s %s", "Checkpoint sync", errorSuffix)); + } + if (syncMode == SyncMode.SNAP || syncMode == SyncMode.X_SNAP) { + throw new ParameterException(commandLine, String.format("%s %s", "Snap sync", errorSuffix)); + } + } + } + private void validateApiOptions() { apiConfigurationOptions.validate(commandLine, logger); } private void validateTransactionPoolOptions() { - transactionPoolOptions.validate(commandLine, getActualGenesisConfigOptions()); + transactionPoolOptions.validate(commandLine, genesisConfigOptionsSupplier.get()); } private void validateDataStorageOptions() { @@ -1534,7 +1547,8 @@ private void validateRequiredOptions() { } private void validateMiningParams() { - miningOptions.validate(commandLine, getActualGenesisConfigOptions(), isMergeEnabled(), logger); + miningOptions.validate( + commandLine, genesisConfigOptionsSupplier.get(), isMergeEnabled(), logger); } /** @@ -1644,29 +1658,20 @@ private void validateChainDataPruningParams() { } } - private GenesisConfigOptions readGenesisConfigOptions() { + private GenesisConfigFile readGenesisConfigFile() { + return genesisFile != null + ? GenesisConfigFile.fromSource(genesisConfigSource(genesisFile)) + : GenesisConfigFile.fromResource( + Optional.ofNullable(network).orElse(MAINNET).getGenesisFile()); + } + private GenesisConfigOptions readGenesisConfigOptions() { try { - final GenesisConfigFile genesisConfigFile = GenesisConfigFile.fromConfig(genesisConfig()); - genesisConfigOptions = genesisConfigFile.getConfigOptions(genesisConfigOverrides); + return genesisConfigFileSupplier.get().getConfigOptions(genesisConfigOverrides); } catch (final Exception e) { throw new ParameterException( this.commandLine, "Unable to load genesis file. " + e.getCause()); } - // snap and checkpoint can't be used with BFT but can for clique - if (genesisConfigOptions.isIbftLegacy() - || genesisConfigOptions.isIbft2() - || genesisConfigOptions.isQbft()) { - final String errorSuffix = "can't be used with BFT networks"; - if (SyncMode.CHECKPOINT.equals(syncMode) || SyncMode.X_CHECKPOINT.equals(syncMode)) { - throw new ParameterException( - commandLine, String.format("%s %s", "Checkpoint sync", errorSuffix)); - } - if (syncMode == SyncMode.SNAP || syncMode == SyncMode.X_SNAP) { - throw new ParameterException(commandLine, String.format("%s %s", "Snap sync", errorSuffix)); - } - } - return genesisConfigOptions; } private void issueOptionWarnings() { @@ -1765,7 +1770,7 @@ private void configure() throws Exception { permissioningConfiguration = permissioningConfiguration(); staticNodes = loadStaticNodes(); - final List enodeURIs = ethNetworkConfig.getBootNodes(); + final List enodeURIs = ethNetworkConfig.bootNodes(); permissioningConfiguration .flatMap(PermissioningConfiguration::getLocalConfig) .ifPresent(p -> ensureAllNodesAreInAllowlist(enodeURIs, p)); @@ -1842,8 +1847,7 @@ public BesuControllerBuilder getControllerBuilder() { getMiningParameters()); final KeyValueStorageProvider storageProvider = keyValueStorageProvider(keyValueStorageName); return controllerBuilderFactory - .fromEthNetworkConfig( - updateNetworkConfig(network), genesisConfigOverrides, getDefaultSyncModeIfNotSet()) + .fromEthNetworkConfig(updateNetworkConfig(network), getDefaultSyncModeIfNotSet()) .synchronizerConfiguration(buildSyncConfig()) .ethProtocolConfiguration(unstableEthProtocolOptions.toDomainObject()) .networkConfiguration(unstableNetworkingOptions.toDomainObject()) @@ -1859,7 +1863,6 @@ public BesuControllerBuilder getControllerBuilder() { .clock(Clock.systemUTC()) .isRevertReasonEnabled(isRevertReasonEnabled) .storageProvider(storageProvider) - .genesisConfigOverrides(genesisConfigOverrides) .gasLimitCalculator( getMiningParameters().getTargetGasLimit().isPresent() ? new FrontierTargetingGasLimitCalculator() @@ -2148,7 +2151,7 @@ private TransactionPoolConfiguration buildTransactionPoolConfiguration() { .from(txPoolConf) .saveFile((dataPath.resolve(txPoolConf.getSaveFile().getPath()).toFile())); - if (getActualGenesisConfigOptions().isZeroBaseFee()) { + if (genesisConfigOptionsSupplier.get().isZeroBaseFee()) { logger.info( "Forcing price bump for transaction replacement to 0, since we are on a zero basefee network"); txPoolConfBuilder.priceBump(Percentage.ZERO); @@ -2185,7 +2188,7 @@ private MiningParameters getMiningParameters() { if (miningParameters == null) { miningOptions.setTransactionSelectionService(transactionSelectionServiceImpl); miningParameters = miningOptions.toDomainObject(); - getGenesisBlockPeriodSeconds(getActualGenesisConfigOptions()) + getGenesisBlockPeriodSeconds(genesisConfigOptionsSupplier.get()) .ifPresent(miningParameters::setBlockPeriodSeconds); initMiningParametersMetrics(miningParameters); } @@ -2337,16 +2340,14 @@ private EthNetworkConfig updateNetworkConfig(final NetworkName network) { + "refer to CLI reference for more details about this constraint."); } - builder.setGenesisConfig(genesisConfig()); - if (networkId == null) { // If no chain id is found in the genesis, use mainnet network id try { builder.setNetworkId( - getGenesisConfigFile() - .getConfigOptions(genesisConfigOverrides) + genesisConfigOptionsSupplier + .get() .getChainId() - .orElse(EthNetworkConfig.getNetworkConfig(MAINNET).getNetworkId())); + .orElse(EthNetworkConfig.getNetworkConfig(MAINNET).networkId())); } catch (final DecodeException e) { throw new ParameterException( this.commandLine, String.format("Unable to parse genesis file %s.", genesisFile), e); @@ -2364,18 +2365,20 @@ private EthNetworkConfig updateNetworkConfig(final NetworkName network) { builder.setDnsDiscoveryUrl(null); } + builder.setGenesisConfigFile(genesisConfigFileSupplier.get()); + + if (networkId != null) { + builder.setNetworkId(networkId); + } + if (p2PDiscoveryOptionGroup.discoveryDnsUrl != null) { builder.setDnsDiscoveryUrl(p2PDiscoveryOptionGroup.discoveryDnsUrl); - } else if (genesisConfigOptions != null) { + } else { final Optional discoveryDnsUrlFromGenesis = - genesisConfigOptions.getDiscoveryOptions().getDiscoveryDnsUrl(); + genesisConfigOptionsSupplier.get().getDiscoveryOptions().getDiscoveryDnsUrl(); discoveryDnsUrlFromGenesis.ifPresent(builder::setDnsDiscoveryUrl); } - if (networkId != null) { - builder.setNetworkId(networkId); - } - List listBootNodes = null; if (p2PDiscoveryOptionGroup.bootNodes != null) { try { @@ -2383,9 +2386,9 @@ private EthNetworkConfig updateNetworkConfig(final NetworkName network) { } catch (final IllegalArgumentException e) { throw new ParameterException(commandLine, e.getMessage()); } - } else if (genesisConfigOptions != null) { + } else { final Optional> bootNodesFromGenesis = - genesisConfigOptions.getDiscoveryOptions().getBootNodes(); + genesisConfigOptionsSupplier.get().getDiscoveryOptions().getBootNodes(); if (bootNodesFromGenesis.isPresent()) { listBootNodes = buildEnodes(bootNodesFromGenesis.get(), getEnodeDnsConfiguration()); } @@ -2400,28 +2403,15 @@ private EthNetworkConfig updateNetworkConfig(final NetworkName network) { return builder.build(); } - private GenesisConfigFile getGenesisConfigFile() { - return GenesisConfigFile.fromConfig(genesisConfig()); - } - - private String genesisConfig() { + private URL genesisConfigSource(final File genesisFile) { try { - return Resources.toString(genesisFile.toURI().toURL(), UTF_8); + return genesisFile.toURI().toURL(); } catch (final IOException e) { throw new ParameterException( this.commandLine, String.format("Unable to load genesis URL %s.", genesisFile), e); } } - private static String genesisConfig(final NetworkName networkName) { - try (final InputStream genesisFileInputStream = - EthNetworkConfig.class.getResourceAsStream(networkName.getGenesisFile())) { - return new String(genesisFileInputStream.readAllBytes(), UTF_8); - } catch (final IOException | NullPointerException e) { - throw new IllegalStateException(e); - } - } - /** * Returns data directory used by Besu. Visible as it is accessed by other subcommands. * @@ -2635,26 +2625,21 @@ private Optional getEcCurveFromGenesisFile() { if (genesisFile == null) { return Optional.empty(); } - return genesisConfigOptions.getEcCurve(); + return genesisConfigOptionsSupplier.get().getEcCurve(); } /** - * Return the genesis config options after applying any specified config overrides + * Return the genesis config options * - * @return the genesis config options after applying any specified config overrides + * @return the genesis config options */ - protected GenesisConfigOptions getActualGenesisConfigOptions() { - return Optional.ofNullable(genesisConfigOptions) - .orElseGet( - () -> - GenesisConfigFile.fromConfig( - genesisConfig(Optional.ofNullable(network).orElse(MAINNET))) - .getConfigOptions(genesisConfigOverrides)); + protected GenesisConfigOptions getGenesisConfigOptions() { + return genesisConfigOptionsSupplier.get(); } private void setMergeConfigOptions() { MergeConfigOptions.setMergeEnabled( - getActualGenesisConfigOptions().getTerminalTotalDifficulty().isPresent()); + genesisConfigOptionsSupplier.get().getTerminalTotalDifficulty().isPresent()); } /** Set ignorable segments in RocksDB Storage Provider plugin. */ @@ -2665,11 +2650,12 @@ public void setIgnorableStorageSegments() { } private void validatePostMergeCheckpointBlockRequirements() { - final GenesisConfigOptions genesisOptions = getActualGenesisConfigOptions(); final SynchronizerConfiguration synchronizerConfiguration = unstableSynchronizerOptions.toDomainObject().build(); - final Optional terminalTotalDifficulty = genesisOptions.getTerminalTotalDifficulty(); - final CheckpointConfigOptions checkpointConfigOptions = genesisOptions.getCheckpointOptions(); + final Optional terminalTotalDifficulty = + genesisConfigOptionsSupplier.get().getTerminalTotalDifficulty(); + final CheckpointConfigOptions checkpointConfigOptions = + genesisConfigOptionsSupplier.get().getCheckpointOptions(); if (synchronizerConfiguration.isCheckpointPostMergeEnabled()) { if (!checkpointConfigOptions.isValid()) { throw new InvalidConfigurationException( @@ -2677,15 +2663,13 @@ private void validatePostMergeCheckpointBlockRequirements() { } terminalTotalDifficulty.ifPresentOrElse( ttd -> { - if (UInt256.fromHexString( - genesisOptions.getCheckpointOptions().getTotalDifficulty().get()) + if (UInt256.fromHexString(checkpointConfigOptions.getTotalDifficulty().get()) .equals(UInt256.ZERO) && ttd.equals(UInt256.ZERO)) { throw new InvalidConfigurationException( "PoS checkpoint sync can't be used with TTD = 0 and checkpoint totalDifficulty = 0"); } - if (UInt256.fromHexString( - genesisOptions.getCheckpointOptions().getTotalDifficulty().get()) + if (UInt256.fromHexString(checkpointConfigOptions.getTotalDifficulty().get()) .lessThan(ttd)) { throw new InvalidConfigurationException( "PoS checkpoint sync requires a block with total difficulty greater or equal than the TTD"); @@ -2742,7 +2726,7 @@ private String generateConfigurationOverview() { if (genesisFile != null) { builder.setCustomGenesis(genesisFile.getAbsolutePath()); } - builder.setNetworkId(ethNetworkConfig.getNetworkId()); + builder.setNetworkId(ethNetworkConfig.networkId()); builder .setDataStorage(dataStorageOptions.normalizeDataStorageFormat()) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/config/EthNetworkConfig.java b/besu/src/main/java/org/hyperledger/besu/cli/config/EthNetworkConfig.java index 3af85016c8c..d591637e33b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/config/EthNetworkConfig.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/config/EthNetworkConfig.java @@ -14,8 +14,6 @@ */ package org.hyperledger.besu.cli.config; -import static java.nio.charset.StandardCharsets.UTF_8; - import org.hyperledger.besu.config.GenesisConfigFile; import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl; @@ -24,6 +22,8 @@ import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; +import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; import java.util.Objects; @@ -31,102 +31,25 @@ import java.util.stream.Collectors; /** The Eth network config. */ -public class EthNetworkConfig { - - private final String genesisConfig; - private final BigInteger networkId; - private final List bootNodes; - private final String dnsDiscoveryUrl; +public record EthNetworkConfig( + GenesisConfigFile genesisConfigFile, + BigInteger networkId, + List bootNodes, + String dnsDiscoveryUrl) { /** - * Instantiates a new Eth network config. + * Validate parameters on new record creation * - * @param genesisConfig the genesis config + * @param genesisConfigFile the genesis config * @param networkId the network id * @param bootNodes the boot nodes * @param dnsDiscoveryUrl the dns discovery url */ - public EthNetworkConfig( - final String genesisConfig, - final BigInteger networkId, - final List bootNodes, - final String dnsDiscoveryUrl) { - Objects.requireNonNull(genesisConfig); + @SuppressWarnings( + "MethodInputParametersMustBeFinal") // needed since record constructors are not yet supported + public EthNetworkConfig { + Objects.requireNonNull(genesisConfigFile); Objects.requireNonNull(bootNodes); - this.genesisConfig = genesisConfig; - this.networkId = networkId; - this.bootNodes = bootNodes; - this.dnsDiscoveryUrl = dnsDiscoveryUrl; - } - - /** - * Gets genesis config. - * - * @return the genesis config - */ - public String getGenesisConfig() { - return genesisConfig; - } - - /** - * Gets network id. - * - * @return the network id - */ - public BigInteger getNetworkId() { - return networkId; - } - - /** - * Gets boot nodes. - * - * @return the boot nodes - */ - public List getBootNodes() { - return bootNodes; - } - - /** - * Gets dns discovery url. - * - * @return the dns discovery url - */ - public String getDnsDiscoveryUrl() { - return dnsDiscoveryUrl; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final EthNetworkConfig that = (EthNetworkConfig) o; - return networkId.equals(that.networkId) - && Objects.equals(genesisConfig, that.genesisConfig) - && Objects.equals(bootNodes, that.bootNodes) - && Objects.equals(dnsDiscoveryUrl, that.dnsDiscoveryUrl); - } - - @Override - public int hashCode() { - return Objects.hash(genesisConfig, networkId, bootNodes, dnsDiscoveryUrl); - } - - @Override - public String toString() { - return "EthNetworkConfig{" - + "genesisConfig=" - + genesisConfig - + ", networkId=" - + networkId - + ", bootNodes=" - + bootNodes - + ", dnsDiscoveryUrl=" - + dnsDiscoveryUrl - + '}'; } /** @@ -136,9 +59,9 @@ public String toString() { * @return the network config */ public static EthNetworkConfig getNetworkConfig(final NetworkName networkName) { - final String genesisContent = jsonConfig(networkName.getGenesisFile()); - final GenesisConfigOptions genesisConfigOptions = - GenesisConfigFile.fromConfig(genesisContent).getConfigOptions(); + final URL genesisSource = jsonConfigSource(networkName.getGenesisFile()); + final GenesisConfigFile genesisConfigFile = GenesisConfigFile.fromSource(genesisSource); + final GenesisConfigOptions genesisConfigOptions = genesisConfigFile.getConfigOptions(); final Optional> rawBootNodes = genesisConfigOptions.getDiscoveryOptions().getBootNodes(); final List bootNodes = @@ -148,36 +71,36 @@ public static EthNetworkConfig getNetworkConfig(final NetworkName networkName) { strings.stream().map(EnodeURLImpl::fromString).collect(Collectors.toList())) .orElse(Collections.emptyList()); return new EthNetworkConfig( - genesisContent, + genesisConfigFile, networkName.getNetworkId(), bootNodes, genesisConfigOptions.getDiscoveryOptions().getDiscoveryDnsUrl().orElse(null)); } - private static String jsonConfig(final String resourceName) { - try (final InputStream genesisFileInputStream = - EthNetworkConfig.class.getResourceAsStream(resourceName)) { - return new String(genesisFileInputStream.readAllBytes(), UTF_8); - } catch (IOException | NullPointerException e) { - throw new IllegalStateException(e); - } + private static URL jsonConfigSource(final String resourceName) { + return EthNetworkConfig.class.getResource(resourceName); } /** * Json config string. * - * @param network the network - * @return the string + * @param network the named network + * @return the json string */ public static String jsonConfig(final NetworkName network) { - return jsonConfig(network.getGenesisFile()); + try (final InputStream genesisFileInputStream = + EthNetworkConfig.class.getResourceAsStream(network.getGenesisFile())) { + return new String(genesisFileInputStream.readAllBytes(), StandardCharsets.UTF_8); + } catch (IOException | NullPointerException e) { + throw new IllegalStateException(e); + } } /** The type Builder. */ public static class Builder { private String dnsDiscoveryUrl; - private String genesisConfig; + private GenesisConfigFile genesisConfigFile; private BigInteger networkId; private List bootNodes; @@ -187,20 +110,20 @@ public static class Builder { * @param ethNetworkConfig the eth network config */ public Builder(final EthNetworkConfig ethNetworkConfig) { - this.genesisConfig = ethNetworkConfig.genesisConfig; + this.genesisConfigFile = ethNetworkConfig.genesisConfigFile; this.networkId = ethNetworkConfig.networkId; this.bootNodes = ethNetworkConfig.bootNodes; this.dnsDiscoveryUrl = ethNetworkConfig.dnsDiscoveryUrl; } /** - * Sets genesis config. + * Sets genesis config file. * - * @param genesisConfig the genesis config - * @return the genesis config + * @param genesisConfigFile the genesis config + * @return this builder */ - public Builder setGenesisConfig(final String genesisConfig) { - this.genesisConfig = genesisConfig; + public Builder setGenesisConfigFile(final GenesisConfigFile genesisConfigFile) { + this.genesisConfigFile = genesisConfigFile; return this; } @@ -208,7 +131,7 @@ public Builder setGenesisConfig(final String genesisConfig) { * Sets network id. * * @param networkId the network id - * @return the network id + * @return this builder */ public Builder setNetworkId(final BigInteger networkId) { this.networkId = networkId; @@ -219,7 +142,7 @@ public Builder setNetworkId(final BigInteger networkId) { * Sets boot nodes. * * @param bootNodes the boot nodes - * @return the boot nodes + * @return this builder */ public Builder setBootNodes(final List bootNodes) { this.bootNodes = bootNodes; @@ -230,7 +153,7 @@ public Builder setBootNodes(final List bootNodes) { * Sets dns discovery url. * * @param dnsDiscoveryUrl the dns discovery url - * @return the dns discovery url + * @return this builder */ public Builder setDnsDiscoveryUrl(final String dnsDiscoveryUrl) { this.dnsDiscoveryUrl = dnsDiscoveryUrl; @@ -243,7 +166,7 @@ public Builder setDnsDiscoveryUrl(final String dnsDiscoveryUrl) { * @return the eth network config */ public EthNetworkConfig build() { - return new EthNetworkConfig(genesisConfig, networkId, bootNodes, dnsDiscoveryUrl); + return new EthNetworkConfig(genesisConfigFile, networkId, bootNodes, dnsDiscoveryUrl); } } } diff --git a/besu/src/main/java/org/hyperledger/besu/controller/BesuController.java b/besu/src/main/java/org/hyperledger/besu/controller/BesuController.java index 2849846f213..6c223674d59 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/BesuController.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/BesuController.java @@ -42,7 +42,6 @@ import java.io.Closeable; import java.io.IOException; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -317,50 +316,29 @@ public static class Builder { * From eth network config besu controller builder. * * @param ethNetworkConfig the eth network config - * @param genesisConfigOverrides the genesis config overrides * @param syncMode The sync mode * @return the besu controller builder */ public BesuControllerBuilder fromEthNetworkConfig( - final EthNetworkConfig ethNetworkConfig, - final Map genesisConfigOverrides, - final SyncMode syncMode) { - return fromGenesisConfig( - GenesisConfigFile.fromConfig(ethNetworkConfig.getGenesisConfig()), - genesisConfigOverrides, - syncMode) - .networkId(ethNetworkConfig.getNetworkId()); + final EthNetworkConfig ethNetworkConfig, final SyncMode syncMode) { + return fromGenesisFile(ethNetworkConfig.genesisConfigFile(), syncMode) + .networkId(ethNetworkConfig.networkId()); } /** * From genesis config besu controller builder. * - * @param genesisConfig the genesis config - * @param syncMode The Sync Mode + * @param genesisConfigFile the genesis config file + * @param syncMode the sync mode * @return the besu controller builder */ - public BesuControllerBuilder fromGenesisConfig( - final GenesisConfigFile genesisConfig, final SyncMode syncMode) { - return fromGenesisConfig(genesisConfig, Collections.emptyMap(), syncMode); - } - - /** - * From genesis config besu controller builder. - * - * @param genesisConfig the genesis config - * @param genesisConfigOverrides the genesis config overrides - * @return the besu controller builder - */ - BesuControllerBuilder fromGenesisConfig( - final GenesisConfigFile genesisConfig, - final Map genesisConfigOverrides, - final SyncMode syncMode) { - final GenesisConfigOptions configOptions = - genesisConfig.getConfigOptions(genesisConfigOverrides); + public BesuControllerBuilder fromGenesisFile( + final GenesisConfigFile genesisConfigFile, final SyncMode syncMode) { final BesuControllerBuilder builder; + final var configOptions = genesisConfigFile.getConfigOptions(); if (configOptions.isConsensusMigration()) { - return createConsensusScheduleBesuControllerBuilder(genesisConfig, configOptions); + return createConsensusScheduleBesuControllerBuilder(genesisConfigFile); } if (configOptions.getPowAlgorithm() != PowAlgorithm.UNSUPPORTED) { @@ -382,21 +360,22 @@ BesuControllerBuilder fromGenesisConfig( if (configOptions.getTerminalTotalDifficulty().isPresent()) { // Enable start with vanilla MergeBesuControllerBuilder for PoS checkpoint block if (isCheckpointSync(syncMode) && isCheckpointPoSBlock(configOptions)) { - return new MergeBesuControllerBuilder().genesisConfigFile(genesisConfig); + return new MergeBesuControllerBuilder().genesisConfigFile(genesisConfigFile); } else { // TODO this should be changed to vanilla MergeBesuControllerBuilder and the Transition* // series of classes removed after we successfully transition to PoS // https://github.com/hyperledger/besu/issues/2897 return new TransitionBesuControllerBuilder(builder, new MergeBesuControllerBuilder()) - .genesisConfigFile(genesisConfig); + .genesisConfigFile(genesisConfigFile); } - } else return builder.genesisConfigFile(genesisConfig); + } else return builder.genesisConfigFile(genesisConfigFile); } private BesuControllerBuilder createConsensusScheduleBesuControllerBuilder( - final GenesisConfigFile genesisConfig, final GenesisConfigOptions configOptions) { + final GenesisConfigFile genesisConfigFile) { final Map besuControllerBuilderSchedule = new HashMap<>(); + final var configOptions = genesisConfigFile.getConfigOptions(); final BesuControllerBuilder originalControllerBuilder; if (configOptions.isIbft2()) { @@ -415,7 +394,7 @@ private BesuControllerBuilder createConsensusScheduleBesuControllerBuilder( besuControllerBuilderSchedule.put(qbftBlock, new QbftBesuControllerBuilder()); return new ConsensusScheduleBesuControllerBuilder(besuControllerBuilderSchedule) - .genesisConfigFile(genesisConfig); + .genesisConfigFile(genesisConfigFile); } private Long readQbftStartBlockConfig(final QbftConfigOptions qbftConfigOptions) { diff --git a/besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java index 7061af4221d..a3c243a656e 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java @@ -117,15 +117,11 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides { private static final Logger LOG = LoggerFactory.getLogger(BesuControllerBuilder.class); - private GenesisConfigFile genesisConfig; - private Map genesisConfigOverrides = Collections.emptyMap(); + /** The genesis file */ + protected GenesisConfigFile genesisConfigFile; - /** The Config options supplier. */ - protected Supplier configOptionsSupplier = - () -> - Optional.ofNullable(genesisConfig) - .map(conf -> conf.getConfigOptions(genesisConfigOverrides)) - .orElseThrow(); + /** The genesis config options; */ + protected GenesisConfigOptions genesisConfigOptions; /** The is genesis state hash from data. */ protected boolean genesisStateHashCacheEnabled; @@ -238,7 +234,8 @@ public BesuControllerBuilder storageProvider(final StorageProvider storageProvid * @return the besu controller builder */ public BesuControllerBuilder genesisConfigFile(final GenesisConfigFile genesisConfig) { - this.genesisConfig = genesisConfig; + this.genesisConfigFile = genesisConfig; + this.genesisConfigOptions = genesisConfig.getConfigOptions(); return this; } @@ -402,18 +399,6 @@ public BesuControllerBuilder isRevertReasonEnabled(final boolean isRevertReasonE return this; } - /** - * Genesis config overrides besu controller builder. - * - * @param genesisConfigOverrides the genesis config overrides - * @return the besu controller builder - */ - public BesuControllerBuilder genesisConfigOverrides( - final Map genesisConfigOverrides) { - this.genesisConfigOverrides = genesisConfigOverrides; - return this; - } - /** * Gas limit calculator besu controller builder. * @@ -544,7 +529,8 @@ public BesuControllerBuilder randomPeerPriority(final Boolean randomPeerPriority * @return the besu controller */ public BesuController build() { - checkNotNull(genesisConfig, "Missing genesis config"); + checkNotNull(genesisConfigFile, "Missing genesis config file"); + checkNotNull(genesisConfigOptions, "Missing genesis config options"); checkNotNull(syncConfig, "Missing sync config"); checkNotNull(ethereumWireProtocolConfiguration, "Missing ethereum protocol configuration"); checkNotNull(networkId, "Missing network ID"); @@ -574,10 +560,10 @@ public BesuController build() { if (genesisStateHash.isPresent()) { genesisState = - GenesisState.fromConfig(genesisStateHash.get(), genesisConfig, protocolSchedule); + GenesisState.fromConfig(genesisStateHash.get(), genesisConfigFile, protocolSchedule); } else { genesisState = - GenesisState.fromConfig(dataStorageConfiguration, genesisConfig, protocolSchedule); + GenesisState.fromConfig(dataStorageConfiguration, genesisConfigFile, protocolSchedule); if (variablesStorage != null) { VariablesStorage.Updater updater = variablesStorage.updater(); if (updater != null) { @@ -660,20 +646,18 @@ public BesuController build() { syncConfig.getComputationParallelism(), metricsSystem); - final GenesisConfigOptions configOptions = - genesisConfig.getConfigOptions(genesisConfigOverrides); - Optional checkpoint = Optional.empty(); - if (configOptions.getCheckpointOptions().isValid()) { + if (genesisConfigOptions.getCheckpointOptions().isValid()) { checkpoint = Optional.of( ImmutableCheckpoint.builder() .blockHash( - Hash.fromHexString(configOptions.getCheckpointOptions().getHash().get())) - .blockNumber(configOptions.getCheckpointOptions().getNumber().getAsLong()) + Hash.fromHexString( + genesisConfigOptions.getCheckpointOptions().getHash().get())) + .blockNumber(genesisConfigOptions.getCheckpointOptions().getNumber().getAsLong()) .totalDifficulty( Difficulty.fromHexString( - configOptions.getCheckpointOptions().getTotalDifficulty().get())) + genesisConfigOptions.getCheckpointOptions().getTotalDifficulty().get())) .build()); } @@ -768,7 +752,7 @@ public BesuController build() { protocolSchedule, protocolContext, ethProtocolManager, - configOptionsSupplier.get(), + genesisConfigOptions, subProtocolConfiguration, synchronizer, syncState, @@ -789,7 +773,6 @@ private TrieLogPruner createTrieLogPruner( final WorldStateKeyValueStorage worldStateStorage, final Blockchain blockchain, final EthScheduler scheduler) { - final GenesisConfigOptions genesisConfigOptions = configOptionsSupplier.get(); final boolean isProofOfStake = genesisConfigOptions.getTerminalTotalDifficulty().isPresent(); final TrieLogPruner trieLogPruner = @@ -849,8 +832,6 @@ private PivotBlockSelector createPivotSelector( final SyncState syncState, final MetricsSystem metricsSystem) { - final GenesisConfigOptions genesisConfigOptions = configOptionsSupplier.get(); - if (genesisConfigOptions.getTerminalTotalDifficulty().isPresent()) { LOG.info("TTD difficulty is present, creating initial sync for PoS"); @@ -887,8 +868,7 @@ private PivotBlockSelector createPivotSelector( * @return the full sync termination condition */ protected SyncTerminationCondition getFullSyncTerminationCondition(final Blockchain blockchain) { - return configOptionsSupplier - .get() + return genesisConfigOptions .getTerminalTotalDifficulty() .map(difficulty -> SyncTerminationCondition.difficulty(difficulty, blockchain)) .orElse(SyncTerminationCondition.never()); @@ -1020,8 +1000,8 @@ protected EthProtocolManager createEthProtocolManager( mergePeerFilter, synchronizerConfiguration, scheduler, - genesisConfig.getForkBlockNumbers(), - genesisConfig.getForkTimestamps()); + genesisConfigOptions.getForkBlockNumbers(), + genesisConfigOptions.getForkBlockTimestamps()); } /** @@ -1109,14 +1089,14 @@ private ChainDataPruner createChainPruner(final BlockchainStorage blockchainStor protected List createPeerValidators(final ProtocolSchedule protocolSchedule) { final List validators = new ArrayList<>(); - final OptionalLong daoBlock = configOptionsSupplier.get().getDaoForkBlock(); + final OptionalLong daoBlock = genesisConfigOptions.getDaoForkBlock(); if (daoBlock.isPresent()) { // Setup dao validator validators.add( new DaoForkPeerValidator(protocolSchedule, metricsSystem, daoBlock.getAsLong())); } - final OptionalLong classicBlock = configOptionsSupplier.get().getClassicForkBlock(); + final OptionalLong classicBlock = genesisConfigOptions.getClassicForkBlock(); // setup classic validator if (classicBlock.isPresent()) { validators.add( @@ -1130,7 +1110,7 @@ protected List createPeerValidators(final ProtocolSchedule protoc } final CheckpointConfigOptions checkpointConfigOptions = - genesisConfig.getConfigOptions(genesisConfigOverrides).getCheckpointOptions(); + genesisConfigOptions.getCheckpointOptions(); if (SyncMode.isCheckpointSync(syncConfig.getSyncMode()) && checkpointConfigOptions.isValid()) { validators.add( new CheckpointBlocksPeerValidator( diff --git a/besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java index 7b13a211a70..e4a30c1dd2f 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java @@ -60,11 +60,11 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder { @Override protected void prepForBuild() { localAddress = Util.publicKeyToAddress(nodeKey.getPublicKey()); - final CliqueConfigOptions cliqueConfig = configOptionsSupplier.get().getCliqueConfigOptions(); + final CliqueConfigOptions cliqueConfig = genesisConfigOptions.getCliqueConfigOptions(); final long blocksPerEpoch = cliqueConfig.getEpochLength(); epochManager = new EpochManager(blocksPerEpoch); - forksSchedule = CliqueForksSchedulesFactory.create(configOptionsSupplier.get()); + forksSchedule = CliqueForksSchedulesFactory.create(genesisConfigOptions); } @Override @@ -124,7 +124,7 @@ protected MiningCoordinator createMiningCoordinator( @Override protected ProtocolSchedule createProtocolSchedule() { return CliqueProtocolSchedule.create( - configOptionsSupplier.get(), + genesisConfigOptions, forksSchedule, nodeKey, privacyParameters, diff --git a/besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java index a7c1cfe35b1..e172115f8dc 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java @@ -160,7 +160,7 @@ protected ProtocolSchedule createProtocolSchedule() { besuControllerBuilderSchedule.entrySet().stream() .map(e -> new ForkSpec<>(e.getKey(), e.getValue().createProtocolSchedule())) .collect(Collectors.toCollection(() -> new TreeSet<>(ForkSpec.COMPARATOR))); - final Optional chainId = configOptionsSupplier.get().getChainId(); + final Optional chainId = genesisConfigOptions.getChainId(); return combinedProtocolScheduleFactory.apply(protocolScheduleSpecs, chainId); } @@ -363,15 +363,6 @@ public BesuControllerBuilder isRevertReasonEnabled(final boolean isRevertReasonE return super.isRevertReasonEnabled(isRevertReasonEnabled); } - @Override - public BesuControllerBuilder genesisConfigOverrides( - final Map genesisConfigOverrides) { - besuControllerBuilderSchedule - .values() - .forEach(b -> b.genesisConfigOverrides(genesisConfigOverrides)); - return super.genesisConfigOverrides(genesisConfigOverrides); - } - @Override public BesuControllerBuilder gasLimitCalculator(final GasLimitCalculator gasLimitCalculator) { besuControllerBuilderSchedule.values().forEach(b -> b.gasLimitCalculator(gasLimitCalculator)); diff --git a/besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java index 6ab517efd6c..0bd36c3b0ac 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java @@ -16,7 +16,6 @@ import org.hyperledger.besu.config.BftConfigOptions; import org.hyperledger.besu.config.BftFork; -import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.consensus.common.BftValidatorOverrides; import org.hyperledger.besu.consensus.common.EpochManager; import org.hyperledger.besu.consensus.common.ForksSchedule; @@ -102,9 +101,9 @@ protected Supplier bftExtraDataCodec() { @Override protected void prepForBuild() { - bftConfig = configOptionsSupplier.get().getBftConfigOptions(); + bftConfig = genesisConfigOptions.getBftConfigOptions(); bftEventQueue = new BftEventQueue(bftConfig.getMessageQueueLimit()); - forksSchedule = IbftForksSchedulesFactory.create(configOptionsSupplier.get()); + forksSchedule = IbftForksSchedulesFactory.create(genesisConfigOptions); } @Override @@ -280,7 +279,7 @@ protected PluginServiceFactory createAdditionalPluginServices( @Override protected ProtocolSchedule createProtocolSchedule() { return IbftProtocolScheduleBuilder.create( - configOptionsSupplier.get(), + genesisConfigOptions, forksSchedule, privacyParameters, isRevertReasonEnabled, @@ -304,12 +303,11 @@ protected BftContext createConsensusContext( final Blockchain blockchain, final WorldStateArchive worldStateArchive, final ProtocolSchedule protocolSchedule) { - final GenesisConfigOptions configOptions = configOptionsSupplier.get(); - final BftConfigOptions ibftConfig = configOptions.getBftConfigOptions(); + final BftConfigOptions ibftConfig = genesisConfigOptions.getBftConfigOptions(); final EpochManager epochManager = new EpochManager(ibftConfig.getEpochLength()); final BftValidatorOverrides validatorOverrides = - convertIbftForks(configOptions.getTransitions().getIbftForks()); + convertIbftForks(genesisConfigOptions.getTransitions().getIbftForks()); return new BftContext( BlockValidatorProvider.forkingValidatorProvider( diff --git a/besu/src/main/java/org/hyperledger/besu/controller/MainnetBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/MainnetBesuControllerBuilder.java index 4c2e0ee47a3..13b3a7111d2 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/MainnetBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/MainnetBesuControllerBuilder.java @@ -91,7 +91,7 @@ protected PluginServiceFactory createAdditionalPluginServices( @Override protected ProtocolSchedule createProtocolSchedule() { return MainnetProtocolSchedule.fromConfig( - configOptionsSupplier.get(), + genesisConfigOptions, privacyParameters, isRevertReasonEnabled, evmConfiguration, @@ -101,8 +101,7 @@ protected ProtocolSchedule createProtocolSchedule() { @Override protected void prepForBuild() { - configOptionsSupplier - .get() + genesisConfigOptions .getThanosBlockNumber() .ifPresent( activationBlock -> epochCalculator = new EpochCalculator.Ecip1099EpochCalculator()); diff --git a/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java index 20cb1084462..3c5f10e4bdd 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java @@ -14,7 +14,6 @@ */ package org.hyperledger.besu.controller; -import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.consensus.merge.MergeContext; import org.hyperledger.besu.consensus.merge.MergeProtocolSchedule; import org.hyperledger.besu.consensus.merge.PostMergeContext; @@ -101,11 +100,7 @@ protected EthProtocolManager createEthProtocolManager( var mergeBestPeerComparator = new TransitionBestPeerComparator( - configOptionsSupplier - .get() - .getTerminalTotalDifficulty() - .map(Difficulty::of) - .orElseThrow()); + genesisConfigOptions.getTerminalTotalDifficulty().map(Difficulty::of).orElseThrow()); ethPeers.setBestChainComparator(mergeBestPeerComparator); mergeContext.observeNewIsPostMergeState(mergeBestPeerComparator); @@ -156,7 +151,6 @@ protected MiningCoordinator createTransitionMiningCoordinator( this.syncState.set(syncState); - final GenesisConfigOptions genesisConfigOptions = configOptionsSupplier.get(); final Optional

depositContractAddress = genesisConfigOptions.getDepositContractAddress(); @@ -173,7 +167,7 @@ protected MiningCoordinator createTransitionMiningCoordinator( @Override protected ProtocolSchedule createProtocolSchedule() { return MergeProtocolSchedule.create( - configOptionsSupplier.get(), + genesisConfigOptions, privacyParameters, isRevertReasonEnabled, miningParameters, @@ -186,7 +180,6 @@ protected MergeContext createConsensusContext( final WorldStateArchive worldStateArchive, final ProtocolSchedule protocolSchedule) { - final GenesisConfigOptions genesisConfigOptions = configOptionsSupplier.get(); final OptionalLong terminalBlockNumber = genesisConfigOptions.getTerminalBlockNumber(); final Optional terminalBlockHash = genesisConfigOptions.getTerminalBlockHash(); final boolean isPostMergeAtGenesis = @@ -236,9 +229,8 @@ protected PluginServiceFactory createAdditionalPluginServices( @Override protected List createPeerValidators(final ProtocolSchedule protocolSchedule) { List retval = super.createPeerValidators(protocolSchedule); - final OptionalLong powTerminalBlockNumber = - configOptionsSupplier.get().getTerminalBlockNumber(); - final Optional powTerminalBlockHash = configOptionsSupplier.get().getTerminalBlockHash(); + final OptionalLong powTerminalBlockNumber = genesisConfigOptions.getTerminalBlockNumber(); + final Optional powTerminalBlockHash = genesisConfigOptions.getTerminalBlockHash(); if (powTerminalBlockHash.isPresent() && powTerminalBlockNumber.isPresent()) { retval.add( new RequiredBlocksPeerValidator( diff --git a/besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java index 747949aac12..3c5b87df591 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java @@ -120,9 +120,9 @@ protected Supplier bftExtraDataCodec() { @Override protected void prepForBuild() { - qbftConfig = configOptionsSupplier.get().getQbftConfigOptions(); + qbftConfig = genesisConfigOptions.getQbftConfigOptions(); bftEventQueue = new BftEventQueue(qbftConfig.getMessageQueueLimit()); - qbftForksSchedule = QbftForksSchedulesFactory.create(configOptionsSupplier.get()); + qbftForksSchedule = QbftForksSchedulesFactory.create(genesisConfigOptions); } @Override @@ -320,7 +320,7 @@ protected PluginServiceFactory createAdditionalPluginServices( @Override protected ProtocolSchedule createProtocolSchedule() { return QbftProtocolScheduleBuilder.create( - configOptionsSupplier.get(), + genesisConfigOptions, qbftForksSchedule, privacyParameters, isRevertReasonEnabled, @@ -355,7 +355,7 @@ private boolean usingValidatorBlockHeaderModeButNoSignersIn( } private boolean isValidatorContractMode() { - return configOptionsSupplier.get().getQbftConfigOptions().isValidatorContractMode(); + return genesisConfigOptions.getQbftConfigOptions().isValidatorContractMode(); } private boolean signersExistIn(final BlockHeader genesisBlockHeader) { @@ -370,7 +370,7 @@ protected BftContext createConsensusContext( final EpochManager epochManager = new EpochManager(qbftConfig.getEpochLength()); final BftValidatorOverrides validatorOverrides = - convertBftForks(configOptionsSupplier.get().getTransitions().getQbftForks()); + convertBftForks(genesisConfigOptions.getTransitions().getQbftForks()); final BlockValidatorProvider blockValidatorProvider = BlockValidatorProvider.forkingValidatorProvider( blockchain, epochManager, bftBlockInterface().get(), validatorOverrides); diff --git a/besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java index dab6ff55790..a2f52c90ee4 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java @@ -15,7 +15,6 @@ package org.hyperledger.besu.controller; import org.hyperledger.besu.config.GenesisConfigFile; -import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.consensus.merge.MergeContext; import org.hyperledger.besu.consensus.merge.PostMergeContext; import org.hyperledger.besu.consensus.merge.TransitionBackwardSyncContext; @@ -232,9 +231,8 @@ protected Synchronizer createSynchronizer( syncState, ethProtocolManager, pivotBlockSelector); - final GenesisConfigOptions maybeForTTD = configOptionsSupplier.get(); - if (maybeForTTD.getTerminalTotalDifficulty().isPresent()) { + if (genesisConfigOptions.getTerminalTotalDifficulty().isPresent()) { LOG.info( "TTD present, creating DefaultSynchronizer that stops propagating after finalization"); protocolContext @@ -383,13 +381,6 @@ public BesuControllerBuilder isRevertReasonEnabled(final boolean isRevertReasonE return propagateConfig(z -> z.isRevertReasonEnabled(isRevertReasonEnabled)); } - @Override - public BesuControllerBuilder genesisConfigOverrides( - final Map genesisConfigOverrides) { - super.genesisConfigOverrides(genesisConfigOverrides); - return propagateConfig(z -> z.genesisConfigOverrides(genesisConfigOverrides)); - } - @Override public BesuControllerBuilder gasLimitCalculator(final GasLimitCalculator gasLimitCalculator) { super.gasLimitCalculator(gasLimitCalculator); diff --git a/besu/src/test/java/org/hyperledger/besu/PrivacyReorgTest.java b/besu/src/test/java/org/hyperledger/besu/PrivacyReorgTest.java index 4f1b31c76b6..ceb0be40fe6 100644 --- a/besu/src/test/java/org/hyperledger/besu/PrivacyReorgTest.java +++ b/besu/src/test/java/org/hyperledger/besu/PrivacyReorgTest.java @@ -180,9 +180,8 @@ public void setUp() throws IOException { besuController = new BesuController.Builder() - .fromGenesisConfig( - GenesisConfigFile.genesisFileFromResources("/privacy_reorg_genesis.json"), - SyncMode.FULL) + .fromGenesisFile( + GenesisConfigFile.fromResource("/privacy_reorg_genesis.json"), SyncMode.FULL) .synchronizerConfiguration(SynchronizerConfiguration.builder().build()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .storageProvider(new InMemoryKeyValueStorageProvider()) diff --git a/besu/src/test/java/org/hyperledger/besu/PrivacyTest.java b/besu/src/test/java/org/hyperledger/besu/PrivacyTest.java index 44730b43ee5..7a4f05ad7fa 100644 --- a/besu/src/test/java/org/hyperledger/besu/PrivacyTest.java +++ b/besu/src/test/java/org/hyperledger/besu/PrivacyTest.java @@ -22,7 +22,8 @@ import static org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions.DEFAULT_IS_HIGH_SPEC; import static org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions.DEFAULT_MAX_OPEN_FILES; -import org.hyperledger.besu.config.GenesisConfigFile; +import org.hyperledger.besu.cli.config.EthNetworkConfig; +import org.hyperledger.besu.cli.config.NetworkName; import org.hyperledger.besu.controller.BesuController; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.datatypes.Address; @@ -111,7 +112,7 @@ private BesuController setUpControllerWithPrivacyEnabled(final boolean flexibleE .setFlexiblePrivacyGroupsEnabled(flexibleEnabled) .build(); return new BesuController.Builder() - .fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FULL) + .fromEthNetworkConfig(EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET), SyncMode.FULL) .synchronizerConfiguration(SynchronizerConfiguration.builder().build()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .storageProvider(new InMemoryKeyValueStorageProvider()) diff --git a/besu/src/test/java/org/hyperledger/besu/RunnerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/RunnerBuilderTest.java index cbd18961ad4..c1770640801 100644 --- a/besu/src/test/java/org/hyperledger/besu/RunnerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/RunnerBuilderTest.java @@ -246,7 +246,7 @@ public void whenEngineApiAddedListensOnDefaultPort() { final JsonRpcConfiguration engine = JsonRpcConfiguration.createEngineDefault(); engine.setEnabled(true); final EthNetworkConfig mockMainnet = mock(EthNetworkConfig.class); - when(mockMainnet.getNetworkId()).thenReturn(BigInteger.ONE); + when(mockMainnet.networkId()).thenReturn(BigInteger.ONE); MergeConfigOptions.setMergeEnabled(true); when(besuController.getMiningCoordinator()).thenReturn(mock(MergeMiningCoordinator.class)); @@ -287,7 +287,7 @@ public void whenEngineApiAddedWebSocketReadyOnSamePort() { final WebSocketConfiguration wsRpc = WebSocketConfiguration.createDefault(); wsRpc.setEnabled(true); final EthNetworkConfig mockMainnet = mock(EthNetworkConfig.class); - when(mockMainnet.getNetworkId()).thenReturn(BigInteger.ONE); + when(mockMainnet.networkId()).thenReturn(BigInteger.ONE); MergeConfigOptions.setMergeEnabled(true); when(besuController.getMiningCoordinator()).thenReturn(mock(MergeMiningCoordinator.class)); final JsonRpcConfiguration engineConf = JsonRpcConfiguration.createEngineDefault(); @@ -329,7 +329,7 @@ public void whenEngineApiAddedEthSubscribeAvailable() { final WebSocketConfiguration wsRpc = WebSocketConfiguration.createDefault(); wsRpc.setEnabled(true); final EthNetworkConfig mockMainnet = mock(EthNetworkConfig.class); - when(mockMainnet.getNetworkId()).thenReturn(BigInteger.ONE); + when(mockMainnet.networkId()).thenReturn(BigInteger.ONE); MergeConfigOptions.setMergeEnabled(true); when(besuController.getMiningCoordinator()).thenReturn(mock(MergeMiningCoordinator.class)); final JsonRpcConfiguration engineConf = JsonRpcConfiguration.createEngineDefault(); @@ -376,7 +376,7 @@ public void noEngineApiNoServiceForMethods() { final WebSocketConfiguration defaultWebSockConfig = WebSocketConfiguration.createDefault(); defaultWebSockConfig.setEnabled(true); final EthNetworkConfig mockMainnet = mock(EthNetworkConfig.class); - when(mockMainnet.getNetworkId()).thenReturn(BigInteger.ONE); + when(mockMainnet.networkId()).thenReturn(BigInteger.ONE); MergeConfigOptions.setMergeEnabled(true); final Runner runner = diff --git a/besu/src/test/java/org/hyperledger/besu/RunnerTest.java b/besu/src/test/java/org/hyperledger/besu/RunnerTest.java index 55cdee554bd..f0125174d27 100644 --- a/besu/src/test/java/org/hyperledger/besu/RunnerTest.java +++ b/besu/src/test/java/org/hyperledger/besu/RunnerTest.java @@ -17,6 +17,7 @@ import static java.util.Collections.emptySet; import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.cli.config.NetworkName.DEV; +import static org.hyperledger.besu.cli.config.NetworkName.MAINNET; import static org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions.DEFAULT_BACKGROUND_THREAD_COUNT; import static org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions.DEFAULT_CACHE_CAPACITY; import static org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions.DEFAULT_IS_HIGH_SPEC; @@ -85,6 +86,7 @@ import java.util.Optional; import java.util.concurrent.TimeUnit; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import io.vertx.core.Future; import io.vertx.core.Promise; @@ -242,7 +244,7 @@ private void syncFromGenesis(final SyncMode mode, final GenesisConfigFile genesi final EnodeURL aheadEnode = runnerAhead.getLocalEnode().get(); final EthNetworkConfig behindEthNetworkConfiguration = new EthNetworkConfig( - EthNetworkConfig.jsonConfig(DEV), + GenesisConfigFile.fromResource(DEV.getGenesisFile()), DEV.getNetworkId(), Collections.singletonList(aheadEnode), null); @@ -367,8 +369,11 @@ private Request getRequest(final String method, final String baseUrl) { .build(); } - private GenesisConfigFile getFastSyncGenesis() { - final ObjectNode jsonNode = GenesisConfigFile.mainnetJsonNode(); + private GenesisConfigFile getFastSyncGenesis() throws IOException { + final ObjectNode jsonNode = + (ObjectNode) + new ObjectMapper() + .readTree(GenesisConfigFile.class.getResource(MAINNET.getGenesisFile())); final Optional configNode = JsonUtil.getObjectNode(jsonNode, "config"); configNode.ifPresent( (node) -> { diff --git a/besu/src/test/java/org/hyperledger/besu/chainexport/RlpBlockExporterTest.java b/besu/src/test/java/org/hyperledger/besu/chainexport/RlpBlockExporterTest.java index faa6bd34b95..05057f15c83 100644 --- a/besu/src/test/java/org/hyperledger/besu/chainexport/RlpBlockExporterTest.java +++ b/besu/src/test/java/org/hyperledger/besu/chainexport/RlpBlockExporterTest.java @@ -18,7 +18,8 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import org.hyperledger.besu.chainimport.RlpBlockImporter; -import org.hyperledger.besu.config.GenesisConfigFile; +import org.hyperledger.besu.cli.config.EthNetworkConfig; +import org.hyperledger.besu.cli.config.NetworkName; import org.hyperledger.besu.controller.BesuController; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.ethereum.GasLimitCalculator; @@ -86,7 +87,7 @@ private static Blockchain importBlocks(final BesuController controller, final Pa private static BesuController createController(final @TempDir Path dataDir) throws IOException { return new BesuController.Builder() - .fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST) + .fromEthNetworkConfig(EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET), SyncMode.FAST) .synchronizerConfiguration(SynchronizerConfiguration.builder().build()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .storageProvider(new InMemoryKeyValueStorageProvider()) diff --git a/besu/src/test/java/org/hyperledger/besu/chainimport/JsonBlockImporterTest.java b/besu/src/test/java/org/hyperledger/besu/chainimport/JsonBlockImporterTest.java index dff42ef654a..522f268c576 100644 --- a/besu/src/test/java/org/hyperledger/besu/chainimport/JsonBlockImporterTest.java +++ b/besu/src/test/java/org/hyperledger/besu/chainimport/JsonBlockImporterTest.java @@ -434,7 +434,7 @@ protected BesuController createController() throws IOException { protected BesuController createController(final GenesisConfigFile genesisConfigFile) { return new BesuController.Builder() - .fromGenesisConfig(genesisConfigFile, SyncMode.FAST) + .fromGenesisFile(genesisConfigFile, SyncMode.FAST) .synchronizerConfiguration(SynchronizerConfiguration.builder().build()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .storageProvider(new InMemoryKeyValueStorageProvider()) diff --git a/besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java b/besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java index d65569535aa..e37b8a5fd08 100644 --- a/besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java +++ b/besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java @@ -17,7 +17,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import org.hyperledger.besu.config.GenesisConfigFile; +import org.hyperledger.besu.cli.config.EthNetworkConfig; +import org.hyperledger.besu.cli.config.NetworkName; import org.hyperledger.besu.config.MergeConfigOptions; import org.hyperledger.besu.controller.BesuController; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; @@ -60,7 +61,8 @@ public void blockImport() throws IOException { BlockTestUtil.write1000Blocks(source); final BesuController targetController = new BesuController.Builder() - .fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST) + .fromEthNetworkConfig( + EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET), SyncMode.FAST) .synchronizerConfiguration(SynchronizerConfiguration.builder().build()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .storageProvider(new InMemoryKeyValueStorageProvider()) @@ -92,7 +94,8 @@ public void blockImportRejectsBadPow() throws IOException { BlockTestUtil.writeBadPowBlocks(source); final BesuController targetController = new BesuController.Builder() - .fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST) + .fromEthNetworkConfig( + EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET), SyncMode.FAST) .synchronizerConfiguration(SynchronizerConfiguration.builder().build()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .storageProvider(new InMemoryKeyValueStorageProvider()) @@ -121,7 +124,8 @@ public void blockImportCanSkipPow() throws IOException { BlockTestUtil.writeBadPowBlocks(source); final BesuController targetController = new BesuController.Builder() - .fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST) + .fromEthNetworkConfig( + EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET), SyncMode.FAST) .synchronizerConfiguration(SynchronizerConfiguration.builder().build()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .storageProvider(new InMemoryKeyValueStorageProvider()) diff --git a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java index 82a69217863..4353fd7d5fe 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java @@ -205,7 +205,7 @@ public void callingBesuCommandWithoutOptionsMustSyncWithDefaultValues() { verify(mockRunnerBuilder) .ethNetworkConfig( new EthNetworkConfig( - EthNetworkConfig.jsonConfig(MAINNET), + GenesisConfigFile.fromResource(MAINNET.getGenesisFile()), MAINNET.getNetworkId(), MAINNET_BOOTSTRAP_NODES, MAINNET_DISCOVERY_URL)); @@ -220,8 +220,7 @@ public void callingBesuCommandWithoutOptionsMustSyncWithDefaultValues() { verify(mockRunnerBuilder).apiConfiguration(DEFAULT_API_CONFIGURATION); verify(mockRunnerBuilder).build(); - verify(mockControllerBuilderFactory) - .fromEthNetworkConfig(ethNetworkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(ethNetworkArg.capture(), any()); final ArgumentCaptor miningArg = ArgumentCaptor.forClass(MiningParameters.class); verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture()); @@ -240,8 +239,8 @@ public void callingBesuCommandWithoutOptionsMustSyncWithDefaultValues() { assertThat(miningArg.getValue().getCoinbase()).isEqualTo(Optional.empty()); assertThat(miningArg.getValue().getMinTransactionGasPrice()).isEqualTo(Wei.of(1000)); assertThat(miningArg.getValue().getExtraData()).isEqualTo(Bytes.EMPTY); - assertThat(ethNetworkArg.getValue().getNetworkId()).isEqualTo(1); - assertThat(ethNetworkArg.getValue().getBootNodes()).isEqualTo(MAINNET_BOOTSTRAP_NODES); + assertThat(ethNetworkArg.getValue().networkId()).isEqualTo(1); + assertThat(ethNetworkArg.getValue().bootNodes()).isEqualTo(MAINNET_BOOTSTRAP_NODES); } // Testing each option @@ -299,7 +298,7 @@ public void callingWithNoBootnodesConfig() throws Exception { parseCommand("--config-file", toml.toAbsolutePath().toString()); verify(mockRunnerBuilder).ethNetworkConfig(ethNetworkConfigArgumentCaptor.capture()); - assertThat(ethNetworkConfigArgumentCaptor.getValue().getBootNodes()).isEmpty(); + assertThat(ethNetworkConfigArgumentCaptor.getValue().bootNodes()).isEmpty(); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); assertThat(commandOutput.toString(UTF_8)).isEmpty(); @@ -410,11 +409,11 @@ public void genesisPathOptionMustBeUsed() throws Exception { parseCommand("--genesis-file", genesisFile.toString()); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); - assertThat(networkArg.getValue().getGenesisConfig()) - .isEqualTo(encodeJsonGenesis(GENESIS_VALID_JSON)); + assertThat(networkArg.getValue().genesisConfigFile()) + .isEqualTo(GenesisConfigFile.fromConfig(encodeJsonGenesis(GENESIS_VALID_JSON))); assertThat(commandOutput.toString(UTF_8)).isEmpty(); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); @@ -429,29 +428,29 @@ public void testGenesisPathEthOptions() throws Exception { parseCommand("--genesis-file", genesisFile.toString()); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getBootNodes()).isEmpty(); - assertThat(config.getDnsDiscoveryUrl()).isNull(); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(3141592)); + assertThat(config.bootNodes()).isEmpty(); + assertThat(config.dnsDiscoveryUrl()).isNull(); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(3141592)); } @Test - public void testGenesisPathMainnetEthConfig() throws Exception { + public void testGenesisPathMainnetEthConfig() { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); parseCommand("--network", "mainnet"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getBootNodes()).isEqualTo(MAINNET_BOOTSTRAP_NODES); - assertThat(config.getDnsDiscoveryUrl()).isEqualTo(MAINNET_DISCOVERY_URL); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(1)); + assertThat(config.bootNodes()).isEqualTo(MAINNET_BOOTSTRAP_NODES); + assertThat(config.dnsDiscoveryUrl()).isEqualTo(MAINNET_DISCOVERY_URL); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(1)); verify(mockLogger, never()).warn(contains("Mainnet is deprecated and will be shutdown")); } @@ -463,13 +462,13 @@ public void testGenesisPathGoerliEthConfig() { parseCommand("--network", "goerli"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getBootNodes()).isEqualTo(GOERLI_BOOTSTRAP_NODES); - assertThat(config.getDnsDiscoveryUrl()).isEqualTo(GOERLI_DISCOVERY_URL); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(5)); + assertThat(config.bootNodes()).isEqualTo(GOERLI_BOOTSTRAP_NODES); + assertThat(config.dnsDiscoveryUrl()).isEqualTo(GOERLI_DISCOVERY_URL); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(5)); } @Test @@ -479,13 +478,13 @@ public void testGenesisPathFutureEipsEthConfig() { parseCommand("--network", "future_eips"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getBootNodes()).isEmpty(); - assertThat(config.getDnsDiscoveryUrl()).isNull(); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(2022)); + assertThat(config.bootNodes()).isEmpty(); + assertThat(config.dnsDiscoveryUrl()).isNull(); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(2022)); } @Test @@ -495,13 +494,13 @@ public void testGenesisPathExperimentalEipsEthConfig() { parseCommand("--network", "experimental_eips"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getBootNodes()).isEmpty(); - assertThat(config.getDnsDiscoveryUrl()).isNull(); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(2023)); + assertThat(config.bootNodes()).isEmpty(); + assertThat(config.dnsDiscoveryUrl()).isNull(); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(2023)); } @Test @@ -518,7 +517,7 @@ public void genesisAndNetworkMustNotBeUsedTogether() throws Exception { } @Test - public void nonExistentGenesisGivesError() throws Exception { + public void nonExistentGenesisGivesError() { final String nonExistentGenesis = "non-existent-genesis.json"; parseCommand("--genesis-file", nonExistentGenesis); @@ -530,7 +529,7 @@ public void nonExistentGenesisGivesError() throws Exception { } @Test - public void testDnsDiscoveryUrlEthConfig() throws Exception { + public void testDnsDiscoveryUrlEthConfig() { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); @@ -538,17 +537,17 @@ public void testDnsDiscoveryUrlEthConfig() throws Exception { "--discovery-dns-url", "enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getDnsDiscoveryUrl()) + assertThat(config.dnsDiscoveryUrl()) .isEqualTo( "enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org"); } @Test - public void testDnsDiscoveryUrlOverridesNetworkEthConfig() throws Exception { + public void testDnsDiscoveryUrlOverridesNetworkEthConfig() { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); @@ -558,11 +557,11 @@ public void testDnsDiscoveryUrlOverridesNetworkEthConfig() throws Exception { "--discovery-dns-url", "enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getDnsDiscoveryUrl()) + assertThat(config.dnsDiscoveryUrl()) .isEqualTo( "enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org"); } @@ -576,13 +575,13 @@ public void defaultNetworkIdAndBootnodesForCustomNetworkOptions() throws Excepti final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); - assertThat(networkArg.getValue().getGenesisConfig()) - .isEqualTo(encodeJsonGenesis(GENESIS_VALID_JSON)); - assertThat(networkArg.getValue().getBootNodes()).isEmpty(); - assertThat(networkArg.getValue().getNetworkId()).isEqualTo(GENESIS_CONFIG_TEST_CHAINID); + assertThat(networkArg.getValue().genesisConfigFile()) + .isEqualTo(GenesisConfigFile.fromConfig(encodeJsonGenesis(GENESIS_VALID_JSON))); + assertThat(networkArg.getValue().bootNodes()).isEmpty(); + assertThat(networkArg.getValue().networkId()).isEqualTo(GENESIS_CONFIG_TEST_CHAINID); assertThat(commandOutput.toString(UTF_8)).isEmpty(); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); @@ -597,11 +596,11 @@ public void defaultNetworkIdForInvalidGenesisMustBeMainnetNetworkId() throws Exc final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); - assertThat(networkArg.getValue().getGenesisConfig()) - .isEqualTo(encodeJsonGenesis(GENESIS_INVALID_DATA)); + assertThat(networkArg.getValue().genesisConfigFile()) + .isEqualTo(GenesisConfigFile.fromConfig(encodeJsonGenesis(GENESIS_INVALID_DATA))); assertThat(commandOutput.toString(UTF_8)).isEmpty(); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); @@ -614,11 +613,11 @@ public void predefinedNetworkIdsMustBeEqualToChainIds() { // id // in this network genesis file. - final GenesisConfigFile genesisConfigFile = - GenesisConfigFile.fromConfig(EthNetworkConfig.getNetworkConfig(MAINNET).getGenesisConfig()); - assertThat(genesisConfigFile.getConfigOptions().getChainId().isPresent()).isTrue(); - assertThat(genesisConfigFile.getConfigOptions().getChainId().get()) - .isEqualTo(EthNetworkConfig.getNetworkConfig(MAINNET).getNetworkId()); + final var genesisConfig = + EthNetworkConfig.getNetworkConfig(MAINNET).genesisConfigFile().getConfigOptions(); + assertThat(genesisConfig.getChainId().isPresent()).isTrue(); + assertThat(genesisConfig.getChainId().get()) + .isEqualTo(EthNetworkConfig.getNetworkConfig(MAINNET).networkId()); } @Test @@ -755,13 +754,13 @@ public void loadDiscoveryOptionsFromGenesisFile() throws IOException { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getDnsDiscoveryUrl()).isEqualTo(DNS_DISCOVERY_URL); + assertThat(config.dnsDiscoveryUrl()).isEqualTo(DNS_DISCOVERY_URL); - assertThat(config.getBootNodes()) + assertThat(config.bootNodes()) .extracting(bootnode -> bootnode.toURI().toString()) .containsExactly(VALID_ENODE_STRINGS); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); @@ -777,11 +776,11 @@ public void discoveryDnsUrlCliArgTakesPrecedenceOverGenesisFile() throws IOExcep final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getDnsDiscoveryUrl()).isEqualTo(discoveryDnsUrlCliArg); + assertThat(config.dnsDiscoveryUrl()).isEqualTo(discoveryDnsUrlCliArg); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); } @@ -796,11 +795,11 @@ public void bootnodesUrlCliArgTakesPrecedenceOverGenesisFile() throws IOExceptio final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getBootNodes()).extracting(EnodeURL::toURI).containsExactly(bootnode); + assertThat(config.bootNodes()).extracting(EnodeURL::toURI).containsExactly(bootnode); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); } @@ -812,7 +811,7 @@ public void callingWithBootnodesOptionButNoValueMustPassEmptyBootnodeList() { verify(mockRunnerBuilder).ethNetworkConfig(ethNetworkConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).build(); - assertThat(ethNetworkConfigArgumentCaptor.getValue().getBootNodes()).isEmpty(); + assertThat(ethNetworkConfigArgumentCaptor.getValue().bootNodes()).isEmpty(); assertThat(commandOutput.toString(UTF_8)).isEmpty(); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); @@ -882,7 +881,7 @@ public void bootnodesOptionMustBeUsed() { verify(mockRunnerBuilder).ethNetworkConfig(ethNetworkConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).build(); - assertThat(ethNetworkConfigArgumentCaptor.getValue().getBootNodes()) + assertThat(ethNetworkConfigArgumentCaptor.getValue().bootNodes()) .isEqualTo( Stream.of(VALID_ENODE_STRINGS) .map(EnodeURLImpl::fromString) @@ -1614,13 +1613,13 @@ public void colorCanBeEnabledOrDisabledExplicitly() { } @Test - public void devModeOptionMustBeUsed() throws Exception { + public void devModeOptionMustBeUsed() { parseCommand("--network", "dev"); final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(DEV)); @@ -1636,7 +1635,7 @@ public void goerliValuesAreUsed() { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(GOERLI)); @@ -1654,7 +1653,7 @@ public void futureEipsValuesAreUsed() { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(FUTURE_EIPS)); @@ -1670,7 +1669,7 @@ public void experimentalEipsValuesAreUsed() { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); assertThat(networkArg.getValue()) @@ -1687,7 +1686,7 @@ public void sepoliaValuesAreUsed() { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(SEPOLIA)); @@ -1705,7 +1704,7 @@ public void holeskyValuesAreUsed() { final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(HOLESKY)); @@ -1717,13 +1716,13 @@ public void holeskyValuesAreUsed() { } @Test - public void classicValuesAreUsed() throws Exception { + public void classicValuesAreUsed() { parseCommand("--network", "classic"); final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(CLASSIC)); @@ -1733,13 +1732,13 @@ public void classicValuesAreUsed() throws Exception { } @Test - public void mordorValuesAreUsed() throws Exception { + public void mordorValuesAreUsed() { parseCommand("--network", "mordor"); final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(MORDOR)); @@ -1749,36 +1748,36 @@ public void mordorValuesAreUsed() throws Exception { } @Test - public void goerliValuesCanBeOverridden() throws Exception { + public void goerliValuesCanBeOverridden() { networkValuesCanBeOverridden("goerli"); } @Test - public void futureEipsValuesCanBeOverridden() throws Exception { + public void futureEipsValuesCanBeOverridden() { networkValuesCanBeOverridden("future_eips"); } @Test - public void experimentalEipsValuesCanBeOverridden() throws Exception { + public void experimentalEipsValuesCanBeOverridden() { networkValuesCanBeOverridden("experimental_eips"); } @Test - public void devValuesCanBeOverridden() throws Exception { + public void devValuesCanBeOverridden() { networkValuesCanBeOverridden("dev"); } @Test - public void classicValuesCanBeOverridden() throws Exception { + public void classicValuesCanBeOverridden() { networkValuesCanBeOverridden("classic"); } @Test - public void mordorValuesCanBeOverridden() throws Exception { + public void mordorValuesCanBeOverridden() { networkValuesCanBeOverridden("mordor"); } - private void networkValuesCanBeOverridden(final String network) throws Exception { + private void networkValuesCanBeOverridden(final String network) { parseCommand( "--network", network, @@ -1790,15 +1789,15 @@ private void networkValuesCanBeOverridden(final String network) throws Exception final ArgumentCaptor networkArg = ArgumentCaptor.forClass(EthNetworkConfig.class); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); - assertThat(networkArg.getValue().getBootNodes()) + assertThat(networkArg.getValue().bootNodes()) .isEqualTo( Stream.of(VALID_ENODE_STRINGS) .map(EnodeURLImpl::fromString) .collect(Collectors.toList())); - assertThat(networkArg.getValue().getNetworkId()).isEqualTo(1234567); + assertThat(networkArg.getValue().networkId()).isEqualTo(1234567); assertThat(commandOutput.toString(UTF_8)).isEmpty(); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); @@ -2385,7 +2384,7 @@ public void genesisStateHashCacheEnabledShouldWork() throws IOException { parseCommand( "--genesis-file", genesisFile.toString(), "--genesis-state-hash-cache-enabled=true"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); verify(mockControllerBuilder).genesisStateHashCacheEnabled(eq(true)); diff --git a/besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java b/besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java index 3cc421440f8..c2e26344a0b 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java @@ -28,6 +28,7 @@ import static org.mockito.Mockito.verify; import org.hyperledger.besu.cli.config.EthNetworkConfig; +import org.hyperledger.besu.config.GenesisConfigFile; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration; @@ -122,17 +123,18 @@ public void overrideDefaultValuesIfKeyIsPresentInConfigFile(final @TempDir File EnodeURLImpl.fromString("enode://" + VALID_NODE_ID + "@192.168.0.1:4567"), EnodeURLImpl.fromString("enode://" + VALID_NODE_ID + "@192.168.0.1:4567"), EnodeURLImpl.fromString("enode://" + VALID_NODE_ID + "@192.168.0.1:4567")); - assertThat(ethNetworkConfigArgumentCaptor.getValue().getBootNodes()).isEqualTo(nodes); + assertThat(ethNetworkConfigArgumentCaptor.getValue().bootNodes()).isEqualTo(nodes); final EthNetworkConfig networkConfig = new EthNetworkConfig.Builder(EthNetworkConfig.getNetworkConfig(MAINNET)) .setNetworkId(BigInteger.valueOf(42)) - .setGenesisConfig(encodeJsonGenesis(GENESIS_VALID_JSON)) + .setGenesisConfigFile( + GenesisConfigFile.fromConfig(encodeJsonGenesis(GENESIS_VALID_JSON))) .setBootNodes(nodes) .setDnsDiscoveryUrl(null) .build(); verify(mockControllerBuilder).dataDirectory(eq(dataFolder.toPath())); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(eq(networkConfig), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(eq(networkConfig), any()); verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture()); assertThat(syncConfigurationCaptor.getValue().getSyncMode()).isEqualTo(SyncMode.FAST); @@ -164,7 +166,7 @@ public void noOverrideDefaultValuesIfKeyIsNotPresentInConfigFile() { verify(mockRunnerBuilder) .ethNetworkConfig( new EthNetworkConfig( - EthNetworkConfig.jsonConfig(MAINNET), + GenesisConfigFile.fromResource(MAINNET.getGenesisFile()), MAINNET.getNetworkId(), MAINNET_BOOTSTRAP_NODES, MAINNET_DISCOVERY_URL)); @@ -234,11 +236,11 @@ public void profileOptionShouldSetCorrectDefaults() { ArgumentCaptor.forClass(EthNetworkConfig.class); parseCommand("--profile", "dev"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getNetworkId()).isEqualTo(DEV.getNetworkId()); + assertThat(config.networkId()).isEqualTo(DEV.getNetworkId()); } /** @@ -252,11 +254,11 @@ public void cliOptionOverridesProfileConfiguration() { ArgumentCaptor.forClass(EthNetworkConfig.class); parseCommand("--profile", "dev", "--network", "MAINNET"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getNetworkId()).isEqualTo(MAINNET.getNetworkId()); + assertThat(config.networkId()).isEqualTo(MAINNET.getNetworkId()); } /** @@ -271,11 +273,11 @@ public void configFileOverridesProfileConfiguration() { final String configFile = this.getClass().getResource("/partial_config.toml").getFile(); parseCommand("--profile", "dev", "--config-file", configFile); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getNetworkId()).isEqualTo(MAINNET.getNetworkId()); + assertThat(config.networkId()).isEqualTo(MAINNET.getNetworkId()); } /** @@ -289,10 +291,10 @@ public void environmentVariableOverridesProfileConfiguration() { ArgumentCaptor.forClass(EthNetworkConfig.class); setEnvironmentVariable("BESU_NETWORK", "MAINNET"); parseCommand("--profile", "dev"); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any(), any()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any()); verify(mockControllerBuilder).build(); final EthNetworkConfig config = networkArg.getValue(); - assertThat(config.getNetworkId()).isEqualTo(MAINNET.getNetworkId()); + assertThat(config.networkId()).isEqualTo(MAINNET.getNetworkId()); } } diff --git a/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java b/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java index deef4f648ca..5216db7036b 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java @@ -266,7 +266,7 @@ public void initMocks() throws Exception { // doReturn used because of generic BesuController doReturn(mockControllerBuilder) .when(mockControllerBuilderFactory) - .fromEthNetworkConfig(any(), any(), any()); + .fromEthNetworkConfig(any(), any()); when(mockControllerBuilder.synchronizerConfiguration(any())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.ethProtocolConfiguration(any())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.transactionPoolConfiguration(any())) @@ -283,7 +283,6 @@ public void initMocks() throws Exception { when(mockControllerBuilder.clock(any())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.isRevertReasonEnabled(false)).thenReturn(mockControllerBuilder); when(mockControllerBuilder.storageProvider(any())).thenReturn(mockControllerBuilder); - when(mockControllerBuilder.genesisConfigOverrides(any())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.gasLimitCalculator(any())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.requiredBlocks(any())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.reorgLoggingThreshold(anyLong())).thenReturn(mockControllerBuilder); @@ -590,8 +589,8 @@ protected Vertx createVertx(final VertxOptions vertxOptions) { } @Override - public GenesisConfigOptions getActualGenesisConfigOptions() { - return super.getActualGenesisConfigOptions(); + public GenesisConfigOptions getGenesisConfigOptions() { + return super.getGenesisConfigOptions(); } public CommandSpec getSpec() { diff --git a/besu/src/test/java/org/hyperledger/besu/cli/config/EthNetworkConfigTest.java b/besu/src/test/java/org/hyperledger/besu/cli/config/EthNetworkConfigTest.java index 3bddc7724bc..75a1bc698ce 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/config/EthNetworkConfigTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/config/EthNetworkConfigTest.java @@ -21,6 +21,8 @@ import static org.hyperledger.besu.ethereum.p2p.config.DefaultDiscoveryConfiguration.MAINNET_BOOTSTRAP_NODES; import static org.hyperledger.besu.ethereum.p2p.config.DefaultDiscoveryConfiguration.MAINNET_DISCOVERY_URL; +import org.hyperledger.besu.config.GenesisConfigFile; + import java.math.BigInteger; import org.junit.jupiter.api.Test; @@ -33,41 +35,41 @@ public class EthNetworkConfigTest { @Test public void testDefaultMainnetConfig() { EthNetworkConfig config = EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET); - assertThat(config.getDnsDiscoveryUrl()).isEqualTo(MAINNET_DISCOVERY_URL); - assertThat(config.getBootNodes()).isEqualTo(MAINNET_BOOTSTRAP_NODES); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.ONE); + assertThat(config.dnsDiscoveryUrl()).isEqualTo(MAINNET_DISCOVERY_URL); + assertThat(config.bootNodes()).isEqualTo(MAINNET_BOOTSTRAP_NODES); + assertThat(config.networkId()).isEqualTo(BigInteger.ONE); } @Test public void testDefaultGoerliConfig() { EthNetworkConfig config = EthNetworkConfig.getNetworkConfig(NetworkName.GOERLI); - assertThat(config.getDnsDiscoveryUrl()).isEqualTo(GOERLI_DISCOVERY_URL); - assertThat(config.getBootNodes()).isEqualTo(GOERLI_BOOTSTRAP_NODES); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(5)); + assertThat(config.dnsDiscoveryUrl()).isEqualTo(GOERLI_DISCOVERY_URL); + assertThat(config.bootNodes()).isEqualTo(GOERLI_BOOTSTRAP_NODES); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(5)); } @Test public void testDefaultDevConfig() { EthNetworkConfig config = EthNetworkConfig.getNetworkConfig(NetworkName.DEV); - assertThat(config.getDnsDiscoveryUrl()).isNull(); - assertThat(config.getBootNodes()).isEmpty(); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(2018)); + assertThat(config.dnsDiscoveryUrl()).isNull(); + assertThat(config.bootNodes()).isEmpty(); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(2018)); } @Test public void testDefaultFutureConfig() { EthNetworkConfig config = EthNetworkConfig.getNetworkConfig(NetworkName.FUTURE_EIPS); - assertThat(config.getDnsDiscoveryUrl()).isNull(); - assertThat(config.getBootNodes()).isEmpty(); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(2022)); + assertThat(config.dnsDiscoveryUrl()).isNull(); + assertThat(config.bootNodes()).isEmpty(); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(2022)); } @Test public void testDefaultExperimentalConfig() { EthNetworkConfig config = EthNetworkConfig.getNetworkConfig(NetworkName.EXPERIMENTAL_EIPS); - assertThat(config.getDnsDiscoveryUrl()).isNull(); - assertThat(config.getBootNodes()).isEmpty(); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(2023)); + assertThat(config.dnsDiscoveryUrl()).isNull(); + assertThat(config.bootNodes()).isEmpty(); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(2023)); } @Test @@ -75,11 +77,20 @@ public void testBuilderWithNetworkId() { EthNetworkConfig config = new EthNetworkConfig.Builder(EthNetworkConfig.getNetworkConfig(MAINNET)) .setNetworkId(BigInteger.valueOf(42)) - .setGenesisConfig("{\"config\":{\"chainId\":\"1234567\"}") + .setGenesisConfigFile( + GenesisConfigFile.fromConfig( + """ + { + "config":{ + "chainId":"1234567" + } + } + """)) .build(); - assertThat(config.getGenesisConfig()).isEqualTo("{\"config\":{\"chainId\":\"1234567\"}"); - assertThat(config.getDnsDiscoveryUrl()).isNotNull(); - assertThat(config.getBootNodes()).isNotEmpty(); - assertThat(config.getNetworkId()).isEqualTo(BigInteger.valueOf(42)); + assertThat(config.genesisConfigFile().getConfigOptions().getChainId()) + .contains(BigInteger.valueOf(1234567)); + assertThat(config.dnsDiscoveryUrl()).isNotNull(); + assertThat(config.bootNodes()).isNotEmpty(); + assertThat(config.networkId()).isEqualTo(BigInteger.valueOf(42)); } } diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java index e06d711be60..e32ff0e4630 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java @@ -426,7 +426,7 @@ protected String[] getNonOptionFields() { private MiningParameters runtimeConfiguration( final TestBesuCommand besuCommand, final MiningParameters miningParameters) { - if (besuCommand.getActualGenesisConfigOptions().isPoa()) { + if (besuCommand.getGenesisConfigOptions().isPoa()) { miningParameters.setBlockPeriodSeconds(POA_BLOCK_PERIOD_SECONDS); } return miningParameters; diff --git a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommandTest.java index 29f519f8911..f43d039b4a3 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommandTest.java @@ -497,6 +497,6 @@ public void blocksImportWithNoSyncModeDoesNotRaiseNPE(final @TempDir File fileTo parseCommand( BLOCK_SUBCOMMAND_NAME, BLOCK_IMPORT_SUBCOMMAND_NAME, "--from", fileToImport.getPath()); - verify(mockControllerBuilderFactory).fromEthNetworkConfig(any(), any(), isNotNull()); + verify(mockControllerBuilderFactory).fromEthNetworkConfig(any(), isNotNull()); } } diff --git a/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java index dfc843f083c..ee4799da965 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java @@ -138,7 +138,7 @@ public void setup() throws JsonProcessingException { .when(synchronizerConfiguration.getBlockPropagationRange()) .thenReturn(Range.closed(1L, 2L)); - setupBftGenesisConfigOptions(); + setupBftGenesisConfigFile(); bftBesuControllerBuilder = createBftControllerBuilder() @@ -160,7 +160,7 @@ public void setup() throws JsonProcessingException { .networkConfiguration(NetworkingConfiguration.create()); } - protected abstract void setupBftGenesisConfigOptions() throws JsonProcessingException; + protected abstract void setupBftGenesisConfigFile() throws JsonProcessingException; protected abstract BesuControllerBuilder createBftControllerBuilder(); diff --git a/besu/src/test/java/org/hyperledger/besu/controller/BesuControllerTest.java b/besu/src/test/java/org/hyperledger/besu/controller/BesuControllerTest.java index 69ee9c9bde4..94c68f7cbe2 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/BesuControllerTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/BesuControllerTest.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.fail; -import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.when; import org.hyperledger.besu.config.GenesisConfigFile; @@ -26,31 +26,33 @@ import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Collections; import java.util.Locale; import java.util.Map; import java.util.OptionalLong; -import com.google.common.io.Resources; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) public class BesuControllerTest { - @Spy private GenesisConfigFile genesisConfigFile = GenesisConfigFile.mainnet(); - @Mock private GenesisConfigOptions genesisConfigOptions; - @Mock private QbftConfigOptions qbftConfigOptions; + @Mock GenesisConfigFile genesisConfigFile; + @Mock GenesisConfigOptions genesisConfigOptions; + @Mock QbftConfigOptions qbftConfigOptions; + + @BeforeEach + public void setUp() { + lenient().when(genesisConfigFile.getConfigOptions()).thenReturn(genesisConfigOptions); + } @Test public void missingQbftStartBlock() { mockGenesisConfigForMigration("ibft2", OptionalLong.empty()); assertThatThrownBy( - () -> new BesuController.Builder().fromGenesisConfig(genesisConfigFile, SyncMode.FULL)) + () -> new BesuController.Builder().fromGenesisFile(genesisConfigFile, SyncMode.FULL)) .isInstanceOf(IllegalStateException.class) .hasMessage("Missing QBFT startBlock config in genesis file"); } @@ -59,19 +61,18 @@ public void missingQbftStartBlock() { public void invalidQbftStartBlock() { mockGenesisConfigForMigration("ibft2", OptionalLong.of(-1L)); assertThatThrownBy( - () -> new BesuController.Builder().fromGenesisConfig(genesisConfigFile, SyncMode.FULL)) + () -> new BesuController.Builder().fromGenesisFile(genesisConfigFile, SyncMode.FULL)) .isInstanceOf(IllegalStateException.class) .hasMessage("Invalid QBFT startBlock config in genesis file"); } @Test public void invalidConsensusCombination() { - when(genesisConfigFile.getConfigOptions(any())).thenReturn(genesisConfigOptions); when(genesisConfigOptions.isConsensusMigration()).thenReturn(true); // explicitly not setting isIbft2() for genesisConfigOptions assertThatThrownBy( - () -> new BesuController.Builder().fromGenesisConfig(genesisConfigFile, SyncMode.FULL)) + () -> new BesuController.Builder().fromGenesisFile(genesisConfigFile, SyncMode.FULL)) .isInstanceOf(IllegalStateException.class) .hasMessage( "Invalid genesis migration config. Migration is supported from IBFT (legacy) or IBFT2 to QBFT)"); @@ -83,7 +84,7 @@ public void createConsensusScheduleBesuControllerBuilderWhenMigratingFromIbft2To mockGenesisConfigForMigration("ibft2", OptionalLong.of(qbftStartBlock)); final BesuControllerBuilder besuControllerBuilder = - new BesuController.Builder().fromGenesisConfig(genesisConfigFile, SyncMode.FULL); + new BesuController.Builder().fromGenesisFile(genesisConfigFile, SyncMode.FULL); assertThat(besuControllerBuilder).isInstanceOf(ConsensusScheduleBesuControllerBuilder.class); @@ -99,7 +100,6 @@ public void createConsensusScheduleBesuControllerBuilderWhenMigratingFromIbft2To private void mockGenesisConfigForMigration( final String consensus, final OptionalLong startBlock) { - when(genesisConfigFile.getConfigOptions(any())).thenReturn(genesisConfigOptions); when(genesisConfigOptions.isConsensusMigration()).thenReturn(true); switch (consensus.toLowerCase(Locale.ROOT)) { @@ -117,16 +117,12 @@ private void mockGenesisConfigForMigration( } @Test - public void postMergeCheckpointSyncUsesMergeControllerBuilder() throws IOException { + public void postMergeCheckpointSyncUsesMergeControllerBuilder() { final GenesisConfigFile postMergeGenesisFile = - GenesisConfigFile.fromConfig( - Resources.toString( - Resources.getResource("valid_post_merge_near_head_checkpoint.json"), - StandardCharsets.UTF_8)); + GenesisConfigFile.fromResource("/valid_post_merge_near_head_checkpoint.json"); final BesuControllerBuilder besuControllerBuilder = - new BesuController.Builder() - .fromGenesisConfig(postMergeGenesisFile, Collections.emptyMap(), SyncMode.CHECKPOINT); + new BesuController.Builder().fromGenesisFile(postMergeGenesisFile, SyncMode.CHECKPOINT); assertThat(besuControllerBuilder).isInstanceOf(MergeBesuControllerBuilder.class); } @@ -135,15 +131,11 @@ public void postMergeCheckpointSyncUsesMergeControllerBuilder() throws IOExcepti public void postMergeCheckpointSyncWithTotalDifficultyEqualsTTDUsesTransitionControllerBuilder() throws IOException { final GenesisConfigFile mergeAtGenesisFile = - GenesisConfigFile.fromConfig( - Resources.toString( - Resources.getResource( - "invalid_post_merge_checkpoint_total_difficulty_same_as_TTD.json"), - StandardCharsets.UTF_8)); + GenesisConfigFile.fromResource( + "/invalid_post_merge_checkpoint_total_difficulty_same_as_TTD.json"); final BesuControllerBuilder besuControllerBuilder = - new BesuController.Builder() - .fromGenesisConfig(mergeAtGenesisFile, Collections.emptyMap(), SyncMode.CHECKPOINT); + new BesuController.Builder().fromGenesisFile(mergeAtGenesisFile, SyncMode.CHECKPOINT); assertThat(besuControllerBuilder).isInstanceOf(TransitionBesuControllerBuilder.class); } @@ -152,7 +144,7 @@ public void postMergeCheckpointSyncWithTotalDifficultyEqualsTTDUsesTransitionCon public void preMergeCheckpointSyncUsesTransitionControllerBuilder() { final BesuControllerBuilder besuControllerBuilder = new BesuController.Builder() - .fromGenesisConfig(genesisConfigFile, Collections.emptyMap(), SyncMode.CHECKPOINT); + .fromGenesisFile(GenesisConfigFile.mainnet(), SyncMode.CHECKPOINT); assertThat(besuControllerBuilder).isInstanceOf(TransitionBesuControllerBuilder.class); } @@ -160,8 +152,7 @@ public void preMergeCheckpointSyncUsesTransitionControllerBuilder() { @Test public void nonCheckpointSyncUsesTransitionControllerBuild() { final BesuControllerBuilder besuControllerBuilder = - new BesuController.Builder() - .fromGenesisConfig(genesisConfigFile, Collections.emptyMap(), SyncMode.SNAP); + new BesuController.Builder().fromGenesisFile(GenesisConfigFile.mainnet(), SyncMode.SNAP); assertThat(besuControllerBuilder).isInstanceOf(TransitionBesuControllerBuilder.class); } diff --git a/besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java index c410ac9ec55..12f36c9f6ec 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java @@ -17,7 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyMap; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -101,11 +100,11 @@ public void mustCreateCombinedProtocolScheduleUsingProtocolSchedulesOrderedByBlo final StubGenesisConfigOptions genesisConfigOptions = new StubGenesisConfigOptions(); genesisConfigOptions.chainId(BigInteger.TEN); - when(genesisConfigFile.getConfigOptions(anyMap())).thenReturn(genesisConfigOptions); final ConsensusScheduleBesuControllerBuilder consensusScheduleBesuControllerBuilder = new ConsensusScheduleBesuControllerBuilder( besuControllerBuilderSchedule, combinedProtocolScheduleFactory); + when(genesisConfigFile.getConfigOptions()).thenReturn(genesisConfigOptions); consensusScheduleBesuControllerBuilder.genesisConfigFile(genesisConfigFile); consensusScheduleBesuControllerBuilder.createProtocolSchedule(); diff --git a/besu/src/test/java/org/hyperledger/besu/controller/IbftBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/IbftBesuControllerBuilderTest.java index 63d2bba9c0c..055e136c8ca 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/IbftBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/IbftBesuControllerBuilderTest.java @@ -33,7 +33,7 @@ public class IbftBesuControllerBuilderTest extends AbstractBftBesuControllerBuilderTest { @Override - public void setupBftGenesisConfigOptions() throws JsonProcessingException { + public void setupBftGenesisConfigFile() throws JsonProcessingException { // Ibft prepForBuild setup lenient() diff --git a/besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java index 50f17fd8a61..1d3c6ad0113 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java @@ -45,7 +45,7 @@ public class QbftBesuControllerBuilderTest extends AbstractBftBesuControllerBuilderTest { @Override - public void setupBftGenesisConfigOptions() throws JsonProcessingException { + public void setupBftGenesisConfigFile() throws JsonProcessingException { // qbft prepForBuild setup lenient() diff --git a/besu/src/test/java/org/hyperledger/besu/util/LocalPermissioningConfigurationValidatorTest.java b/besu/src/test/java/org/hyperledger/besu/util/LocalPermissioningConfigurationValidatorTest.java index 84344c24918..6a39bd3b6b1 100644 --- a/besu/src/test/java/org/hyperledger/besu/util/LocalPermissioningConfigurationValidatorTest.java +++ b/besu/src/test/java/org/hyperledger/besu/util/LocalPermissioningConfigurationValidatorTest.java @@ -67,7 +67,7 @@ public void sepoliaWithNodesAllowlistOptionWhichDoesIncludeRopstenBootnodesMustN true, toml.toAbsolutePath().toString()); - final List enodeURIs = ethNetworkConfig.getBootNodes(); + final List enodeURIs = ethNetworkConfig.bootNodes(); PermissioningConfigurationValidator.areAllNodesInAllowlist( enodeURIs, permissioningConfiguration); } @@ -91,7 +91,7 @@ public void nodesAllowlistOptionWhichDoesNotIncludeBootnodesMustError() throws E toml.toAbsolutePath().toString()); try { - final List enodeURIs = ethNetworkConfig.getBootNodes(); + final List enodeURIs = ethNetworkConfig.bootNodes(); PermissioningConfigurationValidator.areAllNodesInAllowlist( enodeURIs, permissioningConfiguration); fail("expected exception because sepolia bootnodes are not in node-allowlist"); diff --git a/config/src/main/java/org/hyperledger/besu/config/GenesisConfigFile.java b/config/src/main/java/org/hyperledger/besu/config/GenesisConfigFile.java index 638d221e0ad..cf5a13d8558 100644 --- a/config/src/main/java/org/hyperledger/besu/config/GenesisConfigFile.java +++ b/config/src/main/java/org/hyperledger/besu/config/GenesisConfigFile.java @@ -14,23 +14,23 @@ */ package org.hyperledger.besu.config; -import static java.nio.charset.StandardCharsets.UTF_8; import static org.hyperledger.besu.config.JsonUtil.normalizeKeys; import org.hyperledger.besu.datatypes.Wei; -import java.io.IOException; +import java.net.URL; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; +import java.util.stream.Collectors; import java.util.stream.Stream; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.collect.Streams; -import com.google.common.io.Resources; /** The Genesis config file. */ public class GenesisConfigFile { @@ -42,10 +42,10 @@ public class GenesisConfigFile { /** The constant BASEFEE_AT_GENESIS_DEFAULT_VALUE. */ public static final Wei BASEFEE_AT_GENESIS_DEFAULT_VALUE = Wei.of(1_000_000_000L); - private final ObjectNode configRoot; + private final ObjectNode genesisRoot; private GenesisConfigFile(final ObjectNode config) { - this.configRoot = config; + this.genesisRoot = config; } /** @@ -54,46 +54,27 @@ private GenesisConfigFile(final ObjectNode config) { * @return the genesis config file */ public static GenesisConfigFile mainnet() { - return genesisFileFromResources("/mainnet.json"); + return fromSource(GenesisConfigFile.class.getResource("/mainnet.json")); } /** - * Mainnet json node object node. - * - * @return the object node - */ - public static ObjectNode mainnetJsonNode() { - try { - final String jsonString = - Resources.toString(GenesisConfigFile.class.getResource("/mainnet.json"), UTF_8); - return JsonUtil.objectNodeFromString(jsonString, false); - } catch (final IOException e) { - throw new IllegalStateException(e); - } - } - - /** - * Development genesis config file. + * Genesis file from URL. * + * @param jsonSource the URL * @return the genesis config file */ - public static GenesisConfigFile development() { - return genesisFileFromResources("/dev.json"); + public static GenesisConfigFile fromSource(final URL jsonSource) { + return fromConfig(JsonUtil.objectNodeFromURL(jsonSource, false)); } /** - * Genesis file from resources genesis config file. + * Genesis file from resource. * - * @param resourceName the resource name + * @param jsonResource the resource name * @return the genesis config file */ - public static GenesisConfigFile genesisFileFromResources(final String resourceName) { - try { - return fromConfig( - Resources.toString(GenesisConfigFile.class.getResource(resourceName), UTF_8)); - } catch (final IOException e) { - throw new IllegalStateException(e); - } + public static GenesisConfigFile fromResource(final String jsonResource) { + return fromSource(GenesisConfigFile.class.getResource(jsonResource)); } /** @@ -133,7 +114,7 @@ public GenesisConfigOptions getConfigOptions() { */ public GenesisConfigOptions getConfigOptions(final Map overrides) { final ObjectNode config = - JsonUtil.getObjectNode(configRoot, "config").orElse(JsonUtil.createEmptyObjectNode()); + JsonUtil.getObjectNode(genesisRoot, "config").orElse(JsonUtil.createEmptyObjectNode()); Map overridesRef = overrides; @@ -154,7 +135,7 @@ public GenesisConfigOptions getConfigOptions(final Map overrides * @return the stream */ public Stream streamAllocations() { - return JsonUtil.getObjectNode(configRoot, "alloc").stream() + return JsonUtil.getObjectNode(genesisRoot, "alloc").stream() .flatMap( allocations -> Streams.stream(allocations.fieldNames()) @@ -170,7 +151,7 @@ public Stream streamAllocations() { * @return the parent hash */ public String getParentHash() { - return JsonUtil.getString(configRoot, "parenthash", ""); + return JsonUtil.getString(genesisRoot, "parenthash", ""); } /** @@ -188,7 +169,7 @@ public String getDifficulty() { * @return the extra data */ public String getExtraData() { - return JsonUtil.getString(configRoot, "extradata", ""); + return JsonUtil.getString(genesisRoot, "extradata", ""); } /** @@ -206,7 +187,7 @@ public long getGasLimit() { * @return the base fee per gas */ public Optional getBaseFeePerGas() { - return JsonUtil.getString(configRoot, "basefeepergas") + return JsonUtil.getString(genesisRoot, "basefeepergas") .map(baseFeeStr -> Wei.of(parseLong("baseFeePerGas", baseFeeStr))); } @@ -235,7 +216,7 @@ public Optional getGenesisBaseFeePerGas() { * @return the mix hash */ public String getMixHash() { - return JsonUtil.getString(configRoot, "mixhash", ""); + return JsonUtil.getString(genesisRoot, "mixhash", ""); } /** @@ -244,7 +225,7 @@ public String getMixHash() { * @return the nonce */ public String getNonce() { - return JsonUtil.getValueAsString(configRoot, "nonce", "0x0"); + return JsonUtil.getValueAsString(genesisRoot, "nonce", "0x0"); } /** @@ -253,7 +234,7 @@ public String getNonce() { * @return the excess blob gas */ public String getExcessBlobGas() { - return JsonUtil.getValueAsString(configRoot, "excessblobgas", "0x0"); + return JsonUtil.getValueAsString(genesisRoot, "excessblobgas", "0x0"); } /** @@ -262,7 +243,7 @@ public String getExcessBlobGas() { * @return the blob gas used */ public String getBlobGasUsed() { - return JsonUtil.getValueAsString(configRoot, "blobgasused", "0x0"); + return JsonUtil.getValueAsString(genesisRoot, "blobgasused", "0x0"); } /** @@ -272,7 +253,7 @@ public String getBlobGasUsed() { */ public String getParentBeaconBlockRoot() { return JsonUtil.getValueAsString( - configRoot, + genesisRoot, "parentbeaconblockroot", "0x0000000000000000000000000000000000000000000000000000000000000000"); } @@ -283,7 +264,7 @@ public String getParentBeaconBlockRoot() { * @return the coinbase */ public Optional getCoinbase() { - return JsonUtil.getString(configRoot, "coinbase"); + return JsonUtil.getString(genesisRoot, "coinbase"); } /** @@ -292,7 +273,7 @@ public Optional getCoinbase() { * @return the timestamp */ public long getTimestamp() { - return parseLong("timestamp", JsonUtil.getValueAsString(configRoot, "timestamp", "0x0")); + return parseLong("timestamp", JsonUtil.getValueAsString(genesisRoot, "timestamp", "0x0")); } private String getRequiredString(final String key) { @@ -302,9 +283,9 @@ private String getRequiredString(final String key) { private String getFirstRequiredString(final String... keys) { List keysList = Arrays.asList(keys); return keysList.stream() - .filter(configRoot::has) + .filter(genesisRoot::has) .findFirst() - .map(key -> configRoot.get(key).asText()) + .map(key -> genesisRoot.get(key).asText()) .orElseThrow( () -> new IllegalArgumentException( @@ -343,4 +324,27 @@ public List getForkBlockNumbers() { public List getForkTimestamps() { return getConfigOptions().getForkBlockTimestamps(); } + + @Override + public boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + final GenesisConfigFile that = (GenesisConfigFile) o; + return Objects.equals(genesisRoot, that.genesisRoot); + } + + @Override + public int hashCode() { + return Objects.hashCode(genesisRoot); + } + + @Override + public String toString() { + return "GenesisConfigFile{" + + "genesisRoot=" + + genesisRoot + + ", allocations=" + + streamAllocations().map(GenesisAllocation::toString).collect(Collectors.joining(",")) + + '}'; + } } diff --git a/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java index 5c1a2037017..6118fc5080f 100644 --- a/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java @@ -24,6 +24,7 @@ import java.math.BigInteger; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.OptionalInt; import java.util.OptionalLong; @@ -615,4 +616,18 @@ public List getForkBlockTimestamps() { .sorted() .toList(); } + + @Override + public boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + final JsonGenesisConfigOptions that = (JsonGenesisConfigOptions) o; + return Objects.equals(configRoot, that.configRoot) + && Objects.equals(configOverrides, that.configOverrides); + } + + @Override + public int hashCode() { + return Objects.hash(configRoot, configOverrides); + } } diff --git a/config/src/main/java/org/hyperledger/besu/config/JsonUtil.java b/config/src/main/java/org/hyperledger/besu/config/JsonUtil.java index ef19bc7b835..da31a0ca0a3 100644 --- a/config/src/main/java/org/hyperledger/besu/config/JsonUtil.java +++ b/config/src/main/java/org/hyperledger/besu/config/JsonUtil.java @@ -17,6 +17,7 @@ import org.hyperledger.besu.util.number.PositiveNumber; import java.io.IOException; +import java.net.URL; import java.util.Locale; import java.util.Map; import java.util.Optional; @@ -287,7 +288,7 @@ public static ArrayNode createEmptyArrayNode() { * @return the object node */ public static ObjectNode objectNodeFromMap(final Map map) { - return (ObjectNode) getObjectMapper().valueToTree(map); + return getObjectMapper().valueToTree(map); } /** @@ -321,6 +322,27 @@ public static ObjectNode objectNodeFromString( } } + /** + * Object node from URL. + * + * @param jsonSource the URL of the json source + * @param allowComments true to allow comments + * @return the object node + */ + public static ObjectNode objectNodeFromURL(final URL jsonSource, final boolean allowComments) { + + final ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.configure(Feature.ALLOW_COMMENTS, allowComments); + try { + final JsonNode jsonNode = objectMapper.readTree(jsonSource); + validateType(jsonNode, JsonNodeType.OBJECT); + return (ObjectNode) jsonNode; + } catch (final IOException e) { + // Reading directly from a string should not raise an IOException, just catch and rethrow + throw new RuntimeException(e); + } + } + /** * Gets json. * @@ -455,14 +477,14 @@ private static boolean validateType(final JsonNode node, final JsonNodeType expe private static boolean validateLong(final JsonNode node) { if (!node.canConvertToLong()) { - throw new IllegalArgumentException("Cannot convert value to long: " + node.toString()); + throw new IllegalArgumentException("Cannot convert value to long: " + node); } return true; } private static boolean validateInt(final JsonNode node) { if (!node.canConvertToInt()) { - throw new IllegalArgumentException("Cannot convert value to integer: " + node.toString()); + throw new IllegalArgumentException("Cannot convert value to integer: " + node); } return true; } diff --git a/config/src/test/java/org/hyperledger/besu/config/GenesisConfigFileTest.java b/config/src/test/java/org/hyperledger/besu/config/GenesisConfigFileTest.java index 8f2d2e09bd7..7e863b024dc 100644 --- a/config/src/test/java/org/hyperledger/besu/config/GenesisConfigFileTest.java +++ b/config/src/test/java/org/hyperledger/besu/config/GenesisConfigFileTest.java @@ -59,7 +59,7 @@ void shouldLoadMainnetConfigFile() { @Test void shouldLoadDevelopmentConfigFile() { - final GenesisConfigFile config = GenesisConfigFile.development(); + final GenesisConfigFile config = GenesisConfigFile.fromResource("/dev.json"); // Sanity check some basic properties to confirm this is the dev file. assertThat(config.getConfigOptions().isEthHash()).isTrue(); assertThat(config.getConfigOptions().getChainId()).hasValue(DEVELOPMENT_CHAIN_ID); @@ -198,7 +198,7 @@ void shouldGetEmptyTerminalTotalDifficultyAtGenesis() { @Test void assertSepoliaTerminalTotalDifficulty() { GenesisConfigOptions sepoliaOptions = - GenesisConfigFile.genesisFileFromResources("/sepolia.json").getConfigOptions(); + GenesisConfigFile.fromResource("/sepolia.json").getConfigOptions(); assertThat(sepoliaOptions.getTerminalTotalDifficulty()).isPresent(); assertThat(sepoliaOptions.getTerminalTotalDifficulty()) @@ -208,7 +208,7 @@ void assertSepoliaTerminalTotalDifficulty() { @Test void assertGoerliTerminalTotalDifficulty() { GenesisConfigOptions goerliOptions = - GenesisConfigFile.genesisFileFromResources("/goerli.json").getConfigOptions(); + GenesisConfigFile.fromResource("/goerli.json").getConfigOptions(); assertThat(goerliOptions.getTerminalTotalDifficulty()).isPresent(); assertThat(goerliOptions.getTerminalTotalDifficulty()) @@ -218,7 +218,7 @@ void assertGoerliTerminalTotalDifficulty() { @Test void assertMainnetTerminalTotalDifficulty() { GenesisConfigOptions mainnetOptions = - GenesisConfigFile.genesisFileFromResources("/mainnet.json").getConfigOptions(); + GenesisConfigFile.fromResource("/mainnet.json").getConfigOptions(); assertThat(mainnetOptions.getTerminalTotalDifficulty()).isPresent(); // tentative as of 2022-08-11: @@ -229,7 +229,7 @@ void assertMainnetTerminalTotalDifficulty() { @Test void assertTerminalTotalDifficultyOverride() { GenesisConfigOptions sepoliaOverrideOptions = - GenesisConfigFile.genesisFileFromResources("/sepolia.json") + GenesisConfigFile.fromResource("/sepolia.json") .getConfigOptions(Map.of("terminalTotalDifficulty", String.valueOf(Long.MAX_VALUE))); assertThat(sepoliaOverrideOptions.getTerminalTotalDifficulty()).isPresent(); @@ -337,7 +337,7 @@ void mustNotAcceptComments() { @Test void testOverridePresent() { - final GenesisConfigFile config = GenesisConfigFile.development(); + final GenesisConfigFile config = GenesisConfigFile.fromResource("/dev.json"); final int bigBlock = 999_999_999; final String bigBlockString = Integer.toString(bigBlock); final Map override = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); @@ -354,7 +354,7 @@ void testOverridePresent() { @Test void testOverrideNull() { - final GenesisConfigFile config = GenesisConfigFile.development(); + final GenesisConfigFile config = GenesisConfigFile.fromResource("/dev.json"); final Map override = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); override.put("istanbulBlock", null); override.put("chainId", null); @@ -368,7 +368,7 @@ void testOverrideNull() { @Test void testOverrideCaseInsensitivity() { - final GenesisConfigFile config = GenesisConfigFile.development(); + final GenesisConfigFile config = GenesisConfigFile.fromResource("/dev.json"); final int bigBlock = 999_999_999; final String bigBlockString = Integer.toString(bigBlock); final Map override = new HashMap<>(); @@ -387,7 +387,7 @@ void testOverrideCaseInsensitivity() { @Test void testOverrideEmptyString() { - final GenesisConfigFile config = GenesisConfigFile.development(); + final GenesisConfigFile config = GenesisConfigFile.fromResource("/dev.json"); final Map override = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); override.put("istanbulBlock", ""); override.put("chainId", ""); @@ -400,7 +400,7 @@ void testOverrideEmptyString() { @Test void testNoOverride() { - final GenesisConfigFile config = GenesisConfigFile.development(); + final GenesisConfigFile config = GenesisConfigFile.fromResource("/dev.json"); assertThat(config.getConfigOptions().getLondonBlockNumber()).hasValue(0); assertThat(config.getConfigOptions().getIstanbulBlockNumber()).isNotPresent(); @@ -413,7 +413,7 @@ void testNoOverride() { @Test void testConstantinopleFixShouldNotBeSupportedAlongPetersburg() { // petersburg node - final GenesisConfigFile config = GenesisConfigFile.genesisFileFromResources("/all_forks.json"); + final GenesisConfigFile config = GenesisConfigFile.fromResource("/all_forks.json"); assertThat(config.getConfigOptions().getPetersburgBlockNumber()).hasValue(7); diff --git a/config/src/test/java/org/hyperledger/besu/config/JsonUtilTest.java b/config/src/test/java/org/hyperledger/besu/config/JsonUtilTest.java index 962bb42f055..1b251d5cd1d 100644 --- a/config/src/test/java/org/hyperledger/besu/config/JsonUtilTest.java +++ b/config/src/test/java/org/hyperledger/besu/config/JsonUtilTest.java @@ -17,6 +17,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; import java.util.Locale; import java.util.Map; @@ -31,6 +34,7 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class JsonUtilTest { private final ObjectMapper mapper = new ObjectMapper(); @@ -654,6 +658,24 @@ public void objectNodeFromString_withComments_commentsEnabled() { assertThat(result.get("b").asInt()).isEqualTo(2); } + @Test + public void objectNodeFromURL(@TempDir final Path folder) throws IOException { + final String jsonStr = + """ + { + "a":1, + "b":2, + "c":3 + } + """; + final var genesisFile = Files.writeString(folder.resolve("genesis.json"), jsonStr); + + final ObjectNode result = JsonUtil.objectNodeFromURL(genesisFile.toUri().toURL(), false); + assertThat(result.get("a").asInt()).isEqualTo(1); + assertThat(result.get("b").asInt()).isEqualTo(2); + assertThat(result.get("c").asInt()).isEqualTo(3); + } + @Test public void getJson() throws JsonProcessingException { final String jsonStr = "{\"a\":1, \"b\":2}"; diff --git a/consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeGenesisConfigHelper.java b/consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeGenesisConfigHelper.java index 80615552e74..dd0661ded42 100644 --- a/consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeGenesisConfigHelper.java +++ b/consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeGenesisConfigHelper.java @@ -14,8 +14,6 @@ */ package org.hyperledger.besu.consensus.merge.blockcreation; -import static java.nio.charset.StandardCharsets.UTF_8; - import org.hyperledger.besu.config.GenesisAllocation; import org.hyperledger.besu.config.GenesisConfigFile; import org.hyperledger.besu.consensus.merge.MergeProtocolSchedule; @@ -29,14 +27,12 @@ import java.net.URISyntaxException; import java.util.stream.Stream; -import com.google.common.io.Resources; - public interface MergeGenesisConfigHelper { default GenesisConfigFile getPosGenesisConfigFile() { try { final URI uri = MergeGenesisConfigHelper.class.getResource("/posAtGenesis.json").toURI(); - return GenesisConfigFile.fromConfig(Resources.toString(uri.toURL(), UTF_8)); + return GenesisConfigFile.fromSource(uri.toURL()); } catch (final URISyntaxException | IOException e) { throw new IllegalStateException(e); } @@ -45,7 +41,7 @@ default GenesisConfigFile getPosGenesisConfigFile() { default GenesisConfigFile getPowGenesisConfigFile() { try { final URI uri = MergeGenesisConfigHelper.class.getResource("/powAtGenesis.json").toURI(); - return GenesisConfigFile.fromConfig(Resources.toString(uri.toURL(), UTF_8)); + return GenesisConfigFile.fromSource(uri.toURL()); } catch (final URISyntaxException | IOException e) { throw new IllegalStateException(e); } diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java b/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java index f66973ef6a9..7a014986a24 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java +++ b/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java @@ -23,6 +23,7 @@ import static org.mockito.Mockito.when; import org.hyperledger.besu.config.BftFork; +import org.hyperledger.besu.config.GenesisConfigFile; import org.hyperledger.besu.config.JsonQbftConfigOptions; import org.hyperledger.besu.config.JsonUtil; import org.hyperledger.besu.config.QbftConfigOptions; @@ -115,7 +116,6 @@ import org.hyperledger.besu.util.Subscribers; import java.io.IOException; -import java.nio.file.Files; import java.nio.file.Path; import java.time.Clock; import java.time.Instant; @@ -365,8 +365,9 @@ private static Block createGenesisBlock(final Set
validators) { } private GenesisState createGenesisBlock(final String genesisFile) throws IOException { - final String json = Files.readString(Path.of(genesisFile)); - return GenesisState.fromJson(json, ProtocolScheduleFixture.MAINNET); + return GenesisState.fromConfig( + GenesisConfigFile.fromSource(Path.of(genesisFile).toUri().toURL()), + ProtocolScheduleFixture.MAINNET); } private static ControllerAndState createControllerAndFinalState( diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java index 36b965697d8..dba3ef4be9a 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockTransactionSelectorTest.java @@ -220,7 +220,7 @@ protected ProcessableBlockHeader createBlock(final long gasLimit, final Wei base public void emptyPendingTransactionsResultsInEmptyVettingResult() { final ProtocolSchedule protocolSchedule = FixedDifficultyProtocolSchedule.create( - GenesisConfigFile.development().getConfigOptions(), + GenesisConfigFile.fromResource("/dev.json").getConfigOptions(), EvmConfiguration.DEFAULT, MiningParameters.MINING_DISABLED, new BadBlockManager()); diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LegacyFeeMarketBlockTransactionSelectorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LegacyFeeMarketBlockTransactionSelectorTest.java index 91b58fab8d1..3b1ae938f7f 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LegacyFeeMarketBlockTransactionSelectorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LegacyFeeMarketBlockTransactionSelectorTest.java @@ -51,8 +51,7 @@ public class LegacyFeeMarketBlockTransactionSelectorTest @Override protected GenesisConfigFile getGenesisConfigFile() { - return GenesisConfigFile.genesisFileFromResources( - "/block-transaction-selector/gas-price-genesis.json"); + return GenesisConfigFile.fromResource("/block-transaction-selector/gas-price-genesis.json"); } @Override diff --git a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LondonFeeMarketBlockTransactionSelectorTest.java b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LondonFeeMarketBlockTransactionSelectorTest.java index 5fb915fd095..e9bfcfb762a 100644 --- a/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LondonFeeMarketBlockTransactionSelectorTest.java +++ b/ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/LondonFeeMarketBlockTransactionSelectorTest.java @@ -58,8 +58,7 @@ public class LondonFeeMarketBlockTransactionSelectorTest @Override protected GenesisConfigFile getGenesisConfigFile() { - return GenesisConfigFile.genesisFileFromResources( - "/block-transaction-selector/london-genesis.json"); + return GenesisConfigFile.fromResource("/block-transaction-selector/london-genesis.json"); } @Override diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockchainSetupUtil.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockchainSetupUtil.java index f0ffbb98622..60b40c5f24b 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockchainSetupUtil.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockchainSetupUtil.java @@ -45,14 +45,11 @@ import java.io.IOException; import java.net.URISyntaxException; -import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import com.google.common.io.Resources; - public class BlockchainSetupUtil { private final GenesisState genesisState; private final MutableBlockchain blockchain; @@ -169,13 +166,12 @@ private static BlockchainSetupUtil create( final ProtocolContextProvider protocolContextProvider, final EthScheduler scheduler) { try { - final String genesisJson = - Resources.toString(chainResources.getGenesisURL(), StandardCharsets.UTF_8); - - final GenesisConfigFile genesisConfigFile = GenesisConfigFile.fromConfig(genesisJson); + final GenesisConfigFile genesisConfigFile = + GenesisConfigFile.fromSource(chainResources.getGenesisURL()); final ProtocolSchedule protocolSchedule = protocolScheduleProvider.get(genesisConfigFile); - final GenesisState genesisState = GenesisState.fromJson(genesisJson, protocolSchedule); + final GenesisState genesisState = + GenesisState.fromConfig(genesisConfigFile, protocolSchedule); final MutableBlockchain blockchain = createInMemoryBlockchain(genesisState.getBlock()); final WorldStateArchive worldArchive = storageFormat == DataStorageFormat.BONSAI diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/difficulty/fixed/FixedProtocolScheduleTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/difficulty/fixed/FixedProtocolScheduleTest.java index afb0e195f35..adaf4c476b2 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/difficulty/fixed/FixedProtocolScheduleTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/difficulty/fixed/FixedProtocolScheduleTest.java @@ -33,7 +33,7 @@ public void reportedDifficultyForAllBlocksIsAFixedValue() { final ProtocolSchedule schedule = FixedDifficultyProtocolSchedule.create( - GenesisConfigFile.development().getConfigOptions(), + GenesisConfigFile.fromResource("/dev.json").getConfigOptions(), EvmConfiguration.DEFAULT, MiningParameters.MINING_DISABLED, new BadBlockManager()); diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java index a8b5b772f8e..77c8714217d 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java @@ -22,9 +22,6 @@ import org.hyperledger.besu.ethereum.core.ProtocolScheduleFixture; import org.hyperledger.besu.evm.internal.EvmConfiguration; -import java.nio.charset.StandardCharsets; - -import com.google.common.io.Resources; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; @@ -127,13 +124,10 @@ public void outOfOrderConstantinoplesFail() { } @Test - public void shouldCreateGoerliConfig() throws Exception { + public void shouldCreateGoerliConfig() { final ProtocolSchedule sched = MainnetProtocolSchedule.fromConfig( - GenesisConfigFile.fromConfig( - Resources.toString( - this.getClass().getResource("/goerli.json"), StandardCharsets.UTF_8)) - .getConfigOptions(), + GenesisConfigFile.fromResource("/goerli.json").getConfigOptions(), EvmConfiguration.DEFAULT, MiningParameters.MINING_DISABLED, new BadBlockManager()); diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java index e3abbe6f0b7..82bf9209957 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java @@ -105,11 +105,11 @@ public abstract class AbstractIsolationTests { .createKeyPair(SECPPrivateKey.create(Bytes32.fromHexString(key), "ECDSA")); protected final ProtocolSchedule protocolSchedule = MainnetProtocolSchedule.fromConfig( - GenesisConfigFile.development().getConfigOptions(), + GenesisConfigFile.fromResource("/dev.json").getConfigOptions(), MiningParameters.MINING_DISABLED, new BadBlockManager()); protected final GenesisState genesisState = - GenesisState.fromConfig(GenesisConfigFile.development(), protocolSchedule); + GenesisState.fromConfig(GenesisConfigFile.fromResource("/dev.json"), protocolSchedule); protected final MutableBlockchain blockchain = createInMemoryBlockchain(genesisState.getBlock()); protected final TransactionPoolConfiguration poolConfiguration = @@ -140,7 +140,7 @@ public abstract class AbstractIsolationTests { MiningParameters.newDefault())); protected final List accounts = - GenesisConfigFile.development() + GenesisConfigFile.fromResource("/dev.json") .streamAllocations() .filter(ga -> ga.getPrivateKey().isPresent()) .collect(Collectors.toList()); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/BlockBodiesMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/BlockBodiesMessageTest.java index 1a69dd1daba..ac3b8f2fc62 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/BlockBodiesMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/BlockBodiesMessageTest.java @@ -56,7 +56,7 @@ public final class BlockBodiesMessageTest { public void setup() { protocolSchedule = FixedDifficultyProtocolSchedule.create( - GenesisConfigFile.development().getConfigOptions(), + GenesisConfigFile.fromResource("/dev.json").getConfigOptions(), false, EvmConfiguration.DEFAULT, MiningParameters.MINING_DISABLED, diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/BlockHeadersMessageTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/BlockHeadersMessageTest.java index 08d2262c2d5..2b9105ed46d 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/BlockHeadersMessageTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/messages/BlockHeadersMessageTest.java @@ -63,7 +63,7 @@ public void blockHeadersRoundTrip() throws IOException { final List readHeaders = message.getHeaders( FixedDifficultyProtocolSchedule.create( - GenesisConfigFile.development().getConfigOptions(), + GenesisConfigFile.fromResource("/dev.json").getConfigOptions(), false, EvmConfiguration.DEFAULT, MiningParameters.MINING_DISABLED, diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/ChainHeadTrackerTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/ChainHeadTrackerTest.java index 9912d66f381..393824af755 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/ChainHeadTrackerTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/ChainHeadTrackerTest.java @@ -53,7 +53,7 @@ public class ChainHeadTrackerTest { private final ProtocolSchedule protocolSchedule = FixedDifficultyProtocolSchedule.create( - GenesisConfigFile.development().getConfigOptions(), + GenesisConfigFile.fromResource("/dev.json").getConfigOptions(), false, EvmConfiguration.DEFAULT, MiningParameters.MINING_DISABLED, diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java index 62dde1f8f41..743f0b47e2c 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java @@ -110,10 +110,10 @@ public TestNode( .setBindPort(listenPort) .setSupportedProtocols(EthProtocol.get())); - final GenesisConfigFile genesisConfigFile = GenesisConfigFile.development(); + final GenesisConfigFile genesisConfigFile = GenesisConfigFile.fromResource("/dev.json"); final ProtocolSchedule protocolSchedule = FixedDifficultyProtocolSchedule.create( - GenesisConfigFile.development().getConfigOptions(), + GenesisConfigFile.fromResource("/dev.json").getConfigOptions(), false, EvmConfiguration.DEFAULT, MiningParameters.MINING_DISABLED, diff --git a/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/TransactionSmartContractPermissioningControllerTest.java b/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/TransactionSmartContractPermissioningControllerTest.java index 81902e52c40..1fd4f58a4bd 100644 --- a/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/TransactionSmartContractPermissioningControllerTest.java +++ b/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/TransactionSmartContractPermissioningControllerTest.java @@ -14,7 +14,6 @@ */ package org.hyperledger.besu.ethereum.permissioning; -import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider.createInMemoryBlockchain; @@ -42,7 +41,6 @@ import java.io.IOException; import java.math.BigInteger; -import com.google.common.io.Resources; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -57,13 +55,13 @@ public class TransactionSmartContractPermissioningControllerTest { @Mock private Counter checkUnpermittedCounter; private TransactionSmartContractPermissioningController setupController( - final String resourceName, final String contractAddressString) throws IOException { + final String resourceName, final String contractAddressString) { final ProtocolSchedule protocolSchedule = ProtocolScheduleFixture.MAINNET; - final String emptyContractFile = - Resources.toString(this.getClass().getResource(resourceName), UTF_8); final GenesisState genesisState = - GenesisState.fromConfig(GenesisConfigFile.fromConfig(emptyContractFile), protocolSchedule); + GenesisState.fromConfig( + GenesisConfigFile.fromSource(this.getClass().getResource(resourceName)), + protocolSchedule); final MutableBlockchain blockchain = createInMemoryBlockchain(genesisState.getBlock()); final WorldStateArchive worldArchive = createInMemoryWorldStateArchive(); From 903f350a4275d930b9b78a186b229f823c4287c6 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Fri, 3 May 2024 07:39:59 +1000 Subject: [PATCH 50/59] Apply Hyperledger license header to `ethereum/core/` (#7034) * Apply Hyperledger license header to `ethereum/core/` * Fix license header for LogWithMetadata --------- Signed-off-by: Usman Saleem --- .../vm/operations/TransientStorageOperationBenchmark.java | 2 +- .../hyperledger/besu/ethereum/BlockProcessingOutputs.java | 6 ++---- .../hyperledger/besu/ethereum/BlockProcessingResult.java | 6 ++---- .../hyperledger/besu/ethereum/BlockValidationResult.java | 6 ++---- .../org/hyperledger/besu/ethereum/ConsensusContext.java | 2 +- .../org/hyperledger/besu/ethereum/chain/BadBlockCause.java | 3 +-- .../org/hyperledger/besu/ethereum/chain/Blockchain.java | 2 +- .../hyperledger/besu/ethereum/chain/BlockchainStorage.java | 2 +- .../hyperledger/besu/ethereum/chain/ChainDataPruner.java | 3 +-- .../besu/ethereum/chain/ChainDataPrunerStorage.java | 3 +-- .../besu/ethereum/chain/ChainPrunerConfiguration.java | 3 +-- .../hyperledger/besu/ethereum/chain/DefaultBlockchain.java | 2 +- .../hyperledger/besu/ethereum/chain/MutableBlockchain.java | 2 +- .../hyperledger/besu/ethereum/chain/VariablesStorage.java | 2 +- .../org/hyperledger/besu/ethereum/core/BlockHeader.java | 2 +- .../hyperledger/besu/ethereum/core/BlockHeaderBuilder.java | 2 +- .../besu/ethereum/core/BlockValueCalculator.java | 2 +- .../java/org/hyperledger/besu/ethereum/core/Deposit.java | 2 +- .../org/hyperledger/besu/ethereum/core/DepositContract.java | 4 +--- .../org/hyperledger/besu/ethereum/core/LogWithMetadata.java | 2 -- .../org/hyperledger/besu/ethereum/core/LogsWrapper.java | 3 +-- .../hyperledger/besu/ethereum/core/MiningParameters.java | 2 +- .../besu/ethereum/core/MiningParametersMetrics.java | 2 +- .../hyperledger/besu/ethereum/core/MutableWorldState.java | 2 +- .../besu/ethereum/core/PermissionTransactionFilter.java | 4 +--- .../besu/ethereum/core/ProcessableBlockHeader.java | 2 +- .../hyperledger/besu/ethereum/core/SealableBlockHeader.java | 2 +- .../org/hyperledger/besu/ethereum/core/VersionMetadata.java | 2 +- .../java/org/hyperledger/besu/ethereum/core/Withdrawal.java | 2 +- .../hyperledger/besu/ethereum/core/WithdrawalRequest.java | 2 +- .../core/encoding/AccessListTransactionDecoder.java | 2 +- .../core/encoding/AccessListTransactionEncoder.java | 2 +- .../core/encoding/BlobPooledTransactionDecoder.java | 2 +- .../core/encoding/BlobPooledTransactionEncoder.java | 2 +- .../besu/ethereum/core/encoding/BlobTransactionDecoder.java | 2 +- .../besu/ethereum/core/encoding/BlobTransactionEncoder.java | 2 +- .../besu/ethereum/core/encoding/DepositDecoder.java | 2 +- .../besu/ethereum/core/encoding/DepositEncoder.java | 2 +- .../ethereum/core/encoding/EIP1559TransactionDecoder.java | 2 +- .../ethereum/core/encoding/EIP1559TransactionEncoder.java | 2 +- .../besu/ethereum/core/encoding/EncodingContext.java | 2 +- .../ethereum/core/encoding/FrontierTransactionDecoder.java | 2 +- .../ethereum/core/encoding/FrontierTransactionEncoder.java | 2 +- .../besu/ethereum/core/encoding/WithdrawalDecoder.java | 2 +- .../besu/ethereum/core/encoding/WithdrawalEncoder.java | 2 +- .../ethereum/core/encoding/WithdrawalRequestDecoder.java | 2 +- .../ethereum/core/encoding/WithdrawalRequestEncoder.java | 2 +- .../ethereum/core/feemarket/TransactionPriceCalculator.java | 2 +- .../besu/ethereum/core/plugins/PluginConfiguration.java | 2 +- .../hyperledger/besu/ethereum/core/plugins/PluginInfo.java | 2 +- .../hyperledger/besu/ethereum/mainnet/BodyValidation.java | 2 +- .../besu/ethereum/mainnet/DepositsValidator.java | 4 +--- .../besu/ethereum/mainnet/MainnetTransactionValidator.java | 2 +- .../besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java | 2 +- .../ethereum/mainnet/PermissionTransactionValidator.java | 2 +- .../ethereum/mainnet/PragueWithdrawalRequestValidator.java | 1 - .../ethereum/mainnet/PrivacySupportingProtocolSchedule.java | 1 - .../besu/ethereum/mainnet/PrivateStateUtils.java | 2 +- .../hyperledger/besu/ethereum/mainnet/ProtocolSchedule.java | 1 - .../besu/ethereum/mainnet/TransactionValidator.java | 2 +- .../besu/ethereum/mainnet/TransactionValidatorFactory.java | 2 +- .../ethereum/mainnet/WithdrawalRequestContractHelper.java | 2 +- .../besu/ethereum/mainnet/WithdrawalRequestValidator.java | 4 +--- .../besu/ethereum/mainnet/WithdrawalsProcessor.java | 2 +- .../besu/ethereum/mainnet/WithdrawalsValidator.java | 3 +-- .../besu/ethereum/mainnet/feemarket/FixedBaseFeeMarket.java | 2 +- .../besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java | 2 +- .../AttachedComposedFromDetachedRule.java | 2 +- .../headervalidationrules/BlobGasValidationRule.java | 2 +- .../headervalidationrules/ConstantOmmersHashRule.java | 3 +-- .../headervalidationrules/IncrementalTimestampRule.java | 3 +-- .../mainnet/headervalidationrules/NoDifficultyRule.java | 3 +-- .../ethereum/mainnet/headervalidationrules/NoNonceRule.java | 3 +-- .../besu/ethereum/privacy/AbstractPrivacyController.java | 2 +- .../privacy/AbstractRestrictedPrivacyController.java | 2 +- .../besu/ethereum/privacy/FlexiblePrivacyController.java | 2 +- .../org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java | 2 +- .../ethereum/privacy/MultiTenancyPrivacyController.java | 2 +- .../besu/ethereum/privacy/PrivateStateRootResolver.java | 2 +- .../besu/ethereum/proof/WorldStateProofProvider.java | 2 +- .../KeyValueStoragePrefixedKeyBlockchainStorage.java | 2 +- .../ethereum/storage/keyvalue/VariablesKeyValueStorage.java | 2 +- .../besu/ethereum/transaction/PreCloseStateHandler.java | 4 +--- .../trie/diffbased/bonsai/BonsaiWorldStateProvider.java | 4 +--- .../bonsai/cache/BonsaiCachedMerkleTrieLoader.java | 3 +-- .../bonsai/cache/BonsaiCachedMerkleTrieLoaderModule.java | 3 +-- .../bonsai/cache/BonsaiCachedWorldStorageManager.java | 2 +- .../bonsai/cache/NoOpBonsaiCachedWorldStorageManager.java | 2 +- .../trie/diffbased/bonsai/storage/BonsaiPreImageProxy.java | 3 +-- .../storage/BonsaiSnapshotWorldStateKeyValueStorage.java | 3 +-- .../bonsai/storage/BonsaiWorldStateKeyValueStorage.java | 2 +- .../bonsai/storage/BonsaiWorldStateLayerStorage.java | 3 +-- .../diffbased/bonsai/storage/flat/FullFlatDbStrategy.java | 3 +-- .../bonsai/storage/flat/PartialFlatDbStrategy.java | 3 +-- .../trie/diffbased/bonsai/trielog/TrieLogFactoryImpl.java | 3 +-- .../bonsai/worldview/BonsaiWorldStateUpdateAccumulator.java | 3 +-- .../ethereum/trie/diffbased/common/DiffBasedAccount.java | 3 +-- .../besu/ethereum/trie/diffbased/common/DiffBasedValue.java | 3 +-- .../trie/diffbased/common/DiffBasedWorldStateProvider.java | 4 +--- .../ethereum/trie/diffbased/common/StorageSubscriber.java | 2 +- .../common/cache/DiffBasedCachedWorldStorageManager.java | 2 +- .../diffbased/common/cache/DiffBasedCachedWorldView.java | 3 +-- .../storage/DiffBasedLayeredWorldStateKeyValueStorage.java | 3 +-- .../storage/DiffBasedSnapshotWorldStateKeyValueStorage.java | 3 +-- .../common/storage/DiffBasedWorldStateKeyValueStorage.java | 2 +- .../common/storage/flat/AccountHashCodeStorageStrategy.java | 3 +-- .../common/storage/flat/CodeHashCodeStorageStrategy.java | 3 +-- .../diffbased/common/storage/flat/CodeStorageStrategy.java | 3 +-- .../trie/diffbased/common/storage/flat/FlatDbStrategy.java | 3 +-- .../common/storage/flat/FlatDbStrategyProvider.java | 3 +-- .../trie/diffbased/common/trielog/NoOpTrieLogManager.java | 2 +- .../trie/diffbased/common/trielog/TrieLogAddedEvent.java | 1 - .../trie/diffbased/common/trielog/TrieLogManager.java | 3 +-- .../trie/diffbased/common/trielog/TrieLogPruner.java | 1 - .../diffbased/common/worldview/DiffBasedWorldState.java | 3 +-- .../trie/diffbased/common/worldview/DiffBasedWorldView.java | 3 +-- .../accumulator/DiffBasedWorldStateUpdateAccumulator.java | 3 +-- .../worldview/accumulator/preload/AccountConsumingMap.java | 2 +- .../common/worldview/accumulator/preload/Consumer.java | 2 +- .../worldview/accumulator/preload/StorageConsumingMap.java | 2 +- .../besu/ethereum/trie/forest/ForestWorldStateArchive.java | 3 +-- .../forest/storage/ForestWorldStateKeyValueStorage.java | 2 +- .../trie/forest/worldview/ForestMutableWorldState.java | 2 +- .../besu/ethereum/vm/CachingBlockHashLookup.java | 2 +- .../hyperledger/besu/ethereum/worldstate/FlatDbMode.java | 3 +-- .../besu/ethereum/worldstate/PeerTrieNodeFinder.java | 2 +- .../besu/ethereum/worldstate/WorldStateArchive.java | 2 +- .../besu/ethereum/worldstate/WorldStateKeyValueStorage.java | 2 +- .../ethereum/worldstate/WorldStateStorageCoordinator.java | 2 +- .../org/hyperledger/besu/ethereum/core/BlobTestFixture.java | 3 +-- .../besu/ethereum/core/BlockHeaderTestFixture.java | 2 +- .../ethereum/core/MilestoneStreamingProtocolSchedule.java | 1 - .../org/hyperledger/besu/ethereum/core/TrieGenerator.java | 2 +- .../besu/ethereum/core/VariablesStorageHelper.java | 2 +- .../besu/ethereum/BlockImportExceptionHandlingTest.java | 2 +- .../besu/ethereum/chain/BadBlockManagerTest.java | 3 +-- .../besu/ethereum/chain/ChainDataPrunerTest.java | 3 +-- .../besu/ethereum/core/BlockValueCalculatorTest.java | 2 +- .../hyperledger/besu/ethereum/core/VersionMetadataTest.java | 3 +-- .../ethereum/core/encoding/BlobTransactionEncodingTest.java | 2 +- .../besu/ethereum/core/encoding/DepositDecoderTest.java | 2 +- .../besu/ethereum/core/encoding/DepositEncoderTest.java | 2 +- .../besu/ethereum/core/encoding/WithdrawalDecoderTest.java | 2 +- .../besu/ethereum/core/encoding/WithdrawalEncoderTest.java | 2 +- .../core/encoding/WithdrawalRequestDecoderTest.java | 2 +- .../core/encoding/WithdrawalRequestEncoderTest.java | 2 +- .../besu/ethereum/mainnet/AbstractBlockProcessorTest.java | 2 +- .../besu/ethereum/mainnet/DefaultProtocolScheduleTest.java | 1 - .../besu/ethereum/mainnet/DepositsValidatorTest.java | 3 +-- .../ethereum/mainnet/MainnetBlockBodyValidatorTest.java | 2 +- .../ethereum/mainnet/MainnetTransactionValidatorTest.java | 2 +- .../mainnet/PermissionTransactionValidatorTest.java | 2 +- .../ethereum/mainnet/TransactionValidationFactoryTest.java | 2 +- .../mainnet/WithdrawalRequestContractHelperTest.java | 2 +- .../ethereum/mainnet/WithdrawalRequestValidatorTest.java | 2 +- .../mainnet/WithdrawalRequestValidatorTestFixtures.java | 1 - .../besu/ethereum/mainnet/WithdrawalsProcessorTest.java | 2 +- .../besu/ethereum/mainnet/WithdrawalsValidatorTest.java | 3 +-- .../ethereum/mainnet/feemarket/CancunFeeMarketTest.java | 1 - .../ethereum/mainnet/feemarket/FixedBaseFeeMarketTest.java | 2 +- .../ethereum/mainnet/feemarket/LondonFeeMarketTest.java | 2 +- .../ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java | 2 +- .../headervalidationrules/BlobGasValidationRuleTest.java | 3 +-- ...LimitElasticityValidationRuleFixedBaseFeeMarketTest.java | 2 +- ...sLimitElasticityValidationRuleZeroBaseFeeMarketTest.java | 2 +- .../hyperledger/besu/ethereum/privacy/FlexibleUtilTest.java | 2 +- .../ethereum/privacy/PrivateStateGenesisAllocatorTest.java | 3 +-- .../besu/ethereum/proof/WorldStateProofProviderTest.java | 2 +- .../ethereum/proof/WorldStateRangeProofProviderTest.java | 2 +- .../KeyValueStoragePrefixedKeyBlockchainStorageTest.java | 2 +- .../trie/diffbased/bonsai/AbstractIsolationTests.java | 3 +-- .../ethereum/trie/diffbased/bonsai/BonsaiAccountTest.java | 2 +- .../diffbased/bonsai/BonsaiCachedMerkleTrieLoaderTest.java | 3 +-- .../trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java | 4 +--- .../bonsai/storage/BonsaiWorldStateKeyValueStorageTest.java | 2 +- .../trie/diffbased/bonsai/trielog/TrieLogFactoryTests.java | 3 +-- .../trie/diffbased/bonsai/trielog/TrieLogManagerTests.java | 1 - .../trie/diffbased/bonsai/trielog/TrieLogPrunerTest.java | 1 - .../diffbased/bonsai/worldview/BonsaiWorldStateTest.java | 3 +-- .../common/storage/flat/FlatDbStrategyProviderTest.java | 3 +-- .../trie/diffbased/common/trielog/TrieLogLayerTests.java | 1 - .../storage/ForestKeyValueStorageWorldStateStorageTest.java | 2 +- .../trie/forest/worldview/ForestMutableWorldStateTest.java | 2 +- 183 files changed, 173 insertions(+), 257 deletions(-) diff --git a/ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/TransientStorageOperationBenchmark.java b/ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/TransientStorageOperationBenchmark.java index 19d3c8b45ca..aa7ce37313b 100644 --- a/ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/TransientStorageOperationBenchmark.java +++ b/ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/TransientStorageOperationBenchmark.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockProcessingOutputs.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockProcessingOutputs.java index 9e062b4edeb..b72268c6b07 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockProcessingOutputs.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockProcessingOutputs.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum; import org.hyperledger.besu.ethereum.core.MutableWorldState; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockProcessingResult.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockProcessingResult.java index 657a801455f..be8b2dd3d44 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockProcessingResult.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockProcessingResult.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum; import org.hyperledger.besu.ethereum.core.TransactionReceipt; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockValidationResult.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockValidationResult.java index 63d786acdff..68a13c7d980 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockValidationResult.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/BlockValidationResult.java @@ -1,8 +1,8 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum; import java.util.Optional; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/ConsensusContext.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/ConsensusContext.java index 377d55953d8..dc1c117ae82 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/ConsensusContext.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/ConsensusContext.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BadBlockCause.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BadBlockCause.java index 6fd6ae1dfbf..e110876afad 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BadBlockCause.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BadBlockCause.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.chain; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/Blockchain.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/Blockchain.java index 84e92ff019b..3c76ba69f5c 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/Blockchain.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/Blockchain.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BlockchainStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BlockchainStorage.java index c610a3e0d2b..2c0cbf1a5c2 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BlockchainStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BlockchainStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainDataPruner.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainDataPruner.java index 7807786948d..11a1500e4e7 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainDataPruner.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainDataPruner.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.chain; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainDataPrunerStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainDataPrunerStorage.java index 8b50ec83d52..52a37cdba3a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainDataPrunerStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainDataPrunerStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.chain; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainPrunerConfiguration.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainPrunerConfiguration.java index 99ac9bc486d..19e2e37b363 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainPrunerConfiguration.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/ChainPrunerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.chain; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/DefaultBlockchain.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/DefaultBlockchain.java index a92be73bf7c..0515deeb005 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/DefaultBlockchain.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/DefaultBlockchain.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/MutableBlockchain.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/MutableBlockchain.java index 9ec7c8a9d9d..da42e25afc3 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/MutableBlockchain.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/MutableBlockchain.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/VariablesStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/VariablesStorage.java index 594f9c00acd..9d63e6b30a4 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/VariablesStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/VariablesStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java index 98e8e280ecb..69625bf892e 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java index 68572e93839..42da0fd8758 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockValueCalculator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockValueCalculator.java index cbf6a7c6941..c7552c227f8 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockValueCalculator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockValueCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright Contributors to Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Deposit.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Deposit.java index ed362199b23..02fd36ad5da 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Deposit.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Deposit.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/DepositContract.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/DepositContract.java index 9f36df7ca97..a49f25fb008 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/DepositContract.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/DepositContract.java @@ -1,6 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu - * + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.core; import org.hyperledger.besu.evm.log.LogTopic; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/LogWithMetadata.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/LogWithMetadata.java index 57721af98b0..b4b8baa6aaf 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/LogWithMetadata.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/LogWithMetadata.java @@ -1,5 +1,4 @@ /* - * * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.core; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/LogsWrapper.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/LogsWrapper.java index 7ff9af5374d..0e1f3df23f7 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/LogsWrapper.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/LogsWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.core; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MiningParameters.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MiningParameters.java index febce15fe13..20a8a31084d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MiningParameters.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MiningParameters.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MiningParametersMetrics.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MiningParametersMetrics.java index 0c88d36a903..3b3e3a28dcb 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MiningParametersMetrics.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MiningParametersMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MutableWorldState.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MutableWorldState.java index 409003a3218..973774ae5da 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MutableWorldState.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/MutableWorldState.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/PermissionTransactionFilter.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/PermissionTransactionFilter.java index bb2784e9805..9ad4d3c4f53 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/PermissionTransactionFilter.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/PermissionTransactionFilter.java @@ -1,6 +1,5 @@ /* - * - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.core; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ProcessableBlockHeader.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ProcessableBlockHeader.java index 75393315428..036a33af97a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ProcessableBlockHeader.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/ProcessableBlockHeader.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/SealableBlockHeader.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/SealableBlockHeader.java index 1f07f4a5a87..8368c55f896 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/SealableBlockHeader.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/SealableBlockHeader.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java index 0346dd84018..55fc16a99fa 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Withdrawal.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Withdrawal.java index 4fe64ec2016..b82eda72481 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Withdrawal.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Withdrawal.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/WithdrawalRequest.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/WithdrawalRequest.java index c083221e985..dc6f8ace110 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/WithdrawalRequest.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/WithdrawalRequest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionDecoder.java index e9fbf828174..b5a06042406 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionEncoder.java index b539ee931cc..54bf8cc41ec 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionDecoder.java index bac3d472aca..dd786ff7238 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionEncoder.java index b47a406102d..44981a30ad5 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionDecoder.java index 13240930b94..fdb467887da 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncoder.java index 73b7593d9b8..2b918b4f260 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositDecoder.java index cb8410d3d28..05fd5498e96 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoder.java index 15f825e0757..0abdcc4e3c3 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionDecoder.java index 6e419a9ed22..b99f37468e5 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionEncoder.java index 3d061beff84..bc8e41da820 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EncodingContext.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EncodingContext.java index b94289aeb9f..96104d6e2a3 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EncodingContext.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EncodingContext.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionDecoder.java index 8cfd8b93b51..e218eb0ac4d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionEncoder.java index 0c5f61f5454..039c3871040 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalDecoder.java index 77ec6ad0200..c2e98215b73 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalEncoder.java index 9dcac154501..27d6b805cb8 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoder.java index d9c020cc47d..f9c8c41222f 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoder.java index 3ec97d66480..79d13cdab31 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/feemarket/TransactionPriceCalculator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/feemarket/TransactionPriceCalculator.java index 0d86c753320..774063987c4 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/feemarket/TransactionPriceCalculator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/feemarket/TransactionPriceCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginConfiguration.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginConfiguration.java index 1f38386aeae..dbc742fb2fe 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginConfiguration.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginInfo.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginInfo.java index a30d4d55f91..2e3a771bafd 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginInfo.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/plugins/PluginInfo.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java index 2caacdb25cf..fd00ad47649 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/DepositsValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/DepositsValidator.java index befa2231083..670446b49b2 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/DepositsValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/DepositsValidator.java @@ -1,6 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu - * + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import static com.google.common.base.Preconditions.checkArgument; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java index 8b1ae6ff6af..9d90a409a5e 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java index 3715263fd2b..f110d92836d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PermissionTransactionValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PermissionTransactionValidator.java index 43b3d8d2be1..bc3a72ceabe 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PermissionTransactionValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PermissionTransactionValidator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidator.java index 5272812e382..dcebf313966 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PragueWithdrawalRequestValidator.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import org.hyperledger.besu.datatypes.Hash; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacySupportingProtocolSchedule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacySupportingProtocolSchedule.java index 953280a57ae..eea6fe9f6fb 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacySupportingProtocolSchedule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacySupportingProtocolSchedule.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import org.hyperledger.besu.ethereum.core.PermissionTransactionFilter; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivateStateUtils.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivateStateUtils.java index 78e33790d56..e44ed2a6974 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivateStateUtils.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivateStateUtils.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSchedule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSchedule.java index a249a6b5285..e07b2835e9f 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSchedule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSchedule.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import org.hyperledger.besu.ethereum.core.BlockHeader; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidator.java index dc96ac46fcd..f23a0a98ee6 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidatorFactory.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidatorFactory.java index e89ca469a8a..ff2bb53dace 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidatorFactory.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelper.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelper.java index 2eef89c4075..8a98c5dd8ad 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelper.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelper.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidator.java index ce1a61588ec..4423a5a3df4 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidator.java @@ -1,6 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu - * + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import org.hyperledger.besu.ethereum.core.Block; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsProcessor.java index d2b0f8edf78..81765a78ce5 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsProcessor.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsValidator.java index 2adf0f7f719..84172f95ccd 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsValidator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsValidator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import static com.google.common.base.Preconditions.checkArgument; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarket.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarket.java index 5aeddd06720..e3155a74345 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarket.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarket.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java index 7b32e3f84c8..156d1d9926b 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/AttachedComposedFromDetachedRule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/AttachedComposedFromDetachedRule.java index 362cfba0e67..d5f83e4a1ec 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/AttachedComposedFromDetachedRule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/AttachedComposedFromDetachedRule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/BlobGasValidationRule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/BlobGasValidationRule.java index f5c22a710b3..3a34d7be307 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/BlobGasValidationRule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/BlobGasValidationRule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/ConstantOmmersHashRule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/ConstantOmmersHashRule.java index 61eb038f65f..aef185cbc6a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/ConstantOmmersHashRule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/ConstantOmmersHashRule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet.headervalidationrules; import org.hyperledger.besu.datatypes.Hash; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java index 72b5161a775..5a9b42b58e0 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet.headervalidationrules; import org.hyperledger.besu.ethereum.ProtocolContext; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/NoDifficultyRule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/NoDifficultyRule.java index 51828cc3678..5795012937c 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/NoDifficultyRule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/NoDifficultyRule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet.headervalidationrules; import org.hyperledger.besu.ethereum.ProtocolContext; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/NoNonceRule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/NoNonceRule.java index 400565fe868..976b6effce8 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/NoNonceRule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/NoNonceRule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet.headervalidationrules; import org.hyperledger.besu.ethereum.ProtocolContext; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/AbstractPrivacyController.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/AbstractPrivacyController.java index dd8d171c818..09c2a63dc78 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/AbstractPrivacyController.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/AbstractPrivacyController.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/AbstractRestrictedPrivacyController.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/AbstractRestrictedPrivacyController.java index 75d0df629cd..480df6dd0f4 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/AbstractRestrictedPrivacyController.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/AbstractRestrictedPrivacyController.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyController.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyController.java index 595727752b5..458dfa1b317 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyController.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexiblePrivacyController.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java index 1425fdb114e..f9a71675201 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtil.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/MultiTenancyPrivacyController.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/MultiTenancyPrivacyController.java index 192c376a0e5..4d01ec152a8 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/MultiTenancyPrivacyController.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/MultiTenancyPrivacyController.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateStateRootResolver.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateStateRootResolver.java index 747e31d1b05..db0750a410a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateStateRootResolver.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateStateRootResolver.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProvider.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProvider.java index 9bd7f55090d..1f49dea273c 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProvider.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorage.java index e6f3555f60c..73d5c54b348 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/VariablesKeyValueStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/VariablesKeyValueStorage.java index a880932ac39..92c665f9301 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/VariablesKeyValueStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/VariablesKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/PreCloseStateHandler.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/PreCloseStateHandler.java index 7bae8c100ea..879d7dd2a76 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/PreCloseStateHandler.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/PreCloseStateHandler.java @@ -1,6 +1,5 @@ /* - * - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.transaction; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiWorldStateProvider.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiWorldStateProvider.java index 13bd09728b2..d08821ca2ac 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiWorldStateProvider.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiWorldStateProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedMerkleTrieLoader.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedMerkleTrieLoader.java index 9f3251660dc..9b9960b5c67 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedMerkleTrieLoader.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedMerkleTrieLoader.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.cache; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedMerkleTrieLoaderModule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedMerkleTrieLoaderModule.java index 04a8efc4514..8ed7daa35f1 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedMerkleTrieLoaderModule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedMerkleTrieLoaderModule.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.cache; import org.hyperledger.besu.metrics.ObservableMetricsSystem; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedWorldStorageManager.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedWorldStorageManager.java index a7bee477c12..cb081ea8785 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedWorldStorageManager.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/BonsaiCachedWorldStorageManager.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/NoOpBonsaiCachedWorldStorageManager.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/NoOpBonsaiCachedWorldStorageManager.java index 487456e9d44..daecab0e483 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/NoOpBonsaiCachedWorldStorageManager.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/cache/NoOpBonsaiCachedWorldStorageManager.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiPreImageProxy.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiPreImageProxy.java index 4bae322a855..070e797a530 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiPreImageProxy.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiPreImageProxy.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiSnapshotWorldStateKeyValueStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiSnapshotWorldStateKeyValueStorage.java index c2972e04598..5934f88f2a2 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiSnapshotWorldStateKeyValueStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiSnapshotWorldStateKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateKeyValueStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateKeyValueStorage.java index 3f1a87b1348..9f40d2bd350 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateKeyValueStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateLayerStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateLayerStorage.java index 045376f6135..f798dfad739 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateLayerStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateLayerStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/flat/FullFlatDbStrategy.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/flat/FullFlatDbStrategy.java index f8cbf2c3d2b..dd4dac5563b 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/flat/FullFlatDbStrategy.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/flat/FullFlatDbStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage.flat; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/flat/PartialFlatDbStrategy.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/flat/PartialFlatDbStrategy.java index 9e693d63e46..250dc7505cb 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/flat/PartialFlatDbStrategy.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/flat/PartialFlatDbStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage.flat; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogFactoryImpl.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogFactoryImpl.java index 6ebda666dbb..e99b5109649 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogFactoryImpl.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.trielog; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldStateUpdateAccumulator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldStateUpdateAccumulator.java index ff2e696e163..49e8fe03dc1 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldStateUpdateAccumulator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldStateUpdateAccumulator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.worldview; import org.hyperledger.besu.datatypes.AccountValue; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedAccount.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedAccount.java index 9b0a54fa468..2b81ebfbab1 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedAccount.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedAccount.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common; import org.hyperledger.besu.datatypes.AccountValue; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedValue.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedValue.java index bd9c3e3f514..b2b6134550a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedValue.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedValue.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common; import org.hyperledger.besu.plugin.services.trielogs.TrieLog; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedWorldStateProvider.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedWorldStateProvider.java index f985aec7b5d..ad7b06b149a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedWorldStateProvider.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/DiffBasedWorldStateProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.diffbased.common; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/StorageSubscriber.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/StorageSubscriber.java index fe16cf381e9..51ab65bd16c 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/StorageSubscriber.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/StorageSubscriber.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/cache/DiffBasedCachedWorldStorageManager.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/cache/DiffBasedCachedWorldStorageManager.java index 2f92d4e69c9..8ead22bf5bf 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/cache/DiffBasedCachedWorldStorageManager.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/cache/DiffBasedCachedWorldStorageManager.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/cache/DiffBasedCachedWorldView.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/cache/DiffBasedCachedWorldView.java index 951941f0ce1..0d685f63d91 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/cache/DiffBasedCachedWorldView.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/cache/DiffBasedCachedWorldView.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.common.cache; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedLayeredWorldStateKeyValueStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedLayeredWorldStateKeyValueStorage.java index a561072dc05..49f0b6e4b1d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedLayeredWorldStateKeyValueStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedLayeredWorldStateKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.common.storage; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedSnapshotWorldStateKeyValueStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedSnapshotWorldStateKeyValueStorage.java index 9c1a691cf31..032d4a83b03 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedSnapshotWorldStateKeyValueStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedSnapshotWorldStateKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.common.storage; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedWorldStateKeyValueStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedWorldStateKeyValueStorage.java index 33afbe5d4c9..af568035451 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedWorldStateKeyValueStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/DiffBasedWorldStateKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/AccountHashCodeStorageStrategy.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/AccountHashCodeStorageStrategy.java index 446ed3262a1..58eb18b26d4 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/AccountHashCodeStorageStrategy.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/AccountHashCodeStorageStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat; import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.CODE_STORAGE; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/CodeHashCodeStorageStrategy.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/CodeHashCodeStorageStrategy.java index 4263e423b86..3d5516be00a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/CodeHashCodeStorageStrategy.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/CodeHashCodeStorageStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat; import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.CODE_STORAGE; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/CodeStorageStrategy.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/CodeStorageStrategy.java index 91da4eff066..8374a8774e6 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/CodeStorageStrategy.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/CodeStorageStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat; import org.hyperledger.besu.datatypes.Hash; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategy.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategy.java index a614aad0906..299d441350e 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategy.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategyProvider.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategyProvider.java index bfa14aabd7e..17a340fe5d0 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategyProvider.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategyProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat; import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.CODE_STORAGE; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/NoOpTrieLogManager.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/NoOpTrieLogManager.java index d74a6804d92..8c8c2acbfc2 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/NoOpTrieLogManager.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/NoOpTrieLogManager.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogAddedEvent.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogAddedEvent.java index 28edc5cc608..8e69df24e4c 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogAddedEvent.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogAddedEvent.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.common.trielog; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogManager.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogManager.java index 5233cda6f66..9ae6cb38f81 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogManager.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogManager.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.common.trielog; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogPruner.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogPruner.java index 60a728b3fb6..4a5cc875110 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogPruner.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogPruner.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.trielog; import org.hyperledger.besu.datatypes.Hash; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/DiffBasedWorldState.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/DiffBasedWorldState.java index 7a909cbf8e1..db536cbc7a7 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/DiffBasedWorldState.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/DiffBasedWorldState.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.worldview; import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.TRIE_BRANCH_STORAGE; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/DiffBasedWorldView.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/DiffBasedWorldView.java index 626584aa2c3..7ecc49e2863 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/DiffBasedWorldView.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/DiffBasedWorldView.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.worldview; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/DiffBasedWorldStateUpdateAccumulator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/DiffBasedWorldStateUpdateAccumulator.java index 66169ee85a3..4e8c0e76ced 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/DiffBasedWorldStateUpdateAccumulator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/DiffBasedWorldStateUpdateAccumulator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.worldview.accumulator; import org.hyperledger.besu.datatypes.AccountValue; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/AccountConsumingMap.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/AccountConsumingMap.java index 63c5b9233f2..1a69b655b68 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/AccountConsumingMap.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/AccountConsumingMap.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/Consumer.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/Consumer.java index 577b0d8c551..073deb3654a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/Consumer.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/Consumer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/StorageConsumingMap.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/StorageConsumingMap.java index 13b42d7b4a4..f48eab5c870 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/StorageConsumingMap.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/common/worldview/accumulator/preload/StorageConsumingMap.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/ForestWorldStateArchive.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/ForestWorldStateArchive.java index d38976b644b..1cdd079e15a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/ForestWorldStateArchive.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/ForestWorldStateArchive.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.forest; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/storage/ForestWorldStateKeyValueStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/storage/ForestWorldStateKeyValueStorage.java index 6e5457bede1..eeec7835b62 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/storage/ForestWorldStateKeyValueStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/storage/ForestWorldStateKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/worldview/ForestMutableWorldState.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/worldview/ForestMutableWorldState.java index ae2c6392ac3..ac725cb9f09 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/worldview/ForestMutableWorldState.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/forest/worldview/ForestMutableWorldState.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/CachingBlockHashLookup.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/CachingBlockHashLookup.java index 1e1e47ece4a..1e90a349156 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/CachingBlockHashLookup.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/CachingBlockHashLookup.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/FlatDbMode.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/FlatDbMode.java index 89be8acf229..4415ccb8251 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/FlatDbMode.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/FlatDbMode.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.worldstate; diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/PeerTrieNodeFinder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/PeerTrieNodeFinder.java index 549157860bd..8d1b340f0c2 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/PeerTrieNodeFinder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/PeerTrieNodeFinder.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateArchive.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateArchive.java index 89b36917d85..23859ac3961 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateArchive.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateArchive.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateKeyValueStorage.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateKeyValueStorage.java index 3e848dce6ce..07fa922c126 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateKeyValueStorage.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateKeyValueStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateStorageCoordinator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateStorageCoordinator.java index 7e901df6458..710d5ea15df 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateStorageCoordinator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/WorldStateStorageCoordinator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlobTestFixture.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlobTestFixture.java index c4fa3b2852b..21e8630c84f 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlobTestFixture.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlobTestFixture.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.core; import static org.assertj.core.api.Assertions.fail; diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockHeaderTestFixture.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockHeaderTestFixture.java index d2faa8ef033..96ea9c2f783 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockHeaderTestFixture.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockHeaderTestFixture.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/MilestoneStreamingProtocolSchedule.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/MilestoneStreamingProtocolSchedule.java index 4f50d83476f..ad86866c666 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/MilestoneStreamingProtocolSchedule.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/MilestoneStreamingProtocolSchedule.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.core; import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule; diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/TrieGenerator.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/TrieGenerator.java index a04592d3093..9a9108aa042 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/TrieGenerator.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/TrieGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/VariablesStorageHelper.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/VariablesStorageHelper.java index 9744748ef1f..268c7f01350 100644 --- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/VariablesStorageHelper.java +++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/VariablesStorageHelper.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java index 2fb5a598a16..3b98f652ceb 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/BlockImportExceptionHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/BadBlockManagerTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/BadBlockManagerTest.java index b4a73eb5b17..10206af504d 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/BadBlockManagerTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/BadBlockManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.chain; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/ChainDataPrunerTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/ChainDataPrunerTest.java index 7082d8ae1ce..78ab15eb686 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/ChainDataPrunerTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/ChainDataPrunerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.chain; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/BlockValueCalculatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/BlockValueCalculatorTest.java index e819064d9f2..0db0ec4145d 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/BlockValueCalculatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/BlockValueCalculatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Contributors to Hyperledger Besu. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/VersionMetadataTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/VersionMetadataTest.java index dce027b5e5d..32a978c3705 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/VersionMetadataTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/VersionMetadataTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.core; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncodingTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncodingTest.java index 6b33f69dd5a..b847d0bb721 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncodingTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncodingTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/DepositDecoderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/DepositDecoderTest.java index 5939611c5e9..131cd089972 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/DepositDecoderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/DepositDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoderTest.java index b0d15607cba..fc9027cdbab 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalDecoderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalDecoderTest.java index a23bf24cff8..9ffd219db0a 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalDecoderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalEncoderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalEncoderTest.java index 7dd79e229a0..3e4d81f02be 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalEncoderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalEncoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoderTest.java index 0de468ec5da..a6e36063ed4 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoderTest.java index a70d4a7fc95..3f9eb0e8668 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/WithdrawalRequestEncoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java index ebcdb1bc006..e5cb80ce875 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/DefaultProtocolScheduleTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/DefaultProtocolScheduleTest.java index b68104d81ba..9e4522912d7 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/DefaultProtocolScheduleTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/DefaultProtocolScheduleTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/DepositsValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/DepositsValidatorTest.java index 09bd5a110b7..47428ffe532 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/DepositsValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/DepositsValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java index 3106d0dbf85..6c0b8b01165 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetBlockBodyValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java index 92a353319bc..182f1b609e8 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PermissionTransactionValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PermissionTransactionValidatorTest.java index 3fdb20dfd4f..519401c97ba 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PermissionTransactionValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PermissionTransactionValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidationFactoryTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidationFactoryTest.java index 334439b0844..9e29acbe637 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidationFactoryTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/TransactionValidationFactoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelperTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelperTest.java index 5eeff4397d8..46cf1182d33 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelperTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestContractHelperTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTest.java index b5e091ddc2a..8315e9db018 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTestFixtures.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTestFixtures.java index ed132a87ed4..b44830df573 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTestFixtures.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalRequestValidatorTestFixtures.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import static org.hyperledger.besu.ethereum.mainnet.WithdrawalRequestContractHelper.MAX_WITHDRAWAL_REQUESTS_PER_BLOCK; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsProcessorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsProcessorTest.java index db82d33e33c..4f6434bbd6f 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsProcessorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsProcessorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsValidatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsValidatorTest.java index 4b96fd6c1ed..d05a9650928 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsValidatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/WithdrawalsValidatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet; import static java.util.Collections.emptyList; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/CancunFeeMarketTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/CancunFeeMarketTest.java index 2394d66da51..06fe62de581 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/CancunFeeMarketTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/CancunFeeMarketTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet.feemarket; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarketTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarketTest.java index 0e0873b39ce..2bc3cf783ad 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarketTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarketTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarketTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarketTest.java index 1d0bdd53c97..032ede3a8ee 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarketTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarketTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java index 4047c647aec..47f251cc409 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/BlobGasValidationRuleTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/BlobGasValidationRuleTest.java index 34f7079be10..858a8a9a26c 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/BlobGasValidationRuleTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/BlobGasValidationRuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.mainnet.headervalidationrules; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/GasLimitElasticityValidationRuleFixedBaseFeeMarketTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/GasLimitElasticityValidationRuleFixedBaseFeeMarketTest.java index 7f2387cdca0..7f29e6f42a0 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/GasLimitElasticityValidationRuleFixedBaseFeeMarketTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/GasLimitElasticityValidationRuleFixedBaseFeeMarketTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/GasLimitElasticityValidationRuleZeroBaseFeeMarketTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/GasLimitElasticityValidationRuleZeroBaseFeeMarketTest.java index a25345994bc..229b402edce 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/GasLimitElasticityValidationRuleZeroBaseFeeMarketTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/GasLimitElasticityValidationRuleZeroBaseFeeMarketTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtilTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtilTest.java index f4247c7c6d2..6d556f324c9 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtilTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/FlexibleUtilTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateStateGenesisAllocatorTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateStateGenesisAllocatorTest.java index e53244ef6d8..5a037b3b1cf 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateStateGenesisAllocatorTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateStateGenesisAllocatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.privacy; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProviderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProviderTest.java index 36123f5fd99..95b39197ea0 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProviderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateRangeProofProviderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateRangeProofProviderTest.java index 2132b6b48fc..535a91ba939 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateRangeProofProviderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateRangeProofProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorageTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorageTest.java index 526c839b69e..0f0911b4fa0 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorageTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorageTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java index 82bf9209957..2e1dd913a4d 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiAccountTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiAccountTest.java index 60396b9789f..53cf9e1ca12 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiAccountTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiAccountTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiCachedMerkleTrieLoaderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiCachedMerkleTrieLoaderTest.java index d4e42cd516b..06b377ad83a 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiCachedMerkleTrieLoaderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiCachedMerkleTrieLoaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java index c786a609ce6..ffdc3fa897f 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateKeyValueStorageTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateKeyValueStorageTest.java index c4769248e9c..c3d7da9fe77 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateKeyValueStorageTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/storage/BonsaiWorldStateKeyValueStorageTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogFactoryTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogFactoryTests.java index 59c208792e4..5173df717fc 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogFactoryTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.trielog; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogManagerTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogManagerTests.java index a6ff8d3a7c8..129a10f1bd0 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogManagerTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogManagerTests.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.trielog; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogPrunerTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogPrunerTest.java index 19e63f6f940..bca954a4935 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogPrunerTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/trielog/TrieLogPrunerTest.java @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.trielog; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldStateTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldStateTest.java index 8abae1f2b6b..0757b40dbbb 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldStateTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiWorldStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.worldview; import static org.mockito.Mockito.verify; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategyProviderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategyProviderTest.java index 5199bc19db4..7e0d2725068 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategyProviderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/common/storage/flat/FlatDbStrategyProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat; import static org.assertj.core.api.Assertions.assertThat; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogLayerTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogLayerTests.java index d967ca1a1b4..85534de1b06 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogLayerTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/common/trielog/TrieLogLayerTests.java @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.ethereum.trie.diffbased.common.trielog; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/forest/storage/ForestKeyValueStorageWorldStateStorageTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/forest/storage/ForestKeyValueStorageWorldStateStorageTest.java index d60f92448cc..2316089ba99 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/forest/storage/ForestKeyValueStorageWorldStateStorageTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/forest/storage/ForestKeyValueStorageWorldStateStorageTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/forest/worldview/ForestMutableWorldStateTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/forest/worldview/ForestMutableWorldStateTest.java index 359b076338f..4cac816227f 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/forest/worldview/ForestMutableWorldStateTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/forest/worldview/ForestMutableWorldStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From d85036d3b2c1c46af055849f8bf65bfc37d504be Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Fri, 3 May 2024 08:18:04 +1000 Subject: [PATCH 51/59] Apply Hyperledger license header to `ethereum/ethstats` and `ethereum/evmtool` (#7037) Signed-off-by: Usman Saleem --- .../besu/ethstats/util/EthStatsConnectOptionsTest.java | 2 +- .../java/org/hyperledger/besu/evmtool/B11rSubCommand.java | 4 +--- .../org/hyperledger/besu/evmtool/BenchmarkSubCommand.java | 2 +- .../java/org/hyperledger/besu/evmtool/EvmToolComponent.java | 3 +-- .../src/main/java/org/hyperledger/besu/evmtool/JsonUtils.java | 4 +--- .../main/java/org/hyperledger/besu/evmtool/T8nExecutor.java | 3 +-- .../org/hyperledger/besu/evmtool/T8nServerSubCommand.java | 3 +-- .../main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java | 4 +--- .../besu/evmtool/benchmarks/AltBN128Benchmark.java | 2 +- .../besu/evmtool/benchmarks/BenchmarkExecutor.java | 2 +- .../besu/evmtool/benchmarks/ECRecoverBenchmark.java | 2 +- .../hyperledger/besu/evmtool/benchmarks/ModExpBenchmark.java | 2 +- .../besu/evmtool/benchmarks/Secp256k1Benchmark.java | 2 +- .../java/org/hyperledger/besu/evmtool/EvmToolSpecTests.java | 2 +- .../org/hyperledger/besu/evmtool/T8nServerSubCommandTest.java | 2 +- .../p2p/network/exceptions/PeerChannelClosedException.java | 4 +--- .../hyperledger/besu/ethereum/p2p/plain/MessageHandler.java | 2 +- .../org/hyperledger/besu/ethereum/p2p/plain/MessageType.java | 2 +- .../org/hyperledger/besu/ethereum/p2p/plain/PlainFramer.java | 2 +- .../hyperledger/besu/ethereum/p2p/plain/PlainHandshaker.java | 2 +- .../org/hyperledger/besu/ethereum/p2p/plain/PlainMessage.java | 2 +- .../besu/ethereum/p2p/rlpx/RlpxFrameConstants.java | 2 +- .../besu/ethereum/p2p/rlpx/framing/FramerProvider.java | 2 +- .../besu/ethereum/p2p/rlpx/handshake/HandshakerProvider.java | 2 +- .../besu/ethereum/p2p/rlpx/wire/ShouldConnectCallback.java | 2 +- .../besu/ethereum/p2p/network/FileBasedPasswordProvider.java | 2 +- .../besu/ethereum/p2p/network/P2PPlainNetworkTest.java | 2 +- .../besu/ethereum/p2p/plain/MessageHandlerTest.java | 2 +- .../connections/netty/NettyTLSConnectionInitializerTest.java | 3 +-- .../hyperledger/besu/ethereum/p2p/rlpx/wire/PeerInfoTest.java | 2 +- 30 files changed, 30 insertions(+), 42 deletions(-) diff --git a/ethereum/ethstats/src/test/java/org/hyperledger/besu/ethstats/util/EthStatsConnectOptionsTest.java b/ethereum/ethstats/src/test/java/org/hyperledger/besu/ethstats/util/EthStatsConnectOptionsTest.java index f3227a62e76..01c58bbdddf 100644 --- a/ethereum/ethstats/src/test/java/org/hyperledger/besu/ethstats/util/EthStatsConnectOptionsTest.java +++ b/ethereum/ethstats/src/test/java/org/hyperledger/besu/ethstats/util/EthStatsConnectOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java index c48d1cf1da3..9a27a8a40d9 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/B11rSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evmtool; import static org.hyperledger.besu.evmtool.B11rSubCommand.COMMAND_ALIAS; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BenchmarkSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BenchmarkSubCommand.java index 8078bd6ba1b..d190e55b0df 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BenchmarkSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BenchmarkSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolComponent.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolComponent.java index 5f66c5ddf50..95a648fe1fe 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolComponent.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolComponent.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/JsonUtils.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/JsonUtils.java index 277679c0c80..42da8fd950f 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/JsonUtils.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/JsonUtils.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evmtool; import org.hyperledger.besu.datatypes.Address; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java index 462fe890c03..b444be2d315 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java index afb12635afd..1c0a49438e0 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,6 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ package org.hyperledger.besu.evmtool; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java index 40f7bb07987..95dabb3183f 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.evmtool; import static org.hyperledger.besu.evmtool.T8nSubCommand.COMMAND_ALIAS; diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/AltBN128Benchmark.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/AltBN128Benchmark.java index 1145cfbf1af..c8c82cb6faa 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/AltBN128Benchmark.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/AltBN128Benchmark.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java index 8beab2f7c86..8c68295993e 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BenchmarkExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/ECRecoverBenchmark.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/ECRecoverBenchmark.java index a2cca4c5846..5f44c6ff660 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/ECRecoverBenchmark.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/ECRecoverBenchmark.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/ModExpBenchmark.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/ModExpBenchmark.java index 452fd407626..38c6171fea9 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/ModExpBenchmark.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/ModExpBenchmark.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/Secp256k1Benchmark.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/Secp256k1Benchmark.java index fad5d5013c8..57bd39a931a 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/Secp256k1Benchmark.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/Secp256k1Benchmark.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/evmtool/src/test/java/org/hyperledger/besu/evmtool/EvmToolSpecTests.java b/ethereum/evmtool/src/test/java/org/hyperledger/besu/evmtool/EvmToolSpecTests.java index c326d653e52..504d1f04677 100644 --- a/ethereum/evmtool/src/test/java/org/hyperledger/besu/evmtool/EvmToolSpecTests.java +++ b/ethereum/evmtool/src/test/java/org/hyperledger/besu/evmtool/EvmToolSpecTests.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/evmtool/src/test/java/org/hyperledger/besu/evmtool/T8nServerSubCommandTest.java b/ethereum/evmtool/src/test/java/org/hyperledger/besu/evmtool/T8nServerSubCommandTest.java index 2f658eeb323..f3312372f67 100644 --- a/ethereum/evmtool/src/test/java/org/hyperledger/besu/evmtool/T8nServerSubCommandTest.java +++ b/ethereum/evmtool/src/test/java/org/hyperledger/besu/evmtool/T8nServerSubCommandTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/exceptions/PeerChannelClosedException.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/exceptions/PeerChannelClosedException.java index 34590ae1d61..05038f8f83b 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/exceptions/PeerChannelClosedException.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/exceptions/PeerChannelClosedException.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.p2p.network.exceptions; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.PeerInfo; diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/MessageHandler.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/MessageHandler.java index 2b4efba9df6..294bb43cac7 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/MessageHandler.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/MessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/MessageType.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/MessageType.java index 7335b9810f5..b0bb61dc207 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/MessageType.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/MessageType.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainFramer.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainFramer.java index dfab2043024..ad051653021 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainFramer.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainFramer.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainHandshaker.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainHandshaker.java index cc109c87d6b..5800994bccb 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainHandshaker.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainHandshaker.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainMessage.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainMessage.java index f212141037d..ffcb45e880e 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainMessage.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/plain/PlainMessage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/RlpxFrameConstants.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/RlpxFrameConstants.java index 82b706c535e..1c119e53f5d 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/RlpxFrameConstants.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/RlpxFrameConstants.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/framing/FramerProvider.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/framing/FramerProvider.java index 423bdccaf69..270ad9fd36b 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/framing/FramerProvider.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/framing/FramerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/handshake/HandshakerProvider.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/handshake/HandshakerProvider.java index e6eca777582..48d883bb6db 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/handshake/HandshakerProvider.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/handshake/HandshakerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/ShouldConnectCallback.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/ShouldConnectCallback.java index dbc208efb78..f6473528e6a 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/ShouldConnectCallback.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/ShouldConnectCallback.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/FileBasedPasswordProvider.java b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/FileBasedPasswordProvider.java index 7c72a66d23a..5a0e3e861b2 100644 --- a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/FileBasedPasswordProvider.java +++ b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/FileBasedPasswordProvider.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/P2PPlainNetworkTest.java b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/P2PPlainNetworkTest.java index 32cf99635ff..d02cb1ff83f 100644 --- a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/P2PPlainNetworkTest.java +++ b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/P2PPlainNetworkTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/plain/MessageHandlerTest.java b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/plain/MessageHandlerTest.java index fba1bbdf2f3..550b7170a8a 100644 --- a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/plain/MessageHandlerTest.java +++ b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/plain/MessageHandlerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/NettyTLSConnectionInitializerTest.java b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/NettyTLSConnectionInitializerTest.java index f7f3dbc5124..ac39d81bb07 100644 --- a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/NettyTLSConnectionInitializerTest.java +++ b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/NettyTLSConnectionInitializerTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - package org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; diff --git a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/PeerInfoTest.java b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/PeerInfoTest.java index 3217f23fcbb..9e0c3a147ee 100644 --- a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/PeerInfoTest.java +++ b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/PeerInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From f63282c3b21e23efce737c30aa967c969af49858 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Fri, 3 May 2024 09:51:48 +1000 Subject: [PATCH 52/59] Apply Hyperledger license header to `p2p`,`trie` and `verkletrie` (#7038) Signed-off-by: Usman Saleem --- .../referencetests/BonsaiReferenceTestUpdateAccumulator.java | 2 +- .../referencetests/BonsaiReferenceTestWorldState.java | 2 +- .../referencetests/BonsaiReferenceTestWorldStateStorage.java | 2 +- .../referencetests/ForestReferenceTestWorldState.java | 2 +- .../org/hyperledger/besu/ethereum/trie/AllNodesVisitor.java | 2 +- .../org/hyperledger/besu/ethereum/trie/CommitVisitor.java | 2 +- .../org/hyperledger/besu/ethereum/trie/CompactEncoding.java | 2 +- .../besu/ethereum/trie/InnerNodeDiscoveryManager.java | 2 +- .../hyperledger/besu/ethereum/trie/LocationNodeVisitor.java | 2 +- .../org/hyperledger/besu/ethereum/trie/MerkleStorage.java | 2 +- .../java/org/hyperledger/besu/ethereum/trie/MerkleTrie.java | 2 +- .../java/org/hyperledger/besu/ethereum/trie/MissingNode.java | 2 +- .../java/org/hyperledger/besu/ethereum/trie/NodeFactory.java | 2 +- .../java/org/hyperledger/besu/ethereum/trie/NodeVisitor.java | 2 +- .../java/org/hyperledger/besu/ethereum/trie/NullNode.java | 2 +- .../org/hyperledger/besu/ethereum/trie/PathNodeVisitor.java | 2 +- .../org/hyperledger/besu/ethereum/trie/PersistVisitor.java | 4 +--- .../java/org/hyperledger/besu/ethereum/trie/ProofVisitor.java | 2 +- .../java/org/hyperledger/besu/ethereum/trie/RangeManager.java | 2 +- .../besu/ethereum/trie/RangeStorageEntriesCollector.java | 2 +- .../org/hyperledger/besu/ethereum/trie/RestoreVisitor.java | 2 +- .../org/hyperledger/besu/ethereum/trie/SimpleMerkleTrie.java | 2 +- .../org/hyperledger/besu/ethereum/trie/SnapCommitVisitor.java | 2 +- .../org/hyperledger/besu/ethereum/trie/StoredMerkleTrie.java | 2 +- .../java/org/hyperledger/besu/ethereum/trie/StoredNode.java | 2 +- .../java/org/hyperledger/besu/ethereum/trie/TrieIterator.java | 2 +- .../hyperledger/besu/ethereum/trie/patricia/BranchNode.java | 2 +- .../besu/ethereum/trie/patricia/DefaultNodeFactory.java | 2 +- .../besu/ethereum/trie/patricia/ExtensionNode.java | 2 +- .../hyperledger/besu/ethereum/trie/patricia/GetVisitor.java | 2 +- .../org/hyperledger/besu/ethereum/trie/patricia/LeafNode.java | 2 +- .../hyperledger/besu/ethereum/trie/patricia/PutVisitor.java | 2 +- .../besu/ethereum/trie/patricia/RemoveVisitor.java | 2 +- .../besu/ethereum/trie/patricia/SimpleMerklePatriciaTrie.java | 2 +- .../besu/ethereum/trie/patricia/StoredMerklePatriciaTrie.java | 2 +- .../besu/ethereum/trie/patricia/StoredNodeFactory.java | 2 +- .../besu/ethereum/trie/patricia/TrieNodeDecoder.java | 2 +- .../hyperledger/besu/ethereum/trie/AllNodesVisitorTest.java | 2 +- .../besu/ethereum/trie/RangeStorageEntriesCollectorTest.java | 2 +- .../hyperledger/besu/ethereum/trie/SnapCommitVisitorTest.java | 2 +- .../org/hyperledger/besu/ethereum/trie/TrieIteratorTest.java | 2 +- .../hyperledger/besu/ethereum/trie/TrieNodeDecoderTest.java | 2 +- .../trie/patricia/AbstractMerklePatriciaTrieTest.java | 2 +- .../ethereum/trie/patricia/SimpleMerklePatriciaTrieTest.java | 2 +- .../ethereum/trie/patricia/StoredMerklePatriciaTrieTest.java | 2 +- .../besu/ethereum/verkletrie/bandersnatch/Point.java | 2 +- .../besu/ethereum/verkletrie/bandersnatch/PointAffine.java | 2 +- .../besu/ethereum/verkletrie/bandersnatch/fp/Element.java | 2 +- .../besu/ethereum/verkletrie/bandersnatch/fr/Element.java | 2 +- .../besu/ethereum/verkletrie/bandersnatch/fp/ElementTest.java | 2 +- .../besu/ethereum/verkletrie/bandersnatch/fr/ElementTest.java | 2 +- 51 files changed, 51 insertions(+), 53 deletions(-) diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestUpdateAccumulator.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestUpdateAccumulator.java index ee4730ffda3..db8bb4b3e9e 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestUpdateAccumulator.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestUpdateAccumulator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldState.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldState.java index f16452f9360..8acdea1170a 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldState.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldState.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldStateStorage.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldStateStorage.java index 6cdbb3834e4..3d059097810 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldStateStorage.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BonsaiReferenceTestWorldStateStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ForestReferenceTestWorldState.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ForestReferenceTestWorldState.java index 9ab158a554c..014e589f696 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ForestReferenceTestWorldState.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ForestReferenceTestWorldState.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitor.java index 35d4caaae13..1bef1d2952b 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CommitVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CommitVisitor.java index 6958a719426..4d4d70cce97 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CommitVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CommitVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CompactEncoding.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CompactEncoding.java index 4e9eaf92087..132d0036e75 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CompactEncoding.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CompactEncoding.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/InnerNodeDiscoveryManager.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/InnerNodeDiscoveryManager.java index d20b47e9e59..0e33c4c95b5 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/InnerNodeDiscoveryManager.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/InnerNodeDiscoveryManager.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/LocationNodeVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/LocationNodeVisitor.java index ac4ce53796d..6a7990baa1b 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/LocationNodeVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/LocationNodeVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MerkleStorage.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MerkleStorage.java index f9bb764376b..62ccf33e54e 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MerkleStorage.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MerkleStorage.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MerkleTrie.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MerkleTrie.java index 645445e9bf9..2fdb494703f 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MerkleTrie.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MerkleTrie.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MissingNode.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MissingNode.java index 92035330e95..e04384aeffa 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MissingNode.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/MissingNode.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NodeFactory.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NodeFactory.java index 69d61e3ff00..dd0b56d7e73 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NodeFactory.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NodeFactory.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NodeVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NodeVisitor.java index bfc517dfdfc..bbf3301079f 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NodeVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NodeVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NullNode.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NullNode.java index da2ab9cddca..6ef63400aa1 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NullNode.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/NullNode.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/PathNodeVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/PathNodeVisitor.java index 958c1bf5d6f..80301ab3071 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/PathNodeVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/PathNodeVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/PersistVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/PersistVisitor.java index c524df2ceab..3bdc7399640 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/PersistVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/PersistVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,9 +11,7 @@ * specific language governing permissions and limitations under the License. * * SPDX-License-Identifier: Apache-2.0 - * */ - package org.hyperledger.besu.ethereum.trie; import org.hyperledger.besu.ethereum.trie.patricia.BranchNode; diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/ProofVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/ProofVisitor.java index 0b85626d931..25ec8c9c68d 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/ProofVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/ProofVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RangeManager.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RangeManager.java index f0699831d94..99f81989f06 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RangeManager.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RangeManager.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollector.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollector.java index 595f46164d1..475f0c0c637 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollector.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollector.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RestoreVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RestoreVisitor.java index 556db062b9c..a4d61cb8ebb 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RestoreVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/RestoreVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/SimpleMerkleTrie.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/SimpleMerkleTrie.java index d938f098f3d..e337bd7f2b6 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/SimpleMerkleTrie.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/SimpleMerkleTrie.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/SnapCommitVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/SnapCommitVisitor.java index 099674e226b..dfe18d82c26 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/SnapCommitVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/SnapCommitVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/StoredMerkleTrie.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/StoredMerkleTrie.java index 835bcd5b680..03d66fb0c24 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/StoredMerkleTrie.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/StoredMerkleTrie.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/StoredNode.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/StoredNode.java index 8a90287cdb0..752187b899e 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/StoredNode.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/StoredNode.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/TrieIterator.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/TrieIterator.java index cb314d87959..1fc9e7f4094 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/TrieIterator.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/TrieIterator.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/BranchNode.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/BranchNode.java index b5d84513619..15f242b6006 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/BranchNode.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/BranchNode.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/DefaultNodeFactory.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/DefaultNodeFactory.java index 2c348c7a86c..b4c2975c589 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/DefaultNodeFactory.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/DefaultNodeFactory.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/ExtensionNode.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/ExtensionNode.java index 50df015e380..5721c9f98f3 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/ExtensionNode.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/ExtensionNode.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/GetVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/GetVisitor.java index c34bc96fa6f..3cdfd836b6a 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/GetVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/GetVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/LeafNode.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/LeafNode.java index 38690d95050..18de15dc3f5 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/LeafNode.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/LeafNode.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/PutVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/PutVisitor.java index c536fa56b33..ba49cc32227 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/PutVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/PutVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/RemoveVisitor.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/RemoveVisitor.java index 3be8f8f4411..8e88db89217 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/RemoveVisitor.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/RemoveVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/SimpleMerklePatriciaTrie.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/SimpleMerklePatriciaTrie.java index 8bd14cbb93c..faeea67c23d 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/SimpleMerklePatriciaTrie.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/SimpleMerklePatriciaTrie.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrie.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrie.java index 0ae7cf344e7..74077e9c0d8 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrie.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrie.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/StoredNodeFactory.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/StoredNodeFactory.java index 68e0d293f3c..a79f2a9d8b5 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/StoredNodeFactory.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/StoredNodeFactory.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/TrieNodeDecoder.java b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/TrieNodeDecoder.java index 3d99b7ffbec..b3476337a77 100644 --- a/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/TrieNodeDecoder.java +++ b/ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/patricia/TrieNodeDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitorTest.java b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitorTest.java index 5bd3535756f..be6ebdad062 100644 --- a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitorTest.java +++ b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollectorTest.java b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollectorTest.java index 09ddc1b2608..6f507d3668f 100644 --- a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollectorTest.java +++ b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/SnapCommitVisitorTest.java b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/SnapCommitVisitorTest.java index 5b281529893..d0561df5ac7 100644 --- a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/SnapCommitVisitorTest.java +++ b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/SnapCommitVisitorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieIteratorTest.java b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieIteratorTest.java index 3264ccffb72..ebd01edf240 100644 --- a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieIteratorTest.java +++ b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieIteratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieNodeDecoderTest.java b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieNodeDecoderTest.java index f5c15dd18b6..d0372e13b7c 100644 --- a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieNodeDecoderTest.java +++ b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieNodeDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/AbstractMerklePatriciaTrieTest.java b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/AbstractMerklePatriciaTrieTest.java index f201d3fa4e0..284250a79b3 100644 --- a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/AbstractMerklePatriciaTrieTest.java +++ b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/AbstractMerklePatriciaTrieTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/SimpleMerklePatriciaTrieTest.java b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/SimpleMerklePatriciaTrieTest.java index 33eecfd2286..06c4ae184b8 100644 --- a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/SimpleMerklePatriciaTrieTest.java +++ b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/SimpleMerklePatriciaTrieTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrieTest.java b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrieTest.java index d33746b062f..d33ca930737 100644 --- a/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrieTest.java +++ b/ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrieTest.java @@ -1,5 +1,5 @@ /* - * Copyright Hyperledger Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/Point.java b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/Point.java index 18f9dcc8afd..bc10d80bb1d 100644 --- a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/Point.java +++ b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/Point.java @@ -1,5 +1,5 @@ /* - * Copyright Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/PointAffine.java b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/PointAffine.java index 400fa4fbeba..074033e1935 100644 --- a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/PointAffine.java +++ b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/PointAffine.java @@ -1,5 +1,5 @@ /* - * Copyright Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/Element.java b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/Element.java index 02d2e43b9f8..535cde2c5d5 100644 --- a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/Element.java +++ b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/Element.java @@ -1,5 +1,5 @@ /* - * Copyright Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/Element.java b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/Element.java index 8fd84f7041a..28fb0522359 100644 --- a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/Element.java +++ b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/Element.java @@ -1,5 +1,5 @@ /* - * Copyright Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/ElementTest.java b/ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/ElementTest.java index d7f72dd74b2..b51723c5783 100644 --- a/ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/ElementTest.java +++ b/ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/ElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/ElementTest.java b/ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/ElementTest.java index b4046ac6ab4..3a3d6f1b124 100644 --- a/ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/ElementTest.java +++ b/ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/ElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright Besu Contributors. + * Copyright contributors to Hyperledger Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From bbbfc4c822e27565eb514ffae51e5b42acd98072 Mon Sep 17 00:00:00 2001 From: Jason Frame Date: Fri, 3 May 2024 10:43:41 +1000 Subject: [PATCH 53/59] World state halt and chain halt fixes (#7027) Signed-off-by: Jason Frame Signed-off-by: stefan.pingel@consensys.net --- CHANGELOG.md | 1 + .../options/unstable/SynchronizerOptions.java | 13 ++--- .../cli/options/SynchronizerOptionsTest.java | 2 +- .../eth/sync/SynchronizerConfiguration.java | 20 ++++---- .../FastSyncDownloadPipelineFactory.java | 2 +- .../fastsync/PivotSelectorFromSafeBlock.java | 3 +- .../FullSyncDownloadPipelineFactory.java | 2 +- .../eth/sync/range/SyncTargetRangeSource.java | 37 +++++++++----- .../snapsync/DynamicPivotBlockSelector.java | 2 +- .../sync/snapsync/SnapWorldDownloadState.java | 48 ++++++++++------- .../SnapWorldStateDownloadProcess.java | 51 +++++++++++++++++++ .../snapsync/SnapWorldStateDownloader.java | 4 +- .../snapsync/SnapWorldDownloadStateTest.java | 17 ++++++- 13 files changed, 145 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bcabc75921..3130fa01fbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ - Snap client fixes discovered during snap server testing [#6847](https://github.com/hyperledger/besu/pull/6847) - Correctly initialize the txpool as disabled on creation [#6890](https://github.com/hyperledger/besu/pull/6890) - Fix worldstate download halt when using snap sync during initial sync [#6981](https://github.com/hyperledger/besu/pull/6981) +- Fix chain halt due to peers only partially responding with headers. And worldstate halts caused by a halt in the chain sync [#7027](https://github.com/hyperledger/besu/pull/7027) ### Download Links diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/SynchronizerOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/SynchronizerOptions.java index da5199f85dc..1adf7080582 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/SynchronizerOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/SynchronizerOptions.java @@ -39,6 +39,8 @@ public class SynchronizerOptions implements CLIOptions