Skip to content

Commit 04cdd6d

Browse files
authored
Merge branch 'master' into fix/array-pool-leaks
2 parents e7438b5 + a3cbd5b commit 04cdd6d

183 files changed

Lines changed: 2622 additions & 1128 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/run-expb-reproducible-benchmarks.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ on:
5050
disable. Ignored for non-flat layouts and when additional_extra_flags already sets it.
5151
required: false
5252
default: "67108864"
53+
expb_env:
54+
description: >-
55+
Optional environment variables passed to the expb process (KEY=VALUE,
56+
comma- or newline-separated). Applies to both single-image and
57+
multi-image runs. Enables expb env-gated options, e.g.
58+
EXPB_EVM_WARMUP=1 (per-block eth_simulateV1 warmup). Values that
59+
themselves contain commas must use the newline-separated form, since
60+
commas are treated as entry separators.
61+
required: false
62+
default: ""
5363
rebuild_docker:
5464
description: Rebuild Nethermind Docker image before running benchmarks
5565
required: false
@@ -119,6 +129,7 @@ jobs:
119129
delay_seconds: ${{ steps.resolve.outputs.delay_seconds }}
120130
amount: ${{ steps.resolve.outputs.amount }}
121131
additional_extra_flags: ${{ steps.resolve.outputs.additional_extra_flags }}
132+
expb_env: ${{ steps.resolve.outputs.expb_env }}
122133
cleanup_grace_seconds: ${{ steps.resolve.outputs.cleanup_grace_seconds }}
123134
scenario_name: ${{ steps.resolve.outputs.scenario_name }}
124135
run_count: ${{ steps.resolve.outputs.run_count }}
@@ -148,6 +159,7 @@ jobs:
148159
DISPATCH_AMOUNT: ${{ inputs.amount }}
149160
DISPATCH_ADDITIONAL_EXTRA_FLAGS: ${{ inputs.additional_extra_flags }}
150161
DISPATCH_FLAT_WRITE_BUFFER_FLOOR: ${{ inputs.flat_write_buffer_floor }}
162+
DISPATCH_EXPB_ENV: ${{ inputs.expb_env }}
151163
DISPATCH_REBUILD_DOCKER: ${{ inputs.rebuild_docker }}
152164
DISPATCH_RUN_COUNT: ${{ inputs.run_count }}
153165
DISPATCH_DOCKER_IMAGES: ${{ inputs.docker_images }}
@@ -162,6 +174,7 @@ jobs:
162174
mode="single"
163175
# Default FlatDb write-buffer floor (bytes) for flat layout; overridden by the dispatch input.
164176
flat_write_buffer_floor="67108864"
177+
expb_env=""
165178
if [[ "${EVENT_NAME}" == "workflow_dispatch" ]]; then
166179
branch="${PUSH_BRANCH}"
167180
state_layout="${DISPATCH_STATE_LAYOUT}"
@@ -179,6 +192,7 @@ jobs:
179192
fi
180193
additional_extra_flags="${DISPATCH_ADDITIONAL_EXTRA_FLAGS:-}"
181194
flat_write_buffer_floor="${DISPATCH_FLAT_WRITE_BUFFER_FLOOR-67108864}"
195+
expb_env="${DISPATCH_EXPB_ENV:-}"
182196
cleanup_grace_seconds="90"
183197
rebuild_docker="${DISPATCH_REBUILD_DOCKER:-true}"
184198
run_count="${DISPATCH_RUN_COUNT:-1}"
@@ -333,6 +347,9 @@ jobs:
333347
echo "additional_extra_flags<<EOF"
334348
printf '%s\n' "${additional_extra_flags}"
335349
echo "EOF"
350+
echo "expb_env<<EOF"
351+
printf '%s\n' "${expb_env}"
352+
echo "EOF"
336353
} >> "${GITHUB_OUTPUT}"
337354
338355
prepare-docker:
@@ -664,11 +681,27 @@ jobs:
664681
env:
665682
RAW_RUN_LOG: ${{ runner.temp }}/expb-run.log
666683
DOTTRACE: ${{ needs.resolve.outputs.dottrace }}
684+
EXPB_ENV_PASSTHROUGH: ${{ needs.resolve.outputs.expb_env }}
667685
run: |
668686
set -euo pipefail
669687
expb_pid=""
670688
: > "${RAW_RUN_LOG}"
671689
690+
# Export caller-provided expb env tuning (comma- or newline-separated KEY=VALUE;
691+
# values containing commas must use the newline-separated form).
692+
if [[ -n "${EXPB_ENV_PASSTHROUGH:-}" ]]; then
693+
while IFS= read -r _kv; do
694+
_kv="$(printf '%s' "${_kv}" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//')"
695+
[[ -z "${_kv}" ]] && continue
696+
if [[ "${_kv}" =~ ^[A-Za-z_][A-Za-z0-9_]*= ]]; then
697+
export "${_kv}"
698+
echo "Exported expb env: ${_kv%%=*}=<value>"
699+
else
700+
echo "::warning::Skipping invalid expb_env entry (expected KEY=VALUE): ${_kv}"
701+
fi
702+
done < <(printf '%s\n' "${EXPB_ENV_PASSTHROUGH}" | tr ',' '\n')
703+
fi
704+
672705
on_terminate() {
673706
echo "Termination signal received. Waiting up to ${CLEANUP_GRACE_SECONDS}s for expb cleanup."
674707
if [[ -n "${expb_pid}" ]] && kill -0 "${expb_pid}" 2>/dev/null; then
@@ -1727,11 +1760,27 @@ jobs:
17271760
env:
17281761
RAW_RUN_LOG: ${{ runner.temp }}/expb-run-${{ matrix.tag }}-run${{ matrix.run }}.log
17291762
DOTTRACE: ${{ needs.resolve.outputs.dottrace }}
1763+
EXPB_ENV_PASSTHROUGH: ${{ needs.resolve.outputs.expb_env }}
17301764
run: |
17311765
set -euo pipefail
17321766
expb_pid=""
17331767
: > "${RAW_RUN_LOG}"
17341768
1769+
# Export caller-provided expb env tuning (comma- or newline-separated KEY=VALUE;
1770+
# values containing commas must use the newline-separated form).
1771+
if [[ -n "${EXPB_ENV_PASSTHROUGH:-}" ]]; then
1772+
while IFS= read -r _kv; do
1773+
_kv="$(printf '%s' "${_kv}" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//')"
1774+
[[ -z "${_kv}" ]] && continue
1775+
if [[ "${_kv}" =~ ^[A-Za-z_][A-Za-z0-9_]*= ]]; then
1776+
export "${_kv}"
1777+
echo "Exported expb env: ${_kv%%=*}=<value>"
1778+
else
1779+
echo "::warning::Skipping invalid expb_env entry (expected KEY=VALUE): ${_kv}"
1780+
fi
1781+
done < <(printf '%s\n' "${EXPB_ENV_PASSTHROUGH}" | tr ',' '\n')
1782+
fi
1783+
17351784
on_terminate() {
17361785
echo "Termination signal received. Waiting up to ${CLEANUP_GRACE_SECONDS}s for expb cleanup."
17371786
if [[ -n "${expb_pid}" ]] && kill -0 "${expb_pid}" 2>/dev/null; then

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,5 @@ This repository contains a dedicated workflow for reproducible payload benchmark
203203
- The benchmark config is rendered to a temporary file and removed afterward; no source config revert is required.
204204
- For `pull_request` and `push` auto-runs, default mode is `flat` layout with both `superblocks` and `realblocks` payload sets.
205205
- Keep benchmark-related changes isolated to the workflow and benchmark guidance unless explicitly asked otherwise.
206+
- Optional low-variance mode: pass `-f expb_env="EXPB_EVM_WARMUP=1"` to enable expb's per-block EVM warmup (`eth_simulateV1` before each measured block). It serves the measured block's reads from warm caches, which lowers both run-to-run CV (~1.8%→~0.55% on flat-realblocks) and AVG. Pair it with a raised RPC gas cap — `-f additional_extra_flags="--JsonRpc.GasCap=1000000000000"` — otherwise the per-request gas budget (default 100M) is exhausted on dense blocks and the warmup `eth_simulateV1` calls fail with `-38013` (intrinsic gas), silently leaving those blocks un-warmed. Caveat: warmup minimizes cold RocksDB/storage interaction, so it is a low-variance *compute* signal, not a substitute for the default cold benchmark — don't use it when measuring storage-layer changes.
206207
- dotTrace XML reports are 50-70MB. **Never load full XML into context.** Use [`scripts/dottrace-report.sh`](./scripts/dottrace-report.sh): `top <report.xml> [N]` for hot spots, `compare <a.xml> <b.xml> [N]` for regressions/improvements. Runs in <2 seconds via grep+awk.

scripts/known-failing-hive-tests.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@
22

33
testing_buildBlockV1/build-block-empty-transactions (nethermind)
44
testing_buildBlockV1/build-block-with-transactions (nethermind)
5-
6-
# eth_simulateV1 — execution-apis spec ↔ test fixture mismatches. Tracked in
7-
# https://github.com/NethermindEth/nethermind/issues/11412
8-
eth_simulateV1/ethSimulate-basefee-too-low-with-validation-38012 (nethermind)
9-
eth_simulateV1/ethSimulate-check-invalid-nonce (nethermind)
10-
eth_simulateV1/ethSimulate-gas-fees-and-value-error-38014-with-validation (nethermind)
11-
eth_simulateV1/ethSimulate-simple-no-funds-with-validation (nethermind)
12-
eth_simulateV1/ethSimulate-simple-no-funds-with-validation-without-nonces (nethermind)
13-
eth_simulateV1/ethSimulate-simple-send-from-contract-with-validation (nethermind)
5+
eth_config/get-config (nethermind)
6+
eth_capabilities/get-capabilities (nethermind)
147

158
# graphql
169

src/Nethermind/Ethereum.Blockchain.Pyspec.Test/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace Ethereum.Blockchain.Pyspec.Test;
66
public class Constants
77
{
88
public const string ARCHIVE_URL_TEMPLATE = "https://github.com/ethereum/execution-specs/releases/download/{0}/{1}";
9-
public const string DEFAULT_ARCHIVE_VERSION = "tests-bal@v7.3.1";
9+
public const string DEFAULT_ARCHIVE_VERSION = "tests-bal@v7.3.2";
1010
public const string DEFAULT_ARCHIVE_NAME = "fixtures_bal.tar.gz";
1111
}

src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ private static readonly (string ExpectedError, string Substring)[] ValidationErr
448448
("TransactionException.INITCODE_SIZE_EXCEEDED", "max initcode size exceeded"),
449449
("TransactionException.NONCE_MISMATCH_TOO_LOW", "nonce too low"),
450450
("TransactionException.NONCE_MISMATCH_TOO_HIGH", "nonce too high"),
451-
("TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS", "InsufficientMaxFeePerBlobGas: Not enough to cover blob gas fee"),
451+
("TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS", "max fee per blob gas less than block blob gas fee"),
452452
("TransactionException.TYPE_1_TX_PRE_FORK", "InvalidTxType: Transaction type in"),
453453
("TransactionException.TYPE_2_TX_PRE_FORK", "InvalidTxType: Transaction type in"),
454454
("TransactionException.TYPE_3_TX_PRE_FORK", "InvalidTxType: Transaction type in"),

src/Nethermind/Ethereum.Test.Base/TransactionTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private static bool ExceptionMatches(string expected, string observed)
137137
["TransactionException.TYPE_3_TX_ZERO_BLOBS"] = ["blob transaction must have at least 1 blob"],
138138
["TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH"] = ["InvalidBlobVersionedHashVersion"],
139139
["TransactionException.TYPE_3_TX_CONTRACT_CREATION"] = ["blob transaction of type create"],
140-
["TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS"] = ["InsufficientMaxFeePerBlobGas"],
140+
["TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS"] = ["max fee per blob gas less than block blob gas fee"],
141141
};
142142
}
143143

