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

Index malleated transactions properly #612

Merged
merged 8 commits into from
Jan 21, 2022

Conversation

evan-forbes
Copy link
Member

Description

Simple PR to utilize the malleated/original transaction scheme used in #582 and #607 to index malleated transaction by the hash of the original transaction. This allows for querying the transaction using the original hash, instead of the hash of the transaction that actually ends up on chain

@evan-forbes evan-forbes self-assigned this Jan 19, 2022
@evan-forbes evan-forbes removed the request for review from tac0turtle January 19, 2022 01:19
@rach-id
Copy link
Member

rach-id commented Jan 19, 2022

@evan-forbes Should we build a new node depending on this change and test the query ?

@evan-forbes
Copy link
Member Author

evan-forbes commented Jan 19, 2022

Should we build a new node depending on this change and test the query?

yeah, we can. I should also look for a more integrated way to test before merging

@evan-forbes evan-forbes marked this pull request as draft January 19, 2022 21:07
@evan-forbes
Copy link
Member Author

After writing an integration test in the app, I found out that without further modification, the method of unwrapping the tx to get the original tx won't work.

still working on a different solution atm, so I'm marking this as a draft as it should not yet be merged

Copy link
Member Author

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

alrighty, got it working faster than I thought I would. There's an integration test in the app that submits a WirePayForMessage and then attempts to query for the transaction using the original tx hash.

PS: the proto linter is breaking for the typical reasons of our version of tendermint not using v1.0 of buf

#188

@@ -338,6 +338,7 @@ message TxResult {
uint32 index = 2;
bytes tx = 3;
ResponseDeliverTx result = 4 [(gogoproto.nullable) = false];
bytes original_hash = 5;
Copy link
Member Author

Choose a reason for hiding this comment

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

I modified abci.TxResult to include the original hash if the tx is malleated. This saves us from having to attempt to unwrap the malleated tx more than once. Alternatively, we could not cache the original hash, and unwrap the malleated transaction more than once.

Copy link
Member

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Is this test app CI supposed to fail?

@evan-forbes
Copy link
Member Author

Is this test app CI supposed to fail?

looking into this

return ResponsePreprocessTxs{}
return ResponsePreprocessTxs{Txs: req.Txs}
Copy link
Member Author

@evan-forbes evan-forbes Jan 21, 2022

Choose a reason for hiding this comment

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

this took entirely too long to debug... not that it matters too much cause upstream removed these tests in #6685 😆 🙃

app tests should be fixed

@evan-forbes evan-forbes merged commit 863a00a into v0.34.x-celestia Jan 21, 2022
@evan-forbes evan-forbes deleted the evan/index-tx-by-hash branch January 21, 2022 13:16
evan-forbes added a commit that referenced this pull request Apr 28, 2022
* index malleated transactions properly

* linter

* fix malleated transaction indexing and event tracking

* fix malleated event test

* fix test

* fix other test

* update proto building and formatting to use the latest tendermint specs style generation and formatting

* fix app tests
evan-forbes added a commit that referenced this pull request May 3, 2022
* index malleated transactions properly

* linter

* fix malleated transaction indexing and event tracking

* fix malleated event test

* fix test

* fix other test

* update proto building and formatting to use the latest tendermint specs style generation and formatting

* fix app tests

linter

fix max size tests
evan-forbes added a commit that referenced this pull request May 3, 2022
* index malleated transactions properly

* linter

* fix malleated transaction indexing and event tracking

* fix malleated event test

* fix test

* fix other test

* update proto building and formatting to use the latest tendermint specs style generation and formatting

* fix app tests

linter

fix max size tests
evan-forbes added a commit that referenced this pull request May 3, 2022
* index malleated transactions properly

* linter

* fix malleated transaction indexing and event tracking

* fix malleated event test

* fix test

* fix other test

* update proto building and formatting to use the latest tendermint specs style generation and formatting

* fix app tests

linter

fix max size tests
williambanfield pushed a commit to interchainio/celestia-core that referenced this pull request Jul 14, 2022
* index malleated transactions properly

* linter

* fix malleated transaction indexing and event tracking

* fix malleated event test

* fix test

* fix other test

* update proto building and formatting to use the latest tendermint specs style generation and formatting

* fix app tests

linter

fix max size tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants