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(genesis): improve error handling by removing panics #7921

Closed
wants to merge 7 commits into from

Conversation

crStiv
Copy link

@crStiv crStiv commented Feb 6, 2025

Description

This PR addresses issue #7698 by replacing panic calls with proper error handling in genesis functions across the codebase.

Changes

  • Replaced panic with error returns in genesis functions:
    • InitGenesis in core/02-client now returns error instead of panicking
    • ExportGenesis in light-clients/08-wasm now returns error instead of panicking
    • InitGenesis in core/04-channel now returns error instead of panicking
    • InitGenesis in interchain-accounts/host now returns error instead of panicking
    • Changed error handling in simulation/genesis.go to log errors instead of panicking
  • Improved error wrapping using fmt.Errorf with %w verb
  • Updated function signatures to properly propagate errors

Modified files:

  • modules/light-clients/08-wasm/keeper/genesis.go
  • modules/core/simulation/genesis.go
  • modules/core/04-channel/genesis.go
  • modules/apps/27-interchain-accounts/host/keeper/genesis.go
  • modules/core/02-client/genesis.go

Breaking Changes

  • Genesis functions now return errors instead of panicking
  • Callers of these functions need to handle potential errors

Next Steps

  • Tests need to be updated to handle the new error returns
  • Documentation should be updated to reflect the new error handling

Fixes #7698

@gjermundgaraba
Copy link
Contributor

We've decided to hold off on this work as 0.52 has just been put on hold. I am very sorry for the inconvenience.

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.

Propagate errors in favour of panicking in genesis funcs (v0.52/olympus)
2 participants