-
Notifications
You must be signed in to change notification settings - Fork 539
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
chore(state): Copy Iterator
Key()
and Value()
APIs return values.
#3541
Conversation
If/when this is ready for review, please hit the "ready for review" button |
884c0c9
to
e28659f
Compare
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.
Thanks @alesforz ❤️
This PR should also bump cometbft-db version imho.
Shouldn't we first bump the Go version of cometBFT to 1.22.5, i.e., the same version that the latest cometbft-db uses? |
yes |
…e() returned object". Copying the Iterator.Value() object is unnecessary here. This reverts commit 9df0d8b.
898bb22
to
0bff6b2
Compare
There is now a separate PR bumping cometbft-db version. |
…s. (#3541) Related to cometbft/cometbft-db#168. #### Changes We recently updated cometbft-db `Iterator` type `Key()` and `Value()` APIs to return their values directly instead of a copy. Therefore, this PR ensures that code in cometbft that modifies or stores references to the return value of those APIs creates a copy before continuing. --- #### PR checklist ~- [ ] Tests written/updated~ - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec (cherry picked from commit 3be35f0)
…s. (backport #3541) (#3598) Related to cometbft/cometbft-db#168. #### Changes We recently updated cometbft-db `Iterator` type `Key()` and `Value()` APIs to return their values directly instead of a copy. Therefore, this PR ensures that code in cometbft that modifies or stores references to the return value of those APIs creates a copy before continuing. --- #### PR checklist ~- [ ] Tests written/updated~ - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #3541 done by [Mergify](https://mergify.com). Co-authored-by: Alessandro Sforzin <[email protected]>
Related to cometbft/cometbft-db#168.
Changes
We recently updated cometbft-db
Iterator
typeKey()
andValue()
APIs to return their values directly instead of a copy.Therefore, this PR ensures that code in cometbft that modifies or stores references to the return value of those APIs creates a copy before continuing.
PR checklist
- [ ] Tests written/updated.changelog
(we use unclog to manage our changelog)docs/
orspec/
) and code comments