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

feat(core): add begin/end block extension interfaces #14604

Merged
merged 3 commits into from
Jan 13, 2023

Conversation

aaronc
Copy link
Member

@aaronc aaronc commented Jan 12, 2023

Description

This adds begin and end blocker extension interfaces to the cosmossdk.io/core/appmodule API. Support can be added to main and the 0.47.x branch after this is merged.


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)

@aaronc aaronc marked this pull request as ready for review January 12, 2023 17:28
@aaronc aaronc requested a review from a team as a code owner January 12, 2023 17:28
@github-prbot github-prbot requested review from a team, amaury1093 and tac0turtle and removed request for a team January 12, 2023 17:28
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Remind me, how will we track validator updates? Ultimately I believe these will be returned in FinalizeBlock, at which point, Begin/EndBlock are solely application methods.

@aaronc
Copy link
Member Author

aaronc commented Jan 12, 2023

Remind me, how will we track validator updates? Ultimately I believe these will be returned in FinalizeBlock, at which point, Begin/EndBlock are solely application methods.

This is what I'm proposing: https://github.com/cosmos/cosmos-sdk/pull/12972/files#diff-ad6d86070e8d6bfe68ff82947bc1681dd77ecc133bf6992d65bcdf0b930c1b9bR364-R373.


// HasBeginBlocker is the extension interface that modules should implement to run
// custom logic before transaction processing in a block.
type HasBeginBlocker interface {
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

@likhita-809 likhita-809 left a comment

Choose a reason for hiding this comment

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

interface lgtm

@aaronc
Copy link
Member Author

aaronc commented Jan 13, 2023

Are you okay with this @tac0turtle @alexanderbez ?

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

yea im a fan of this. Just the nit from Julien

@aaronc
Copy link
Member Author

aaronc commented Jan 13, 2023

yea im a fan of this. Just the nit from Julien

What's the nit?

@tac0turtle
Copy link
Member

yea im a fan of this. Just the nit from Julien

What's the nit?

#14604 (comment)

@aaronc
Copy link
Member Author

aaronc commented Jan 13, 2023

yea im a fan of this. Just the nit from Julien

What's the nit?

#14604 (comment)

That seems like he's saying he likes the name in this PR better. Am I missing something?

@tac0turtle
Copy link
Member

oh my bad, read it wrong

@tac0turtle tac0turtle enabled auto-merge (squash) January 13, 2023 15:32
@tac0turtle tac0turtle merged commit fa7ff32 into main Jan 13, 2023
@tac0turtle tac0turtle deleted the aaronc/core-api-begin-end-block branch January 13, 2023 17:21
mergify bot pushed a commit that referenced this pull request Jan 31, 2023
(cherry picked from commit fa7ff32)

# Conflicts:
#	core/appmodule/module.go
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants