Skip to content

Commit

Permalink
Merge branch 'main' into 8053-add-get-pooled-transactions-from-peer-task
Browse files Browse the repository at this point in the history
  • Loading branch information
Matilda-Clerke authored Jan 21, 2025
2 parents 32a7e01 + 6d05f83 commit 2e2a075
Show file tree
Hide file tree
Showing 556 changed files with 8,571 additions and 9,924 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,23 @@ jobs:
ARTIFACTORY_USER: ${{ secrets.BESU_ARTIFACTORY_USER }}
ARTIFACTORY_KEY: ${{ secrets.BESU_ARTIFACTORY_TOKEN }}
run: ./gradlew -Prelease.releaseVersion=${{ env.RELEASE_VERSION }} -Pversion=${{env.RELEASE_VERSION}} artifactoryPublish

verify_artifactory:
runs-on: ubuntu-22.04
needs: [artifactory, validate, test-linux, test-windows]
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: ${{ env.RELEASE_VERSION }}

# actions/[email protected]
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: '3.13'

- name: Install dependencies
run: pip install requests argparse

- name: Run the script
run: python3 .github/workflows/verify_artifacts.py --besu_version="${{ needs.validate.outputs.release_version }}"
55 changes: 55 additions & 0 deletions .github/workflows/verify_artifacts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import requests
import argparse


def create_artifact_paths(version):
artifacts_base_path = "https://hyperledger.jfrog.io/hyperledger/besu-maven/org/hyperledger/besu"
# add to this list here to update the list of artifacts to check
artifacts = [
# besu/evm
f"{artifacts_base_path}/evm/{version}/evm-{version}.module",
f"{artifacts_base_path}/evm/{version}/evm-{version}.pom",
f"{artifacts_base_path}/evm/{version}/evm-{version}.jar",
# besu/plugin-api
f"{artifacts_base_path}/plugin-api/{version}/plugin-api-{version}.module",
f"{artifacts_base_path}/plugin-api/{version}/plugin-api-{version}.pom",
f"{artifacts_base_path}/plugin-api/{version}/plugin-api-{version}.jar",
# besu/metrics-core
f"{artifacts_base_path}/internal/metrics-core/{version}/metrics-core-{version}.module",
f"{artifacts_base_path}/internal/metrics-core/{version}/metrics-core-{version}.pom",
f"{artifacts_base_path}/internal/metrics-core/{version}/metrics-core-{version}.jar",
# besu/internal/core
f"{artifacts_base_path}/internal/core/{version}/core-{version}.module",
f"{artifacts_base_path}/internal/core/{version}/core-{version}.pom",
f"{artifacts_base_path}/internal/core/{version}/core-{version}.jar",
# besu/internal/config
f"{artifacts_base_path}/internal/config/{version}/config-{version}.module",
f"{artifacts_base_path}/internal/config/{version}/config-{version}.pom",
f"{artifacts_base_path}/internal/config/{version}/config-{version}.jar"
# bom
f"{artifacts_base_path}/bom/{version}/bom-{version}.module",
f"{artifacts_base_path}/bom/{version}/bom-{version}.pom",
]
return artifacts



def check_url(url):
print(f"Checking artifact at: {url}")
r = requests.head(url)
if (r.status_code != 200):
raise Exception(f"Sorry, No artifact found at '{url}' !!!")

def main():
parser = argparse.ArgumentParser(description='Check besu artifacts')
parser.add_argument('--besu_{version}', action="store", dest='besu_{version}', default="")
args = parser.parse_args()
print(args.besu_{version})

artifacts = create_artifact_paths(args.besu_{version})
print(artifacts)
for url in artifacts:
check_url(url)

if __name__ == "__main__":
main()
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@

