-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
chore: move precommit & preparecheckstate to core api #15923
Conversation
e2007f4
to
a691456
Compare
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! You'll need to add a replace in tests I think.
Could you as well rename the interface in https://github.com/cosmos/cosmos-sdk/blob/93d64cc/docs/docs/building-modules/01-module-manager.md ?
core/appmodule/module.go
Outdated
// HasPrepareCheckState is an extension interface that contains information about the AppModule | ||
// and PrepareCheckState. | ||
type HasPrepareCheckState interface { | ||
AppModule | ||
PrepareCheckState(context.Context) | ||
} |
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.
What is "PrepareCheckState"? Where and when is it used by a module?
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.
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.
I see. That doc/section is malformed making it very difficult to read.
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.
The PR type should be feat.
If we have these callbacks they should they include the request type? What would a module do in these callbacks?
this is only a follow up to move the interfaces to core as they were added to module.go in #14860. There isnt a request type here to use, this is mainly to set some states before writing to disk and before executing that are outside of begin and endblock. Dydx and berachain are using these currently |
Okay makes sense. I'd like to better understand when and how these should be used. I see the module docs but it's not clear what I would actually do as a module developer or why. |
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.
How would PrepareCheckState and Precommit be called in an app that is based on Rollkit or another consensus engine besides Comet? Are they still relevant there? If not, they shouldn't go in core/appmodule, but in core/comet probably
these methods are agnostic to consensus engines. They only relate to application state. In the future if comet removes some of these calls in abci these calls would be moved elsewhere as they are still useful |
Description
Closes: #15914
move precommit and preparecheck states to core api
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change