Fix account_transactions silently dropping BlockEpilogue write-sets - #65
Open
sausagee wants to merge 2 commits into
Open
Fix account_transactions silently dropping BlockEpilogue write-sets#65sausagee wants to merge 2 commits into
sausagee wants to merge 2 commits into
Conversation
BlockEpilogue (and other non-User/Genesis/BlockMetadata/Validator types) returned an empty account set before walking transaction_info.changes. Epilogues write resources such as 0x1::block::BlockResource, so those accounts were never indexed. Walk write-set resource accounts for every txn type; only events and signatures remain type-specific. Co-authored-by: Young Yang Liauw <sausagee@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
AccountTransaction::get_accountsreturned an empty set forTxnData::BlockEpilogue(andStateCheckpoint) before walkingtransaction_info.changes. Block epilogues write resources — e.g.0x1::block::BlockResource— so those accounts never appeared inaccount_transactions.This is a silent skip, not a crash. Distinct from #58, which only fixed the parquet default processor's
Transaction::from_transactionpath (write_set_changes/move_resources). This is theaccount_transactionsprocessor / table.Not covered by open PRs #16–#64.
Root cause
The match on
txn_datatreated anything other than User / Genesis / BlockMetadata / Validator as “no accounts” and returned immediately. Events and signatures are type-specific; write-set resource accounts are not.Fix
Keep events/signatures type-specific. Always walk write-set
WriteResource/DeleteResourceaddresses so epilogue (and other change-bearing) txns are indexed.Tests
cargo test -p processor --lib processors::account_transactions::account_transactions_model::tests::block_epilogue_indexes_write_set_accounts— okcargo clippy -p processor --lib -- -A clippy::all -W clippy::correctness— cleanAikido scan was not run: the Aikido MCP requires an interactive sign-in that is not available in this environment.