### Breaking Changes
- `--host-whitelist` has been deprecated since 2020 and this option is removed. Use the equivalent `--host-allowlist` instead.
- Changed tracer API to include the mining beneficiary in BlockAwareOperationTracer::traceStartBlock [#8096](https://github.com/hyperledger/besu/pull/8096)
- Change the input defaults on debug_trace* calls to not trace memory by default ("disableMemory": true, "disableStack": false, "disableStorage": false)
- Change the output format of debug_trace* and trace_* calls to match Geth behaviour

### Upcoming Breaking Changes
- `MetricSystem::createLabelledGauge` is deprecated and will be removed in a future release, replace it with `MetricSystem::createLabelledSuppliedGauge`
- k8s (KUBERNETES) Nat method is now deprecated and will be removed in a future release. Use docker or none instead.
- `--Xsnapsync-synchronizer-flat-db-healing-enabled` is deprecated, use `--Xbonsai-full-flat-db-enabled` instead.
- `--Xbonsai-limit-trie-logs-enabled` is deprecated, use `--bonsai-limit-trie-logs-enabled` instead.
- `--Xbonsai-trie-log-pruning-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.
- Sunsetting features - for more context on the reasoning behind the deprecation of these features, including alternative options, read [this blog post](https://www.lfdecentralizedtrust.org/blog/sunsetting-tessera-and-simplifying-hyperledger-besu)
- Tessera privacy
- Smart-contract-based (onchain) permissioning
Expand All @@ -19,7 +26,12 @@
- Retrieve all transaction receipts for a block in one request [#6646](https://github.com/hyperledger/besu/pull/6646)
- Implement EIP-7840: Add blob schedule to config files [#8042](https://github.com/hyperledger/besu/pull/8042)
- Allow gasPrice (legacy) and 1559 gasPrice params to be specified simultaneously for `eth_call`, `eth_createAccessList`, and `eth_estimateGas` [#8059](https://github.com/hyperledger/besu/pull/8059)

- Improve debug_traceBlock calls performance and reduce output size [#8076](https://github.com/hyperledger/besu/pull/8076)
- Add support for EIP-7702 transaction in the txpool [#8018](https://github.com/hyperledger/besu/pull/8018) [#7984](https://github.com/hyperledger/besu/pull/7984)
- Add support for `movePrecompileToAddress` in `StateOverrides` (`eth_call`)[8115](https://github.com/hyperledger/besu/pull/8115)
- Default target-gas-limit to 36M for holesky [#8125](https://github.com/hyperledger/besu/pull/8125)
- Add EIP-7623 - Increase calldata cost [#8093](https://github.com/hyperledger/besu/pull/8093)
- Add nonce to transaction call object [#8139](https://github.com/hyperledger/besu/pull/8139)

### Bug fixes
- Fix serialization of state overrides when `movePrecompileToAddress` is present [#8204](https://github.com/hyperledger/besu/pull/8024)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package org.hyperledger.besu.tests.acceptance.dsl.transaction.eth;

import static org.web3j.protocol.core.DefaultBlockParameterName.LATEST;

import org.hyperledger.besu.tests.acceptance.dsl.transaction.NodeRequests;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.Transaction;

Expand All @@ -36,11 +38,13 @@ public EthEstimateGasTransaction(final String contractAddress, final String func
public EthEstimateGas execute(final NodeRequests node) {
try {

var nonce = node.eth().ethGetTransactionCount(from, LATEST).send().getTransactionCount();

return node.eth()
.ethEstimateGas(
new org.web3j.protocol.core.methods.request.Transaction(
from,
BigInteger.ONE,
nonce,
BigInteger.ZERO,
BigInteger.ZERO,
contractAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public void shouldTransferAllEthOfAuthorizerToSponsor() throws IOException {
*/
@Test
public void shouldCheckNonceAfterNonceIncreaseOfSender() throws IOException {
final long GAS_LIMIT = 1000000L;
cluster.verify(authorizer.balanceEquals(Amount.ether(90000)));
final long GAS_LIMIT = 1_000_000L;
cluster.verify(authorizer.balanceEquals(Amount.ether(90_000)));

final CodeDelegation authorization =
org.hyperledger.besu.ethereum.core.CodeDelegation.builder()
Expand All @@ -159,7 +159,7 @@ public void shouldCheckNonceAfterNonceIncreaseOfSender() throws IOException {
.type(TransactionType.DELEGATE_CODE)
.chainId(BigInteger.valueOf(20211))
.nonce(0)
.maxPriorityFeePerGas(Wei.of(1000000000))
.maxPriorityFeePerGas(Wei.of(1_000_000_000))
.maxFeePerGas(Wei.fromHexString("0x02540BE400"))
.gasLimit(GAS_LIMIT)
.to(Address.fromHexStringStrict(authorizer.getAddress()))
Expand Down Expand Up @@ -209,7 +209,7 @@ public void shouldCheckNonceAfterNonceIncreaseOfSender() throws IOException {
.nonce(2)
.maxPriorityFeePerGas(Wei.of(10))
.maxFeePerGas(Wei.of(100))
.gasLimit(21000)
.gasLimit(21_000)
.to(Address.fromHexStringStrict(otherAccount.getAddress()))
.value(Wei.ONE)
.payload(Bytes.EMPTY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public void buildNewBlock() throws IOException {
executionPayload.toString(), parentBeaconBlockRoot, executionRequests.toString()));
try (final Response newPayloadResponse = newPayloadRequest.execute()) {
assertThat(newPayloadResponse.code()).isEqualTo(200);

final String responseStatus =
mapper.readTree(newPayloadResponse.body().string()).get("result").get("status").asText();
assertThat(responseStatus).isEqualTo("VALID");
}

final Call moveChainAheadRequest = createEngineCall(createForkChoiceRequest(newBlockHash));
Expand Down
9 changes: 6 additions & 3 deletions acceptance-tests/tests/src/test/resources/dev/dev_prague.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@
"blobSchedule": {
"cancun": {
"target": 3,
"max": 6
"max": 6,
"baseFeeUpdateFraction": 3338477
},
"prague": {
"target": 6,
"max": 9
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"osaka": {
"target": 9,
"max": 12
"max": 12,
"baseFeeUpdateFraction": 5007716
}
},
"clique": {
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/tests/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" monitorInterval="30">
<Configuration level="WARN" monitorInterval="30">
<Properties>
<Property name="root.log.level">INFO</Property>
</Properties>
Expand Down
24 changes: 16 additions & 8 deletions besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright ConsenSys AG.
* Copyright contributors to Besu.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -74,6 +74,7 @@
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.FlexiblePrivacyPrecompiledContract;
Expand Down Expand Up @@ -836,7 +837,8 @@ public Runner build() {
besuPluginContext.getNamedPlugins(),
dataDir,
rpcEndpointServiceImpl,
transactionSimulator);
transactionSimulator,
besuController.getProtocolManager().ethContext().getScheduler());

jsonRpcHttpService =
Optional.of(
Expand Down Expand Up @@ -882,7 +884,8 @@ public Runner build() {
besuPluginContext.getNamedPlugins(),
dataDir,
rpcEndpointServiceImpl,
transactionSimulator);
transactionSimulator,
besuController.getProtocolManager().ethContext().getScheduler());

final Optional<AuthenticationService> authToUse =
engineJsonRpcConfiguration.get().isAuthenticationEnabled()
Expand Down Expand Up @@ -978,7 +981,8 @@ public Runner build() {
besuPluginContext.getNamedPlugins(),
dataDir,
rpcEndpointServiceImpl,
transactionSimulator);
transactionSimulator,
besuController.getProtocolManager().ethContext().getScheduler());

createLogsSubscriptionService(
context.getBlockchain(), subscriptionManager, privacyParameters, blockchainQueries);
Expand Down Expand Up @@ -1059,7 +1063,8 @@ public Runner build() {
besuPluginContext.getNamedPlugins(),
dataDir,
rpcEndpointServiceImpl,
transactionSimulator);
transactionSimulator,
besuController.getProtocolManager().ethContext().getScheduler());

jsonRpcIpcService =
Optional.of(
Expand Down Expand Up @@ -1099,7 +1104,8 @@ public Runner build() {
besuPluginContext.getNamedPlugins(),
dataDir,
rpcEndpointServiceImpl,
transactionSimulator);
transactionSimulator,
besuController.getProtocolManager().ethContext().getScheduler());
} else {
inProcessRpcMethods = Map.of();
}
Expand Down Expand Up @@ -1262,7 +1268,8 @@ private Map<String, JsonRpcMethod> jsonRpcMethods(
final Map<String, BesuPlugin> namedPlugins,
final Path dataDir,
final RpcEndpointServiceImpl rpcEndpointServiceImpl,
final TransactionSimulator transactionSimulator) {
final TransactionSimulator transactionSimulator,
final EthScheduler ethScheduler) {
// sync vertx for engine consensus API, to process requests in FIFO order;
final Vertx consensusEngineServer = Vertx.vertx(new VertxOptions().setWorkerPoolSize(1));

Expand Down Expand Up @@ -1300,7 +1307,8 @@ private Map<String, JsonRpcMethod> jsonRpcMethods(
consensusEngineServer,
apiConfiguration,
enodeDnsConfiguration,
transactionSimulator);
transactionSimulator,
ethScheduler);
methods.putAll(besuController.getAdditionalJsonRpcMethods(jsonRpcApis));

final var pluginMethods =
Expand Down
13 changes: 9 additions & 4 deletions besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -1816,10 +1816,8 @@ public BesuControllerBuilder setupControllerBuilder() {
if (DataStorageFormat.BONSAI.equals(getDataStorageConfiguration().getDataStorageFormat())) {
final DiffBasedSubStorageConfiguration subStorageConfiguration =
getDataStorageConfiguration().getDiffBasedSubStorageConfiguration();
if (subStorageConfiguration.getLimitTrieLogsEnabled()) {
besuControllerBuilder.isParallelTxProcessingEnabled(
subStorageConfiguration.getUnstable().isParallelTxProcessingEnabled());
}
besuControllerBuilder.isParallelTxProcessingEnabled(
subStorageConfiguration.getUnstable().isParallelTxProcessingEnabled());
}
return besuControllerBuilder;
}
Expand Down Expand Up @@ -2134,6 +2132,13 @@ private MiningConfiguration getMiningParameters() {
getGenesisBlockPeriodSeconds(genesisConfigOptionsSupplier.get())
.ifPresent(miningParameters::setBlockPeriodSeconds);
initMiningParametersMetrics(miningParameters);
// if network = holesky, set targetGasLimit to 36,000,000 unless otherwise specified
if (miningParameters.getTargetGasLimit().isEmpty() && NetworkName.HOLESKY.equals(network)) {
logger.info(
"Setting target gas limit for holesky: {}",
MiningConfiguration.DEFAULT_TARGET_GAS_LIMIT_HOLESKY);
miningParameters.setTargetGasLimit(MiningConfiguration.DEFAULT_TARGET_GAS_LIMIT_HOLESKY);
}
return miningParameters;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package org.hyperledger.besu.services;

import org.hyperledger.besu.datatypes.AccountOverrideMap;
import org.hyperledger.besu.datatypes.StateOverrideMap;
import org.hyperledger.besu.datatypes.Transaction;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader;
Expand Down Expand Up @@ -69,16 +69,16 @@ public BlockSimulatorServiceImpl(
* @param blockNumber the block number
* @param transactions the transactions to include in the block
* @param blockOverrides the blockSimulationOverride of the block
* @param accountOverrides state overrides of the block
* @param stateOverrides state overrides of the block
* @return the block context
*/
@Override
public PluginBlockSimulationResult simulate(
final long blockNumber,
final List<? extends Transaction> transactions,
final BlockOverrides blockOverrides,
final AccountOverrideMap accountOverrides) {
return processSimulation(blockNumber, transactions, blockOverrides, accountOverrides, false);
final StateOverrideMap stateOverrides) {
return processSimulation(blockNumber, transactions, blockOverrides, stateOverrides, false);
}

/**
Expand All @@ -88,7 +88,7 @@ public PluginBlockSimulationResult simulate(
* @param blockNumber the block number
* @param transactions the transactions to include in the block
* @param blockOverrides block overrides for the block
* @param accountOverrides state overrides of the block
* @param stateOverrides state overrides of the block
* @return the PluginBlockSimulationResult
*/
@Unstable
Expand All @@ -97,21 +97,21 @@ public PluginBlockSimulationResult simulateAndPersistWorldState(
final long blockNumber,
final List<? extends Transaction> transactions,
final BlockOverrides blockOverrides,
final AccountOverrideMap accountOverrides) {
return processSimulation(blockNumber, transactions, blockOverrides, accountOverrides, true);
final StateOverrideMap stateOverrides) {
return processSimulation(blockNumber, transactions, blockOverrides, stateOverrides, true);
}

private PluginBlockSimulationResult processSimulation(
final long blockNumber,
final List<? extends Transaction> transactions,
final BlockOverrides blockOverrides,
final AccountOverrideMap accountOverrides,
final StateOverrideMap stateOverrides,
final boolean persistWorldState) {
BlockHeader header = getBlockHeader(blockNumber);
List<CallParameter> callParameters =
transactions.stream().map(CallParameter::fromTransaction).toList();
BlockStateCall blockStateCall =
new BlockStateCall(callParameters, blockOverrides, accountOverrides, true);
new BlockStateCall(callParameters, blockOverrides, stateOverrides, true);
try (final MutableWorldState ws = getWorldState(header, persistWorldState)) {
List<BlockSimulationResult> results =
blockSimulator.process(header, List.of(blockStateCall), ws);
Expand Down
Loading

0 comments on commit 2e2a075

Please sign in to comment.