feat(scraper): add two-stage tip/finalized scraper indexing#8193
feat(scraper): add two-stage tip/finalized scraper indexing#8193paulbalaji wants to merge 7 commits intomainfrom
Conversation
Co-authored-by: Paul Balaji <paulbalaji@users.noreply.github.com>
|
@claude review |
|
Claude finished @paulbalaji's task in 2m 5s —— View job Review: Two-Stage Tip/Finalized Scraper Indexing
Overall AssessmentWell-structured change. The two-stage architecture cleanly separates concerns: finalized pipeline remains unchanged and authoritative, tip stage writes only to What Looks Good
Items to Address
Questions for the Author
No Issues Found
|
rust/main/agents/scraper/migration/src/m20260224_000007_add_cursor_type.rs
Show resolved
Hide resolved
|
Addressed latest review feedback in b43f9c7:\n- log when tip indexer is skipped if is none\n- clarify semantics under tip config\n- clarify intentional near-head seed for tip cursor\n- document stale raw-row edge case in tip store docs\n- fix clippy on migration iden naming ()\n\nValidation:\n- (pass) |
|
Follow-up (clean formatting): addressed latest review feedback in Changes:
Validation:
|
|
Addressed latest review comment in Change:
Validation:
|
rust/main/agents/scraper/migration/src/m20260224_000007_add_cursor_type.rs
Show resolved
Hide resolved
|
Addressed latest monorepo PR comments in Changes:
Validation:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
Addressed latest cursor comments:
Checks run:
|
|
Addressed rust e2e failures from the linked logs in Root cause:
Fix:
Validation:
|
|
Follow-up fix for the next CI failures in From the new logs:
Root causes + fixes:
Validation:
|
🦀 Rust Agent Docker Image Built Successfully
Full image paths |
Summary
message_dispatch_tip) withreorg_period = Noneraw_message_dispatchvia reorg-tolerant upsertcursor_type(finalized|tip) to avoid cursor collisionsWhy
DB Changes
m20260224_000007_add_cursor_typecursor.cursor_type(defaultfinalized)(domain, cursor_type, height)Migration Apply Notes
Simple SQL equivalent:
rollback:
Testing Plan
cargo fmt -p scraperCXX=g++ CC=gcc CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=gcc cargo test -p scraper test_failed_build_chain_scrapers -- --nocapturecd rust/main && cargo clippy --features aleo,integration_test -- -D warningsmessage_dispatch_tipandraw_message_dispatch_tipraw_message_dispatchwhile finalizedmessage_viewremains authoritativeLinked PRs
Note
Medium Risk
Adds a DB migration and changes cursor persistence/query behavior, plus introduces an additional long-running indexing task; rollout requires migration ordering and could affect indexing progress/metrics if misconfigured.
Overview
Adds a second, near-tip dispatch indexing stage to the scraper: when a chain has a reorg period configured, it now spawns an additional
message_dispatch_tipsyncer withreorg_period = Noneto pick up the latest dispatches quickly.Introduces cursor stream isolation by adding
cursor.cursor_type(finalizedvstip) via a new migration and updatingBlockCursorto read/write per-kind cursors (with legacy fallback when the column is missing). Tip-stage writes are routed through a newTipMessageStorethat only upserts intoraw_message_dispatchand emits a separateraw_message_dispatch_tipmetric.Updates run-locally E2E invariant checks to use exact label matching (
fetch_metric_exact) and to account for raw dispatch counts coming from both finalized and tip metrics.Written by Cursor Bugbot for commit 216ee60. This will update automatically on new commits. Configure here.