Skip to content
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

Merge/processing through queue #4171

Closed
wants to merge 25 commits into from
Closed

Conversation

LukaszRozmej
Copy link
Member

Changes:

Moves processing payloads to be always through queue

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

Combine  Suggest setAsMain into BlockTreeSuggestOptions
…oughQueue

# Conflicts:
#	src/Nethermind/Nethermind.State/IReadOnlyStateProvider.cs
@LukaszRozmej LukaszRozmej marked this pull request as ready for review June 28, 2022 16:38
if (_logger.IsTrace)
_logger.Trace(
$"Suggesting a new block. BestSuggestedBlock {BestSuggestedBody}, BestSuggestedBlock TD {BestSuggestedBody?.TotalDifficulty}, Block TD {block?.TotalDifficulty}, Head: {Head}, Head TD: {Head?.TotalDifficulty}, Block {block?.ToString(Block.Format.FullHashAndNumber)}. ShouldProcess: {shouldProcess}, TryProcessKnownBlock: {fillBeaconBlock}");
bool setAsMainSet = (options & BlockTreeSuggestOptions.SetAsMain) != 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is weird that we have SetAsMain and DontSetAsMain option

Copy link
Member Author

@LukaszRozmej LukaszRozmej Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but before we had bool? setAsMain = null. We could force to set or not set, or derive that from !ShouldProcess flag. Left it the same here. Otherwise, we can change it for ShouldProcess contain flag NotSetAsMain and SetAsMain being the default? It's riskier in my opinion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoudve kept as bool or make the option a proper struct imo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit manipulation is overly complicated for something that could just use a standard struct, hard to read. There is no noticable performance nor size advantage for this use case.

Copy link
Member Author

@LukaszRozmej LukaszRozmej Jun 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made it bit more readable and added more docs. Yes it wasn't about performance, wanted to make it more consistent API.

@LukaszRozmej
Copy link
Member Author

Closing in favor of #4224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants