-
Notifications
You must be signed in to change notification settings - Fork 132
supplycommit: add MultiStateMachineManager for managing group state machines #1643
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
Conversation
@guggero have i defined |
Pull Request Test Coverage Report for Build 16339924797Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Straight forward diff!
No major comments, nicely done.
1cf0088
to
d538aec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean! Got a couple of suggestions, nothing too involved I think.
d538aec
to
8d1dd7e
Compare
0433cc0
to
09a1823
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, LGTM 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚝
Reviewed 15 of 15 files at r1, 12 of 12 files at r2, all commit messages.
Reviewable status: all files reviewed, 13 unresolved discussions (waiting on @ffranr and @guggero)
Can land after a rebase! |
This change separates the keyring interface from the wallet interface, allowing integration with an existing keyring service instead of extending the wallet service. We also use DeriveNextTaprootAssetKey as a simplification.
Add context argument to `SupplyTreeView` interface methods to allow `tapdb.SupplyTreeStore` to satisfy the interface.
Introduces `DefaultCommitConfTarget`, a constant for the default confirmation target (in blocks) for a supply commitment transaction. This constant provides a sensible default for fee estimation, ensuring that the commitment transaction is confirmed in a timely manner without overpaying. Centralizing this value makes it easier to manage and adjust in the future. If we don't set `CommitConfTarget` field in state machine env to a reasonable value fee estimation will fail.
The state machine that curates a supply commit transaction is specific to an asset group key. To manage multiple such state machines across asset groups at the RPC layer, introduce the MultiStateMachineManager. The manager caches separate state machines for each asset group.
Populate the SupplyCommitManager field in the config so that the rpcserver can invoke methods on the supply commitment manager.
This allows derivation of PSBT BIP32 paths for a keychain.KeyDescriptor using network-specific parameters. The new field is unread in this commit but will be used later.
Introduce LndFsmDaemonAdapters, a struct implementing the protofsm.DaemonAdapters interface. This is passed into supplycommit.NewMultiStateMachineManager, which then propagates it to each asset group-specific state machine.
chain_bridge.go now contains multiple Lightning clients: invoices, transport, and router. The new name lnd_services.go reflects this richer scope and improves discoverability.
In this commit, we add logic to resend trigger events for select states. Along the way, we modify the way the state machine works: we can avoid having to extract the PSBT again, just by reading it from the state transition.
09a1823
to
a3cbff2
Compare
Part of the work towards completing #1534
These commits are split out from #1554
This PR introduces the
MultiStateMachineManager
, a service that manages supply commitment state machines for multiple asset groups. Each state machine is scoped to a specific asset group. TheMultiStateMachineManager
caches and orchestrates these group-specific machines, providing a unified interface for the RPC server to start, query, and stop them.This change is