src/Nethermind/Nethermind.Api/IApiWithBlockchain.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

4-
using Nethermind.Blockchain;
5-
using Nethermind.Config;
64
using Nethermind.Consensus;
75
using Nethermind.Consensus.Comparers;
86
using Nethermind.Consensus.Processing;
@@ -26,8 +24,6 @@ public interface IApiWithBlockchain : IApiWithStores
2624
IBlockProducer? BlockProducer { get; set; }
2725
IBlockProducerRunner BlockProducerRunner { get; set; }
2826

29-
IEnode? Enode { get; set; }
30-
3127
IManualBlockProductionTrigger ManualBlockProductionTrigger { get; }
3228
ISealer Sealer { get; }
3329
ISealEngine SealEngine { get; }
@@ -47,14 +43,6 @@ public interface IApiWithBlockchain : IApiWithStores
4743
[SkipServiceCollection]
4844
ITxValidator? HeadTxValidator { get; }
4945

50-
/// <summary>
51-
/// Manager of block finalization
52-
/// </summary>
53-
/// <remarks>
54-
/// Currently supported in <see cref="SealEngineType.AuRa"/> and Eth2Merge.
55-
/// </remarks>
56-
IBlockFinalizationManager? FinalizationManager { get; set; }
57-
5846
IBlockProducerEnvFactory BlockProducerEnvFactory { get; }
5947

6048
IBlockProductionPolicy? BlockProductionPolicy { get; set; }

src/Nethermind/Nethermind.Api/NethermindApi.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ ILifetimeScope Context
6767
public IDbProvider DbProvider => Context.Resolve<IDbProvider>();
6868
public ISigner? EngineSigner { get; set; }
6969
public ISignerStore? EngineSignerStore { get; set; }
70-
public IEnode? Enode { get; set; }
7170
public IEthereumEcdsa EthereumEcdsa => Context.Resolve<IEthereumEcdsa>();
7271
public IFileSystem FileSystem => Context.Resolve<IFileSystem>();
7372
public IEngineRequestsTracker EngineRequestsTracker => Context.Resolve<IEngineRequestsTracker>();
@@ -111,7 +110,6 @@ ILifetimeScope Context
111110
public ITxPool? TxPool { get; set; }
112111
public TxValidator? TxValidator => Context.Resolve<TxValidator>();
113112
public ITxValidator? HeadTxValidator => Context.ResolveOptionalKeyed<ITxValidator>(ITxValidator.HeadTxValidatorKey);
114-
public IBlockFinalizationManager? FinalizationManager { get; set; }
115113

116114
public IBlockProducerEnvFactory BlockProducerEnvFactory => Context.Resolve<IBlockProducerEnvFactory>();
117115
public IBlockProductionPolicy? BlockProductionPolicy { get; set; }

