-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[bridge-indexer] revamp task #19245
[bridge-indexer] revamp task #19245
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
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.
great, thanks!
let's get going!
@@ -63,14 +64,13 @@ impl EthSubscriptionDatasource { | |||
impl Datasource<RawEthData> for EthSubscriptionDatasource { | |||
async fn start_data_retrieval( | |||
&self, | |||
starting_checkpoint: u64, | |||
target_checkpoint: u64, | |||
task: Task, |
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 like that
@@ -23,6 +23,9 @@ use tokio::task::JoinHandle; | |||
|
|||
use crate::metrics::BridgeIndexerMetrics; | |||
|
|||
const BACKFILL_TASK_INGESTION_READER_BATCH_SIZE: usize = 300; |
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 assume this is the value that defines how much is going to be read in one shot?
Can you add a comment as to what this mean?
Also is this something that should be defined in the config file besides and env variable?
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.
this is the fetching concurrency in ingestion framework. https://github.com/MystenLabs/sui/blob/main/crates/sui-data-ingestion-core/src/reader.rs#L207
it guarantees at most N checkpoints can be fetched at the same time. A recent change downgraded the default value to 10, which significantly bottlenecked the backfill speed. In backfill tasks we should use a larger number, in live sync 10 is fine.
will add in the comment
@longbowlu one final question, is this going to affect the deepbook indexer or is this all private implementation to the indexer "framework"? |
411ec7b
to
11f47cc
Compare
it will affect deepbook because deepbook is using this framework, right? If you are asking about if DB indexer need to change anything, i think the only thing to add is |
279bbb1
to
dd0ff09
Compare
## Description This PR reworks `Tasks`: 1. get rid of trait `Tasks` and create struct `Tasks` instead. 2. add `is_live_task` field to `Task` 3. pass `Task` to several functions instead of its parameters. 4. for ingestion framework, use a custom batch read size for backfill tasks (this significantly improves the data download speed) ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
Description
This PR reworks
Tasks
:Tasks
and create structTasks
instead.is_live_task
field toTask
Task
to several functions instead of its parameters.Test plan
How did you test the new or updated feature?
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.