Skip to content
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

Clarification regarding the timestamp field #8

Open
vinshet opened this issue Dec 10, 2021 · 3 comments
Open

Clarification regarding the timestamp field #8

vinshet opened this issue Dec 10, 2021 · 3 comments

Comments

@vinshet
Copy link

vinshet commented Dec 10, 2021

What exactly does the timestamp field denote in the restore function?
Does it mean that the channels returned in the O/P are open at that timestamp and the listed nodes are reachable as well?
Additionally, if my goal is to get the topology from the latest dataset would the epoch value corresponding to the date on the name of the dataset suffice?

@cdecker
Copy link
Contributor

cdecker commented Dec 11, 2021

The timestamps are selected by the node at the time they decide to send a node or channel update. They are supposed to be close to the actual current time, since there are some age thresholds in the specification. We do not have control over them since they're part of the signed payload.

In order to reconstruct the topology at a given time you'll have to replay the gossip messages whose timestamp is lower than your snapshot time (in order) and then prune all channels whose funding outpoint was spent (we currently don't track channel closes).

@vinshet
Copy link
Author

vinshet commented Dec 13, 2021

Thanks for the clarification. So basically, if I want a network snapshot I just take the timestamp value of the date I want the snapshot for and I direct the O/P to a file? I tried this for the timestamp corresponding to 01/01/2020 and got the error that all the nodes are pruned. Any idea as to why I got that error? I ran it over various other timestamps and it seems to work fine.

@m-pescador
Copy link

prune all channels whose funding outpoint was spent

how can I do that without searching the whole blockchain from when the channel was opened? With gettxout I can only check if the output is currently unspent but not if it was unspent at a certain time in the past.

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

No branches or pull requests

3 participants