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

chore: optimize tx fetching #969

Merged
merged 7 commits into from
Jun 2, 2023
Merged

Conversation

ra0x3
Copy link
Contributor

@ra0x3 ra0x3 commented Jun 2, 2023

  • Please add proper labels
  • If there is an issue associated with this PR, please link the issue (right-hand sidebar)
  • If there is not an issue associated with this PR, add this PR to the "Fuel Indexer" project (right-hand sidebar)

Description

  • Optimized TX fetching per @xgreenx
  • The BlockData looks like:

BlockData { height: 28, id: 2007426b9299e10db4ff01d8d9045d002707bf398e200171bc6725e0b67a6a80, header: Header { id: 2007426b9299e10db4ff01d8d9045d002707bf398e200171bc6725e0b67a6a80, da_height: 8632717, transactions_count: 1, output_messages_count: 0, transactions_root: bd88b13585efa030b8b81256d7905418b2b58abba31c496426127be6c1dd4a4f, output_messages_root: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, height: 28, prev_root: 07115dec08253999e2e4c24bd20353f0731107d38858f24fa3a593c2505761fd, time: 1678485391, application_hash: c4889b20748aeebaa60dca18fa37e375667dafccfc0ba59eb3886d1ee290c5e2 }, producer: Some(f65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871), time: 1678485391, consensus: PoA(PoA { signature: a8674e5fb86b32e98a903e1bc04d3484abde2dd93c815766fe4af4ab68eab4229ef47e1a668a4804dff1d9f9726b1800c2d98f1890e712db18fc8f2f13790bb3 }), transactions: [TransactionData { transaction: Script(Script { gas_price: 0, gas_limit: 0, maturity: 0, script: [], script_data: [], inputs: [], outputs: [], witnesses: [], receipts_root: 0000000000000000000000000000000000000000000000000000000000000000, metadata: None }), status: Success { block: 2007426b9299e10db4ff01d8d9045d002707bf398e200171bc6725e0b67a6a80, time: 1678485391, program_state: None }, receipts: [], id: c3a279eec0b298c36a28292197e7e09c6f5eebf40497f368c1aac81982c4f24a }] }

Testing steps

  • Running the fuel-explorer w/ beta-3 should work
cargo run --bin fuel-indexer -- run --manifest examples/fuel-explorer/fuel-explorer/fuel_explorer.manifest.yaml --run-migrations --fuel-node-host beta-3.fuel.network --fuel-node-port 80 --verbos

Changelog

  • chore: optimize tx fetching

@ra0x3 ra0x3 self-assigned this Jun 2, 2023
@ra0x3 ra0x3 changed the title fix: optimize tx fetching chore: optimize tx fetching Jun 2, 2023
@ra0x3 ra0x3 linked an issue Jun 2, 2023 that may be closed by this pull request
@ra0x3 ra0x3 marked this pull request as draft June 2, 2023 02:01
@ra0x3 ra0x3 marked this pull request as ready for review June 2, 2023 15:26
@ra0x3 ra0x3 force-pushed the rashad/288-optimize-tx-fetching branch from f342d1b to 743efa0 Compare June 2, 2023 15:30
@ra0x3 ra0x3 linked an issue Jun 2, 2023 that may be closed by this pull request
@ra0x3 ra0x3 force-pushed the rashad/288-optimize-tx-fetching branch from 1a497c2 to 4373205 Compare June 2, 2023 15:39
@ra0x3 ra0x3 force-pushed the rashad/288-optimize-tx-fetching branch from 4373205 to 435ddb1 Compare June 2, 2023 15:55
@ra0x3 ra0x3 requested a review from deekerno June 2, 2023 17:54
Copy link
Contributor

@deekerno deekerno left a comment

Choose a reason for hiding this comment

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

Thank you @xgreenx and @ra0x3 for working so quickly on this! Our users will be pleased.

@@ -0,0 +1,102 @@
use cynic::QueryBuilder;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should make a tracking issue for making sure that all of this lands in fuel-core so we don't have duplicated code that's susceptible to drift. Not a blocker though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deekerno feel free! You're right copying the code is just a temp solution

@deekerno deekerno merged commit 725ddf6 into master Jun 2, 2023
@deekerno deekerno deleted the rashad/288-optimize-tx-fetching branch June 2, 2023 21:00
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.

Run experiment to analyze fuel-core <> indexer synchronization Optimize transaction fetching
2 participants