Merge branch 'main' into zkbesu

This commit is contained in:
Fabio Di Fabio
2024-10-22 13:52:26 +02:00
14 changed files with 1186 additions and 1130 deletions

View File

@@ -12,25 +12,34 @@ assignees: ''
- [ ] Notify maintainers about updating changelog for in-flight PRs
- [ ] Optional: for hotfixes, create a release branch and cherry-pick, e.g. `release-<version>-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-RC2`
- [ ] git tag 24.4.0-RC2
- [ ] git push upstream 24.4.0-RC2
- [ ] 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
- [ ] 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-RC2
- [ ] 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
- [ ] Seek sign off for burn-in
- [ ] 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
- [ ] 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:
- [ ] Optional: Perform a dry run with https://github.com/consensys/protocols-release-sandbox to test the workflows
- [ ] Sync fork
- [ ] git checkout <sha of 24.4.0-RC1>
- [ ] git tag 24.4.0
- [ ] git push origin 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
- [ ] 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
- [ ] 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 artefacts and version-specific docker tags
- publishes the docker `latest` tag variants
- [ ] Check binary SHAs are correct on the release page
- [ ] Check "Container Verify" GitHub workflow has run successfully
- [ ] Update the besu-docs version [update-version workflow](https://github.com/hyperledger/besu-docs/actions/workflows/update-version.yml)
- If the PR has not been automatically created, create the PR manually using the created branch `besu-version-<version>`
- [ ] Create homebrew release 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-<version>`
- Run commands `brew tap hyperledger/besu && brew install besu` on MacOSX and verify latest version has been installed

View File

@@ -10,6 +10,7 @@
### Additions and Improvements
- Fine tune already seen txs tracker when a tx is removed from the pool [#7755](https://github.com/hyperledger/besu/pull/7755)
- Create and publish Besu BOM (Bill of Materials) [#7615](https://github.com/hyperledger/besu/pull/7615)
- Update Java dependencies [#7786](https://github.com/hyperledger/besu/pull/7786)
### Bug fixes

View File

@@ -15,7 +15,7 @@
package org.hyperledger.besu.tests.acceptance.crypto;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import org.hyperledger.besu.crypto.KeyPair;
import org.hyperledger.besu.crypto.SECP256R1;
@@ -80,7 +80,7 @@ public class SECP256R1AcceptanceTest extends AcceptanceTestBase {
// the signature algorithm instance to SECP256R1 as it could influence other tests running at
// the same time. So we only execute the test when ProcessBesuNodeRunner is used, as there is
// not conflict because we use separate processes.
assumeThat(BesuNodeRunner.isProcessBesuNodeRunner()).isTrue();
assumeTrue(BesuNodeRunner.isProcessBesuNodeRunner());
minerNode.verify(net.awaitPeerCount(1));
otherNode.verify(net.awaitPeerCount(1));

View File

@@ -15,6 +15,7 @@
package org.hyperledger.besu;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -46,20 +47,14 @@ import java.util.stream.Stream;
import com.google.common.collect.Streams;
import org.apache.tuweni.bytes.Bytes;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.mockito.junit.jupiter.MockitoExtension;
@RunWith(Parameterized.class)
@ExtendWith(MockitoExtension.class)
public class ForkIdsNetworkConfigTest {
@Parameterized.Parameter public NetworkName chainName;
@Parameterized.Parameter(1)
public List<ForkId> expectedForkIds;
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> parameters() {
return List.of(
new Object[] {
@@ -149,8 +144,8 @@ public class ForkIdsNetworkConfigTest {
final AtomicLong blockNumber = new AtomicLong();
when(mockBlockchain.getChainHeadHeader()).thenReturn(mockBlockHeader);
when(mockBlockHeader.getNumber()).thenAnswer(o -> blockNumber.get());
when(mockBlockHeader.getTimestamp()).thenAnswer(o -> blockNumber.get());
lenient().when(mockBlockHeader.getNumber()).thenAnswer(o -> blockNumber.get());
lenient().when(mockBlockHeader.getTimestamp()).thenAnswer(o -> blockNumber.get());
final ForkIdManager forkIdManager =
new ForkIdManager(

View File

@@ -16,7 +16,6 @@ package org.hyperledger.besu.cli;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hyperledger.besu.cli.config.NetworkName.CLASSIC;
import static org.hyperledger.besu.cli.config.NetworkName.DEV;
import static org.hyperledger.besu.cli.config.NetworkName.EPHEMERY;
@@ -33,7 +32,7 @@ import static org.hyperledger.besu.ethereum.p2p.config.DefaultDiscoveryConfigura
import static org.hyperledger.besu.ethereum.p2p.config.DefaultDiscoveryConfiguration.SEPOLIA_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DefaultDiscoveryConfiguration.SEPOLIA_DISCOVERY_URL;
import static org.hyperledger.besu.plugin.services.storage.DataStorageFormat.BONSAI;
import static org.junit.Assume.assumeThat;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.ArgumentMatchers.eq;
@@ -2392,7 +2391,7 @@ public class BesuCommandTest extends CommandTestAbstract {
@Test
public void logsWarningWhenFailToLoadJemalloc() {
assumeThat(PlatformDetector.getOSType(), is("linux"));
assumeTrue(PlatformDetector.getOSType().equals("linux"));
setEnvironmentVariable("BESU_USING_JEMALLOC", "true");
parseCommand();
verify(mockLogger)
@@ -2404,7 +2403,7 @@ public class BesuCommandTest extends CommandTestAbstract {
@Test
public void logsSuggestInstallingJemallocWhenEnvVarNotPresent() {
assumeThat(PlatformDetector.getOSType(), is("linux"));
assumeTrue(PlatformDetector.getOSType().equals("linux"));
parseCommand();
verify(mockLogger)
.info("jemalloc library not found, memory usage may be reduced by installing it");

View File

@@ -16,8 +16,7 @@ package org.hyperledger.besu.cli;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assume.assumeThat;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -415,10 +414,9 @@ public class PrivacyOptionsTest extends CommandTestAbstract {
@Test
public void privEnclaveKeyFileDoesNotExist() {
assumeThat(
"Ignored if system language is not English",
System.getProperty("user.language"),
startsWith("en"));
assumeTrue(
System.getProperty("user.language").startsWith("en"),
"Ignored if system language is not English");
parseCommand("--privacy-enabled=true", "--privacy-public-key-file", "/non/existent/file");
assertThat(commandOutput.toString(UTF_8)).isEmpty();

View File

@@ -24,7 +24,6 @@ import java.util.regex.Pattern
plugins {
id 'com.diffplug.spotless' version '6.25.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'com.github.jk1.dependency-license-report' version '2.9'
id 'com.jfrog.artifactory' version '5.2.5'
id 'me.champeau.jmh' version '0.7.2' apply false

View File

@@ -92,6 +92,19 @@ public class BlockHeader extends SealableBlockHeader
this.parsedExtraData = Suppliers.memoize(() -> blockHeaderFunctions.parseExtraData(this));
}
public static boolean hasEmptyBlock(final BlockHeader blockHeader) {
return blockHeader.getOmmersHash().equals(Hash.EMPTY_LIST_HASH)
&& blockHeader.getTransactionsRoot().equals(Hash.EMPTY_TRIE_HASH)
&& blockHeader
.getWithdrawalsRoot()
.map(wsRoot -> wsRoot.equals(Hash.EMPTY_TRIE_HASH))
.orElse(true)
&& blockHeader
.getRequestsRoot()
.map(reqRoot -> reqRoot.equals(Hash.EMPTY_TRIE_HASH))
.orElse(true);
}
/**
* Returns the block mixed hash.
*

View File

@@ -19,7 +19,6 @@ import static java.util.Collections.emptyList;
import static java.util.concurrent.CompletableFuture.completedFuture;
import static java.util.stream.Collectors.toMap;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeader;
@@ -75,7 +74,7 @@ public class CompleteBlocksTask extends AbstractRetryingPeerTask<List<Block>> {
this.headers = headers;
this.blocks =
headers.stream()
.filter(this::hasEmptyBody)
.filter(BlockHeader::hasEmptyBlock)
.collect(
toMap(
BlockHeader::getNumber,
@@ -102,15 +101,6 @@ public class CompleteBlocksTask extends AbstractRetryingPeerTask<List<Block>> {
return protocolSchedule.getByBlockHeader(header).getWithdrawalsProcessor().isPresent();
}
private boolean hasEmptyBody(final BlockHeader header) {
return header.getOmmersHash().equals(Hash.EMPTY_LIST_HASH)
&& header.getTransactionsRoot().equals(Hash.EMPTY_TRIE_HASH)
&& header
.getWithdrawalsRoot()
.map(wsRoot -> wsRoot.equals(Hash.EMPTY_TRIE_HASH))
.orElse(true);
}
public static CompleteBlocksTask forHeaders(
final ProtocolSchedule protocolSchedule,
final EthContext ethContext,

View File

@@ -15,7 +15,7 @@
package org.hyperledger.besu.ethereum.vm;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
@@ -148,18 +148,15 @@ public class BlockchainReferenceTestTools {
}
static void verifyJournaledEVMAccountCompatability(
final MutableWorldState worldState, final ProtocolSpec protocolSpec) {
final MutableWorldState worldState, final ProtocolSpec protocolSpec) {
EVM evm = protocolSpec.getEvm();
if (evm.getEvmConfiguration().worldUpdaterMode() == WorldUpdaterMode.JOURNALED) {
assumeThat(
assumeFalse(
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();
.streamAccounts(Bytes32.ZERO, Integer.MAX_VALUE).anyMatch(AccountState::isEmpty),
"Journaled account configured and empty account detected");
assumeFalse(EvmSpecVersion.SPURIOUS_DRAGON.compareTo(evm.getEvmVersion()) > 0,
"Journaled account configured and fork prior to the merge specified");
}
}
}

View File

@@ -15,7 +15,7 @@
package org.hyperledger.besu.evm.operation;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import org.hyperledger.besu.evm.Code;
import org.hyperledger.besu.evm.EVM;
@@ -136,7 +136,7 @@ class DataCopyOperationTest {
"0xef0001010004020001001d04%04x000080000367%016x67%016x67%016xd300%s"
.formatted(data.size(), dst, src, len, data.toUnprefixedHexString());
Code code = evm.getCodeUncached(Bytes.fromHexString(eofCode));
assumeThat(code.isValid()).isTrue();
assumeTrue(code.isValid());
MessageFrame frame =
new TestMessageFrameBuilder()
@@ -158,7 +158,7 @@ class DataCopyOperationTest {
void legacyCallFails() {
DataCopyOperation subject = new DataCopyOperation(new PragueGasCalculator());
Code code = evm.getCodeUncached(Bytes.fromHexString("0x600460046004d3"));
assumeThat(code.isValid()).isTrue();
assumeTrue(code.isValid());
MessageFrame frame =
new TestMessageFrameBuilder()

File diff suppressed because it is too large Load Diff

View File

@@ -84,7 +84,7 @@ public class KubernetesNatManager extends AbstractNatManager {
final V1Service service =
api
.listServiceForAllNamespaces(
null, null, null, null, null, null, null, null, null, null)
null, null, null, null, null, null, null, null, null, null, null)
.getItems()
.stream()
.filter(

View File

@@ -27,17 +27,17 @@ javaPlatform {
}
dependencies {
api platform('com.fasterxml.jackson:jackson-bom:2.17.2')
api platform('io.grpc:grpc-bom:1.66.0')
api platform('io.netty:netty-bom:4.1.112.Final')
api platform('io.opentelemetry:opentelemetry-bom:1.41.0')
api platform('com.fasterxml.jackson:jackson-bom:2.18.0')
api platform('io.grpc:grpc-bom:1.68.0')
api platform('io.netty:netty-bom:4.1.114.Final')
api platform('io.opentelemetry:opentelemetry-bom:1.43.0')
api platform('io.prometheus:simpleclient_bom:0.16.0')
api platform('io.vertx:vertx-stack-depchain:4.5.9')
api platform('org.apache.logging.log4j:log4j-bom:2.23.1')
api platform('io.vertx:vertx-stack-depchain:4.5.10')
api platform('org.apache.logging.log4j:log4j-bom:2.24.1')
api platform('org.assertj:assertj-bom:3.26.3')
api platform('org.immutables:bom:2.10.1')
api platform('org.junit:junit-bom:5.11.0')
api platform('org.mockito:mockito-bom:5.13.0')
api platform('org.junit:junit-bom:5.11.2')
api platform('org.mockito:mockito-bom:5.14.2')
api platform('org.slf4j:slf4j-bom:2.0.16')
constraints {
@@ -60,39 +60,37 @@ dependencies {
api 'com.github.ben-manes.caffeine:caffeine:3.1.8'
api 'org.bitbucket.b_c:jose4j:0.9.4'
api 'com.github.oshi:oshi-core:6.6.3'
api 'com.github.oshi:oshi-core:6.6.5'
api 'com.google.auto.service:auto-service:1.1.1'
api 'com.google.dagger:dagger-compiler:2.52'
api 'com.google.dagger:dagger:2.52'
api 'com.google.guava:guava:33.3.0-jre'
api 'com.google.guava:guava:33.3.1-jre'
api 'com.google.protobuf:protobuf-java:3.25.5'
api 'com.graphql-java:graphql-java:22.2'
api 'com.graphql-java:graphql-java:22.3'
api 'com.splunk.logging:splunk-library-javalogging:1.11.8'
api 'com.squareup.okhttp3:okhttp:4.12.0'
api 'commons-io:commons-io:2.16.1'
api 'commons-io:commons-io:2.17.0'
api 'commons-net:commons-net:3.11.1'
api 'dnsjava:dnsjava:3.6.1'
api 'dnsjava:dnsjava:3.6.2'
api 'info.picocli:picocli:4.7.6'
api 'info.picocli:picocli-codegen:4.7.6'
api 'io.kubernetes:client-java:18.0.1'
api 'io.kubernetes:client-java:21.0.1-legacy'
api 'io.opentelemetry.instrumentation:opentelemetry-okhttp-3.0:2.7.0-alpha'
api 'io.opentelemetry.instrumentation:opentelemetry-okhttp-3.0:2.9.0-alpha'
api 'io.opentelemetry.proto:opentelemetry-proto:1.3.2-alpha'
api 'io.opentelemetry.semconv:opentelemetry-semconv:1.27.0-alpha'
api 'io.opentelemetry.semconv:opentelemetry-semconv:1.28.0-alpha'
api 'io.opentracing:opentracing-api:0.33.0'
api 'io.opentracing:opentracing-util:0.33.0'
@@ -113,7 +111,7 @@ dependencies {
api 'junit:junit:4.13.2'
api 'net.java.dev.jna:jna:5.14.0'
api 'net.java.dev.jna:jna:5.15.0'
api 'org.antlr:antlr4:4.11.1'
api 'org.antlr:antlr4-runtime:4.11.1'
@@ -123,7 +121,7 @@ dependencies {
api 'org.apache.commons:commons-lang3:3.17.0'
api 'org.apache.commons:commons-text:1.12.0'
api 'org.apache.maven:maven-artifact:3.9.6'
api 'org.apache.maven:maven-artifact:3.9.9'
api 'org.awaitility:awaitility:4.2.2'
@@ -146,7 +144,6 @@ dependencies {
api 'org.jacoco:org.jacoco.core:0.8.12'
api 'org.junit.platform:junit-platform-runner:1.9.2'
api 'org.junit.vintage:junit-vintage-engine:5.10.1'
api 'org.jupnp:org.jupnp:3.0.2'
api 'org.jupnp:org.jupnp.support:3.0.2'
@@ -162,21 +159,21 @@ dependencies {
api 'org.springframework.security:spring-security-crypto:6.3.3'
api 'org.testcontainers:testcontainers:1.20.1'
api 'org.testcontainers:testcontainers:1.20.2'
api 'org.wiremock:wiremock:3.9.1'
api 'org.web3j:abi:4.12.1'
api 'org.web3j:besu:4.12.1'
api 'org.web3j:core:4.12.1'
api 'org.web3j:crypto:4.12.1'
api 'org.web3j:abi:4.12.2'
api 'org.web3j:besu:4.12.2'
api 'org.web3j:core:4.12.2'
api 'org.web3j:crypto:4.12.2'
api 'org.web3j:quorum:4.10.0'
api 'org.xerial.snappy:snappy-java:1.1.10.6'
api 'org.xerial.snappy:snappy-java:1.1.10.7'
api 'tech.pegasys:jc-kzg-4844:1.0.0'
api 'tech.pegasys.discovery:discovery:24.6.0'
api 'tech.pegasys.discovery:discovery:24.9.1'
}
}