-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: gov and group amino and snapshot hashes #49
Conversation
Pending cosmos#14103 (and therefore cosmos#14214) |
Can we cherry pick the PRs individually from upstream so they show up in the commit log? |
* fix!(group): Register types with Amino * Chagenlog
* fix!: Fix gov amino codec * changelog
* fix!: Fix group amino codec * changelog
…ork/cosmos-sdk into ryan/add-amino-fixes
4b46d09
to
aec8723
Compare
The tests that are failing appear to be failing on |
09a3d24
to
2ee3503
Compare
…mos#14305) (cosmos#14309) Co-authored-by: Daniel Wedul <[email protected]> Co-authored-by: Julien Robert <[email protected]>
We may want to clean this up and merge in separate pull requests but changes we need to make should all be included here to fix amino and to fix snapshots (and therefore require go 1.19 in regen ledger). |
One item I'm not totally sure on is the changes included from 2ee3503. I excluded some changes and had to update some of the hashes separately, because some things do not exist in the release branch that were included in the original pull request. |
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.
Went through all the diff files (comparing against the source PRs in the description line-by-line), and I think is looking good to me!
A few comments, pointing out the hashes @ryanchristo alluded to in his last comment. Would appreciate an SDK perspective on this if @AmauryM you can have a look?
Otherwise, giving this an ACK. I'm in general support of us adding in the last commits so we ensure building with go 1.19 works as expected for regen ledger v5.0.
snapshots/manager_test.go
Outdated
@@ -91,7 +91,7 @@ func TestManager_Take(t *testing.T) { | |||
Height: 5, | |||
Format: snapshotter.SnapshotFormat(), | |||
Chunks: 1, | |||
Hash: []uint8{0xcd, 0x17, 0x9e, 0x7f, 0x28, 0xb6, 0x82, 0x90, 0xc7, 0x25, 0xf3, 0x42, 0xac, 0x65, 0x73, 0x50, 0xaa, 0xa0, 0x10, 0x5c, 0x40, 0x8c, 0xd5, 0x1, 0xed, 0x82, 0xb5, 0xca, 0x8b, 0xe0, 0x83, 0xa2}, | |||
Hash: []uint8{0xcf, 0xd8, 0x16, 0xd2, 0xf8, 0x11, 0xe8, 0x90, 0x92, 0xf1, 0xfe, 0x3b, 0xea, 0xd2, 0x94, 0xfc, 0xfa, 0x4f, 0x9e, 0x2a, 0x91, 0xbe, 0xb0, 0x50, 0x83, 0xe9, 0x28, 0x62, 0x48, 0x6a, 0x4b, 0x4}, |
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.
These hashes are different from the hashes in the tests on cosmos#13400 (see snapshots/manager_test.go).
@AmauryM any thoughts as to whether this might be a problem?
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.
I think we should understand why there's a hash mismatch before merging this PR. Currently I'm not sure, and I also don't know if this will break state sync on regen-ledger or not.
Looking at git blames on the snapshot-related files, I noticed this addition wasn't included in this PR: https://github.com/cosmos/cosmos-sdk/blame/main/store/snapshots/store.go#L263. I also see we do a proto.Marshal()
on the snaphot object. Maybe it's worth giving a try at backporting cosmos#13070 here?
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.
Resolved with 8985cf8
@@ -151,7 +151,7 @@ func TestMultistoreSnapshot_Checksum(t *testing.T) { | |||
"05dfef0e32c34ef3900300f9de51f228d7fb204fa8f4e4d0d1529f083d122029", | |||
"77d30aeeb427b0bdcedf3639adde1e822c15233d652782e171125280875aa492", | |||
"c00c3801da889ea4370f0e647ffe1e291bd47f500e2a7269611eb4cc198b993f", | |||
"6d565eb28776631f3e3e764decd53436c3be073a8a01fa5434afd539f9ae6eda", | |||
"df5b8eeea83ca7f1e10824d0161bff46200ca12c02f50c1f42c8ed156368493e", |
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.
This hash update also seems to not be in a source PR (e.g. cosmos#13400)... Would be good to confirm that there's nothing to worry about here.
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.
Store v2alpha1 is not used, so I'm not too worried about this. Though I suspect the reason of this hash mismatch is the same as the comment above.
|
||
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec | ||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { | ||
cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/mint/Params", nil) |
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.
I think it's OK to keep this added, but I'm not sure if its actually necessary since we don't have MsgUpdateParams
in v0.46.x. Either way, I don't think its harmful to add the registration here.
RegisterLegacyAminoCodec(govcodec.Amino) | ||
RegisterLegacyAminoCodec(groupcodec.Amino) |
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.
One thing we shouldn't forget to do in the PR that integrates this into regen-ledger, is to add these 2 lines to regen-ledger's modules too
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.
Included in regen-network/regen-ledger#1694
@@ -151,7 +151,7 @@ func TestMultistoreSnapshot_Checksum(t *testing.T) { | |||
"05dfef0e32c34ef3900300f9de51f228d7fb204fa8f4e4d0d1529f083d122029", | |||
"77d30aeeb427b0bdcedf3639adde1e822c15233d652782e171125280875aa492", | |||
"c00c3801da889ea4370f0e647ffe1e291bd47f500e2a7269611eb4cc198b993f", | |||
"6d565eb28776631f3e3e764decd53436c3be073a8a01fa5434afd539f9ae6eda", | |||
"df5b8eeea83ca7f1e10824d0161bff46200ca12c02f50c1f42c8ed156368493e", |
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.
Store v2alpha1 is not used, so I'm not too worried about this. Though I suspect the reason of this hash mismatch is the same as the comment above.
snapshots/manager_test.go
Outdated
@@ -91,7 +91,7 @@ func TestManager_Take(t *testing.T) { | |||
Height: 5, | |||
Format: snapshotter.SnapshotFormat(), | |||
Chunks: 1, | |||
Hash: []uint8{0xcd, 0x17, 0x9e, 0x7f, 0x28, 0xb6, 0x82, 0x90, 0xc7, 0x25, 0xf3, 0x42, 0xac, 0x65, 0x73, 0x50, 0xaa, 0xa0, 0x10, 0x5c, 0x40, 0x8c, 0xd5, 0x1, 0xed, 0x82, 0xb5, 0xca, 0x8b, 0xe0, 0x83, 0xa2}, | |||
Hash: []uint8{0xcf, 0xd8, 0x16, 0xd2, 0xf8, 0x11, 0xe8, 0x90, 0x92, 0xf1, 0xfe, 0x3b, 0xea, 0xd2, 0x94, 0xfc, 0xfa, 0x4f, 0x9e, 0x2a, 0x91, 0xbe, 0xb0, 0x50, 0x83, 0xe9, 0x28, 0x62, 0x48, 0x6a, 0x4b, 0x4}, |
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.
I think we should understand why there's a hash mismatch before merging this PR. Currently I'm not sure, and I also don't know if this will break state sync on regen-ledger or not.
Looking at git blames on the snapshot-related files, I noticed this addition wasn't included in this PR: https://github.com/cosmos/cosmos-sdk/blame/main/store/snapshots/store.go#L263. I also see we do a proto.Marshal()
on the snaphot object. Maybe it's worth giving a try at backporting cosmos#13070 here?
* Make extension snapshotter interface safer to use Closes: cosmos#11824 Solution: - Use new methods `SnapshotExtension`/`RestoreExtension` to handle payload stream specifically. - Improve unit tests. * update changelog * Update snapshots/types/util.go * changelog * go linter * Update CHANGELOG.md Co-authored-by: Aleksandr Bezobchuk <[email protected]>
@@ -91,7 +95,7 @@ func TestManager_Take(t *testing.T) { | |||
Height: 5, | |||
Format: snapshotter.SnapshotFormat(), | |||
Chunks: 1, | |||
Hash: []uint8{0xcf, 0xd8, 0x16, 0xd2, 0xf8, 0x11, 0xe8, 0x90, 0x92, 0xf1, 0xfe, 0x3b, 0xea, 0xd2, 0x94, 0xfc, 0xfa, 0x4f, 0x9e, 0x2a, 0x91, 0xbe, 0xb0, 0x50, 0x83, 0xe9, 0x28, 0x62, 0x48, 0x6a, 0x4b, 0x4}, | |||
Hash: []uint8{0xc5, 0xf7, 0xfe, 0xea, 0xd3, 0x4d, 0x3e, 0x87, 0xff, 0x41, 0xa2, 0x27, 0xfa, 0xcb, 0x38, 0x17, 0xa, 0x5, 0xeb, 0x27, 0x4e, 0x16, 0x5e, 0xf3, 0xb2, 0x8b, 0x47, 0xd1, 0xe6, 0x94, 0x7e, 0x8b}, |
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.
This was updated manually within the last commit to align with what was originally expected.
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.
i.e. what it was updated to in cosmos#13400
This did not fail for me locally but will try to rerun tests to see if intermittent: |
Seems to be intermittent and unrelated. |
Just took a final pass over the latest commit comparing it to the source PR (cosmos#11825). I also verified that hashes now match what we expected from backporting cosmos#13400. Looks like we didn't need to back port cosmos#13070 after all? Makes sense to me since the line in question that @AmauryM pointed out ( ACK from me 🎉 |
Description
This pull request adds the gov and group module amino codec fixes that were added in the following pull requests but were not included in cosmos sdk
v0.46.7
:This pull request also includes
RegisterLegacyAminoCodec
in the mint module added in the following pull request:Update
Another issue was discovered as tests were failing for me locally (using go 1.19) and intermittently on github (using go 1.18) and so I discovered cosmos#13373, which was resolved with two pull requests:
Also noticed the latest commit added to the release branch that fixes another failing test:
Update
To resolve the snapshot mismatch between this branch and main, one more pull request was added:
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change