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

Store migration for slashing, auth and authz #746

Merged
merged 13 commits into from
Aug 7, 2023

Conversation

skyargos
Copy link
Contributor

@skyargos skyargos commented Aug 1, 2023

Closes: #XXX
Related: #XXX

Description


For contributor use:

  • 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

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]"

@skyargos skyargos marked this pull request as ready for review August 1, 2023 07:33
@skyargos skyargos requested a review from a team as a code owner August 1, 2023 07:33
@skyargos skyargos requested review from kevin-yuhh and haozhan9 and removed request for a team August 1, 2023 07:33
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #746 (99f4c8a) into prefix-trans-stkazf (95c37b0) will decrease coverage by 0.68%.
The diff coverage is 52.29%.

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                   @@
##           prefix-trans-stkazf     #746      +/-   ##
=======================================================
- Coverage                47.40%   46.72%   -0.68%     
=======================================================
  Files                      130      126       -4     
  Lines                    12563    12181     -382     
=======================================================
- Hits                      5955     5692     -263     
+ Misses                    6041     5955      -86     
+ Partials                   567      534      -33     
Files Changed Coverage Δ
app/upgrade_handler.go 46.25% <52.29%> (+3.24%) ⬆️

... and 8 files with indirect coverage changes

@skyargos skyargos changed the title Store migration for slashing and auth Store migration for slashing, auth and authz Aug 3, 2023
authorization := grant.Authorization
value := authorization.GetValue()

switch authorization.GetTypeUrl() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it better to use type comparison?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix

if err := ak.SaveGrant(ctx, granteeAddr, granterAddr, stakeAuthorization, grant.Expiration); err != nil {
return true
}
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

just for your info:
it seems there is another Authorization, which is bank.types.SendAuthorization. But it looks like we don't have it on mainnet state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the current data on the chain does not have this status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add

@skyargos skyargos merged commit 41e4510 into prefix-trans-stkazf Aug 7, 2023
17 checks passed
@skyargos skyargos deleted the prefix-slashing-auth branch August 7, 2023 06:16
haozhan9 added a commit that referenced this pull request Aug 7, 2023
* initially add staking store migration

* finish store migration for staking

* add store migration for feegrant and gov

* add unit test

* fix feegrant unit test

* fix lint

* using cosmos sdk 0.45.11-3

* add negative tests

* change impl for feegrant

* simplify code

* Store migration for slashing, auth and authz (#746)

* Store migration for slashing, auth and authz

---------

Co-authored-by: zheng-bin <wenwubinzheng@gmail.com>
kevin-yuhh added a commit that referenced this pull request Aug 24, 2023
* change address prefix to shentu

* Migrate shield (#738)

* migrate shield certik prefix to shentu

* migrate shield certik prefix to shentu

* migrate shield certik prefix to shentu

* migrate shield stored prefix to shentu

* sort import files

* update ConsensusVersion

* update pool migration

* change v280 to v4

* add v4_test package

* migrate oracle certik prefix to shentu (#740)

* migrate oracle certik prefix to shentu

* update ConsensusVersion

* update operator migration

* add oracle withdraw migration

* sort imports

* change v280 to v3

* add v3

* migrate cert stored prefix to shentu (#739)

* migrate cert stored prefix to shentu

* sort import files

* update ConsensusVersion

* add cert library migration

* change v280 to v2

* migrate certificate.content

* [prefix-trans]migrate store for staking, gov and feegrant (#747)

* initially add staking store migration

* finish store migration for staking

* add store migration for feegrant and gov

* add unit test

* fix feegrant unit test

* fix lint

* using cosmos sdk 0.45.11-3

* add negative tests

* change impl for feegrant

* simplify code

* Store migration for slashing, auth and authz (#746)

* Store migration for slashing, auth and authz

---------

Co-authored-by: zheng-bin <wenwubinzheng@gmail.com>

* skip empty certificate's proposer (#749)

add v3

* change migration certificate MustMarshalLengthPrefixed function  to M… (#750)

* change migration certificate MustMarshalLengthPrefixed function  to MustMarshal function

* change migration certificate MustMarshalLengthPrefixed function  to MustMarshal function

* Shentu prefix revoke certificate (#754)

* fix revoke-certificate, platform cmd

* fix revoke-certificate, platform cmd

* fix revoke-certificate, platform cmd

* Replace certik word (#752)

* replace shentu

* change to shentu word

* change to shentu word

* replace to shentu

* add address prefix conversion for specific gov proposal content (#758)

* add address conversion for specific proposal contens

* add more negative test

---------

Co-authored-by: haozhan9 <zhanghao_tt@sina.com>
Co-authored-by: zheng-bin <wenwubinzheng@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants