-
Notifications
You must be signed in to change notification settings - Fork 388
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
feat(tm2): store tx results and add endpoint to query them #1546
feat(tm2): store tx results and add endpoint to query them #1546
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1546 +/- ##
==========================================
+ Coverage 45.10% 47.78% +2.67%
==========================================
Files 464 393 -71
Lines 68039 61608 -6431
==========================================
- Hits 30689 29437 -1252
+ Misses 34774 29701 -5073
+ Partials 2576 2470 -106 ☔ View full report in Codecov by Sentry. |
I've added tx result support for the Gno RPC in this PR, both for regular calls and for clients |
Ping @ajnavarro @gfanton @thehowl for visibility |
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.
nits & q's, lgtm
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.
The changes LGTM, but I have one question:
Transactions and blocks are not stored using the same transaction, so we might have eventually inconsistencies between blocks and transactions stored. Is that a problem?
I wish I could give you a better answer to this question, but in order for that to happen I'd need to untangle the mess that is our block building logic, something I'm tackling with @petar-dambovaliev in a separate effort. We save ABCI results as part of I'm assuming (hoping, really) that |
I think after addressing the |
Pinging @ajnavarro and @gfanton for a second screen 🙏 |
Update on this PR: I've spoken internally with @ajnavarro and we agreed a much leaner option would be to store the tx hash -> block number / tx index mapping, rather than tx hash -> tx result, just because it keeps the DB footprint minimal, and we can always reconstruct the result from the state on the fly I'll update this PR accordingly 🙏 |
I've updated the index: Now, instead of
the mapping is:
and the actual RPC endpoint digs this out of the DB and constructs the response type, so we're avoiding double saves |
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.
LGTM 👍
) ## Description This PR introduces saving transaction results (execution results) in the node's state DB, and serving them over the node's RPC endpoint (`tx`). <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
Description
This PR introduces saving transaction results (execution results) in the node's state DB, and serving them over the node's RPC endpoint (
tx
).Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description