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

Simulate fail for chains created with address-prefix setup #4185

Closed
pangwa opened this issue Jun 8, 2024 · 4 comments · Fixed by #4199
Closed

Simulate fail for chains created with address-prefix setup #4185

pangwa opened this issue Jun 8, 2024 · 4 comments · Fixed by #4199
Assignees
Labels
type:error Something isn't working

Comments

@pangwa
Copy link

pangwa commented Jun 8, 2024

Describe the bug
ignite simulate failed for chains created with a custom address prefix

To reproduce
Steps to reproduce the behavior:

  1. ignite scaffold chain github.com/test/example --address-prefix test
  2. cd example
  3. ignite chain simulate # fails here

Below is the error messages:

panic: invalid bank authority address: hrp does not match bech32 prefix: expected 'test' got 'cosmos': internal logic error [cosmos/[email protected]/codec/address/bech32_codec.go:37]

goroutine 50 [running]:
github.com/cosmos/cosmos-sdk/x/bank/keeper.NewBaseKeeper({_, _}, {_, _}, {_, _}, _, {_, _}, {0x10861b9e8, ...})

What version are you using?

Ignite CLI version:             v28.4.0
Ignite CLI build date:          2024-05-15T13:42:13Z
Ignite CLI source hash:         83ee9ba5f81f2d2104ed91808f2cb72719a23e41
Ignite CLI config version:      v1
Cosmos SDK version:             v0.50.6
Your OS:                        darwin
Your arch:                      amd64
Your Node.js version:           v22.2.0
Your go version:                go version go1.22.4 darwin/amd64
@julienrbrt julienrbrt self-assigned this Jun 8, 2024
@salmad3 salmad3 added the type:error Something isn't working label Jun 9, 2024
@salmad3 salmad3 moved this from To Discuss to Todo in Ignite CLI Masterboard Jun 9, 2024
@mondainai247
Copy link
Contributor

@pangwa The example chain had already been scaffolded with address prefix 'cosmos' then pushed to github. I beleive you can change the address prefix to 'test' in the app.go file then you should not get an error when you serve the chain or build the binary. Can you please try that?

cc: @salmad3 @julienrbrt

@pangwa
Copy link
Author

pangwa commented Jun 14, 2024

I tried that, cleanup the binaries to make sure everything was rebuilt. ignite chain serve works well. only ignite chain simulate fails.

@mondainai247
Copy link
Contributor

Thanks @pangwa, I tried scaffolding a new chain from scratch with the 'test' prefix and got the same error message as you. Thanks for flagging this, hopefully a solution can be found.

@julienrbrt
Copy link
Member

Due to the leak of the global config still present in the SDK, setting the bech32 prefixes only in the app config isn't sufficient. Currently, we were initializing the bech32 global sdk config when the root command was called. Which wasn't the case in simulations.

The fix is to move the setting of the bech32 prefix in the app (app/) instead of the app commands. See the opened PR for how to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:error Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants