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

chore: move precommit & preparecheckstate to core api #15923

Merged
merged 23 commits into from
May 2, 2023

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Apr 24, 2023

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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@tac0turtle tac0turtle changed the title choreL more precommit & preparecheckstate to core api chore: more precommit & preparecheckstate to core api Apr 24, 2023
@tac0turtle tac0turtle marked this pull request as ready for review April 24, 2023 14:46
@tac0turtle tac0turtle requested a review from a team as a code owner April 24, 2023 14:46
Copy link
Member

@julienrbrt julienrbrt left a 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 ?

Comment on lines 41 to 46
// HasPrepareCheckState is an extension interface that contains information about the AppModule
// and PrepareCheckState.
type HasPrepareCheckState interface {
AppModule
PrepareCheckState(context.Context)
}
Copy link
Contributor

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?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

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.

Copy link
Member

@aaronc aaronc left a 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?

@tac0turtle tac0turtle changed the title chore: more precommit & preparecheckstate to core api chore: move precommit & preparecheckstate to core api Apr 25, 2023
@tac0turtle
Copy link
Member Author

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

@aaronc
Copy link
Member

aaronc commented Apr 25, 2023

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.

Copy link
Member

@aaronc aaronc left a 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

@tac0turtle
Copy link
Member Author

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

@github-actions github-actions bot added the C:Rosetta Issues and PR related to Rosetta label May 2, 2023
@tac0turtle tac0turtle added this pull request to the merge queue May 2, 2023
Merged via the queue into main with commit 678ee79 May 2, 2023
@tac0turtle tac0turtle deleted the marko/move-precommit-core branch May 2, 2023 07:19
rllola pushed a commit to Zondax/cosmos-sdk that referenced this pull request May 11, 2023
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
@coderabbitai coderabbitai bot mentioned this pull request May 3, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Follow-up]: Prepare states
4 participants