-
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
fix: Capability Issue on Restart, Backport to v0.42 #9835
Conversation
Visit https://dashboard.github.orijtech.com?pr=9835&repo=cosmos%2Fcosmos-sdk to see benchmark details. |
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.
Moved the in-memory initialization logic to BeginBlock
and InitGenesis
rather than having it run on first capability tx.
This removes worry about tx reverting. It also is a cleaner solution. In-memory initialization happens in InitGenesis
for new chains or genesis restarts. It happens on first BeginBlock, for all other cases.
// initialize in-memory capabilities | ||
k.InitMemStore(ctx) | ||
} |
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 will be used if node is restarted from genesis (either a new chain or genesis restart)
x/capability/abci.go
Outdated
func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { | ||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) | ||
|
||
k.InitMemStore(ctx) |
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 will be used if node is restarting without genesis restart (ie. regular restart, upgrade with upgrade module, statesync)
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.
BeginBlocker
will be called on genesis I think (i.e. the 1st block).
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.
Yes but the initialization logic won't get rerun because the initialization flag in memory is already set
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.
Just to confirm, state sync nodes will only run NewApp
and not InitGenesis or BeginBlocker (before state sync)?
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.
That is my understanding, please confirm @alexanderbez
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.
Correct, state-synced nodes will NOT run InitGenesis
and will not run BeginBlock
until the first block after the state-sync height.
…k into aditya/backport-cap-fix
Tested using our upgrade test CI action: the fix works! The CI does the following:
The first transaction ( The second transaction ( Previously the second transaction would have failed with the error reported inside the issues. |
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.
Excellent work! Very clean fix!! Left some nits
x/capability/abci.go
Outdated
func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { | ||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) | ||
|
||
k.InitMemStore(ctx) |
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.
Just to confirm, state sync nodes will only run NewApp
and not InitGenesis or BeginBlocker (before state sync)?
prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixIndexCapability) | ||
iterator := sdk.KVStorePrefixIterator(prefixStore, nil) | ||
k.sealed = true | ||
} |
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.
so InitializeAndSeal
no longer initializes any capabilities, it just seals the keeper and ensures the mem store is a mem store. Should the godoc be updated?
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.
Correct and yes, I break this API on the breaking-changes pr
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 function doesn't do a full initialization - it doesn't call InitMemStore
. Maybe let's make a note, that this function should be called after InitMemStore
. So we should update the comments of this function and InitMemStore
function. And in 0.43 we can maybe rework it to make it more clear - by renaming this function to k.Seal(ctx)
BTW: we don't need to check the store type - this should be done in InitMemStore
.
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 see that you are sealing in the InitMemStore
. So we should update the comments of this function and InitMemStore
. And in 0.43
we can maybe rework it to make it more clear.
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.
Also, this is a breaking change of the state machine.
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.
No this shouldn't be breaking the state machine. InitializeCapability
only writes to the memstores and in-memory go map.
The memory store does not get committed along with the rest of the app state. It is in-memory local storage for each node. So changing things inside of it does not break the state machine.
https://github.com/cosmos/cosmos-sdk/blob/master/store/mem/store.go
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.
The memory store does not
I know. Breaking state machine doesn't necessary mean to break the written state. To illustrate this issue:
- Node A will run app with 0.42.8
- Node B will run same app (same app manager config) but using 0.42.9
Node A will have all capabilities initialized, Node B will not have.
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.
No this PR just changes where/when the capabilities are initialized.
In 0.42.8, the capabilities are initialized in app start NewApp
, and then reinitialized on the first transaction that calls GetCapability
.
In 0.42.9, the capabilities are initialized at the first abci method after startup (either InitChain
or BeginBlock
).
In either case, the capabilities are initialized before they are requested in a transaction, which is what is necessary for keeping nodes in sync.
There is a bug in 0.42.7 and 0.42.8, so there are situations where its state becomes out of sync with a node from 0.42.6.
However, comparing a node on 0.42.6 to a node on 0.42.9. They may initialize the in-memory capabilities in different places; however both will be fully initialized by the time the capability module gets used and thus will authenticate and reject the same transactions and be perfectly in sync.
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.
The behavior of InitializeCapability
is different - so an app will need to make more changes in the code than bumping a version. IMHO this is a breaking change - we signal to the app that bumping a version is not enough.
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.
Yes just bumping the version will not be enough. You will also have to make changes to app.go
. But it should be clear that you can run gaia with 0.42.6
and 0.42.9
on the same network and there will be no state divergence
x/capability/abci.go
Outdated
func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { | ||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) | ||
|
||
k.InitMemStore(ctx) |
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.
Correct, state-synced nodes will NOT run InitGenesis
and will not run BeginBlock
until the first block after the state-sync height.
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
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.
Let's update the function comments and changelog.
prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixIndexCapability) | ||
iterator := sdk.KVStorePrefixIterator(prefixStore, nil) | ||
k.sealed = true | ||
} |
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 function doesn't do a full initialization - it doesn't call InitMemStore
. Maybe let's make a note, that this function should be called after InitMemStore
. So we should update the comments of this function and InitMemStore
function. And in 0.43 we can maybe rework it to make it more clear - by renaming this function to k.Seal(ctx)
BTW: we don't need to check the store type - this should be done in InitMemStore
.
prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixIndexCapability) | ||
iterator := sdk.KVStorePrefixIterator(prefixStore, nil) | ||
k.sealed = true | ||
} |
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 see that you are sealing in the InitMemStore
. So we should update the comments of this function and InitMemStore
. And in 0.43
we can maybe rework it to make it more clear.
// IsInitialized returns true if the initialized flag is set, and false otherwise | ||
func (k *Keeper) IsInitialized(ctx sdk.Context) bool { | ||
memStore := ctx.KVStore(k.memKey) | ||
return memStore.Get(types.KeyMemInitialized) != 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.
Shall we use a keeper variable to cache the state? Now we are doing an extra state hit all the time. Once the response is true, we can cache it in the Keeper private variable (eg k.initialized
).
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.
Sure, but note this is a read to an in-memory store, so it's not nearly as expensive as an I/O read. Maybe caching with private variable will be a bit faster so I can do this if desired
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.
right, I made this automatic by looking at the code. I think it's "nice to have"
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
…k into aditya/backport-cap-fix
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.
utACK. Thanks for updates Aditya
…9845) ## Description + Backported go doc comment updates from #9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog --- ### 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... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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)
…9845) ## Description + Backported go doc comment updates from #9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog --- ### 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... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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) (cherry picked from commit bdf5aee) # Conflicts: # CHANGELOG.md # x/capability/keeper/keeper.go # x/capability/module.go
* implement BeginBlock fix * add changelog * fix lint * address reviews * Update CHANGELOG.md Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> * address reviews * Apply suggestions from code review Co-authored-by: Robert Zaremba <robert@zaremba.ch> * move store check * add api breaking changelog * fix lint Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Robert Zaremba <robert@zaremba.ch>
…ackport #9845) (#9846) * style(capability)!: update go doc comments and remove BeginBlocker (#9845) ## Description + Backported go doc comment updates from #9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog --- ### 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... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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) (cherry picked from commit bdf5aee) # Conflicts: # CHANGELOG.md # x/capability/keeper/keeper.go # x/capability/module.go * solve conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
…ackport #9845) (#9846) * style(capability)!: update go doc comments and remove BeginBlocker (#9845) ## Description + Backported go doc comment updates from cosmos/cosmos-sdk#9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog
…ackport #9845) (#9846) * style(capability)!: update go doc comments and remove BeginBlocker (#9845) ## Description + Backported go doc comment updates from cosmos/cosmos-sdk#9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog
…ackport cosmos#9845) (cosmos#9846) * style(capability)!: update go doc comments and remove BeginBlocker (cosmos#9845) ## Description + Backported go doc comment updates from cosmos#9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog --- ### 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... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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) (cherry picked from commit bdf5aee) # Conflicts: # CHANGELOG.md # x/capability/keeper/keeper.go # x/capability/module.go * solve conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
…ackport cosmos#9845) (cosmos#9846) * style(capability)!: update go doc comments and remove BeginBlocker (cosmos#9845) ## Description + Backported go doc comment updates from cosmos#9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog --- ### 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... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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) (cherry picked from commit bdf5aee) # Conflicts: # CHANGELOG.md # x/capability/keeper/keeper.go # x/capability/module.go * solve conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
* docs: add v0.43 release version option (backport cosmos#9506) (cosmos#9677) * docs: add v0.43 version option (cosmos#9506) Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com> (cherry picked from commit 325dabd) # Conflicts: # docs/versions * fix conflicts Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: Amaury M <1293565+amaurym@users.noreply.github.com> * chore: Add missing entry in 0.42.7 Changelog (cosmos#9722) * fix: support output flag on tx commands (backport cosmos#9717) (cosmos#9772) * fix: support output flag on tx commands (cosmos#9717) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Closes: cosmos#9684 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> * feat: Query txs by signature and by address+seq (backport cosmos#9750) (cosmos#9783) * feat: Query txs by signature and by address+seq (cosmos#9750) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Closes: cosmos#9741 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> * fix: hardcoded ledger algo on `keys add` (backport cosmos#9766) (cosmos#9804) * fix: hardcoded ledger algo on `keys add` (cosmos#9766) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Closes: cosmos#9734 cc: @jleni <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> * chore: Add Changelog and Release Notes for v0.42.8 (cosmos#9807) * chore: Add Changelog and Release Notes for v0.42.8 * Change date * feat: Improve withdraw-all-rewards UX (backport cosmos#9781) (cosmos#9825) * feat: Improve withdraw-all-rewards UX (cosmos#9781) ## Description Related to cosmos#9489, this PR improves the UX when using the `withdraw-all-rewards` command by forcing the broadcast mode to `block` if the chunk size is greater than 0. This will ensure that the transactions do not fail even if the user uses invalid broadcast modes for this command (`sync` and `async`). * fix: Capability Issue on Restart, Backport to v0.42 (cosmos#9835) * implement BeginBlock fix * add changelog * fix lint * address reviews * Update CHANGELOG.md Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> * address reviews * Apply suggestions from code review Co-authored-by: Robert Zaremba <robert@zaremba.ch> * move store check * add api breaking changelog * fix lint Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Robert Zaremba <robert@zaremba.ch> * Fixed the --recover flag not working properly inside the init command (cosmos#9201) (cosmos#9850) Co-authored-by: Alessio Treglia <alessio@tendermint.com> (cherry picked from commit fdbc32e) Co-authored-by: Riccardo Montagnin <riccardo.montagnin@gmail.com> * chore: prepare 0.42.9 release (cosmos#9852) * prepare 0.42.9 release * add 9201 to changelog Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: Amaury M <1293565+amaurym@users.noreply.github.com> Co-authored-by: Aditya <adityasripal@gmail.com> Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Robert Zaremba <robert@zaremba.ch> Co-authored-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
…ackport #9845) (#9846) * style(capability)!: update go doc comments and remove BeginBlocker (#9845) ## Description + Backported go doc comment updates from cosmos/cosmos-sdk#9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog
…ackport cosmos#9845) (cosmos#9846) * style(capability)!: update go doc comments and remove BeginBlocker (cosmos#9845) ## Description + Backported go doc comment updates from cosmos#9835 + Removed BeginBlocker function which only wraps the `InitMemStore` -> https://github.com/cosmos/cosmos-sdk/pull/9835/files#r681987005 -- this is not a breaking change because RC3 was not yet released. + Updated changelog --- ### 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... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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) (cherry picked from commit bdf5aee) # Conflicts: # CHANGELOG.md # x/capability/keeper/keeper.go # x/capability/module.go * solve conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Description
Closes: #9800
This PR fixes the issue explained in #9800 . The previous was bug happened because initialization logic was put in first transaction execution pipeline, and initialized state got reverted if the first capability tx to run the initialization logic got reverted.
This PR fixes the problem by moving the initialized flag from a global variable in the binary, to a flag in the memory store. It gets set once the capabilities have been correctly initialized which will happen either on
InitChain
(in case of genesis start). Or inBeginBlock
(regular restart/upgrade with upgrade module/statesync)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