-
Notifications
You must be signed in to change notification settings - Fork 290
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: prototype versioned app module upgrades #3729
base: main
Are you sure you want to change the base?
Conversation
$ ./node panic: error with code 2 is already registered: "duplicate" goroutine 1 [running]: cosmossdk.io/errors.RegisterWithGRPCCode({0x105b93b3f, 0x3}, 0x2, 0x2, {0x105b9a8f5, 0x9}) /Users/rootulp/go/pkg/mod/cosmossdk.io/[email protected]/errors.go:43 +0x240 cosmossdk.io/errors.Register(...) /Users/rootulp/go/pkg/mod/cosmossdk.io/[email protected]/errors.go:35 github.com/celestiaorg/celestia-app/x/qgb/types.init() /Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/x/qgb/types/errors.go:8 +0x128
e9c0c49
to
6b08045
Compare
This comment was marked as resolved.
This comment was marked as resolved.
New issue:
|
This was the error that I first got when trying to unfork the SDK. There is a global proto registry and thus when we import multiple versions we end up with this panic. One option would be to go mod the modules that way there's not two copies of |
Thanks for your help!
What if celestia-app v3 needs x/blob/v2 and celestia-app v1 needs x/blob/v1, then I think we'll hit the same issue where both modules try to register the same types in the global proto registry.
This one seems more hacky but potentially do-able. The concern is if celestia-app v2's |
If we created a x/blob/2 we would bump the proto version so the msg url would look like |
I've tried a few times to create a Go module from
|
error while importing github.com/celestiaorg/celestia-app/v2/app: ambiguous import: found package github.com/celestiaorg/celestia-app/x/blob in multiple modules: github.com/celestiaorg/celestia-app v1.13.0 (/Users/rootulp/go/pkg/mod/github.com/celestiaorg/[email protected]/x/blob) github.com/celestiaorg/celestia-app/x/blob v0.0.0 (/Users/rootulp/git/rootulp/celestiaorg/celestia-app/x/blob)
I thought the issue might be because v1.x has an
I tried cleaning the go mod cache and a few different variations of importing the x/blob package from the root |
The original error message
makes me think that both the types MsgPayForBlobs and MsgRegisterEVMAddress don't have a proto.MessageName defined because this line should suffix it to |
That's strange. This isn't a problem in main. These two would be registered under different names |
|
Hitting an error I resolved earlier on this PR
|
Problematic code in Cosmos SDK lives here. |
Added some debug logs to Cosmos SDK. Strange that registerImpl is being invoked with a
|
More logs:
|
In order to extract |
I extracted a new Go module for x/minfee, refactored the existing PR and v2.x branch to use the extracted x/minfee module and now there are no more duplicate proto registry logs: -2024/10/21 15:50:57 proto: duplicate proto type registered: celestia.minfee.v1.GenesisState
-2024/10/21 15:50:57 proto: duplicate proto type registered: celestia.minfee.v1.QueryNetworkMinGasPrice
-2024/10/21 15:50:57 proto: duplicate proto type registered: celestia.minfee.v1.QueryNetworkMinGasPriceResponse so I think we can pursue this path. Note: we need to either:
Next steps
|
Closes #3625
Issues encountered
errors.Register
. Since the multiplexer imports multiple celestia-app versions, all errors get registered twice resulting in a:panic: error with code 2 is already registered: "duplicate"
. To resolve, we need to:errors.Register
to notpanic
if a duplicate error is registered. Did this in https://github.com/rootulp/cosmos-sdk/releases/tag/errors%2Fv1.4.0panic: concrete type *types.MsgPayForBlobs has already been registered under typeURL /, cannot register *types.MsgRegisterEVMAddress under same typeURL. This usually means that there are conflicting modules registering different concrete types for a same interface implementation
.Option A: bump the proto package versions (did in this PR)go.mod
for each package and de-duplicate imports. Note: we'll have to extract thex/blob
package from this repo so that it isn't present in the root-level celestia-app go module. Use the v2 version because it has types that aren't present in the v1 version.Remaining tasks
main
. Extract the previous changes to a new v2 branch.config.IsSealed
cosmos-sdk#414node
tomultiplexer
Commit
of the block height before the upgrade height? In order to satisfy that constraint, the v2 state machine has to be updated so that modules support the range v1 to v3. If we remove v2 supporting v3 modules then we hit this errorInfo()
get the version and then start that state machineFLUPs
Notes
make build-node && ./build/node
Screenshot