src/Nethermind/Nethermind.AuRa.Test/Validators/ContractBasedValidatorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void initializes_pendingValidators_from_db()
158158
IAuRaValidator validator = new ContractBasedValidator(_validatorContract, _blockTree, _receiptsStorage, _validatorStore, _validSealerStrategy, _blockFinalizationManager, default, _logManager, 1);
159159

160160
_blockFinalizationManager.BlocksFinalized +=
161-
Raise.EventWith(new FinalizeEventArgs(_block.Header,
161+
Raise.EventWith(new AuRaFinalizeEventArgs(_block.Header,
162162
Build.A.BlockHeader.WithNumber(blockNumber).WithHash(blockHash).TestObject));
163163

164164
Assert.That(validator.Validators, Is.EqualTo(validators));
@@ -526,7 +526,7 @@ public void consecutive_initiate_change_gets_finalized_and_switch_validators(Con
526526
int finalizedNumber = blockNumber - validator.Validators.MinSealersForFinalization() + 1;
527527
_blockFinalizationManager.GetLastLevelFinalizedBy(_block.Header.Hash).Returns(finalizedNumber);
528528
_blockFinalizationManager.BlocksFinalized += Raise.EventWith(
529-
new FinalizeEventArgs(_block.Header, Build.A.BlockHeader.WithNumber(finalizedNumber)
529+
new AuRaFinalizeEventArgs(_block.Header, Build.A.BlockHeader.WithNumber(finalizedNumber)
530530
.WithHash(Keccak.Compute((finalizedNumber + hashSeeds[finalizedNumber]).ToString())).TestObject));
531531

532532
currentValidators = test.GetCurrentValidators(blockNumber);

src/Nethermind/Nethermind.AuRa.Test/Validators/MultiValidatorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void creates_inner_validators()
100100

101101
foreach (long blockNumber in _validator.Validators.Keys.Skip(1))
102102
{
103-
_finalizationManager.BlocksFinalized += Raise.EventWith(new FinalizeEventArgs(
103+
_finalizationManager.BlocksFinalized += Raise.EventWith(new AuRaFinalizeEventArgs(
104104
Build.A.BlockHeader.WithNumber(blockNumber + 1).TestObject, Build.A.BlockHeader.WithNumber(blockNumber).TestObject));
105105
}
106106

@@ -191,7 +191,7 @@ private void ProcessBlocks(long count, IAuRaValidator validator, int blocksToFin
191191
int finalizedBlock = i - blocksToFinalization;
192192
if (finalizedBlock >= 1)
193193
{
194-
_finalizationManager.BlocksFinalized += Raise.EventWith(new FinalizeEventArgs(
194+
_finalizationManager.BlocksFinalized += Raise.EventWith(new AuRaFinalizeEventArgs(
195195
Build.A.BlockHeader.WithNumber(i).TestObject,
196196
Build.A.BlockHeader.WithNumber(finalizedBlock).TestObject));
197197
}

0 commit comments

Comments
 (0)