Skip to content

Commit 40bcb62

Browse files
LukaszRozmejclaude
andcommitted
fix(stateless): wire chain tx-processor factory into witness BAL
The witness block-processing envs hand-built BlockAccessListManager with a null transactionProcessorFactory, so the block-access list fell back to the plain Ethereum factory. On AuRa the chain overrides ITransactionProcessorFactory, and its contract-based withdrawal system calls touch the system-sender account that the plain factory omits, so the witness-generated BAL diverged from the main pipeline's and newPayloadWithWitness returned INVALID. Pass the container's ITransactionProcessorFactory while deliberately leaving the parallel parent-reader factories out, so the BAL still runs sequentially and every access is recorded into the witness. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 36aca55 commit 40bcb62

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/Nethermind/Nethermind.Consensus/Stateless/WitnessCapturingBlockProcessingEnv.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Nethermind.Core.Specs;
1414
using Nethermind.Evm;
1515
using Nethermind.Evm.State;
16+
using Nethermind.Evm.TransactionProcessing;
1617
using Nethermind.Logging;
1718
using Nethermind.State;
1819
using Nethermind.Trie.Pruning;
@@ -84,14 +85,19 @@ private static Graph Build(
8485
.AddScoped<IHeaderFinder>(recordingFinder)
8586
.AddScoped<IBlockhashCache, BlockhashCache>()
8687
.AddScoped<ICodeInfoRepository, CodeInfoRepository>()
88+
// Non-caching code repo captures code reads in the witness; the chain's transaction-processor factory
89+
// (e.g. AuRa's) keeps the generated block-access list identical to the main pipeline's. The parallel
90+
// parent-reader factories are deliberately left out: their workers read parent state through separate
91+
// read-only envs that bypass the recorder, so the BAL must run sequentially to record every access.
8792
.AddScoped<IBlockAccessListManager>(ctx => new BlockAccessListManager(
8893
ctx.Resolve<IWorldState>(),
8994
ctx.Resolve<ISpecProvider>(),
9095
ctx.Resolve<IBlockhashProvider>(),
9196
ctx.Resolve<ILogManager>(),
9297
ctx.Resolve<IBlocksConfig>(),
9398
ctx.Resolve<IWithdrawalProcessorFactory>(),
94-
codeInfoRepositoryFactory: CodeInfoRepositoryFactories.Witness))
99+
codeInfoRepositoryFactory: CodeInfoRepositoryFactories.Witness,
100+
transactionProcessorFactory: ctx.Resolve<ITransactionProcessorFactory>()))
95101
// Validation tx executor; everything else is inherited from root and re-resolved against the overridden world state.
96102
.AddModule(validationModules));
97103

src/Nethermind/Nethermind.Consensus/Stateless/WitnessGeneratingBlockProcessingEnvFactory.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using Nethermind.Db;
1818
using Nethermind.Evm;
1919
using Nethermind.Evm.State;
20+
using Nethermind.Evm.TransactionProcessing;
2021
using Nethermind.Logging;
2122
using Nethermind.State;
2223
using Nethermind.Trie.Pruning;
@@ -91,14 +92,19 @@ private PooledEntry BuildEntry()
9192
.AddScoped<IBlockhashCache, BlockhashCache>()
9293
.AddScoped<IReceiptStorage>(NullReceiptStorage.Instance)
9394
.AddScoped<ICodeInfoRepository, CodeInfoRepository>()
95+
// Non-caching code repo captures code reads in the witness; the chain's transaction-processor factory
96+
// (e.g. AuRa's) keeps the generated block-access list identical to the main pipeline's. The parallel
97+
// parent-reader factories are deliberately left out: their workers read parent state through separate
98+
// read-only envs that bypass the recorder, so the BAL must run sequentially to record every access.
9499
.AddScoped<IBlockAccessListManager>(ctx => new BlockAccessListManager(
95100
ctx.Resolve<IWorldState>(),
96101
ctx.Resolve<ISpecProvider>(),
97102
ctx.Resolve<IBlockhashProvider>(),
98103
ctx.Resolve<ILogManager>(),
99104
ctx.Resolve<IBlocksConfig>(),
100105
ctx.Resolve<IWithdrawalProcessorFactory>(),
101-
codeInfoRepositoryFactory: CodeInfoRepositoryFactories.Witness))
106+
codeInfoRepositoryFactory: CodeInfoRepositoryFactories.Witness,
107+
transactionProcessorFactory: ctx.Resolve<ITransactionProcessorFactory>()))
102108
.AddModule(validationModules)
103109
.AddScoped<IWitnessGeneratingBlockProcessingEnv, WitnessGeneratingBlockProcessingEnv>());
104110

0 commit comments

Comments
 (0)