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 indexing bug #76

Merged
merged 3 commits into from
May 12, 2022
Merged

Fix indexing bug #76

merged 3 commits into from
May 12, 2022

Conversation

hanjukim
Copy link

@hanjukim hanjukim commented May 11, 2022

Description

This PR addresses the problem of overwriting the txhash index of successful transactions with failed transactions in later blocks. In such case, txhash query will return failed transaction.

Example case:
https://lcd.terra.dev/cosmos/tx/v1beta1/txs/6053BE407FFBCAC836AA94C6D7A7A81C7655A138D112C3DD2F46496FCB98FBE4

The above tx was indexed at height 7573592. However, we have a successful transaction with the same txhash.
https://check-tx.vercel.app/api/check-tx?height=7571561&txhash=6053BE407FFBCAC836AA94C6D7A7A81C7655A138D112C3DD2F46496FCB98FBE4

@yihuang
Copy link

yihuang commented May 16, 2022

is there a plan to push this fix to upstream?

creachadair pushed a commit to tendermint/tendermint that referenced this pull request Jun 30, 2022
Port the bug fix terra-money#76 to upstream. This is critical for ethermint json-rpc to work.

fix: prevent duplicate tx index if it succeeded before
fix: use CodeTypeOk instead of 0
fix: handle duplicate txs within the same block
Co-authored-by: jess [email protected]

ref: #5281
yihuang added a commit to yihuang/tendermint that referenced this pull request Jul 6, 2022
…tendermint#8625)

Port the bug fix terra-money#76 to upstream. This is critical for ethermint json-rpc to work.

fix: prevent duplicate tx index if it succeeded before
fix: use CodeTypeOk instead of 0
fix: handle duplicate txs within the same block
Co-authored-by: jess [email protected]

ref: tendermint#5281
tychoish pushed a commit to tendermint/tendermint that referenced this pull request Jul 6, 2022
…#8625) (#8945)

Port the bug fix terra-money#76 to upstream. This is critical for ethermint json-rpc to work.

fix: prevent duplicate tx index if it succeeded before
fix: use CodeTypeOk instead of 0
fix: handle duplicate txs within the same block
Co-authored-by: jess [email protected]

ref: #5281

Co-authored-by: M. J. Fromberger <[email protected]>
mergify bot pushed a commit to tendermint/tendermint that referenced this pull request Jul 6, 2022
…#8625) (#8945)

Port the bug fix terra-money#76 to upstream. This is critical for ethermint json-rpc to work.

fix: prevent duplicate tx index if it succeeded before
fix: use CodeTypeOk instead of 0
fix: handle duplicate txs within the same block
Co-authored-by: jess [email protected]

ref: #5281

Co-authored-by: M. J. Fromberger <[email protected]>
(cherry picked from commit be6d74e)

# Conflicts:
#	CHANGELOG_PENDING.md
#	internal/state/indexer/indexer_service.go
mergify bot pushed a commit to tendermint/tendermint that referenced this pull request Jul 6, 2022
…#8625) (#8945)

Port the bug fix terra-money#76 to upstream. This is critical for ethermint json-rpc to work.

fix: prevent duplicate tx index if it succeeded before
fix: use CodeTypeOk instead of 0
fix: handle duplicate txs within the same block
Co-authored-by: jess [email protected]

ref: #5281

Co-authored-by: M. J. Fromberger <[email protected]>
(cherry picked from commit be6d74e)
tychoish pushed a commit to tendermint/tendermint that referenced this pull request Jul 6, 2022
…#8625) (#8945) (#8951)

Port the bug fix terra-money#76 to upstream. This is critical for ethermint json-rpc to work.

fix: prevent duplicate tx index if it succeeded before
fix: use CodeTypeOk instead of 0
fix: handle duplicate txs within the same block
Co-authored-by: jess [email protected]

ref: #5281

Co-authored-by: M. J. Fromberger <[email protected]>
(cherry picked from commit be6d74e)

Co-authored-by: yihuang <[email protected]>
inon-man added a commit to classic-terra/tendermint that referenced this pull request Feb 28, 2023
javiersuweijie pushed a commit that referenced this pull request Mar 16, 2023
* Bugfixes in range queries and result deduplication

* Refactored code to clean up cases where height conditions are the only ones existing; fixed tests

Co-authored-by: Thane Thomson <[email protected]>


* Append match.events=0 if RPC flag is missing

Co-authored-by: Sergio Mena <[email protected]>

Big thanks to @sergio-mena  for the extra UTs and @thanethomson  for the discussions related to this. 
---------

Co-authored-by: Thane Thomson <[email protected]>
Co-authored-by: Sergio Mena <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants