Skip to content

chore(state): Copy Iterator Key() and Value() APIs return values. (backport #3541)#3598

Merged
alesforz merged 1 commit intov1.xfrom
mergify/bp/v1.x/pr-3541
Jul 31, 2024
Merged

chore(state): Copy Iterator Key() and Value() APIs return values. (backport #3541)#3598
alesforz merged 1 commit intov1.xfrom
mergify/bp/v1.x/pr-3541

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Jul 31, 2024

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

  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments
  • Title follows the Conventional Commits spec

This is an automatic backport of pull request #3541 done by [Mergify](https://mergify.com).

…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)
@mergify mergify bot requested a review from a team as a code owner July 31, 2024 13:23
@mergify mergify bot requested a review from a team July 31, 2024 13:23
@alesforz alesforz self-assigned this Jul 31, 2024
@alesforz alesforz added the chore label Jul 31, 2024
@alesforz alesforz merged commit da6365b into v1.x Jul 31, 2024
@alesforz alesforz deleted the mergify/bp/v1.x/pr-3541 branch July 31, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant