-
Notifications
You must be signed in to change notification settings - Fork 379
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/separate block production and running #7012
Refactor/separate block production and running #7012
Conversation
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.
Mixed feelings: It doesn't seem to make things simpler? Also am I right that we are loosing easily triggering block production from a simple plugin as we are not exposing trigger?
event EventHandler<BlockEventArgs> BlockProduced; | ||
Task<Block?> BuildBlock( | ||
BlockHeader? parentHeader = null, | ||
CancellationToken? cancellationToken = null, |
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.
minor: convention puts cancellationToken often as last parameter to separate it from more logic-oriented parameters.
Task Start(); | ||
Task StopAsync(); |
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 don't have truly async implementations of this?
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.
Only clique for stop
using Nethermind.Evm.Tracing; | ||
|
||
namespace Nethermind.Consensus.Producers | ||
{ | ||
public interface IBlockProducerInfo | ||
{ | ||
IBlockProducer BlockProducer { get; } | ||
IManualBlockProductionTrigger BlockProductionTrigger { get; } | ||
Func<BlockHeader, bool> Condition { 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.
Cryptic?
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.
Switched to custom interface.
Yea, it does not look like it help much unfortunately. It does expose |
@@ -9,7 +9,7 @@ namespace Nethermind.Consensus; | |||
|
|||
public interface IBlockProducerRunner | |||
{ | |||
Task Start(); | |||
void Start(); |
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.
or we could make it a ValueTask if we wanted flexibility
evm_mine
which may want to trigger event which is used to put the block in main chain.Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Nodes on testing