-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Refactor store keys for variable-length addresses #8363
Conversation
type validatorsByAddr map[[sdk.AddrLen]byte][]byte | ||
// map of operator bech32-addresses to serialized power | ||
// We use bech32 strings here, because we can't have slices as keys: map[[]byte][]byte | ||
type validatorsByAddr map[string][]byte |
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.
most changes in this file are related to this change: since we use variable-length addresses, we cannot have map[[]byte][]byte
. I'm using the bech32-string as map key 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.
This generally looks good to me. It would be great if we had someone else who's worked with staking take a look as it's a pretty significant change... If not, I can approve
Putting automerge on as to unblock other pieces depending on this PR |
This Cosmos SDK change allows variable-sized addresses: cosmos/cosmos-sdk#8363 This commit changes the validation logic to support addresses whose lengths are `1..=255`.
This commit changes the constructor and `to_bytes` methods to fully support variable-width account IDs, as added in cosmos/cosmos-sdk#8363. This is a breaking change.
This commit changes the constructor and `to_bytes` methods to fully support variable-width account IDs, as added in cosmos/cosmos-sdk#8363. This is a breaking change.
* Change account store key in x/bank * Fix pagination test * Fix merge master * Fix staking keys.go * Use bech32 in val state change map * Fix sortNoLongerBonded * Use length-prefix function * Use length prefix function * Fix test accountStore * Fix ExamplePaginate * Fix staking keys * Use shorter balances prefix * Do slashing keys * Fix gov keys * Fix x/gov tests * Fix x/distrib * Address reviews * add change log entry * Add changelog * Fix failing tests * Fix sim tests * fix after-export sim * Fix lint * Address review * Fix x/authz * Fix global config in test * Update x/staking/keeper/val_state_change.go Co-authored-by: Robert Zaremba <robert@zaremba.ch> * Address comments * Fix comments * Address review * Fix authz test * Update comment * Rename to LengthPrefixedAddressStoreKey * Use variable * Rename function * Fix test build * chore: update rosetta CI (cosmos#8453) * Rename again * Rename yet again * Update feegrant keys * Add function to create prefix Co-authored-by: Robert Zaremba <robert@zaremba.ch> Co-authored-by: Frojdi Dymylja <33157909+fdymylja@users.noreply.github.com> Co-authored-by: Aaron Craelius <aaron@regen.network> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Description
ref: #8345
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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes