Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@HristoStaykov
Copy link
Contributor

Summary

  • Add per-network reorg tracking loop that detects forked blocks, requeues affected updates, and bumps the new observed_reorgs metric.
  • Persist non-finalized batches and observed block hashes through the inflight tracker and capture inclusion details when relaying transactions.
  • Refresh feed round-buffer indices whenever on-chain state diverges and wire the reorg trackers into the worker startup flow.
  • Extend provider configuration with reorg settings, move await_time into shared utils, and cover the behavior with unit plus Anvil-based integration tests.

Testing

  • New unit and integration tests land alongside the implementation.

@HristoStaykov HristoStaykov self-assigned this Oct 8, 2025
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch 2 times, most recently from db9f57d to a30cd73 Compare October 10, 2025 10:21
@HristoStaykov HristoStaykov force-pushed the refactor_feed_id_stride branch from 62da767 to b314c2f Compare October 10, 2025 10:22
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch 4 times, most recently from 3548ead to b7262b0 Compare October 13, 2025 11:34
@HristoStaykov HristoStaykov force-pushed the refactor_feed_id_stride branch from b314c2f to 2145c39 Compare October 13, 2025 11:34
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from b7262b0 to d1c5366 Compare October 13, 2025 12:31
@HristoStaykov HristoStaykov force-pushed the refactor_feed_id_stride branch 2 times, most recently from 4a04194 to 617a135 Compare October 13, 2025 13:02
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch 2 times, most recently from 00f9d71 to e463124 Compare October 16, 2025 11:17
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from e463124 to ec4d8ae Compare October 22, 2025 09:15
@HristoStaykov HristoStaykov force-pushed the refactor_feed_id_stride branch from 617a135 to fbc3456 Compare October 22, 2025 09:18
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from ec4d8ae to 3615a5b Compare October 22, 2025 11:37
// It also verifies that a resync of indices is initiated when the on-chain root differs
// from the local calldata-merkle frontier (without deploying contracts).
#[tokio::test]
async fn test_loop_tracking_reorg_detect_and_resync_indices() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Main reorg test

@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from 3615a5b to a81ab7c Compare October 29, 2025 09:40
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch 2 times, most recently from 13bec09 to a69c9ec Compare October 30, 2025 10:13
@HristoStaykov HristoStaykov force-pushed the refactor_feed_id_stride branch from abe8d3f to 7566d8d Compare October 30, 2025 10:32
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from a69c9ec to bb62a74 Compare October 30, 2025 15:29
@HristoStaykov HristoStaykov force-pushed the refactor_feed_id_stride branch from 7566d8d to 35af4b0 Compare October 30, 2025 15:29
Base automatically changed from refactor_feed_id_stride to refactor_use_state_hash_for_sync_rebased October 30, 2025 15:29
@HristoStaykov HristoStaykov force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from bb62a74 to a03ddd3 Compare October 30, 2025 16:15
@HristoStaykov HristoStaykov force-pushed the refactor_use_state_hash_for_sync_rebased branch from 5215d2f to 571691f Compare October 30, 2025 16:16
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from a03ddd3 to 3db5703 Compare October 30, 2025 16:30
@reo101 reo101 force-pushed the refactor_use_state_hash_for_sync_rebased branch from 16eebd2 to e906ed3 Compare November 7, 2025 12:45
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from 6a77f2d to 6f6555b Compare November 7, 2025 12:50
@reo101 reo101 force-pushed the refactor_use_state_hash_for_sync_rebased branch from e906ed3 to a7d3c68 Compare November 7, 2025 12:50
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from 6f6555b to fc1cae8 Compare November 7, 2025 13:01
@reo101 reo101 force-pushed the refactor_use_state_hash_for_sync_rebased branch from a7d3c68 to 9809240 Compare November 7, 2025 13:01
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from fc1cae8 to 8529704 Compare November 7, 2025 13:56
@reo101 reo101 force-pushed the refactor_use_state_hash_for_sync_rebased branch 2 times, most recently from d96ad89 to 93fa6c3 Compare November 7, 2025 14:00
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from 8529704 to 57ab0b4 Compare November 7, 2025 14:00
@reo101 reo101 force-pushed the refactor_use_state_hash_for_sync_rebased branch from 93fa6c3 to 8f4ecd1 Compare November 7, 2025 14:08
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch 2 times, most recently from 0551195 to 7c73bab Compare November 7, 2025 14:16
@reo101 reo101 force-pushed the refactor_use_state_hash_for_sync_rebased branch from 8f4ecd1 to 4fe7564 Compare November 7, 2025 14:16
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from 7c73bab to 90be292 Compare November 7, 2025 14:37
@reo101 reo101 force-pushed the refactor_use_state_hash_for_sync_rebased branch 2 times, most recently from 140b9f8 to eb670b4 Compare November 7, 2025 15:12
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from 90be292 to 0ceace1 Compare November 7, 2025 15:15
…ized blocks

  - Wire per‑network reorg trackers: spawn loop_tracking_for_reorg_in_network via create_per_network_reorg_trackers
  - Refactor relayer path: eth_batch_send_to_contract now takes BatchOfUpdatesToProcess; update caller and use net_clone
  - Add InflightObservations to RpcProvider with helpers to insert_non_finalized_update, insert_observed_block_hash, prune_observed_up_to
  - Centralize await_time in blocksense_utils; remove duplicate in feed_registry and update tests/imports
  - Add imports for BlockNumberOrTag, B256, await_time, chrono::Local to support reorg tracking and timing
  - Improve task naming/log messages and fix minor comment typo
…k discovery, logging, and metrics; include a simulated‑reorg test that verifies resync

  - feat(sequencer/providers): add reorg handling helper, counter, and test
  - Introduce handle_reorg(...) in eth_send_utils to:
      - Locate first common ancestor, log diverged blocks, and return fork height
      - List non_finalized_updates at/above fork for visibility
  - Add RpcProvider.reorgs_count with initialization to track detected reorgs
  - Extend test flow to simulate a reorg by mining a new branch:
      - Assert divergence at T1 and resync behavior (merkle_root_in_contract set, rb_indices refreshed)
      - Verify reorgs_count increments and abort loop cleanly
  - No changes to normal tx/receipt flow outside reorg handling paths
@reo101 reo101 force-pushed the refactor_use_state_hash_for_sync_rebased branch from eb670b4 to caee75b Compare November 7, 2025 15:32
@reo101 reo101 force-pushed the hstaykov/reorg_detecting_tasks_per_network branch from 0ceace1 to dc50c60 Compare November 7, 2025 15:32
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.