-
Notifications
You must be signed in to change notification settings - Fork 6
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: cosmos v50 upgrade #179
Conversation
fix dependencies fix build upgrade protogen image Co-authored-by: mmsqe <[email protected]> wait for block properly fix py-lint fix test fix py-lint
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 122 files out of 205 files are above the max files limit of 75. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
for _, m := range app.ModuleManager.Modules { | ||
if moduleWithName, ok := m.(module.HasName); ok { | ||
moduleName := moduleWithName.Name() | ||
if appModule, ok := moduleWithName.(appmodule.AppModule); ok { | ||
modules[moduleName] = appModule | ||
} | ||
} | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { | ||
am.keeper.BeginBlock(ctx, req) | ||
func (am AppModule) BeginBlock(ctx context.Context) error { | ||
return am.keeper.BeginBlock(sdk.UnwrapSDKContext(ctx)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
if consParams != nil && consParams.Block.MaxGas > -1 { | ||
gasLimit = big.NewInt(consParams.Block.MaxGas) | ||
if consParams.Block == nil || consParams.Block.MaxGas <= -1 { | ||
panic(fmt.Sprintf("get invalid consensus params: %s", consParams)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
store := k.storeService.OpenKVStore(ctx) | ||
bz, err := store.Get(types.ParamsKey) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { | ||
am.keeper.BeginBlock(ctx, req) | ||
func (am AppModule) BeginBlock(ctx context.Context) error { | ||
return am.keeper.BeginBlock(sdk.UnwrapSDKContext(ctx)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
am.keeper.EndBlock(ctx, req) | ||
return []abci.ValidatorUpdate{} | ||
func (am AppModule) EndBlock(ctx context.Context) error { | ||
return am.keeper.EndBlock(sdk.UnwrapSDKContext(ctx)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
var InterfaceRegistry types.InterfaceRegistry | ||
|
||
func customGetSignerFn(path string) func(msg proto.Message) ([][]byte, error) { | ||
return func(msg proto.Message) ([][]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in cronos fork from is changed to be bytes instead of string, but for now we can keep it string with this custom signer func
// add rosetta | ||
rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) | ||
autoCliOpts := tempApp.AutoCliOpts() | ||
initClientCtx, _ = clientcfg.ReadDefaultValuesFromDefaultClientConfig(initClientCtx) |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack. Warning
# ) | ||
|
||
|
||
# def test_cosmovisor_upgrade(custom_ethermint: Ethermint): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you just @pytest.mark.skip
? should minimize the diff and future merge conflicts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I was looking at the specific commit. If it was commented out before I think this is fine. We have upgrade test coverage on the node side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it was commented out, i guess with same reasoning that we are testing upgrade anyways on node side, but will open the issue in any case to check this since it might uncover some hidden issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cherry pick seems clean. Most of the extra diff comes from fixing the nix build and CI stuff.
also because there were changes between our last cherry pick until this one that we didn't check in meantime, causing all kinds of issues with integration and unit tests i will follow up on this in more details, but with future work, for this one i think it is fine |
Follow up issues (I will open with more details after merging this PR)
refactor unit tests to reduce coupling between integration_tests.go and keeper tests (already done in cronos), this makes running some unit tests hard as integration_tests.go change keeper state and impact unit tests execution
uncomment test_upgrade and fix - this was already commented out before this PR, so probably not related
base fee in subscription related rpc methods is not contained in header events, should be refactored to use block and extract header from it