-
Notifications
You must be signed in to change notification settings - Fork 283
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
Update optimistic import rules #5255
Conversation
Can now import a block optimistically if it's parent has a non-default payload or if it is sufficiently old. Also moves the logic for determining if optimistic import is allowed into the spec module since it's a function from the spec itself.
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.
LGTM with some nits
} | ||
|
||
@Test | ||
void isOptimisticSyncPossible_shouldBeFalseWhenBlockIsMergeButNotOldEnough() { |
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.
nit: rename to canOptimisticallyImport_
} | ||
|
||
@Test | ||
void isOptimisticSyncPossible_shouldBeTrueWhenBlockIsMergeAndIsOldEnough() { |
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.
nit: rename to canOptimisticallyImport_
final boolean isExecutionBlock = | ||
parentExecutionRoot.isPresent() && !parentExecutionRoot.get().isZero(); | ||
return isExecutionBlock; |
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.
nit: the local boolean isExecutionBlock
seems a bit redundant to me. The method itself has that name and should be enough to understand the objective.
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.
IntelliJ agrees. :)
PR Description
Can now import a block optimistically if it's parent has a non-default payload or if it is sufficiently old.
Also moves the logic for determining if optimistic import is allowed into the spec module since it's a function from the spec itself.
Fixed Issue(s)
fixes #5105
Documentation
doc-change-required
label to this PR if updates are required.Changelog