-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat!: add "is-genesis" check #267
Conversation
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
@@ -269,7 +269,7 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul | |||
} | |||
|
|||
// retrieve signer data | |||
genesis := ctx.BlockHeight() == 0 |
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.
Lets remove this ||
here, and just use IsGenesis
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 alternatively do IsGenesis && ctx.BlockHeight() == ctx.InitialHeight()
as a defense in depth.
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.
Lets remove this || here, and just use IsGenesis
Too many tests fail that would require funky re-wiring. This is why I suggested to add the ||
to keep the tests passing. Probably because IsGenesis
returns false as it does not go through the InitGenesis
flow.
Alternatively, the || ctx.BlockHeight() == ctx.InitialHeight()
can work too.
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.
Yeah @ValarDragon we switched it to the OR due to tests failing, should we aim to rewrite the tests or does this implementation work?
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!
* is gen test * my attempt at isGenesis * logs and uncomment * more changes * comment out * change init gen call loc * further gen tests * more tests * another test * revert unneeded changes * remove extra * reset to false * Update x/auth/ante/sigverify.go Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> * changes from call with bez Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
* is gen test * my attempt at isGenesis * logs and uncomment * more changes * comment out * change init gen call loc * further gen tests * more tests * another test * revert unneeded changes * remove extra * reset to false * Update x/auth/ante/sigverify.go Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> * changes from call with bez Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Closes: #XXX
What is the purpose of the change
This pull request exports an "is-genesis" boolean which is set to "true" during init-chain. We can then use this value to properly sign gentxs that happen at a non zero height.
Brief Changelog
Testing and Verifying
This change is already covered by existing tests
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? no