Skip to content

chore(gas_price_service): add a method to wait until storages are synced #2886

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

Open
2 tasks
rymnc opened this issue Mar 19, 2025 · 1 comment
Open
2 tasks
Labels
good first issue Good for newcomers tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable.

Comments

@rymnc
Copy link
Member

rymnc commented Mar 19, 2025

since we have the gas price service depending upon the onchain database as well as the gas price database, we need a reliable way to run tests such that the gas price database is known to have been updated by some state change in the onchain database i.e new L2 block, for example.

#2874 (comment)

the relayer provides similar functionality via await_synced:

pub async fn await_synced(&self) -> anyhow::Result<()> {
let mut rx = self.synced.clone();
loop {
if rx.borrow_and_update().is_synced() {
break;
}
rx.changed().await?;
}
Ok(())
}

Definition of done

  • the gas price service updates the status when it receives a new block to NotSynced and when it is done processing the block, updates it to Synced(height)
  • The tests(unit + integ) are updated to remove sleep's and instead use the new await_synced method with a timeout instead
@rymnc rymnc added the good first issue Good for newcomers label Mar 19, 2025
@rymnc
Copy link
Member Author

rymnc commented Mar 19, 2025

you can use 0a2ea74 as reference on how to do it

@MitchTurner MitchTurner added the tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable. label Mar 27, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable.
Projects
None yet
Development

No branches or pull requests

2 participants