feat: Adds retry + usd estimate logic + prevents submission above threshold#105
Merged
moraesjeremias merged 6 commits intomain-cudafrom Sep 25, 2025
Merged
feat: Adds retry + usd estimate logic + prevents submission above threshold#105moraesjeremias merged 6 commits intomain-cudafrom
moraesjeremias merged 6 commits intomain-cudafrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
0xSasaPrsic
reviewed
Sep 19, 2025
script/bin/operator.rs
Outdated
| N: Network, | ||
| { | ||
| let wei = Unit::ETHER.wei_const().to::<u64>() as f64; | ||
| let gas_estimate = provider.estimate_gas(tx_request.clone()).await.unwrap() as f64; |
Member
Author
There was a problem hiding this comment.
Added error propagation
0xSasaPrsic
reviewed
Sep 24, 2025
|
|
||
| pub async fn fetch_eth_to_usd_rate() -> CoingekoApiResponse { | ||
| pub async fn fetch_usd_rate() -> CoingekoApiResponse { | ||
| let from_token: String = env::var("ASSET_TO_USD_CONVERSION").unwrap_or("ethereum".to_string()); |
Member
There was a problem hiding this comment.
This still fetches only the eth usd rate.
Can it be ignored for other chains?
0xSasaPrsic
reviewed
Sep 24, 2025
script/bin/operator.rs
Outdated
| message = "USD Gas fee too high!!", | ||
| usd_estimate = round_to_decimals(effective_gas_estimate, 2) | ||
| ); | ||
| sleep_until(Instant::now() + Duration::from_secs(retry_sleep_interval)).await; |
Member
There was a problem hiding this comment.
why not tokio::time::sleep(retry_sleep_interval).await;
Member
Author
There was a problem hiding this comment.
Can be, no worries.
0xSasaPrsic
approved these changes
Sep 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description