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: state listener could observe discarded writes #13459

Merged
merged 6 commits into from Oct 6, 2022

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Oct 6, 2022

Description

Closes: #13457

don't pass listeners to nested cache store,
only the most inner layer's cache writes should be observed.


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
  • 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)

Closes: cosmos#13457

don't pass listeners to nested cached store,
only the most inner layer's cache writes should be observed.
@yihuang yihuang requested a review from a team as a code owner October 6, 2022 06:52
CHANGELOG.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Merging #13459 (4b9a62d) into main (90bd316) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13459      +/-   ##
==========================================
- Coverage   53.87%   53.83%   -0.04%     
==========================================
  Files         641      641              
  Lines       55031    55034       +3     
==========================================
- Hits        29647    29628      -19     
- Misses      23001    23025      +24     
+ Partials     2383     2381       -2     
Impacted Files Coverage Δ
store/cachemulti/store.go 9.30% <0.00%> (-0.34%) ⬇️
x/distribution/simulation/operations.go 80.64% <0.00%> (-9.68%) ⬇️
x/group/keeper/keeper.go 56.25% <0.00%> (-0.40%) ⬇️

@yihuang yihuang changed the title fix: state listener could observe uncommitted writes fix: state listener could observe discarded writes Oct 6, 2022
@yihuang yihuang added backport/0.45.x backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release labels Oct 6, 2022
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK

@tac0turtle tac0turtle enabled auto-merge (squash) October 6, 2022 11:27
@tac0turtle tac0turtle merged commit bb54c59 into cosmos:main Oct 6, 2022
mergify bot pushed a commit that referenced this pull request Oct 6, 2022
* fix: state listener could observe uncommitted writes

Closes: #13457

don't pass listeners to nested cached store,
only the most inner layer's cache writes should be observed.

* Update CHANGELOG.md

* add unit test

* rename

Co-authored-by: Marko <marbar3778@yahoo.com>
(cherry picked from commit bb54c59)

# Conflicts:
#	CHANGELOG.md
mergify bot pushed a commit that referenced this pull request Oct 6, 2022
* fix: state listener could observe uncommitted writes

Closes: #13457

don't pass listeners to nested cached store,
only the most inner layer's cache writes should be observed.

* Update CHANGELOG.md

* add unit test

* rename

Co-authored-by: Marko <marbar3778@yahoo.com>
(cherry picked from commit bb54c59)

# Conflicts:
#	CHANGELOG.md
tac0turtle pushed a commit that referenced this pull request Oct 6, 2022
…13462)

* fix: state listener could observe discarded writes (#13459)

* fix: state listener could observe uncommitted writes

Closes: #13457

don't pass listeners to nested cached store,
only the most inner layer's cache writes should be observed.

* Update CHANGELOG.md

* add unit test

* rename

Co-authored-by: Marko <marbar3778@yahoo.com>
(cherry picked from commit bb54c59)

# Conflicts:
#	CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
tac0turtle added a commit that referenced this pull request Oct 9, 2022
…13463)

* fix: state listener could observe discarded writes (#13459)

* fix: state listener could observe uncommitted writes

Closes: #13457

don't pass listeners to nested cached store,
only the most inner layer's cache writes should be observed.

* Update CHANGELOG.md

* add unit test

* rename

Co-authored-by: Marko <marbar3778@yahoo.com>
(cherry picked from commit bb54c59)

# Conflicts:
#	CHANGELOG.md

* fixes

* gofumpt

* gofumpt

* updates

Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Wryhder pushed a commit to Wryhder/cosmos-sdk that referenced this pull request Oct 26, 2022
* fix: state listener could observe uncommitted writes

Closes: cosmos#13457

don't pass listeners to nested cached store,
only the most inner layer's cache writes should be observed.

* Update CHANGELOG.md

* add unit test

* rename

Co-authored-by: Marko <marbar3778@yahoo.com>
MissingNO57 added a commit to fetchai/cosmos-sdk that referenced this pull request Nov 30, 2022
## v0.45.9 - 2022-10-14

ATTENTION:

This is a security release for the 
[Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702). 

All users should upgrade immediately.

Users *must* add a replace directive in their go.mod for the
new `ics23` package in the SDK:

```
replace (
    github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23
)

```

### Features

* [#13435](cosmos/cosmos-sdk#13435) Extend error context when a simulation fails.

### Improvements

* [#13369](cosmos/cosmos-sdk#13369) Improve UX for `keyring.List` by returning all retrieved keys.
* [#13323](cosmos/cosmos-sdk#13323) Ensure `withdraw_rewards` rewards are emitted from all actions that result in rewards being withdrawn.
* [#13321](cosmos/cosmos-sdk#13321) Add flag to disable fast node migration and usage.
* (store) [#13326](cosmos/cosmos-sdk#13326) Implementation of ADR-038 file StreamingService, backport #8664.
* (store) [#13540](cosmos/cosmos-sdk#13540) Default fastnode migration to false to prevent suprises. Operators must enable it, unless they have it enabled already. 

### API Breaking Changes

* (cli) [#13089](cosmos/cosmos-sdk#13089) Fix rollback command don't actually delete multistore versions, added method `RollbackToVersion` to interface `CommitMultiStore` and added method `CommitMultiStore` to `Application` interface.

### Bug Fixes

* [#...](https://github.com/cosmos/cosmos-sdk/pull/) Implement dragonberry security patch.
  * For applying the patch please refer to the [RELEASE NOTES](./RELEASE_NOTES.md)
* (store) [#13459](cosmos/cosmos-sdk#13459) Don't let state listener observe the uncommitted writes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release C:Store
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adr-038 state listener could observe uncommitted writes
3 participants