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

fix multisig account pubkeys migration #8788

Closed
wants to merge 70 commits into from

Conversation

akhilkumarpilli
Copy link
Contributor

Description

ref: #8776 (comment)

When migrating genesis to v0.40, set pub_key to null if account is multisig as a quick fix


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

clevinson and others added 30 commits January 8, 2021 17:43
* v0.40.0 final changelog & release notes

* Trigger Build
* fix reproducible builds (#8300)
* fix library file path (#8301)

Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
From: #8282

Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
) (#8373)

From: #8273

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
From #8282

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
#8376)

From #8291

Bumps [github.com/gogo/protobuf](https://github.com/gogo/protobuf) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/gogo/protobuf/releases)
- [Commits](gogo/protobuf@v1.3.1...v1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
From: #8287

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
From: #8385

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
From: #8385

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* Update gogo proto deps with v1.3.2 security fixes

* Regenerate proto files

Co-authored-by: Aaron Craelius <aaron@regen.network>
* fix-ibc-client
* add changelog

Co-authored-by: Segue <huoda.china@163.com>
* fix proto generation

* merge grpc_gateway into gocosmos_out

* change env variable names

Co-authored-by: Marko <marbar3778@yahoo.com>
* add missing UnpackInterfaces functions

* fix build

* add tests cc @fedekunze

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
From: #8317

Co-authored-by: Amaury <amaury.martiny@protonmail.com>
* Update changelog for 0.40.1

* add tendermint

* Add release notes

* add known issues

* update

* update release notes

* fix a few things in CHANGELOG

* Update RELEASE_NOTES.md

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* update to tendermint v0.34.3

* go.mod replace with grpc v1.33.2

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
From: #8436

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
From #8458

Co-authored-by: Ethan Frey <ethanfrey@users.noreply.github.com>
Still a problem with `cat` - a tmp_genesis file needs to be created and then moved to the old location

Co-authored-by: Amaury <amaury.martiny@protonmail.com>
Co-authored-by: Cory <cjlevinson@gmail.com>
@alessio
Copy link
Contributor

alessio commented Mar 4, 2021

Thanks @akhilkumarpilli for taking the time and making this PR! Did you test this, and if so how?

@codecov
Copy link

codecov bot commented Mar 4, 2021

Codecov Report

Merging #8788 (1ebd023) into release/v0.41.x (3aaf1bc) will increase coverage by 0.00%.
The diff coverage is 33.33%.

Impacted file tree graph

@@               Coverage Diff                @@
##           release/v0.41.x    #8788   +/-   ##
================================================
  Coverage            61.95%   61.95%           
================================================
  Files                  612      612           
  Lines                35417    35432   +15     
================================================
+ Hits                 21942    21953   +11     
- Misses               11155    11156    +1     
- Partials              2320     2323    +3     
Impacted Files Coverage Δ
x/auth/legacy/v040/migrate.go 87.30% <33.33%> (-2.87%) ⬇️
x/ibc/core/02-client/keeper/client.go 98.27% <0.00%> (+0.06%) ⬆️
x/ibc/core/02-client/types/encoding.go 60.00% <0.00%> (+6.15%) ⬆️

@akhilkumarpilli
Copy link
Contributor Author

Thanks @akhilkumarpilli for taking the time and making this PR! Did you test this, and if so how?

Yes, tested locally. I just ran akash local devnet with couple of multisig accounts and migrated it from v0.39 to v0.40. I tried to do multisig transaction but got some panic error from tx. I found issue is with empty public_keys array.

Later, I tried with this fix by setting multisig account pub_key to null and it worked fine.

@aaronc
Copy link
Member

aaronc commented Mar 4, 2021

Would be good to understand if this is an active issue on the hub

@alessio
Copy link
Contributor

alessio commented Mar 4, 2021

Would be good to understand if this is an active issue on the hub

It looks like an issue for which a known workaround is available. It still is an issue though I think.

@zmanian
Copy link
Member

zmanian commented Mar 4, 2021

I have used hub multisigs after the migration and it worked fine.

@zmanian
Copy link
Member

zmanian commented Mar 4, 2021

This seems like a good direction.

the ways addresses work right now, it is always safe to set a pubkey to nil on export.

If we implement key rotation and addresses become stateful, then export will be required for upgrades.

@alessio
Copy link
Contributor

alessio commented Mar 4, 2021

@zmanian so you reckon this can be safely merged, yeah?

@boz
Copy link
Contributor

boz commented Mar 5, 2021

cosmoshub-4 was not affected by this - the genesis had "pub_key": null for all accounts.

Copy link
Collaborator

@anilcse anilcse left a comment

Choose a reason for hiding this comment

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

@anilcse
Copy link
Collaborator

anilcse commented Mar 5, 2021

I have used hub multisigs after the migration and it worked fine.

v0.38 migration sets nil for all the account pubkeys. That's the reason Hub upgrade worked just fine. This issue will be only for chains who migrate form 039 to 040 as we are setting pubkey to the account if exists.

I suggest to merge this asap and tag a release. Otherwise other chains might run into similar issues and non-recoverable cases

cc @aaronc @clevinson @alessio

@anilcse
Copy link
Collaborator

anilcse commented Mar 5, 2021

@akhilkumarpilli this should go into master and then backported to release-0.41.x

Cc @clevinson

@akhilkumarpilli akhilkumarpilli changed the base branch from release/v0.41.x to master March 5, 2021 09:10
@amaury1093
Copy link
Contributor

@akhilkumarpilli Could you rebase?

@akhilkumarpilli
Copy link
Contributor Author

akhilkumarpilli commented Mar 5, 2021

Actually, I raised PR with base from v0.41.4. But there are lot of conflicts when I changed base to master. Do I need to close this PR and raise a new one with adding fix in master as there are more conflicts?

@amaury1093
Copy link
Contributor

@akhilkumarpilli this PR has already 2 approvals, so I would suggest to push --force. But if that's too messy, okay to create a new PR too.

@akhilkumarpilli
Copy link
Contributor Author

I tried to resolve conflicts but there are lot of conflicts and too messy. So, I will raise a new PR.

@akhilkumarpilli
Copy link
Contributor Author

Closing this and opened new one #8794. Thank you.

@alessio alessio deleted the akhil/multisig-migrate-fix branch March 14, 2021 01:39
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.