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

enhancement: store raw data for unknown transaction kinds in order to capture them so they can be parsed later #183

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

joel-u410
Copy link
Contributor

@joel-u410 joel-u410 commented Dec 6, 2024

This changes the behavior for unknown transaction kinds so that they capture the underlying raw data into the data column, allowing later analysis & possible parsing in the future without losing necessary data that might get pruned from the node.

Additionally, I've added all existing wasms from the namada-sdk to the checksums, so that even if they aren't supported yet in the transaction indexer as a known kind, they will at least identify their name.

Finally, here I've introduced on_conflict when inserting inner_transactions and wrapper_transactions to make it quite a bit easier to perform some maintenance on an indexer database by simply updating the last_processed_block in crawler_state and running transactions to re-crawl them. (In the future, this could be improved even more by offering a command-line option to re-crawl specific blocks.)

TX_DEACTIVATE_VALIDATOR_WASM.to_string(),
TX_REACTIVATE_VALIDATOR_WASM.to_string(),
TX_UPDATE_ACCOUNT_WASM.to_string(),
VP_USER_WASM.to_string(),
Copy link
Member

@Fraccaman Fraccaman Dec 9, 2024

Choose a reason for hiding this comment

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

i think we can remove this one (I mean VP_USER_WASM)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah sounds good, I can remove -- I had just blindly added all the wasms I found in namada-sdk but yeah it makes sense that we only need the tx_ ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know of a way to dynamically query the node for all its wasms without knowing their names ahead of time? I was hoping to do that (like what namadac join-network does) but it seemed like there wasn't any good way to do it unfortunately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just updated to remove the VP_USER_WASM

Copy link
Member

Choose a reason for hiding this comment

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

good idea! we might be able to do that but lets keep it as a refactor for later :)

@joel-u410 joel-u410 force-pushed the joel/record-unknown-tx-type-name branch from 1547377 to 97a64ff Compare December 9, 2024 17:58
@Fraccaman Fraccaman added this pull request to the merge queue Dec 10, 2024
Merged via the queue into anoma:main with commit b763c29 Dec 10, 2024
8 checks passed
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.

2 participants