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

Use cosmos v47 #320

Merged
merged 11 commits into from
Mar 3, 2023
Merged

Use cosmos v47 #320

merged 11 commits into from
Mar 3, 2023

Conversation

KonradStaniec
Copy link
Collaborator

@KonradStaniec KonradStaniec commented Feb 23, 2023

Bump cosmos sdk to 47, ibc-go to v7, and btcd to latest version.

One caveat, for now I disabled e2e test as it seems hermes relayer is not ready for new tendermint version. Long story short, hermes uses events associated with transaction to declare in if some operation succeeded. Format of events was updated with new tendermint version. One easy wasy to confirm that is to run manually some operation on hermes (like create client ) and then check hermes query tx events hash and and ./babylond query tx hash , even though babylon node shows all events are there, hermes does not recoignize them.

UPDATE: hermes 1.3 actually returns an error when trying to retrieve events by cli:
ERROR relayer error: RPC error to endpoint http://bbn-test-a-node-babylon-default-a-3:26657/: serde parse error: incomplete utf-8 byte sequence from index 1 at line 22 column 30

We can re-enable those after support will be added.

@KonradStaniec KonradStaniec marked this pull request as ready for review February 28, 2023 13:41
Copy link
Member

@vitsalis vitsalis left a comment

Choose a reason for hiding this comment

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

This is very impressive work! Added some comments, questions, and suggestions.

@@ -68,6 +78,8 @@ func TestUpgradeStateOnGenesis(t *testing.T) {
ctx := app.NewContext(false, tmproto.Header{})
vm := app.UpgradeKeeper.GetModuleVersionMap(ctx)
for v, i := range app.mm.Modules {
require.Equal(t, vm[v], i.ConsensusVersion())
if i, ok := i.(module.HasConsensusVersion); ok {
Copy link
Member

Choose a reason for hiding this comment

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

What's the case in which a module does not have a ConsensusVersion()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

then we do not need to test it here. From what I understand , this test mainly checks that upgrade keeper versions are inline with versions declared by modules themselves

) (servertypes.ExportedApp, error) {
forZeroHeight bool,
jailAllowedAddrs []string,
modulesToExport []string) (servertypes.ExportedApp, error) {
Copy link
Member

Choose a reason for hiding this comment

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

The modulesToExport is not used here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch! we should use here new method for exporting genesis i.e have app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) instead of app.mm.ExportGenesis(ctx, app.appCodec)

app/params/config.go Show resolved Hide resolved
@@ -15,7 +16,7 @@ import (
"github.com/babylonchain/babylon/x/checkpointing/types"
)

func AddGenBlsCmd() *cobra.Command {
func AddGenBlsCmd(validator genutiltypes.MessageValidator) *cobra.Command {
Copy link
Member

Choose a reason for hiding this comment

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

Why do we add this argument? cc @gitferry

Copy link
Collaborator Author

@KonradStaniec KonradStaniec Mar 1, 2023

Choose a reason for hiding this comment

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

it is needed as genutiltypes.ValidateAndGetGenTx require new argument of type genutiltypes.MessageValidator. This argument should be consistent across whole app and all commands so we need to pass it from root.go to all necessary call sites.

From what I understand, this new argument makes it possible to customize validator message which is put in genesis file. (at least validations done on that message) So it may come in handy at some point, for example to require custom create validator message with bls key. For now everywhere I am passing just the default implementation DefaultMessageValidator which makes this behave as old implementation without breaking stuff.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nice feature introduced by v47, which allows us to customize the validation rules against staking.MsgCreateValidator messages. I think for now the DefaultMessageValidator is sufficient, which solely calls the ValidateBasic method of the staking.MsgCreateValidator. I don't think we should add more rules about BLS keys because BLS keys are added after genesis txs are generated.

cmd/babylond/cmd/genesis.go Outdated Show resolved Hide resolved
x/btccheckpoint/module_simulation.go Outdated Show resolved Hide resolved
x/btclightclient/keeper/state.go Outdated Show resolved Hide resolved
x/btclightclient/module.go Show resolved Hide resolved
x/epoching/keeper/epoch_msg_queue_test.go Show resolved Hide resolved
x/epoching/keeper/hooks.go Show resolved Hide resolved
Copy link
Member

@SebastianElvis SebastianElvis left a comment

Choose a reason for hiding this comment

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

Finally we can get rid of the btcd issue! I only have some minor comments. Maybe we can wait for followup comments from @vitsalis before merging this

Makefile Outdated

proto-all: proto-gen proto-swagger-gen
proto-all: proto-format proto-lint proto-gen
Copy link
Member

Choose a reason for hiding this comment

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

Why do we ditch proto-swagger-gen here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point, I just got carried away and copied stuff from cosmos-sdk. (we do not even have proto-format and proto-lint)

I will bring it back to how it was and crated task to and linter and formatter for protos- #321

x/epoching/keeper/epoch_msg_queue_test.go Show resolved Hide resolved
x/epoching/keeper/hooks.go Show resolved Hide resolved
Copy link
Member

@vitsalis vitsalis left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for the updates!

@KonradStaniec KonradStaniec merged commit f32db3a into dev Mar 3, 2023
@KonradStaniec KonradStaniec deleted the use-cosmos-v47 branch March 3, 2023 07:06
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.

4 participants