Skip to content

Document RGS timestamp usage #3419

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

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lightning-rapid-gossip-sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ This crate exposes functionality for rapid gossip graph syncing, aimed primarily
Its server counterpart is the
[rapid-gossip-sync-server](https://github.com/lightningdevkit/rapid-gossip-sync-server) repository.

## Usage

To kick off Rapid Gossip Sync from the beginning, retrieve a snapshot from an RGS server instance with the initial
timestamp being 0.

Applying that snapshot using the `RapidGossipSync` instance will extract and retrieve the subsequent timestamp to
request from the server instance. The methods `sync_network_graph_with_file_path`, `update_network_graph`, and
`update_network_graph_no_std` all return a `Result<u32, GraphSyncError>`, and that `u32` success value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we generally expect users to instead call https://docs.rs/lightning/latest/lightning/routing/gossip/struct.NetworkGraph.html#method.get_last_rapid_gossip_sync_timestamp to fetch the timestamp when syncing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the same value with just an extra layer of indirection (and caching), but happy to change it.

is the timestamp meant to be used for the next server request.

## Mechanism

The (presumed) server sends a compressed gossip response containing gossip data. The gossip data is
Expand Down