Skip to content

fix(state/indexer): copy value#4321

Merged
mergify[bot] merged 3 commits intov0.38.xfrom
4295-tx-indexer
Oct 24, 2024
Merged

fix(state/indexer): copy value#4321
mergify[bot] merged 3 commits intov0.38.xfrom
4295-tx-indexer

Conversation

@melekes
Copy link
Collaborator

@melekes melekes commented Oct 23, 2024

Because, in cometbft-db v0.13+, the iterator is being reused so we need to always copy key and value if we're storing them in a map or other in-memory structure.

Closes #4295

Because, in cometbft-db v0.13+, the iterator is being reused so we need
to always copy key and value if we're storing them in a map or other
in-memory structure.

Closes #4295
Copy link
Collaborator

@andynog andynog left a comment

Choose a reason for hiding this comment

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

The changes look good to me. I've performed some local testing with the kvstore and before I was only getting one event from tx_search using goleveldb backend, but now I get multiple evens as expected. So seems to be fixed.

But I there is a go vulnerability check that is failing in CI, I don't get it running make vulncheck on my local machine though.

@andynog andynog added this to the 2024-Q4 milestone Oct 23, 2024
@melekes
Copy link
Collaborator Author

melekes commented Oct 24, 2024

This patch was also verified by the Noble team ✅

@mergify mergify bot merged commit 2fee473 into v0.38.x Oct 24, 2024
@mergify mergify bot deleted the 4295-tx-indexer branch October 24, 2024 07:33
mergify bot pushed a commit that referenced this pull request Oct 24, 2024
Because, in cometbft-db v0.13+, the iterator is being reused so we need
to always copy key and value if we're storing them in a map or other
in-memory structure.

Closes #4295

(cherry picked from commit 2fee473)

# Conflicts:
#	go.sum
#	state/txindex/kv/kv.go
@melekes
Copy link
Collaborator Author

melekes commented Oct 24, 2024

@mergify backport v0.37.x

@mergify
Copy link
Contributor

mergify bot commented Oct 24, 2024

backport v0.37.x

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Oct 24, 2024
Because, in cometbft-db v0.13+, the iterator is being reused so we need
to always copy key and value if we're storing them in a map or other
in-memory structure.

Closes #4295

(cherry picked from commit 2fee473)

# Conflicts:
#	go.mod
#	go.sum
#	test/e2e/docker/Dockerfile
mergify bot added a commit that referenced this pull request Oct 24, 2024
Because, in cometbft-db v0.13+, the iterator is being reused so we need
to always copy key and value if we're storing them in a map or other
in-memory structure.

Closes #4295
<hr>This is an automatic backport of pull request #4321 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
mergify bot added a commit that referenced this pull request Oct 24, 2024
Because, in cometbft-db v0.13+, the iterator is being reused so we need
to always copy key and value if we're storing them in a map or other
in-memory structure.

Closes #4295
<hr>This is an automatic backport of pull request #4321 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants