Skip to content

Commit

Permalink
Merge branch 'main' into state-tests-dump-world-state
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Dudley <[email protected]>
  • Loading branch information
siladu committed Jan 14, 2025
2 parents 69e8a4c + ff5266a commit f870df3
Show file tree
Hide file tree
Showing 28 changed files with 264 additions and 76 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()
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
2 changes: 1 addition & 1 deletion besu/src/main/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">
<Configuration level="WARN">
<Properties>
<Property name="root.log.level">${env:LOG_LEVEL:-INFO}</Property>
<Property name="root.log.logger">${env:LOGGER:-Console}</Property>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Configuration level="WARN">
<Properties>
<Property name="root.log.level">DEBUG</Property>
</Properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright contributors to Hyperledger Besu.
* 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 All @@ -22,6 +22,7 @@
import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.ExecutionEngineJsonRpcMethod.EngineStatus.VALID;
import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.RequestValidatorProvider.getRequestsValidator;
import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.WithdrawalsValidatorProvider.getWithdrawalsValidator;
import static org.hyperledger.besu.metrics.BesuMetricCategory.BLOCK_PROCESSING;

import org.hyperledger.besu.consensus.merge.blockcreation.MergeMiningCoordinator;
import org.hyperledger.besu.datatypes.BlobGas;
Expand Down Expand Up @@ -61,6 +62,7 @@
import org.hyperledger.besu.ethereum.mainnet.feemarket.ExcessBlobGasCalculator;
import org.hyperledger.besu.ethereum.rlp.RLPException;
import org.hyperledger.besu.ethereum.trie.MerkleTrieException;
import org.hyperledger.besu.plugin.services.MetricsSystem;
import org.hyperledger.besu.plugin.services.exception.StorageException;

import java.security.InvalidParameterException;
Expand All @@ -85,17 +87,24 @@ public abstract class AbstractEngineNewPayload extends ExecutionEngineJsonRpcMet
private static final BlockHeaderFunctions headerFunctions = new MainnetBlockHeaderFunctions();
private final MergeMiningCoordinator mergeCoordinator;
private final EthPeers ethPeers;
private long lastExecutionTime = 0L;

public AbstractEngineNewPayload(
final Vertx vertx,
final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext,
final MergeMiningCoordinator mergeCoordinator,
final EthPeers ethPeers,
final EngineCallListener engineCallListener) {
final EngineCallListener engineCallListener,
final MetricsSystem metricsSystem) {
super(vertx, protocolSchedule, protocolContext, engineCallListener);
this.mergeCoordinator = mergeCoordinator;
this.ethPeers = ethPeers;
metricsSystem.createLongGauge(
BLOCK_PROCESSING,
"execution_time_head",
"The execution time of the last block (head)",
this::getLastExecutionTime);
}

@Override
Expand Down Expand Up @@ -347,16 +356,16 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
// execute block and return result response
final long startTimeMs = System.currentTimeMillis();
final BlockProcessingResult executionResult = mergeCoordinator.rememberBlock(block);

