From c8ad1d12a0cf4eafcd0822874075427dfb0b1108 Mon Sep 17 00:00:00 2001 From: garyschulte Date: Wed, 11 Dec 2024 14:04:18 -0800 Subject: [PATCH 1/7] Bump besu-native dep to 1.0.0 (#8019) * remove evm dep on matter-labs bls12 lib Signed-off-by: garyschulte --- evm/build.gradle | 1 - gradle/verification-metadata.xml | 68 ++++++++++++++------------------ platform/build.gradle | 13 +++--- 3 files changed, 36 insertions(+), 46 deletions(-) diff --git a/evm/build.gradle b/evm/build.gradle index a48cb916493..c9506523f3d 100644 --- a/evm/build.gradle +++ b/evm/build.gradle @@ -44,7 +44,6 @@ dependencies { implementation 'io.tmio:tuweni-bytes' implementation 'io.tmio:tuweni-units' implementation 'org.hyperledger.besu:arithmetic' - implementation 'org.hyperledger.besu:bls12-381' implementation'org.hyperledger.besu:gnark' implementation 'tech.pegasys:jc-kzg-4844' diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index d6392fbe2ce..c3acee03312 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -5160,12 +5160,12 @@ - - - + + + - - + + @@ -5176,52 +5176,44 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - - - - - - - - + + diff --git a/platform/build.gradle b/platform/build.gradle index 79c2c5c5651..f679fa20d2e 100644 --- a/platform/build.gradle +++ b/platform/build.gradle @@ -138,13 +138,12 @@ dependencies { api 'org.hibernate.validator:hibernate-validator:8.0.1.Final' - api 'org.hyperledger.besu:arithmetic:0.9.7' - api 'org.hyperledger.besu:blake2bf:0.9.7' - api 'org.hyperledger.besu:bls12-381:0.9.7' - api 'org.hyperledger.besu:gnark:0.9.7' - api 'org.hyperledger.besu:ipa-multipoint:0.9.7' - api 'org.hyperledger.besu:secp256k1:0.9.7' - api 'org.hyperledger.besu:secp256r1:0.9.7' + api 'org.hyperledger.besu:arithmetic:1.0.0' + api 'org.hyperledger.besu:blake2bf:1.0.0' + api 'org.hyperledger.besu:gnark:1.0.0' + api 'org.hyperledger.besu:ipa-multipoint:1.0.0' + api 'org.hyperledger.besu:secp256k1:1.0.0' + api 'org.hyperledger.besu:secp256r1:1.0.0' api 'org.hyperledger.besu:besu-errorprone-checks:1.0.0' From 19119f1e0fab8891dea2be8b880fff602eeb260b Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Thu, 12 Dec 2024 19:16:23 +0100 Subject: [PATCH 2/7] Fix BOM pom publication to Artifactory (#8021) Signed-off-by: Fabio Di Fabio --- build.gradle | 2 +- platform/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8b6982cd4a0..9c9bb68939b 100644 --- a/build.gradle +++ b/build.gradle @@ -579,7 +579,7 @@ subprojects { password = artifactoryKey } defaults { - publications('mavenJava') + publications('mavenJava', 'mavenJavaPlatform') publishArtifacts = true publishPom = true } diff --git a/platform/build.gradle b/platform/build.gradle index f679fa20d2e..f5bb54afcd1 100644 --- a/platform/build.gradle +++ b/platform/build.gradle @@ -194,7 +194,7 @@ spotless { publishing { publications { - mavenPlatform(MavenPublication) { + mavenJavaPlatform(MavenPublication) { from components.javaPlatform groupId "org.hyperledger.besu" artifactId 'bom' From 98780efd15ee3223de2c0cf2d144c8aaee30d5db Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Fri, 13 Dec 2024 14:27:55 +1000 Subject: [PATCH 3/7] eth_call state override bugfix - movePrecompileToAddress (#8024) * add ignore unknown prop to builder Signed-off-by: Sally MacFarlane --------- Signed-off-by: Sally MacFarlane --- .../besu/datatypes/AccountOverride.java | 1 + ...stateOverride_movePrecompileToAddress.json | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_stateOverride_movePrecompileToAddress.json diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountOverride.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountOverride.java index 55ee71fde15..e33f6feef54 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountOverride.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountOverride.java @@ -85,6 +85,7 @@ public Optional> getStateDiff() { } /** Builder class for Account overrides */ + @JsonIgnoreProperties(ignoreUnknown = true) public static class Builder { private Optional balance = Optional.empty(); private Optional nonce = Optional.empty(); diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_stateOverride_movePrecompileToAddress.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_stateOverride_movePrecompileToAddress.json new file mode 100644 index 00000000000..c49130c00bd --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_stateOverride_movePrecompileToAddress.json @@ -0,0 +1,33 @@ +{ + "request": { + "id": 3, + "jsonrpc": "2.0", + "method": "eth_call", + "params": [ + { + "to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "data": "0x12a7b914" + }, + "latest", + { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "0xde0b6b3a7640000", + "nonce": 88 + }, + "0xb9741079a300Cb3B8f324CdDB847c0d1d273a05E": { + "stateDiff": { + "0x1cf7945003fc5b59d2f6736f0704557aa805c4f2844084ccd1173b8d56946962": "0x000000000000000000000000000000000000000000000000000000110ed03bf7" + }, + "movePrecompileToAddress":null + } + } + ] + }, + "response": { + "jsonrpc": "2.0", + "id": 3, + "result": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "statusCode": 200 +} \ No newline at end of file From 566583c3782eaf412c86e609161a8b190037b586 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Mon, 16 Dec 2024 03:26:44 +0100 Subject: [PATCH 4/7] Fix simulate pending block timestamp (#8027) Signed-off-by: Fabio Di Fabio --- .../besu/ethereum/transaction/TransactionSimulator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 c4558ab14dc..57cef89006a 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 @@ -14,6 +14,7 @@ */ package org.hyperledger.besu.ethereum.transaction; +import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.hyperledger.besu.ethereum.mainnet.feemarket.ExcessBlobGasCalculator.calculateExcessBlobGasForParent; import org.hyperledger.besu.crypto.SECPSignature; @@ -176,7 +177,7 @@ public Optional processOnPending( } public ProcessableBlockHeader simulatePendingBlockHeader() { - final long timestamp = System.currentTimeMillis(); + final long timestamp = MILLISECONDS.toSeconds(System.currentTimeMillis()); final var chainHeadHeader = blockchain.getChainHeadHeader(); final ProtocolSpec protocolSpec = protocolSchedule.getForNextBlockHeader(chainHeadHeader, timestamp); From 6c952a3bd69cf136eec6846b08b1bab61afdc441 Mon Sep 17 00:00:00 2001 From: Simon Dudley Date: Mon, 16 Dec 2024 15:33:26 +1000 Subject: [PATCH 5/7] Update release-checklist.md (#8033) Add jfrog check Make homebrew check clearer Signed-off-by: Simon Dudley --- .github/ISSUE_TEMPLATE/release-checklist.md | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release-checklist.md b/.github/ISSUE_TEMPLATE/release-checklist.md index e9d84c74453..8919d682e97 100644 --- a/.github/ISSUE_TEMPLATE/release-checklist.md +++ b/.github/ISSUE_TEMPLATE/release-checklist.md @@ -13,8 +13,8 @@ assignees: '' - [ ] Optional: for hotfixes, create a release branch and cherry-pick, e.g. `release--hotfix` - [ ] Optional: for hotfixes, create a PR into main from the hotfix branch to see the CI checks pass - [ ] On the appropriate branch/commit, create a calver tag for the release candidate, format example: `24.4.0-RC1` - - [ ] git tag 24.4.0-RC1 - - [ ] git push upstream 24.4.0-RC1 + - [ ] `git tag 24.4.0-RC1` + - [ ] `git push upstream 24.4.0-RC1` - [ ] Sign-off with team; announce the tag in #besu-release in Discord - [ ] Targeting this tag for the burn-in: https://github.com/hyperledger/besu/releases/tag/24.4.0-RC1 - [ ] Consensys staff start burn-in using this tag @@ -22,26 +22,27 @@ assignees: '' - [ ] Pass? Go ahead and complete the release process - [ ] Fail? Put a message in #besu-release in Discord indicating the release will be aborted because it failed burn-in - [ ] Optional: Perform a dry run with https://github.com/consensys/protocols-release-sandbox to test the workflows - - [ ] Sync fork - - [ ] git checkout - - [ ] git tag 24.4.0 - - [ ] git push origin 24.4.0 + - [ ] Sync fork in github + - [ ] `git checkout ` + - [ ] `git tag 24.4.0` + - [ ] `git push 24.4.0` - [ ] Manually run https://github.com/Consensys/protocols-release-sandbox/actions/workflows/draft-release.yml using `main` branch and `24.4.0` tag - [ ] Back on besu, using the same git sha as 24.4.0-RC1, create a calver tag for the FULL RELEASE, example format `24.4.0` - - [ ] git checkout 24.4.0-RC1 - - [ ] git tag 24.4.0 - - [ ] git push upstream 24.4.0 + - [ ] `git checkout 24.4.0-RC1` + - [ ] `git tag 24.4.0` + - [ ] `git push upstream 24.4.0` - [ ] Manually run https://github.com/hyperledger/besu/actions/workflows/draft-release.yml using `main` branch` and the FULL RELEASE tag name, i.e. `24.4.0`. Note, this workflow should always be run from `main` branch (hotfix tags will still be released even if they were created based on another branch) - publishes artefacts and version-specific docker tags but does not fully publish the GitHub release so subscribers are not yet notified - [ ] Check all draft-release workflow jobs went green - [ ] Check binary SHAs are correct on the release page +- [ ] Check artifacts exist in https://hyperledger.jfrog.io/ui/repos/tree/General/besu-maven - [ ] Update release notes in the GitHub draft release, save draft and sign-off with team - [ ] Publish draft release ensuring it is marked as latest release (if appropriate) - this is now public and notifies subscribed users - makes the release "latest" in github - publishes the docker `latest` tag variants -- [ ] Create homebrew release using [update-version workflow](https://github.com/hyperledger/homebrew-besu/actions/workflows/update-version.yml) +- [ ] Create homebrew release PR using [update-version workflow](https://github.com/hyperledger/homebrew-besu/actions/workflows/update-version.yml) - If the PR has not been automatically created, create the PR manually using the created branch `update-` - - Run commands `brew tap hyperledger/besu && brew install besu` on MacOSX and verify latest version has been installed +- [ ] Verify homebrew release once the PR has merged using `brew tap hyperledger/besu && brew install besu` on MacOSX to verify latest version has been installed - [ ] Delete the burn-in nodes (unless required for further analysis eg performance) - [ ] Social announcements From 929945ad6c559d787a99c12e7f6c3dbcef6716f2 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Mon, 16 Dec 2024 17:22:47 +0100 Subject: [PATCH 6/7] Precompute authorities when importing blocks (#8017) * Precompute authorities when importing blocks Signed-off-by: Fabio Di Fabio * Using Supplier to make the authorizer thread safe Signed-off-by: Fabio Di Fabio * Process code delegation in parallel if there are more that one Signed-off-by: Fabio Di Fabio --------- Signed-off-by: Fabio Di Fabio --- .../engine/AbstractEngineNewPayload.java | 58 ++++++++++++++----- .../besu/ethereum/core/CodeDelegation.java | 11 +--- .../eth/transactions/PendingTransaction.java | 2 +- 3 files changed, 47 insertions(+), 24 deletions(-) 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 ac9dfe221e6..0c69c9c1c1d 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 @@ -24,7 +24,6 @@ import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.WithdrawalsValidatorProvider.getWithdrawalsValidator; import org.hyperledger.besu.consensus.merge.blockcreation.MergeMiningCoordinator; -import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.BlobGas; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.RequestType; @@ -222,20 +221,8 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) blockParam.getTransactions().stream() .map(Bytes::fromHexString) .map(in -> TransactionDecoder.decodeOpaqueBytes(in, EncodingContext.BLOCK_BODY)) - .collect(Collectors.toList()); - transactions.forEach( - transaction -> - mergeCoordinator - .getEthScheduler() - .scheduleTxWorkerTask( - () -> { - Address sender = transaction.getSender(); - LOG.atTrace() - .setMessage("The sender for transaction {} is calculated : {}") - .addArgument(transaction::getHash) - .addArgument(sender) - .log(); - })); + .toList(); + precomputeSenders(transactions); } catch (final RLPException | IllegalArgumentException e) { return respondWithInvalid( reqId, @@ -392,6 +379,47 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) } } + private void precomputeSenders(final List transactions) { + transactions.forEach( + transaction -> { + mergeCoordinator + .getEthScheduler() + .scheduleTxWorkerTask( + () -> { + final var sender = transaction.getSender(); + LOG.atTrace() + .setMessage("The sender for transaction {} is calculated : {}") + .addArgument(transaction::getHash) + .addArgument(sender) + .log(); + }); + if (transaction.getType().supportsDelegateCode()) { + precomputeAuthorities(transaction); + } + }); + } + + private void precomputeAuthorities(final Transaction transaction) { + final var codeDelegations = transaction.getCodeDelegationList().get(); + int index = 0; + for (final var codeDelegation : codeDelegations) { + final var constIndex = index++; + mergeCoordinator + .getEthScheduler() + .scheduleTxWorkerTask( + () -> { + final var authority = codeDelegation.authorizer(); + LOG.atTrace() + .setMessage( + "The code delegation authority at index {} for transaction {} is calculated : {}") + .addArgument(constIndex) + .addArgument(transaction::getHash) + .addArgument(authority) + .log(); + }); + } + } + JsonRpcResponse respondWith( final Object requestId, final EnginePayloadParameter param, diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/CodeDelegation.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/CodeDelegation.java index ef38a982224..ecf1da973f3 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/CodeDelegation.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/CodeDelegation.java @@ -42,8 +42,8 @@ public class CodeDelegation implements org.hyperledger.besu.datatypes.CodeDelega private final Address address; private final long nonce; private final SECPSignature signature; - private Optional
authorizer = Optional.empty(); - private boolean isAuthorityComputed = false; + private final Supplier> authorizerSupplier = + Suppliers.memoize(this::computeAuthority); /** * An access list entry as defined in EIP-7702 @@ -107,12 +107,7 @@ public SECPSignature signature() { @Override public Optional
authorizer() { - if (!isAuthorityComputed) { - authorizer = computeAuthority(); - isAuthorityComputed = true; - } - - return authorizer; + return authorizerSupplier.get(); } @Override 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 ee5c40a3f4f..e6a84f69fa4 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 @@ -430,7 +430,7 @@ public interface MemorySize { int ACCESS_LIST_ENTRY_SHALLOW_SIZE = 248; int OPTIONAL_ACCESS_LIST_SHALLOW_SIZE = 40; int OPTIONAL_CODE_DELEGATION_LIST_SHALLOW_SIZE = 40; - int CODE_DELEGATION_ENTRY_SIZE = 432; + int CODE_DELEGATION_ENTRY_SIZE = 472; int VERSIONED_HASH_SIZE = 96; int LIST_SHALLOW_SIZE = 48; int OPTIONAL_SHALLOW_SIZE = 16; From 4aa89b2ee1f97fc3ac177591e0c625ac92dde93c Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Tue, 17 Dec 2024 18:47:25 +1000 Subject: [PATCH 7/7] [FLAKE] disable CliqueProposeRpcAcceptanceTests x 2 (#8035) Signed-off-by: Sally MacFarlane --- .../acceptance/clique/CliqueProposeRpcAcceptanceTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueProposeRpcAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueProposeRpcAcceptanceTest.java index 405f56fd93b..f5de8bdef29 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueProposeRpcAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueProposeRpcAcceptanceTest.java @@ -21,6 +21,7 @@ import java.io.IOException; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; public class CliqueProposeRpcAcceptanceTest extends AcceptanceTestBase { @@ -59,6 +60,7 @@ public void shouldRemoveValidators() throws IOException { cluster.verify(clique.validatorsEqual(minerNode1, minerNode2)); } + @Disabled @Test public void shouldNotAddValidatorWhenInsufficientVotes() throws IOException { final String[] initialValidators = {"miner1", "miner2"}; @@ -90,6 +92,7 @@ public void shouldNotRemoveValidatorWhenInsufficientVotes() throws IOException { cluster.verify(clique.validatorsEqual(minerNode1, minerNode2, minerNode3)); } + @Disabled @Test public void shouldIncludeVoteInBlockHeader() throws IOException { final String[] initialValidators = {"miner1", "miner2"};