Skip to content

Add observability to rewind progress #2614

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
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

JoshdfG
Copy link
Contributor

@JoshdfG JoshdfG commented Jul 31, 2025

closes: #2593

Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.6%. Comparing base (c12bc44) to head (334c6e6).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...visor/storage/src/providers/derivation_provider.rs 69.5% 7 Missing ⚠️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JoshdfG JoshdfG force-pushed the Add-observability-to-rewind-progress branch from aad6f0c to 0ae5996 Compare July 31, 2025 22:51
Comment on lines 480 to 489
// Count total blocks to rewind for progress tracking
let mut total_blocks = 0;
{
let mut cursor = self.tx.cursor_read::<DerivedBlocks>()?;
let mut walker = cursor.walk(Some(block.number))?;
while let Some(Ok(_)) = walker.next() {
total_blocks += 1;
}
}

Copy link
Member

Choose a reason for hiding this comment

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

this is too costly for observability logic, which is kind of "secondary logic" if that makes sense. just do latest block number minus target block number

let mut processed_blocks = 0;
const LOG_INTERVAL: u64 = 100;

info!("Starting rewind of {} blocks...", total_blocks);
Copy link
Member

Choose a reason for hiding this comment

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

target is missing and pls specify values as key value pairs, see how it's done for other logs. also pls add the target block, the latest block and total number of blocks to walk back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@emhane thank you, I have updated the code.

@JoshdfG JoshdfG requested a review from emhane August 1, 2025 19:30
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.

Add observability to rewind progress
2 participants