-
Notifications
You must be signed in to change notification settings - Fork 51
Fix system transaction result indexing & event block/transaction indices #907
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
Conversation
da93d56 to
1b8ed8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes inaccuracies in system transaction result indexing by introducing composite keys (blockID + txID) for storage and retrieval. This resolves issues where system transactions with duplicate IDs across blocks would overwrite each other's results. Additionally, the PR corrects event block/transaction indices to ensure each system transaction receives a unique sequential index.
Key changes:
- System transaction results now stored with composite keys (blockID, txID) instead of txID alone
- System transaction indices are now computed sequentially after user transactions
- Refactored
CommitBlockto separate system transactions from regular transactions in storage
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| storage/store.go | Added SystemTransactionResultByID method and composite key generation; refactored CommitBlock signature to accept separate system transaction parameters |
| storage/mocks/store.go | Updated mock methods to match new CommitBlock and SystemTransactionResultByID signatures |
| storage/memstore/memstore.go | Added in-memory storage for system transaction results with composite keys; updated CommitBlock implementation |
| storage/checkpoint/checkpoint.go | Updated CommitBlock call with additional nil parameters for system transactions |
| emulator/system_transaction_test.go | Added comprehensive tests verifying system transaction events and unique transaction indices |
| emulator/blockchain.go | Refactored system transaction execution to assign correct sequential indices; updated result retrieval to use composite keys |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
#911) * Initial plan * Improve comment clarity for system chunk transaction index calculation Co-authored-by: jribbink <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jribbink <[email protected]>
Closes #903
Description
Fixes inaccuracies in the scheduled/system tx result indexing.
For contributor use:
masterbranchFiles changedin the GitHub PR explorer