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

refactor: ibc core runtime env #7601

Merged
merged 113 commits into from
Dec 20, 2024
Merged

refactor: ibc core runtime env #7601

merged 113 commits into from
Dec 20, 2024

Conversation

damiannolan
Copy link
Member

@damiannolan damiannolan commented Nov 26, 2024

Description

ref: #7712


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@@ -182,7 +182,7 @@

// BeginBlock returns the begin blocker for the ibc module.
func (am AppModule) BeginBlock(ctx context.Context) error {
ibcclient.BeginBlocker(sdk.UnwrapSDKContext(ctx), am.keeper.ClientKeeper)
ibcclient.BeginBlocker(ctx, am.keeper.ClientKeeper)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

path flow from Begin/EndBlock to a panic call
@@ -415,10 +386,10 @@ func (k *Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPack
writeFn()
Copy link
Member Author

Choose a reason for hiding this comment

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

For RecvPacket see #7752

modules/core/keeper/msg_server.go Outdated Show resolved Hide resolved
@@ -208,8 +208,9 @@ func (chain *TestChain) GetContext() sdk.Context {
headerInfo := header.Info{
Copy link
Member Author

Choose a reason for hiding this comment

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

I have a PR to sdk which can remove this. This stuff should all be set in baseapp test_helpers NewUncachedContext which we use above

Copy link
Member Author

Choose a reason for hiding this comment

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

Just needs dependency bump and this could be removed

@damiannolan damiannolan marked this pull request as ready for review December 19, 2024 19:08
@damiannolan
Copy link
Member Author

I think I have a few follow up commits to address tomorrow, but publishing r4r. The recvPacket issue is pushed to a different PR. We could just remove the error prefixed events... but I think they were requested before for dev ex

Copy link
Contributor

@gjermundgaraba gjermundgaraba left a comment

Choose a reason for hiding this comment

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

Looks straightforward enough! LGTM!

Copy link
Member Author

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

CacheContext is still being used by:

  • RecvPacket
  • Channel Upgrade handlers (Init, Try, Ack)

Comment on lines +15 to +16
// TODO: In order to fully migrate away from sdk.Context here we will need to depend on comet service in order
// to consume the full block header as Env only contains header.Info (where we cannot access next vals hash)
Copy link
Member Author

Choose a reason for hiding this comment

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

Create issue

func (k *Keeper) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSubmitMisbehaviour) (*clienttypes.MsgSubmitMisbehaviourResponse, error) { //nolint:staticcheck // for now, we're using msgsubmitmisbehaviour.
ctx := sdk.UnwrapSDKContext(goCtx)

func (k *Keeper) SubmitMisbehaviour(ctx context.Context, msg *clienttypes.MsgSubmitMisbehaviour) (*clienttypes.MsgSubmitMisbehaviourResponse, error) { //nolint:staticcheck // for now, we're using msgsubmitmisbehaviour.
Copy link
Member Author

Choose a reason for hiding this comment

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

nolint can probs be removed here

@@ -208,8 +208,9 @@ func (chain *TestChain) GetContext() sdk.Context {
headerInfo := header.Info{
Copy link
Member Author

Choose a reason for hiding this comment

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

Just needs dependency bump and this could be removed

Copy link

@damiannolan damiannolan merged commit f5e1a4c into main Dec 20, 2024
67 of 68 checks passed
@damiannolan damiannolan deleted the damian/core-runtime-env branch December 20, 2024 08:41
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