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
lightningd: add topology and lightningd statuses #1800
Conversation
This will be used to indicate the status of lightningd at a high-level. It will be computed from various internal statuses such as chain_topology. Signed-off-by: William Casarin <jb55@jb55.com>
Add topology_status This will be used for keeping track current status of the chain topology. Right now we track if it's initializing, syncing, or at a tip. Suggested-by: rusty Signed-off-by: William Casarin <jb55@jb55.com>
Set topology status to TOPOLOGY_SYNCING when adding new blocks. Right now this happens at the same time the "Adding block ..." log happens. Set status to TOPOLOGY_AT_TIP when syncing is finished in updates_complete. Suggested-by: rusty Signed-off-by: William Casarin <jb55@jb55.com>
This should give us enough flexibility for future statuses Signed-off-by: William Casarin <jb55@jb55.com>
Will be used for rendering the status for getinfo Signed-off-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
OK, I apologize for spinning my wheels on this for so long. It's not your code (which can be changed anyway), it's that the JSON API is so hard to change, we need to make sure it's (1) correct, and (2) extensible. There are two things here:
So, I think 'status: ready' is a bad API. We almost want a 'not-ready-because' field, which is clearly non-programmatic. So, maybe 'startup' and a string field? Which vanishes once we're ready? It would be a more global version of the peer billboard; later topology would post to it saying how many blocks to go, for example? And if we did the 'is bitcoind synced' test we could similarly guesstimate how we're going there. We could similarly have a gossip startup with messages, or whatever; it would all fit in the same API... |
sounds good 👍 I'll take a new stab at this the next chance I get |
This patchset adds a
status
field to getinfo. This field tracks various statuses such as the newtoplogy_status
inchain_toplogy
:These states are mapped to the "high-level" status of lightningd. Right now there's a 1-to-1 mapping between chain_topology statuses and lightningd statuses:
but in the future we may want to map other subsystem statuses to lightningd's status.
See #1652 for motivation.
Fixes #1652
This is a rework of #1789 to use enums instead of bit flags for the status, and a rework of #1792 to keep track of topology's status separately as recommended by @rustyrussell.