Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Extract RETRY_PREVIOUS_BLOCKS into EthereumConfig

Description

This PR extracts the hardcoded RETRY_PREVIOUS_BLOCKS constant from block.rs into a configurable field in the EthereumConfig struct. The default value in the config is set to the current hardcoded value (100).

Changes

  • Added a new field retry_previous_blocks to EthereumConfig struct in config.rs
  • Created a default function that returns the current value (100)
  • Modified watch_blocks_wrapper and watch_blocks functions to accept retry_previous_blocks as a parameter
  • Updated the call to watch_blocks_wrapper in run_keeper_threads to pass the config value
  • Added #[allow(dead_code)] to the constant to keep it for backward compatibility

Testing

  • Verified changes with pre-commit hooks
  • Ensured code compiles and passes linting

Link to Devin run

https://app.devin.ai/sessions/1e0c733957604bcb9b8e5e9bdab120a9

Requested by: Jayant Krishnamurthy ([email protected])

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented May 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 3:25pm
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 3:25pm
developer-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 3:25pm
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 3:25pm
entropy-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 3:25pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 3:25pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 3:25pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 3:25pm

Co-Authored-By: Jayant Krishnamurthy <[email protected]>
const POLL_INTERVAL: Duration = Duration::from_secs(2);
/// Retry last N blocks
#[allow(dead_code)]
const RETRY_PREVIOUS_BLOCKS: u64 = 100;
Copy link
Contributor

Choose a reason for hiding this comment

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

please delete this constant

m30m added a commit that referenced this pull request May 21, 2025
m30m added a commit that referenced this pull request May 22, 2025
* Revert "feat(fortuna): extract RETRY_PREVIOUS_BLOCKS into EthereumConfig (#2713)"

This reverts commit 0b1a59f.

* optional provider random number in case of failure

* add gas

* more fields

* limit and offset

* add network id as the main identifier

* bump
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.

2 participants