-
Notifications
You must be signed in to change notification settings - Fork 384
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: expose InitChain tx responses #1941
Conversation
b190ec1
to
9ed4da1
Compare
Signed-off-by: Norman Meier <[email protected]>
9ed4da1
to
7be8225
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1941 +/- ##
=======================================
Coverage 55.01% 55.01%
=======================================
Files 595 595
Lines 79731 79744 +13
=======================================
+ Hits 43861 43871 +10
- Misses 32552 32555 +3
Partials 3318 3318
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Is this common on other blockchains? I have concerns about the size of the response generated. I see advantages in having this new information, but I also think that it could be OK to just consider that "the genesis is there, and we don't need to know how." |
I don't know if it's common in other blockchains but in order to index the portal loop we need to get the genesis transactions results otherwise indexers can't restore their state after a portal loop upgrade since the previous version transactions are embedded in genesis |
The Portal Loop isn't ideal for indexers. Indexers should focus on networks like test3 and test4. If we can enhance the Portal Loop to benefit other uses, we're open to it. Share how improving it could help beyond just the Portal Loop. Related with #1791. |
Hey @n0izn0iz, the Portal Loop is a bit specific when it comes to the way it works. It is not fully persistent will the way it handles state, and it can prove difficult to try and index it. We discussed this with Berty as well - we can either 1. add a way to fetch genesis transactions, 2. think of a different solution to index the Portal Loop. I'll bring this up on the engineer meeting today. |
I also think it's important for other networks What happens if you add a package in genesis that creates a grc20 token and want to index a "grc20.created" event, or "users.registered" events or dao membership history (some daos will probably be seeded in genesis, no?) IMO there is many cases where it's desired to not have to extract this information in two ways (one for post-genesis-state via state inspection and one for regular txs via events) but instead run the same logic for all txs #all_txs_are_equal 🙅🏽♂️ Maybe adding a gnoland subcommand to generate genesis result could be a way? |
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.
I'm a bit late to the party 🙏
I like this approach, and I think it works fine, but I think we can do even better -- please check out my leftover comments regarding data saves
Signed-off-by: Norman Meier <[email protected]>
Signed-off-by: Norman Meier <[email protected]>
Signed-off-by: Norman Meier <[email protected]>
97733cb
to
e4dd0f6
Compare
sorry for the push --force, I push-forced again to restore history before squash |
Signed-off-by: Norman Meier <[email protected]>
What about a server starting with a quick sync snapshot, beginning at block 1M? |
The Genesis file is approximately 700MB on test3. |
I don't understand the question
The full genesis goes in the ABCI protocol and it can be fetched from the api currently. I don't understand why we couldn't return and expose the results also |
What happens when someone starts at block 1M instead of block 0? Will your virtual block 1M differ from other nodes that started from an earlier genesis? Could you add a test to expose this case for a chain starting with a sync snapshot?
I think I don't fully understand the purpose of this PR. Could someone please explain the different elements (genesis, virtual block 0, and upcoming blocks) and how they are affected by this PR, perhaps with a visual schema? |
Signed-off-by: Norman Meier <[email protected]>
Signed-off-by: Norman Meier <[email protected]>
Signed-off-by: Norman Meier <[email protected]>
How could I start at block 1M? I don't see a
The way a tendermint chain is initialized is through the The in-memory Currently, the result of these transactions is lost, this is very annoying for indexing as, among other things, you loose events from those transactions. This PR returns the result of these genesis transactions in the These results are stored as belonging to |
Signed-off-by: Norman Meier <[email protected]>
Signed-off-by: Norman Meier <[email protected]>
Co-authored-by: Morgan <[email protected]>
❤️ |
Save and allow to fetch genesis txs responses ### Before ``` ❯ curl 'http://127.0.0.1:26657/block_results?height=0' -s | head -n 20 { "jsonrpc": "2.0", "id": "", "error": { "code": -32603, "message": "Internal error", "data": "height must be greater than 0" } } ``` ### After ``` ❯ curl 'http://127.0.0.1:26657/block_results?height=0' -s | head -n 20 { "jsonrpc": "2.0", "id": "", "result": { "height": "0", "results": { "deliver_tx": [ { "ResponseBase": { "Error": null, "Data": null, "Events": null, "Log": "msg:0,success:true,log:,events:[]", "Info": "" }, "GasWanted": "50000", "GasUsed": "240261825" }, { "ResponseBase": { ``` <details><summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] 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> --------- Signed-off-by: Norman Meier <[email protected]> Co-authored-by: Morgan <[email protected]>
Save and allow to fetch genesis txs responses
Before
After
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description