-
Notifications
You must be signed in to change notification settings - Fork 104
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
[OTE-553] Fix early return during timestamp nonce check bug #1984
Conversation
WalkthroughThe recent changes enhance the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- protocol/app/ante/sigverify.go (1 hunks)
- protocol/app/ante/sigverify_test.go (1 hunks)
Additional comments not posted (2)
protocol/app/ante/sigverify.go (1)
Line range hint
1-1
:
Verify the impact of control flow change.The removal of the early return statement changes the function's behavior by allowing subsequent code to execute. Ensure that this change does not introduce unintended side effects or errors in the subsequent code execution.
protocol/app/ante/sigverify_test.go (1)
333-348
: LGTM! The new test case enhances robustness.The new test case validates the behavior of the signature verification process with invalid signatures associated with a timestamp nonce. This enhances the robustness of the testing suite.
@@ -105,7 +105,6 @@ func (svd SigVerificationDecorator) AnteHandle( | |||
1, | |||
[]gometrics.Label{metrics.GetLabelForIntValue(metrics.ExecMode, int(ctx.ExecMode()))}, | |||
) | |||
return ctx, nil |
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.
Could we clean up by minimizing indent and removing else condition:
if accountpluskeeper.IsTimestampNonce(sig.Sequence) {
if err := svd.akp.ProcessTimestampNonce(ctx, acc, sig.Sequence); err != nil {
telemetry.IncrCounterWithLabels(
[]string{metrics.TimestampNonce, metrics.Invalid, metrics.Count},
1,
[]gometrics.Label{metrics.GetLabelForIntValue(metrics.ExecMode, int(ctx.ExecMode()))},
)
return ctx, errorsmod.Wrapf(sdkerrors.ErrWrongSequence, err.Error())
}
telemetry.IncrCounterWithLabels(
[]string{metrics.TimestampNonce, metrics.Valid, metrics.Count},
1,
[]gometrics.Label{metrics.GetLabelForIntValue(metrics.ExecMode, int(ctx.ExecMode()))},
)
} else {
See https://go.dev/wiki/CodeReviewComments#indent-error-flow
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- protocol/app/ante/sigverify.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- protocol/app/ante/sigverify.go
@Mergifyio backport release/protocol/v6.x |
✅ Backports have been created
|
(cherry picked from commit 74288c0)
…1984) (#1988) Co-authored-by: jerryfan01234 <[email protected]>
Changelist
[Describe or list the changes made in this PR]
Test Plan
[Describe how this PR was tested (if applicable)]
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
New Features
Bug Fixes