-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor for verkle transition #7373
base: master
Are you sure you want to change the base?
Conversation
src/Nethermind/Nethermind.Blockchain/Contracts/CallableContract.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus.AuRa/Validators/ReportingContractBasedValidator.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.JsonRpc/Modules/Trace/TraceModuleFactory.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Merge.AuRa/AuRaMergeBlockProcessor.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Merge.AuRa/AuRaMergeBlockProducerEnvFactory.cs
Outdated
Show resolved
Hide resolved
…s not require WorldStateManager
# Conflicts: # src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs # src/Nethermind/Nethermind.AuRa.Test/AuraBlockProcessorTests.cs # src/Nethermind/Nethermind.Blockchain.Test/Producers/DevBlockproducerTests.cs # src/Nethermind/Nethermind.Blockchain.Test/ReorgTests.cs # src/Nethermind/Nethermind.Blockchain/GenesisLoader.cs # src/Nethermind/Nethermind.Clique.Test/CliqueBlockProducerTests.cs # src/Nethermind/Nethermind.Consensus.AuRa/AuRaBlockProcessor.cs # src/Nethermind/Nethermind.Consensus.Clique/CliquePlugin.cs # src/Nethermind/Nethermind.Consensus.Ethash/NethDevPlugin.cs # src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.BlockProductionTransactionsExecutor.cs # src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs # src/Nethermind/Nethermind.Consensus/Processing/IBlockProcessor.cs # src/Nethermind/Nethermind.Consensus/Processing/ReadOnlyChainProcessingEnv.cs # src/Nethermind/Nethermind.Consensus/Processing/ReadOnlyTxProcessingEnv.cs # src/Nethermind/Nethermind.Consensus/Producers/BlockProducerEnvFactory.cs # src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs # src/Nethermind/Nethermind.Evm/TransactionProcessing/CallAndRestoreTransactionProcessorAdapter.cs # src/Nethermind/Nethermind.Evm/TransactionProcessing/ExecuteTransactionProcessorAdapter.cs # src/Nethermind/Nethermind.Evm/TransactionProcessing/TraceTransactionProcessorAdapter.cs # src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs # src/Nethermind/Nethermind.Facade/Simulate/SimulateReadOnlyBlocksProcessingEnv.cs # src/Nethermind/Nethermind.Facade/Simulate/SimulateTransactionProcessor.cs # src/Nethermind/Nethermind.Init/InitializeStateDb.cs # src/Nethermind/Nethermind.Init/Steps/InitializeBlockchain.cs # src/Nethermind/Nethermind.JsonRpc.Benchmark/EthModuleBenchmarks.cs # src/Nethermind/Nethermind.JsonRpc.Test/Modules/Trace/ParityStyleTracerTests.cs # src/Nethermind/Nethermind.JsonRpc/Modules/RpcBlockTransactionsExecutor.cs # src/Nethermind/Nethermind.Merge.AuRa.Test/AuRaMergeEngineModuleTests.cs # src/Nethermind/Nethermind.Merge.AuRa/AuRaMergeBlockProcessor.cs # src/Nethermind/Nethermind.Merge.AuRa/InitializationSteps/InitializeBlockchainAuRaMerge.cs # src/Nethermind/Nethermind.Merge.Plugin.Test/EngineModuleTests.HelperFunctions.cs # src/Nethermind/Nethermind.Merge.Plugin.Test/EngineModuleTests.Setup.cs # src/Nethermind/Nethermind.Optimism/InitializeBlockchainOptimism.cs # src/Nethermind/Nethermind.Optimism/OptimismBlockProcessor.cs # src/Nethermind/Nethermind.Optimism/OptimismBlockProducerEnvFactory.cs # src/Nethermind/Nethermind.Optimism/OptimismTransactionProcessor.cs # src/Nethermind/Nethermind.Optimism/ReadOnlyChainProcessingEnv.cs # src/Nethermind/Nethermind.Synchronization.Test/SyncThreadTests.cs
# Conflicts: # src/Nethermind/Nethermind.Blockchain/BeaconBlockRoot/BeaconBlockRootHandler.cs # src/Nethermind/Nethermind.Blockchain/BeaconBlockRoot/IBeaconBlockRootHandler.cs # src/Nethermind/Nethermind.Consensus/Processing/BlockCachePreWarmer.cs # src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs # src/Nethermind/Nethermind.Consensus/Processing/IBlockCachePreWarmer.cs
# Conflicts: # src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs
src/Nethermind/Nethermind.Consensus.AuRa/InitializationSteps/StartBlockProducerAuRa.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus.AuRa/InitializationSteps/StartBlockProducerAuRa.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus.AuRa/InitializationSteps/StartBlockProducerAuRa.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus.AuRa/InitializationSteps/StartBlockProducerAuRa.cs
Show resolved
Hide resolved
@@ -28,10 +28,10 @@ public partial class ReportingContractBasedValidator : IAuRaValidator, IReportin | |||
private readonly ContractBasedValidator _contractValidator; | |||
private readonly long _posdaoTransition; | |||
private readonly ITxSender _posdaoTxSender; | |||
private readonly IReadOnlyStateProvider _stateProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we introduce a IReadOnlyWorldStateProvider interface, it will be the same as the old one, just act as a place holder?
@@ -72,8 +72,7 @@ protected override ITxSource CreateTxSourceForProducer(ITxSource? additionalTxSo | |||
return new OptimismTxPoolTxSource(baseTxSource); | |||
} | |||
|
|||
protected override BlockProcessor CreateBlockProcessor( | |||
IReadOnlyTxProcessingScope readOnlyTxProcessingEnv, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scope?
{ | ||
return new OptimismBlockProcessor( | ||
specProvider, | ||
blockValidator, | ||
rewardCalculator, | ||
transactionsExecutor, | ||
scope.WorldState, | ||
worldStateProvider, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scope?
{ | ||
tx.Nonce = _accountStateProvider.GetNonce(tx.SenderAddress); | ||
tx.Nonce = _worldStateManager.GlobalWorldStateProvider | ||
.GetGlobalStateReader().GetNonce(_blockFinder.Head.StateRoot, tx.SenderAddress); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manager.StateReader?
@@ -52,7 +52,7 @@ protected override ReadOnlyTxProcessingEnv CreateTxProcessingEnv() => | |||
_receiptStorage, | |||
_specProvider, | |||
_blockTree, | |||
_worldStateManager.GlobalStateReader, | |||
_worldStateManager.GlobalWorldStateProvider, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can keep the stateReader here
/// <returns></returns> | ||
IWorldState CreateResettableWorldState(IWorldState? forWarmup = null); | ||
IWorldStateProvider CreateResettableWorldStateProvider(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IWorldStateProvider to warmup?
Blockchain.LogManager, | ||
transactionsExecutor); | ||
|
||
ReadOnlyChainProcessingEnv traceProcessingEnv = CreateChainProcessingEnv(rpcBlockTransactionsExecutor); | ||
ReadOnlyChainProcessingEnv executeProcessingEnv = CreateChainProcessingEnv(executeBlockTransactionsExecutor); | ||
|
||
Tracer tracer = new(scope.WorldState, traceProcessingEnv.ChainProcessor, executeProcessingEnv.ChainProcessor); | ||
TraceRpcModule = new TraceRpcModule(receiptFinder, tracer, Blockchain.BlockFinder, JsonRpcConfig, txProcessingEnv.StateReader); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bring back state reader
1d52b72
to
9fad607
Compare
@@ -9,5 +9,5 @@ namespace Nethermind.Evm.TransactionProcessing; | |||
public interface IReadOnlyTxProcessingScope : IDisposable | |||
{ | |||
ITransactionProcessor TransactionProcessor { get; } | |||
IWorldState WorldState { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... yea. This is a problem as the whole point of the scope is to represent a single IWorldState. So making it a WorldStateProvider changes that. So it probably should be called IReadOnlyTxProcessingEnv now.
Fixes Closes Resolves #
Please choose one of the keywords above to refer to the issue this PR solves followed by the issue number (e.g. Fixes #000). If no issue number, remove the line. Also, remove everything marked optional that is not applicable. Remove this note after reading.
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs
. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.