Refactor/Move aura block processor to DI.#8950
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors block validation and RPC execution by centralizing related registrations into DI modules, removes outdated factory overrides, and streamlines plugin and JSON-RPC initialization.
- Introduce
IBlockValidationModuleto unify block validation and RPC DI configuration, replacingIValidationTransactionExecutor. - Update plugins (
TaikoPlugin,AuRaPlugin, etc.) and JSON-RPC factories to register and apply these validation modules via a newAddModuleextension. - Remove legacy interfaces and factory classes no longer needed under the new DI pattern.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Nethermind/Nethermind.Taiko/TaikoPlugin.cs | Replace scoped executor registration with TaikoBlockValidationModule |
| src/Nethermind/Nethermind.Init/Modules/BlockProcessingModule.cs | Add StandardBlockValidationModule and register it as IBlockValidationModule |
| src/Nethermind/Nethermind.Core/ContainerBuilderExtensions.cs | Add AddModule extension for bulk module registration |
| src/Nethermind/Nethermind.Core/Container/ValidationBlockProcessingModule.cs | Define new IBlockValidationModule marker interface |
Comments suppressed due to low confidence (1)
src/Nethermind/Nethermind.Init/Modules/BlockProcessingModule.cs:85
- The new
StandardBlockValidationModuleregisters scoped bindings for block validation; however, there are no tests verifying these registrations. Consider adding unit tests to confirm thatIBlockProcessor.IBlockTransactionsExecutorandITransactionProcessorAdapterare correctly bound.
private class StandardBlockValidationModule : Module, IBlockValidationModule
| } | ||
|
|
||
| public static ContainerBuilder AddModule(this ContainerBuilder builder, IModule module) | ||
| public static ContainerBuilder AddModule(this ContainerBuilder builder, params IReadOnlyList<IModule> modules) |
There was a problem hiding this comment.
The AddModule extension signature expects params IReadOnlyList<IModule> modules, which will not match typical module arrays. Change it to accept params IModule[] modules or IEnumerable<IModule> modules so that passed-in modules are properly registered.
| public static ContainerBuilder AddModule(this ContainerBuilder builder, params IReadOnlyList<IModule> modules) | |
| public static ContainerBuilder AddModule(this ContainerBuilder builder, params IModule[] modules) |
| return payloadPreparationService; | ||
| } | ||
|
|
||
| private class TaikoBlockValidationModule : Module, IBlockValidationModule |
There was a problem hiding this comment.
[nitpick] Consider moving TaikoBlockValidationModule out of TaikoPlugin.cs into its own file to improve readability and reduce the size of the plugin class.
33341c2 to
ccc1572
Compare
ccc1572 to
ffb4e0c
Compare
ffb4e0c to
8da1902
Compare
IBlockValidationModulefor some weird aura component that is not set in block producer. This replacesIValidationTransactionExecutor.Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing