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(x/authz): GetAuthorizations #17334

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

devon-chain
Copy link
Contributor

Description

When there are multiple authorizations, the cachedValue in the authorization will be assigned after the first grant is unmarshaled, and the cachedValue will not be assigned again for the second and subsequent grants

Because the grant is only created once.

both v0.46.x and v0.47.x have this problem.


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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

* Iterator Unmarshal Grant with Any cachedValue
@devon-chain devon-chain requested a review from a team as a code owner August 9, 2023 10:07
@julienrbrt
Copy link
Member

Could you add a test?

@devon-chain
Copy link
Contributor Author

@julienrbrt Sorry, I'll add a test! But when I added the test, I found that the main branch did not have this problem. The problem I found in v0.46.x, I compared the code is the same with main branch. I guess the proto or unmarshal have been updated. So I will resubmit a pull request in v0.46.x branch, thanks!

@devon-chain
Copy link
Contributor Author

@julienrbrt I have added tests, but this branch is normal, so no tests for error cases

@julienrbrt julienrbrt added backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release labels Aug 24, 2023
@julienrbrt julienrbrt added this pull request to the merge queue Aug 24, 2023
Merged via the queue into cosmos:main with commit a429238 Aug 24, 2023
42 of 46 checks passed
mergify bot pushed a commit that referenced this pull request Aug 24, 2023
mergify bot pushed a commit that referenced this pull request Aug 24, 2023
@julienrbrt
Copy link
Member

@Mergifyio backport release/v0.46.x

@mergify
Copy link
Contributor

mergify bot commented Aug 24, 2023

backport release/v0.46.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 24, 2023
julienrbrt added a commit that referenced this pull request Aug 24, 2023
Co-authored-by: devon <80245700+devon-chain@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
julienrbrt added a commit that referenced this pull request Aug 24, 2023
Co-authored-by: devon <80245700+devon-chain@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
@yihuang
Copy link
Collaborator

yihuang commented Aug 28, 2023

where is this method called? if it's called in state machine, this is a consensus breaking change, right?

@julienrbrt
Copy link
Member

julienrbrt commented Aug 28, 2023

where is this method called? if it's called in state machine, this is a consensus breaking change, right?

It isn't called anywhere. It is only used in tests. I've verified on sourcegraph as well.

julienrbrt added a commit that referenced this pull request Aug 31, 2023
@julienrbrt julienrbrt mentioned this pull request Aug 31, 2023
20 tasks
julienrbrt added a commit that referenced this pull request Oct 13, 2023
rootulp pushed a commit to rootulp/cosmos-sdk that referenced this pull request Nov 7, 2023
Co-authored-by: devon <80245700+devon-chain@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
rootulp added a commit to celestiaorg/cosmos-sdk that referenced this pull request Nov 14, 2023
* refactor: add MigrateHandler to allow reuse migrate genesis related function  (backport cosmos#17296) (cosmos#17301)

Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>

* fix: resolve migration map in MigrateHandler (cosmos#17301) (cosmos#17302)

* feat(x/gov): Emit VoterAddr (backport cosmos#17354) (cosmos#17357)

Co-authored-by: Devon Bear <itsdevbear@berachain.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>

* feat(x/gov): add MsgSubmitProposal SetMsgs method (backport cosmos#17387) (cosmos#17388)

Co-authored-by: Julien Robert <julien@rbrt.fr>

* fix: use correct config key for db_backend (backport cosmos#17406) (cosmos#17412)

Co-authored-by: Julien Robert <julien@rbrt.fr>

* chore: prepare v0.46.15 (cosmos#17408)

* fix(x/authz): GetAuthorizations (backport cosmos#17334) (cosmos#17527)

Co-authored-by: devon <80245700+devon-chain@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>

* docs: update x/group create-proposal to submit-proposal (backport cosmos#17544) (cosmos#17549)

Co-authored-by: Félix C. Morency <1102868+fmorency@users.noreply.github.com>

* fix: typo in comment (backport cosmos#17635) (cosmos#17638)

Co-authored-by: Bryan White <bryanchriswhite@gmail.com>
Co-authored-by: Marko <marbar3778@yahoo.com>

* build(deps): bump cosmos/ledger-cosmos-go to v0.12.3 in v0.46 (backport cosmos#18105) (cosmos#18112)

Co-authored-by: Julien Robert <julien@rbrt.fr>

* chore: prepare release notes v0.46.16 (cosmos#18118)

* fix(server): don't hardcode grpc address to localhost (backport cosmos#18254) (cosmos#18260)

Co-authored-by: Julien Robert <julien@rbrt.fr>

* chore: update tag date v0.46.16 (cosmos#18385)

* revert: Go 1.19

* revert: c226e8b

* chore(deps): upgrade to v1.29.0-tm-v0.34.29

* chore: downgrade to grpc 1.54.0

to match the versions used in upstream

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Devon Bear <itsdevbear@berachain.com>
Co-authored-by: devon <80245700+devon-chain@users.noreply.github.com>
Co-authored-by: Félix C. Morency <1102868+fmorency@users.noreply.github.com>
Co-authored-by: Bryan White <bryanchriswhite@gmail.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
JeancarloBarrios pushed a commit to agoric-labs/cosmos-sdk that referenced this pull request Sep 28, 2024
Co-authored-by: devon <80245700+devon-chain@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release C:x/authz
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants