Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask

pull/7638/head
Matilda-Clerke 1 month ago committed by GitHub
commit 095e31d876
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 31
      .github/ISSUE_TEMPLATE/release-checklist.md
  2. 1
      CHANGELOG.md
  3. 1
      acceptance-tests/dsl/build.gradle
  4. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/blockchain/ExpectBlockNotCreated.java
  5. 12
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java
  6. 2
      acceptance-tests/test-plugins/build.gradle
  7. 3
      acceptance-tests/tests/build.gradle
  8. 4
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/crypto/SECP256R1AcceptanceTest.java
  9. 10
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/mining/MiningAcceptanceTest.java
  10. 17
      besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java
  11. 7
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java
  12. 10
      besu/src/test/java/org/hyperledger/besu/cli/PrivacyOptionsTest.java
  13. 1
      build.gradle
  14. 13
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeader.java
  15. 12
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTask.java
  16. 2
      ethereum/evmtool/build.gradle
  17. 15
      ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java
  18. 3
      evm/src/main/java/org/hyperledger/besu/evm/operation/CallFOperation.java
  19. 8
      evm/src/main/java/org/hyperledger/besu/evm/operation/JumpFOperation.java
  20. 6
      evm/src/test/java/org/hyperledger/besu/evm/operation/DataCopyOperationTest.java
  21. 2142
      gradle/verification-metadata.xml
  22. 2
      nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java
  23. 55
      platform/build.gradle
  24. 2
      plugins/rocksdb/build.gradle

