Skip to content

Conversation

@SupernaviX
Copy link
Collaborator

@SupernaviX SupernaviX commented Nov 5, 2025

Fixes #204

Implements a peer-network-interface module. This module runs the ChainSync and BlockFetch protocols against a small set of explicitly-configured peers. It follows the fork defined by the first peer in the list, but will switch to other forks if that peer disconnects.

Testing strategy was a combination of unit tests of the ChainState struct, and manual testing against three preview nodes on my laptop which I randomly killed and revived.

Includes a small architecture diagram: https://github.com/input-output-hk/acropolis/blob/sg/peer-network-interface/modules/peer_network_interface/NOTES.md

Manual testing

To test it, you can run the omnibus process using the "local" configuration:

cd processes/omnibus
cargo run -- --config omnibus-local.toml

That configuration tries connecting to three Cardano nodes running against the preview environment, on ports 3001 3002 and 3003. To create such a setup, you can use this gist https://gist.github.com/SupernaviX/16627499dae71092abeac96434e96817

@buddhisthead
Copy link
Collaborator

I'd like to run this on my computer, if that's possible. Can you give some detailed instructions in the PR for how to do that, please?

@SupernaviX
Copy link
Collaborator Author

I'd like to run this on my computer, if that's possible. Can you give some detailed instructions in the PR for how to do that, please?

Sorry for the delay, I missed this yesterday. I just attached setup instructions.

@buddhisthead
Copy link
Collaborator

I'd like to run this on my computer, if that's possible. Can you give some detailed instructions in the PR for how to do that, please?

Sorry for the delay, I missed this yesterday. I just attached setup instructions.

Thanks. And how will I know that it's working? That it prints certain log messages? You mention killing and reviving the other nodes. Can you briefly describe that sequence and what I should expect?

@SupernaviX
Copy link
Collaborator Author

SupernaviX commented Nov 7, 2025

I'd like to run this on my computer, if that's possible. Can you give some detailed instructions in the PR for how to do that, please?

Sorry for the delay, I missed this yesterday. I just attached setup instructions.

Thanks. And how will I know that it's working? That it prints certain log messages? You mention killing and reviving the other nodes. Can you briefly describe that sequence and what I should expect?

Yep! The main method I used to test fallover was starting from the origin (by setting sync-point = "origin" in omnibus-local.toml), and then using docker stop and docker start to stop and start the three cardano nodes while it synced. The module emits a log line for every 1000 messages it produces, which happens pretty rapidly when syncing from origin. It also emits log lines when a node is disconnected (and tries reconnecting every 5 seconds). So what you see in logs with this setup is

  • While all nodes are running, it just keeps logging that progress is being made every few seconds ("Published block 5999").
  • When one or two nodes stop running, it keeps logging that progress is made, and also logs that there are connection issues every 5 seconds or so.
  • When all nodes are stopped, it logs that there are connection issues and does not log that progress is being made.
  • When a previously-stopped node starts again, it stops logging connection issues (for that node), and goes back to publishing blocks if it hadn't been before.

There's other points it can start from too:

  • from the last block in a newly-restored snapshot
  • from a local cache which it writes as it syncs (very slow and unreliable until Change format of upstream cache #341)
  • from the tip (pretty reliable, but blocks only come every ~20 seconds so the logs don't show many signs of life)

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.

Multi-peer - Basic

3 participants