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

Add error handling in BeginBlock for IBC client #7938

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

avorylli
Copy link

@avorylli avorylli commented Feb 9, 2025

  • Add proper error handling for BeginBlocker in core module
  • Wrap error with context for better debugging
  • Improve reliability by not silently ignoring potential errors

@@ -197,7 +197,9 @@ func (AppModule) ConsensusVersion() uint64 { return 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)
if err := ibcclient.BeginBlocker(sdk.UnwrapSDKContext(ctx), am.keeper.ClientKeeper); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's OK to catch the error and log it, but we cannot return an error here as it would not let the block finalize and subsequently halt the chain

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.

2 participants