@ -12,25 +12,34 @@ assignees: ''
- [ ] Notify maintainers about updating changelog for in-flight PRs - [ ] 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 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 - [ ] 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` - [ ] On the appropriate branch/commit, create a calver tag for the release candidate, format example: `24.4.0-RC1`
- [ ] git tag 24.4.0-RC2 - [ ] git tag 24.4.0-RC1
- [ ] git push upstream 24.4.0-RC2 - [ ] git push upstream 24.4.0-RC1
- [ ] Sign-off with team; announce the tag in #besu-release in Discord - [ ] 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 - [ ] Consensys staff start burn-in using this tag
- [ ] Seek sign off for burn-in - [ ] Seek sign off for burn-in
- [ ] Pass? Go ahead and complete the release process - [ ] 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 - [ ] 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` - [ ] Optional: Perform a dry run with https://github.com/consensys/protocols-release-sandbox to test the workflows
- [ ] Using the FULL RELEASE tag, create a release in github to trigger the workflows. Once published: - [ ] 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 - this is now public and notifies subscribed users
- makes the release "latest" in github - makes the release "latest" in github
- publishes artefacts and version-specific docker tags
- publishes the docker `latest` tag variants - 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) - [ ] 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>` - 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 - Run commands `brew tap hyperledger/besu && brew install besu` on MacOSX and verify latest version has been installed

@ -10,6 +10,7 @@
### Additions and Improvements ### 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) - 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) - 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 ### Bug fixes

@ -33,7 +33,6 @@ dependencies {
implementation 'info.picocli:picocli' implementation 'info.picocli:picocli'
implementation 'io.reactivex.rxjava2:rxjava' implementation 'io.reactivex.rxjava2:rxjava'
implementation 'io.vertx:vertx-core' implementation 'io.vertx:vertx-core'
implementation 'junit:junit'
implementation 'io.opentelemetry:opentelemetry-api' implementation 'io.opentelemetry:opentelemetry-api'
implementation 'io.tmio:tuweni-bytes' implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-io' implementation 'io.tmio:tuweni-io'

@ -14,7 +14,7 @@
*/ */
package org.hyperledger.besu.tests.acceptance.dsl.condition.blockchain; package org.hyperledger.besu.tests.acceptance.dsl.condition.blockchain;
import static junit.framework.TestCase.fail; import static org.junit.jupiter.api.Assertions.fail;
import org.hyperledger.besu.tests.acceptance.dsl.condition.Condition; import org.hyperledger.besu.tests.acceptance.dsl.condition.Condition;
import org.hyperledger.besu.tests.acceptance.dsl.node.Node; import org.hyperledger.besu.tests.acceptance.dsl.node.Node;

@ -54,6 +54,7 @@ import org.hyperledger.besu.ethereum.trie.diffbased.bonsai.cache.BonsaiCachedMer
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration; import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive; import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
import org.hyperledger.besu.evm.internal.EvmConfiguration; import org.hyperledger.besu.evm.internal.EvmConfiguration;
import org.hyperledger.besu.metrics.MetricCategoryRegistryImpl;
import org.hyperledger.besu.metrics.MetricsSystemModule; import org.hyperledger.besu.metrics.MetricsSystemModule;
import org.hyperledger.besu.metrics.ObservableMetricsSystem; import org.hyperledger.besu.metrics.ObservableMetricsSystem;
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
@ -71,6 +72,7 @@ import org.hyperledger.besu.plugin.services.StorageService;
import org.hyperledger.besu.plugin.services.TransactionPoolValidatorService; import org.hyperledger.besu.plugin.services.TransactionPoolValidatorService;
import org.hyperledger.besu.plugin.services.TransactionSelectionService; import org.hyperledger.besu.plugin.services.TransactionSelectionService;
import org.hyperledger.besu.plugin.services.TransactionSimulationService; import org.hyperledger.besu.plugin.services.TransactionSimulationService;
import org.hyperledger.besu.plugin.services.metrics.MetricCategoryRegistry;
import org.hyperledger.besu.plugin.services.storage.rocksdb.RocksDBPlugin; import org.hyperledger.besu.plugin.services.storage.rocksdb.RocksDBPlugin;
import org.hyperledger.besu.services.BesuConfigurationImpl; import org.hyperledger.besu.services.BesuConfigurationImpl;
import org.hyperledger.besu.services.BesuEventsImpl; import org.hyperledger.besu.services.BesuEventsImpl;
@ -396,6 +398,12 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
retval.init(blockchain, transactionSimulator); retval.init(blockchain, transactionSimulator);
return retval; return retval;
} }
@Provides
@Singleton
MetricCategoryRegistryImpl provideMetricCategoryRegistry() {
return new MetricCategoryRegistryImpl();
}
} }
@Module @Module
@ -476,6 +484,8 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
final RpcEndpointServiceImpl rpcEndpointServiceImpl, final RpcEndpointServiceImpl rpcEndpointServiceImpl,
final BesuConfiguration commonPluginConfiguration, final BesuConfiguration commonPluginConfiguration,
final PermissioningServiceImpl permissioningService, final PermissioningServiceImpl permissioningService,
final MetricCategoryRegistryImpl metricCategoryRegistry,
final MetricsSystem metricsSystem,
final @Named("ExtraCLIOptions") List<String> extraCLIOptions, final @Named("ExtraCLIOptions") List<String> extraCLIOptions,
final @Named("RequestedPlugins") List<String> requestedPlugins) { final @Named("RequestedPlugins") List<String> requestedPlugins) {
final CommandLine commandLine = new CommandLine(CommandSpec.create()); final CommandLine commandLine = new CommandLine(CommandSpec.create());
@ -492,6 +502,8 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
TransactionSimulationService.class, transactionSimulationServiceImpl); TransactionSimulationService.class, transactionSimulationServiceImpl);
besuPluginContext.addService(BlockchainService.class, blockchainServiceImpl); besuPluginContext.addService(BlockchainService.class, blockchainServiceImpl);
besuPluginContext.addService(BesuConfiguration.class, commonPluginConfiguration); besuPluginContext.addService(BesuConfiguration.class, commonPluginConfiguration);
besuPluginContext.addService(MetricCategoryRegistry.class, metricCategoryRegistry);
besuPluginContext.addService(MetricsSystem.class, metricsSystem);
final Path pluginsPath; final Path pluginsPath;
final String pluginDir = System.getProperty("besu.plugins.dir"); final String pluginDir = System.getProperty("besu.plugins.dir");

@ -14,8 +14,6 @@ dependencies {
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter' testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
task testPluginsJar(type: Jar) { task testPluginsJar(type: Jar) {

@ -68,7 +68,6 @@ dependencies {
testImplementation 'io.opentracing:opentracing-api' testImplementation 'io.opentracing:opentracing-api'
testImplementation 'io.opentracing:opentracing-util' testImplementation 'io.opentracing:opentracing-util'
testImplementation 'io.vertx:vertx-core' testImplementation 'io.vertx:vertx-core'
testImplementation 'junit:junit'
testImplementation 'org.apache.commons:commons-compress' testImplementation 'org.apache.commons:commons-compress'
testImplementation 'org.apache.logging.log4j:log4j-core' testImplementation 'org.apache.logging.log4j:log4j-core'
testImplementation 'io.tmio:tuweni-crypto' testImplementation 'io.tmio:tuweni-crypto'
@ -81,8 +80,6 @@ dependencies {
testImplementation 'org.web3j:core' testImplementation 'org.web3j:core'
testImplementation 'org.wiremock:wiremock' testImplementation 'org.wiremock:wiremock'
testImplementation project(path: ':acceptance-tests:tests:shanghai') testImplementation project(path: ':acceptance-tests:tests:shanghai')
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
test.enabled = false test.enabled = false

@ -15,7 +15,7 @@
package org.hyperledger.besu.tests.acceptance.crypto; package org.hyperledger.besu.tests.acceptance.crypto;
import static org.assertj.core.api.Assertions.assertThat; 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.KeyPair;
import org.hyperledger.besu.crypto.SECP256R1; 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 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 // the same time. So we only execute the test when ProcessBesuNodeRunner is used, as there is
// not conflict because we use separate processes. // not conflict because we use separate processes.
assumeThat(BesuNodeRunner.isProcessBesuNodeRunner()).isTrue(); assumeTrue(BesuNodeRunner.isProcessBesuNodeRunner());
minerNode.verify(net.awaitPeerCount(1)); minerNode.verify(net.awaitPeerCount(1));
otherNode.verify(net.awaitPeerCount(1)); otherNode.verify(net.awaitPeerCount(1));

@ -18,21 +18,21 @@ import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.account.Account; import org.hyperledger.besu.tests.acceptance.dsl.account.Account;
import org.hyperledger.besu.tests.acceptance.dsl.node.Node; import org.hyperledger.besu.tests.acceptance.dsl.node.Node;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class MiningAcceptanceTest extends AcceptanceTestBase { class MiningAcceptanceTest extends AcceptanceTestBase {
private Node minerNode; private Node minerNode;
@Before @BeforeEach
public void setUp() throws Exception { public void setUp() throws Exception {
minerNode = besu.createMinerNode("miner1"); minerNode = besu.createMinerNode("miner1");
cluster.start(minerNode); cluster.start(minerNode);
} }
@Test @Test
public void shouldMineTransactions() { void shouldMineTransactions() {
final Account sender = accounts.createAccount("account1"); final Account sender = accounts.createAccount("account1");
final Account receiver = accounts.createAccount("account2"); final Account receiver = accounts.createAccount("account2");
minerNode.execute(accountTransactions.createTransfer(sender, 50)); minerNode.execute(accountTransactions.createTransfer(sender, 50));

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

@ -16,7 +16,6 @@ package org.hyperledger.besu.cli;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat; 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.CLASSIC;
import static org.hyperledger.besu.cli.config.NetworkName.DEV; import static org.hyperledger.besu.cli.config.NetworkName.DEV;
import static org.hyperledger.besu.cli.config.NetworkName.EPHEMERY; 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_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DefaultDiscoveryConfiguration.SEPOLIA_DISCOVERY_URL; 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.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.any;
import static org.mockito.ArgumentMatchers.contains; import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.eq;
@ -2392,7 +2391,7 @@ public class BesuCommandTest extends CommandTestAbstract {
@Test @Test
public void logsWarningWhenFailToLoadJemalloc() { public void logsWarningWhenFailToLoadJemalloc() {
assumeThat(PlatformDetector.getOSType(), is("linux")); assumeTrue(PlatformDetector.getOSType().equals("linux"));
setEnvironmentVariable("BESU_USING_JEMALLOC", "true"); setEnvironmentVariable("BESU_USING_JEMALLOC", "true");
parseCommand(); parseCommand();
verify(mockLogger) verify(mockLogger)
@ -2404,7 +2403,7 @@ public class BesuCommandTest extends CommandTestAbstract {
@Test @Test
public void logsSuggestInstallingJemallocWhenEnvVarNotPresent() { public void logsSuggestInstallingJemallocWhenEnvVarNotPresent() {
assumeThat(PlatformDetector.getOSType(), is("linux")); assumeTrue(PlatformDetector.getOSType().equals("linux"));
parseCommand(); parseCommand();
verify(mockLogger) verify(mockLogger)
.info("jemalloc library not found, memory usage may be reduced by installing it"); .info("jemalloc library not found, memory usage may be reduced by installing it");

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

@ -24,7 +24,6 @@ import java.util.regex.Pattern
plugins { plugins {
id 'com.diffplug.spotless' version '6.25.0' 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.github.jk1.dependency-license-report' version '2.9'
id 'com.jfrog.artifactory' version '5.2.5' id 'com.jfrog.artifactory' version '5.2.5'
id 'me.champeau.jmh' version '0.7.2' apply false id 'me.champeau.jmh' version '0.7.2' apply false

@ -92,6 +92,19 @@ public class BlockHeader extends SealableBlockHeader
this.parsedExtraData = Suppliers.memoize(() -> blockHeaderFunctions.parseExtraData(this)); 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. * Returns the block mixed hash.
* *

@ -19,7 +19,6 @@ import static java.util.Collections.emptyList;
import static java.util.concurrent.CompletableFuture.completedFuture; import static java.util.concurrent.CompletableFuture.completedFuture;
import static java.util.stream.Collectors.toMap; 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.Block;
import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
@ -75,7 +74,7 @@ public class CompleteBlocksTask extends AbstractRetryingPeerTask<List<Block>> {
this.headers = headers; this.headers = headers;
this.blocks = this.blocks =
headers.stream() headers.stream()
.filter(this::hasEmptyBody) .filter(BlockHeader::hasEmptyBlock)
.collect( .collect(
toMap( toMap(
BlockHeader::getNumber, BlockHeader::getNumber,
@ -102,15 +101,6 @@ public class CompleteBlocksTask extends AbstractRetryingPeerTask<List<Block>> {
return protocolSchedule.getByBlockHeader(header).getWithdrawalsProcessor().isPresent(); 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( public static CompleteBlocksTask forHeaders(
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final EthContext ethContext, final EthContext ethContext,

@ -65,8 +65,6 @@ dependencies {
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation 'org.mockito:mockito-junit-jupiter' testImplementation 'org.mockito:mockito-junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
// No logging in graalvm EvmTool // No logging in graalvm EvmTool
nativeImageClasspath 'org.slf4j:slf4j-nop' nativeImageClasspath 'org.slf4j:slf4j-nop'
} }

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

@ -54,8 +54,7 @@ public class CallFOperation extends AbstractOperation {
int section = code.readBigEndianU16(pc + 1); int section = code.readBigEndianU16(pc + 1);
CodeSection info = code.getCodeSection(section); CodeSection info = code.getCodeSection(section);
int operandStackSize = frame.stackSize(); int operandStackSize = frame.stackSize();
if (operandStackSize >= 1024 if (operandStackSize > 1024 - info.getMaxStackHeight() + info.getInputs()) {
|| operandStackSize > 1024 - info.getMaxStackHeight() + info.getInputs()) {
return callfStackOverflow; return callfStackOverflow;
} }
frame.getReturnStack().push(new ReturnStack.ReturnStackItem(frame.getSection(), pc + 2)); frame.getReturnStack().push(new ReturnStack.ReturnStackItem(frame.getSection(), pc + 2));

@ -16,6 +16,7 @@ package org.hyperledger.besu.evm.operation;
import org.hyperledger.besu.evm.Code; import org.hyperledger.besu.evm.Code;
import org.hyperledger.besu.evm.EVM; import org.hyperledger.besu.evm.EVM;
import org.hyperledger.besu.evm.frame.ExceptionalHaltReason;
import org.hyperledger.besu.evm.frame.MessageFrame; import org.hyperledger.besu.evm.frame.MessageFrame;
import org.hyperledger.besu.evm.gascalculator.GasCalculator; import org.hyperledger.besu.evm.gascalculator.GasCalculator;
@ -28,6 +29,9 @@ public class JumpFOperation extends AbstractOperation {
/** The Jump F success operation result. */ /** The Jump F success operation result. */
static final OperationResult jumpfSuccess = new OperationResult(5, null); static final OperationResult jumpfSuccess = new OperationResult(5, null);
static final OperationResult jumpfStackOverflow =
new OperationResult(5, ExceptionalHaltReason.TOO_MANY_STACK_ITEMS);
/** /**
* Instantiates a new Jump F operation. * Instantiates a new Jump F operation.
* *
@ -46,6 +50,10 @@ public class JumpFOperation extends AbstractOperation {
int pc = frame.getPC(); int pc = frame.getPC();
int section = code.readBigEndianU16(pc + 1); int section = code.readBigEndianU16(pc + 1);
var info = code.getCodeSection(section); var info = code.getCodeSection(section);
int operandStackSize = frame.stackSize();
if (operandStackSize > 1024 - info.getMaxStackHeight() + info.getInputs()) {
return jumpfStackOverflow;
}
frame.setPC(info.getEntryPoint() - 1); // will be +1ed at end of operations loop frame.setPC(info.getEntryPoint() - 1); // will be +1ed at end of operations loop
frame.setSection(section); frame.setSection(section);
return jumpfSuccess; return jumpfSuccess;

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

File diff suppressed because it is too large Load Diff

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

@ -27,17 +27,17 @@ javaPlatform {
} }
dependencies { dependencies {
api platform('com.fasterxml.jackson:jackson-bom:2.17.2') api platform('com.fasterxml.jackson:jackson-bom:2.18.0')
api platform('io.grpc:grpc-bom:1.66.0') api platform('io.grpc:grpc-bom:1.68.0')
api platform('io.netty:netty-bom:4.1.112.Final') api platform('io.netty:netty-bom:4.1.114.Final')
api platform('io.opentelemetry:opentelemetry-bom:1.41.0') api platform('io.opentelemetry:opentelemetry-bom:1.43.0')
api platform('io.prometheus:simpleclient_bom:0.16.0') api platform('io.prometheus:simpleclient_bom:0.16.0')
api platform('io.vertx:vertx-stack-depchain:4.5.9') api platform('io.vertx:vertx-stack-depchain:4.5.10')
api platform('org.apache.logging.log4j:log4j-bom:2.23.1') api platform('org.apache.logging.log4j:log4j-bom:2.24.1')
api platform('org.assertj:assertj-bom:3.26.3') api platform('org.assertj:assertj-bom:3.26.3')
api platform('org.immutables:bom:2.10.1') api platform('org.immutables:bom:2.10.1')
api platform('org.junit:junit-bom:5.11.0') api platform('org.junit:junit-bom:5.11.2')
api platform('org.mockito:mockito-bom:5.13.0') api platform('org.mockito:mockito-bom:5.14.2')
api platform('org.slf4j:slf4j-bom:2.0.16') api platform('org.slf4j:slf4j-bom:2.0.16')
constraints { constraints {
@ -60,39 +60,37 @@ dependencies {
api 'com.github.ben-manes.caffeine:caffeine:3.1.8' 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.5'
api 'com.github.oshi:oshi-core:6.6.3'
api 'com.google.auto.service:auto-service:1.1.1' api 'com.google.auto.service:auto-service:1.1.1'
api 'com.google.dagger:dagger-compiler:2.52' api 'com.google.dagger:dagger-compiler:2.52'
api 'com.google.dagger:dagger: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.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.splunk.logging:splunk-library-javalogging:1.11.8'
api 'com.squareup.okhttp3:okhttp:4.12.0' 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 '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:4.7.6'
api 'info.picocli:picocli-codegen: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.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-api:0.33.0'
api 'io.opentracing:opentracing-util:0.33.0' api 'io.opentracing:opentracing-util:0.33.0'
@ -111,9 +109,7 @@ dependencies {
api 'io.tmio:tuweni-toml:2.4.2' api 'io.tmio:tuweni-toml:2.4.2'
api 'io.tmio:tuweni-units:2.4.2' api 'io.tmio:tuweni-units:2.4.2'
api 'junit:junit:4.13.2' api 'net.java.dev.jna:jna:5.15.0'
api 'net.java.dev.jna:jna:5.14.0'
api 'org.antlr:antlr4:4.11.1' api 'org.antlr:antlr4:4.11.1'
api 'org.antlr:antlr4-runtime:4.11.1' api 'org.antlr:antlr4-runtime:4.11.1'
@ -123,7 +119,7 @@ dependencies {
api 'org.apache.commons:commons-lang3:3.17.0' api 'org.apache.commons:commons-lang3:3.17.0'
api 'org.apache.commons:commons-text:1.12.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' api 'org.awaitility:awaitility:4.2.2'
@ -146,7 +142,6 @@ dependencies {
api 'org.jacoco:org.jacoco.core:0.8.12' api 'org.jacoco:org.jacoco.core:0.8.12'
api 'org.junit.platform:junit-platform-runner:1.9.2' 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:3.0.2'
api 'org.jupnp:org.jupnp.support:3.0.2' api 'org.jupnp:org.jupnp.support:3.0.2'
@ -162,21 +157,21 @@ dependencies {
api 'org.springframework.security:spring-security-crypto:6.3.3' 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.wiremock:wiremock:3.9.1'
api 'org.web3j:abi:4.12.1' api 'org.web3j:abi:4.12.2'
api 'org.web3j:besu:4.12.1' api 'org.web3j:besu:4.12.2'
api 'org.web3j:core:4.12.1' api 'org.web3j:core:4.12.2'
api 'org.web3j:crypto:4.12.1' api 'org.web3j:crypto:4.12.2'
api 'org.web3j:quorum:4.10.0' 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:jc-kzg-4844:1.0.0'
api 'tech.pegasys.discovery:discovery:24.6.0' api 'tech.pegasys.discovery:discovery:24.9.1'
} }
} }

@ -58,6 +58,4 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter' testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-junit-jupiter' testImplementation 'org.mockito:mockito-junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

Loading…
Cancel
Save