Skip to content

Conversation

@whankinsiv
Copy link
Collaborator

Description

This PR introduces a new dynamic sync mode to the peer_network_interface. In this mode, the interface waits for a ChangeSyncPoint command on the cardano.sync.command topic and begins fetching from that point.

A background task forwards incoming sync points to the NetworkManager. When a new point arrives, the manager resets the ChainState, clears outstanding peer requests, and issues a new find_intersect across all upstream peers.

A minimal indexer process is included to demonstrate this behavior. It registers only the required modules and emits two ChangeSyncPoint commands 5 seconds apart, demonstrating dynamic re-syncing.

Related Issue(s)

#374

How was this tested?

By running the indexer process:

  1. It publishes a sync point at the last Byron block.
  2. The peer_network_interface begins fetching blocks normally.
  3. A second ChangeSyncPoint is published, returning to the starting point.
  4. The peer_network_interface resets and syncs again from that point.

For visibility, you can log inside handle_roll_forward to observe block fetching.

Checklist

  • My code builds and passes local tests
  • I added/updated tests for my changes, where applicable
  • I updated documentation (if applicable)
  • CI is green for this PR

Impact / Side effects

Adds a basic indexer process intended to become the minimal working example for building custom indexers on top of Acropolis.

Reviewer notes / Areas to focus

  • Dynamic NetworkManager construction in peer_network_interface/src/peer_network_interface.rs.
  • Correct behavior of on_sync_cmd when resetting sync state in peer_network_interface/src/network.rs.

Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
@SupernaviX SupernaviX marked this pull request as ready for review November 24, 2025 20:31
Copy link
Collaborator

@sandtreader sandtreader left a comment

Choose a reason for hiding this comment

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

This is really nice, and I agree with all of Simon's tweaks. I like the forward thinking for subsequent commands from consensus and the simplicity of the demo indexer!

@SupernaviX SupernaviX merged commit 5f1092c into main Nov 25, 2025
2 checks passed
@SupernaviX SupernaviX deleted the whankinsiv/peer-network-dynamic-sync branch November 25, 2025 15:07
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.

5 participants