if (executionResult.isSuccessful()) {
lastExecutionTime = System.currentTimeMillis() - startTimeMs;
logImportedBlockInfo(
block,
blobTransactions.stream()
.map(Transaction::getVersionedHashes)
.flatMap(Optional::stream)
.mapToInt(List::size)
.sum(),
(System.currentTimeMillis() - startTimeMs) / 1000.0,
lastExecutionTime / 1000.0,
executionResult.getNbParallelizedTransations());
return respondWith(reqId, blockParam, newBlockHeader.getHash(), VALID);
} else {
Expand Down Expand Up @@ -629,4 +638,8 @@ private void logImportedBlockInfo(
messageArgs.add(ethPeers.peerCount());
LOG.info(String.format(message.toString(), messageArgs.toArray()));
}

private long getLastExecutionTime() {
return this.lastExecutionTime;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright contributors to Hyperledger Besu.
* 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 @@ -27,6 +27,7 @@
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
import org.hyperledger.besu.ethereum.mainnet.ValidationResult;
import org.hyperledger.besu.plugin.services.MetricsSystem;

import java.util.List;
import java.util.Optional;
Expand All @@ -41,8 +42,16 @@ public EngineNewPayloadV1(
final ProtocolContext protocolContext,
final MergeMiningCoordinator mergeCoordinator,
final EthPeers ethPeers,
final EngineCallListener engineCallListener) {
super(vertx, protocolSchedule, protocolContext, mergeCoordinator, ethPeers, engineCallListener);
final EngineCallListener engineCallListener,
final MetricsSystem metricsSystem) {
super(
vertx,
protocolSchedule,
protocolContext,
mergeCoordinator,
ethPeers,
engineCallListener,
metricsSystem);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright contributors to Hyperledger Besu.
* 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 @@ -28,6 +28,7 @@
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
import org.hyperledger.besu.ethereum.mainnet.ValidationResult;
import org.hyperledger.besu.plugin.services.MetricsSystem;

import java.util.List;
import java.util.Optional;
Expand All @@ -43,8 +44,16 @@ public EngineNewPayloadV2(
final ProtocolContext protocolContext,
final MergeMiningCoordinator mergeCoordinator,
final EthPeers ethPeers,
final EngineCallListener engineCallListener) {
super(vertx, protocolSchedule, protocolContext, mergeCoordinator, ethPeers, engineCallListener);
final EngineCallListener engineCallListener,
final MetricsSystem metricsSystem) {
super(
vertx,
protocolSchedule,
protocolContext,
mergeCoordinator,
ethPeers,
engineCallListener,
metricsSystem);
cancunMilestone = protocolSchedule.milestoneFor(CANCUN);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ValidationResult;
import org.hyperledger.besu.plugin.services.MetricsSystem;

import java.util.List;
import java.util.Optional;
Expand All @@ -40,9 +41,16 @@ public EngineNewPayloadV3(
final ProtocolContext protocolContext,
final MergeMiningCoordinator mergeCoordinator,
final EthPeers ethPeers,
final EngineCallListener engineCallListener) {
final EngineCallListener engineCallListener,
final MetricsSystem metricsSystem) {
super(
vertx, timestampSchedule, protocolContext, mergeCoordinator, ethPeers, engineCallListener);
vertx,
timestampSchedule,
protocolContext,
mergeCoordinator,
ethPeers,
engineCallListener,
metricsSystem);
this.cancunMilestone = timestampSchedule.milestoneFor(CANCUN);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ValidationResult;
import org.hyperledger.besu.plugin.services.MetricsSystem;

import java.util.List;
import java.util.Optional;
Expand All @@ -40,9 +41,16 @@ public EngineNewPayloadV4(
final ProtocolContext protocolContext,
final MergeMiningCoordinator mergeCoordinator,
final EthPeers ethPeers,
final EngineCallListener engineCallListener) {
final EngineCallListener engineCallListener,
final MetricsSystem metricsSystem) {
super(
vertx, timestampSchedule, protocolContext, mergeCoordinator, ethPeers, engineCallListener);
vertx,
timestampSchedule,
protocolContext,
mergeCoordinator,
ethPeers,
engineCallListener,
metricsSystem);
pragueMilestone = timestampSchedule.milestoneFor(PRAGUE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.plugin.services.MetricsSystem;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -63,6 +64,7 @@ public class ExecutionEngineJsonRpcMethods extends ApiGroupJsonRpcMethods {
private final String clientVersion;
private final String commit;
private final TransactionPool transactionPool;
private final MetricsSystem metricsSystem;

ExecutionEngineJsonRpcMethods(
final MiningCoordinator miningCoordinator,
Expand All @@ -72,7 +74,8 @@ public class ExecutionEngineJsonRpcMethods extends ApiGroupJsonRpcMethods {
final Vertx consensusEngineServer,
final String clientVersion,
final String commit,
final TransactionPool transactionPool) {
final TransactionPool transactionPool,
final MetricsSystem metricsSystem) {
this.mergeCoordinator =
Optional.ofNullable(miningCoordinator)
.filter(mc -> mc.isCompatibleWithEngineApi())
Expand All @@ -84,6 +87,7 @@ public class ExecutionEngineJsonRpcMethods extends ApiGroupJsonRpcMethods {
this.clientVersion = clientVersion;
this.commit = commit;
this.transactionPool = transactionPool;
this.metricsSystem = metricsSystem;
}

@Override
Expand Down Expand Up @@ -117,21 +121,24 @@ protected Map<String, JsonRpcMethod> create() {
protocolContext,
mergeCoordinator.get(),
ethPeers,
engineQosTimer),
engineQosTimer,
metricsSystem),
new EngineNewPayloadV2(
consensusEngineServer,
protocolSchedule,
protocolContext,
mergeCoordinator.get(),
ethPeers,
engineQosTimer),
engineQosTimer,
metricsSystem),
new EngineNewPayloadV3(
consensusEngineServer,
protocolSchedule,
protocolContext,
mergeCoordinator.get(),
ethPeers,
engineQosTimer),
engineQosTimer,
metricsSystem),
new EngineForkchoiceUpdatedV1(
consensusEngineServer,
protocolSchedule,
Expand Down Expand Up @@ -193,7 +200,8 @@ protected Map<String, JsonRpcMethod> create() {
protocolContext,
mergeCoordinator.get(),
ethPeers,
engineQosTimer));
engineQosTimer,
metricsSystem));
}

return mapOf(executionEngineApisSupported);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public Map<String, JsonRpcMethod> methods(
consensusEngineServer,
clientVersion,
commit,
transactionPool),
transactionPool,
metricsSystem),
new EthJsonRpcMethods(
blockchainQueries,
synchronizer,
Expand Down
Loading

0 comments on commit f870df3

Please sign in to comment.