Skip to content

Commit

Permalink
Merge branch 'main' into zkbesu
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle/verification-metadata.xml
#	plugin-api/build.gradle
  • Loading branch information
fab-10 committed Jul 23, 2024
2 parents 14d6f05 + 7e4a25a commit 26f89ac
Show file tree
Hide file tree
Showing 183 changed files with 5,389 additions and 651 deletions.
20 changes: 8 additions & 12 deletions .github/ISSUE_TEMPLATE/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ assignees: ''
---

- [ ] Confirm anything outstanding for release with other maintainers on #besu-release in Discord
- [ ] Update changelog if necessary, and merge a PR for it to main
- [ ] Notify maintainers about updating changelog for in-flight PRs
- [ ] Update changelog if necessary, and merge a PR for it to main
- [ ] Optional: for hotfixes, create a release branch and cherry-pick, e.g. `release-<version>-hotfix`
- [ ] Optional: 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-RC2`
Expand All @@ -18,18 +18,14 @@ assignees: ''
- [ ] Sign off burn-in; convey burn-in results in #besu-release in Discord
- [ ] Using the same git sha, create a calver tag for the FULL RELEASE, example format `24.4.0`
- [ ] Using the FULL RELEASE tag, create a release in github to trigger the workflows. Once published:
- makes the release "latest" in github
- this is now public and notifies subscribed users
- makes the release "latest" in github
- publishes artefacts and version-specific docker tags
- publishes the docker `latest` tag variants
- [ ] Draft homebrew PR
- [ ] Draft documentation release
- [ ] Ensure binary SHAs are correct on the release page
- [ ] Docker release startup test:
- `docker run hyperledger/besu:<version>`
- `docker run hyperledger/besu:<version>-arm64`
- `docker run --platform linux/amd64 hyperledger/besu:<version>-amd64`
- `docker run --pull=always hyperledger/besu:latest` (check version is <version>)
- [ ] Merge homebrew PR
- [ ] Publish Docs Release
- [ ] Check binary SHAs are correct on the release page
- [ ] Check "Container Verify" GitHub workflow has run successfully
- [ ] Create homebrew release - run https://github.com/hyperledger/homebrew-besu/actions/workflows/update-version.yml
- [ ] Create besu-docs release - https://github.com/hyperledger/besu-docs/releases/new
- Copy release notes from besu
- If publishing the release in github doesn't automatically trigger this workflow, then manually run https://github.com/hyperledger/besu-docs/actions/workflows/update-version.yml
- [ ] Social announcements
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Next release

### 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.
- --Xbonsai-limit-trie-logs-enabled is deprecated, use --bonsai-limit-trie-logs-enabled instead
- --Xbonsai-trie-logs-pruning-window-size is deprecated, use --bonsai-trie-logs-pruning-window-size instead
- `besu storage x-trie-log` subcommand is deprecated, use `besu storage trie-log` instead

### Breaking Changes
- Remove deprecated sync modes (X_SNAP and X_CHECKPOINT). Use SNAP and CHECKPOINT instead [#7309](https://github.com/hyperledger/besu/pull/7309)
- Remove PKI-backed QBFT (deprecated in 24.5.1) Other forms of QBFT remain unchanged. [#7293](https://github.com/hyperledger/besu/pull/7293)
Expand All @@ -10,8 +16,16 @@
- `--Xsnapsync-bft-enabled` option enables experimental support for snap sync with IBFT/QBFT permissioned Bonsai-DB chains [#7140](https://github.com/hyperledger/besu/pull/7140)
- Add support to load external profiles using `--profile` [#7265](https://github.com/hyperledger/besu/issues/7265)
- `privacy-nonce-always-increments` option enables private transactions to always increment the nonce, even if the transaction is invalid [#6593](https://github.com/hyperledger/besu/pull/6593)
- Add `block-test` subcommand to the evmtool which runs blockchain reference tests [#7310](https://github.com/hyperledger/besu/pull/7310)
- Added `block-test` subcommand to the evmtool which runs blockchain reference tests [#7293](https://github.com/hyperledger/besu/pull/7293)
- removed PKI backed QBFT [#7310](https://github.com/hyperledger/besu/pull/7310)
- Implement gnark-crypto for eip-2537 [#7316](https://github.com/hyperledger/besu/pull/7316)
- Improve blob size transaction selector [#7312](https://github.com/hyperledger/besu/pull/7312)
- Added EIP-7702 [#7237](https://github.com/hyperledger/besu/pull/7237)
- Implement gnark-crypto for eip-196 [#7262](https://github.com/hyperledger/besu/pull/7262)
- Add trie log pruner metrics [#7352](https://github.com/hyperledger/besu/pull/7352)
- `--Xbonsai-parallel-tx-processing-enabled` option enables executing transactions in parallel during block processing for Bonsai nodes

- Add option `--poa-discovery-retry-bootnodes` for PoA networks to always use bootnodes during peer refresh, not just on first start [#7314](https://github.com/hyperledger/besu/pull/7314)

### Bug fixes
- Fix `eth_call` deserialization to correctly ignore unknown fields in the transaction object. [#7323](https://github.com/hyperledger/besu/pull/7323)
Expand Down
32 changes: 2 additions & 30 deletions acceptance-tests/tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,39 +122,11 @@ task acceptanceTest(type: Test) {

doFirst { mkdir "${buildDir}/jvmErrorLogs" }
}
task acceptanceTestMainnet(type: Test) {
inputs.property "integration.date", LocalTime.now() // so it runs at every invocation
exclude '**/bft/**'
exclude '**/clique/**'
exclude '**/permissioning/**'
exclude '**/privacy/**'

useJUnitPlatform {}

dependsOn(rootProject.installDist)
setSystemProperties(test.getSystemProperties())
systemProperty 'acctests.runBesuAsProcess', 'true'
systemProperty 'java.security.properties', "${buildDir}/resources/test/acceptanceTesting.security"
mustRunAfter rootProject.subprojects*.test
description = 'Runs MAINNET Besu acceptance tests (excluding permissioning, privacy and some other stable features).'
group = 'verification'

jvmArgs "-XX:ErrorFile=${buildDir}/jvmErrorLogs/java_err_pid%p.log"

testLogging {
exceptionFormat = 'full'
showStackTraces = true
showStandardStreams = Boolean.getBoolean('acctests.showStandardStreams')
showExceptions = true
showCauses = true
}

doFirst { mkdir "${buildDir}/jvmErrorLogs" }
}

task acceptanceTestNotPrivacy(type: Test) {
inputs.property "integration.date", LocalTime.now() // so it runs at every invocation
exclude '**/privacy/**'
exclude '**/permissioning/**'
exclude '**/bftsoak/**'

useJUnitPlatform {}
Expand All @@ -164,7 +136,7 @@ task acceptanceTestNotPrivacy(type: Test) {
systemProperty 'acctests.runBesuAsProcess', 'true'
systemProperty 'java.security.properties', "${buildDir}/resources/test/acceptanceTesting.security"
mustRunAfter rootProject.subprojects*.test
description = 'Runs MAINNET Besu acceptance tests (excluding privacy since they run nightly, and are being refactored).'
description = 'Runs MAINNET Besu acceptance tests (excluding specific non-mainnet suites).'
group = 'verification'

jvmArgs "-XX:ErrorFile=${buildDir}/jvmErrorLogs/java_err_pid%p.log"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public void testDefaultLoggingIsAtLeastInfo() throws IOException {

node.verify(net.awaitPeerCount(0));

assertThat(cluster.getConsoleContents()).contains("| INFO |");
assertThat(cluster.getConsoleContents()).contains("INFO");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
/*
* Copyright contributors to Hyperledger Besu.
*
* Licensed under the Apache License, Version 2.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.ethereum;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.eth.EthTransactions;

import java.io.IOException;
import java.util.Optional;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import okhttp3.Call;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.web3j.protocol.core.methods.response.EthBlock;

public class PragueAcceptanceTestHelper {
protected static final MediaType MEDIA_TYPE_JSON =
MediaType.parse("application/json; charset=utf-8");

private final OkHttpClient httpClient;
private final ObjectMapper mapper;
private final BesuNode besuNode;
private final EthTransactions ethTransactions;

private long blockTimeStamp = 0;

PragueAcceptanceTestHelper(final BesuNode besuNode, final EthTransactions ethTransactions) {
this.besuNode = besuNode;
this.ethTransactions = ethTransactions;
httpClient = new OkHttpClient();
mapper = new ObjectMapper();
}

public void buildNewBlock() throws IOException {
final EthBlock.Block block = besuNode.execute(ethTransactions.block());

blockTimeStamp += 1;
final Call buildBlockRequest =
createEngineCall(createForkChoiceRequest(block.getHash(), blockTimeStamp));

final String payloadId;
try (final Response buildBlockResponse = buildBlockRequest.execute()) {
payloadId =
mapper
.readTree(buildBlockResponse.body().string())
.get("result")
.get("payloadId")
.asText();

assertThat(payloadId).isNotEmpty();
}

waitFor(500);

final Call getPayloadRequest = createEngineCall(createGetPayloadRequest(payloadId));

final ObjectNode executionPayload;
final String newBlockHash;
final String parentBeaconBlockRoot;
try (final Response getPayloadResponse = getPayloadRequest.execute()) {
assertThat(getPayloadResponse.code()).isEqualTo(200);

executionPayload =
(ObjectNode)
mapper
.readTree(getPayloadResponse.body().string())
.get("result")
.get("executionPayload");

newBlockHash = executionPayload.get("blockHash").asText();
parentBeaconBlockRoot = executionPayload.remove("parentBeaconBlockRoot").asText();

assertThat(newBlockHash).isNotEmpty();
}

final Call newPayloadRequest =
createEngineCall(
createNewPayloadRequest(executionPayload.toString(), parentBeaconBlockRoot));
try (final Response newPayloadResponse = newPayloadRequest.execute()) {
assertThat(newPayloadResponse.code()).isEqualTo(200);
}

final Call moveChainAheadRequest = createEngineCall(createForkChoiceRequest(newBlockHash));

try (final Response moveChainAheadResponse = moveChainAheadRequest.execute()) {
assertThat(moveChainAheadResponse.code()).isEqualTo(200);
}
}

private Call createEngineCall(final String request) {
return httpClient.newCall(
new Request.Builder()
.url(besuNode.engineRpcUrl().get())
.post(RequestBody.create(request, MEDIA_TYPE_JSON))
.build());
}

private String createForkChoiceRequest(final String blockHash) {
return createForkChoiceRequest(blockHash, null);
}

private String createForkChoiceRequest(final String parentBlockHash, final Long timeStamp) {
final Optional<Long> maybeTimeStamp = Optional.ofNullable(timeStamp);

String forkChoiceRequest =
"{"
+ " \"jsonrpc\": \"2.0\","
+ " \"method\": \"engine_forkchoiceUpdatedV3\","
+ " \"params\": ["
+ " {"
+ " \"headBlockHash\": \""
+ parentBlockHash
+ "\","
+ " \"safeBlockHash\": \""
+ parentBlockHash
+ "\","
+ " \"finalizedBlockHash\": \""
+ parentBlockHash
+ "\""
+ " }";

if (maybeTimeStamp.isPresent()) {
forkChoiceRequest +=
" ,{"
+ " \"timestamp\": \""
+ Long.toHexString(maybeTimeStamp.get())
+ "\","
+ " \"prevRandao\": \"0x0000000000000000000000000000000000000000000000000000000000000000\","
+ " \"suggestedFeeRecipient\": \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\","
+ " \"withdrawals\": [],"
+ " \"parentBeaconBlockRoot\": \"0x0000000000000000000000000000000000000000000000000000000000000000\""
+ " }";
}

forkChoiceRequest += " ]," + " \"id\": 67" + "}";

return forkChoiceRequest;
}

private String createGetPayloadRequest(final String payloadId) {
return "{"
+ " \"jsonrpc\": \"2.0\","
+ " \"method\": \"engine_getPayloadV4\","
+ " \"params\": [\""
+ payloadId
+ "\"],"
+ " \"id\": 67"
+ "}";
}

private String createNewPayloadRequest(
final String executionPayload, final String parentBeaconBlockRoot) {
return "{"
+ " \"jsonrpc\": \"2.0\","
+ " \"method\": \"engine_newPayloadV4\","
+ " \"params\": ["
+ executionPayload
+ ",[],"
+ "\""
+ parentBeaconBlockRoot
+ "\""
+ "],"
+ " \"id\": 67"
+ "}";
}

private static void waitFor(final long durationMilliSeconds) {
try {
Thread.sleep(durationMilliSeconds);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
Loading

0 comments on commit 26f89ac

Please sign in to comment.