lnrpc: add new WalletKit sub-RPC server#2093
Conversation
| The number of satoshis per kilo weight that should be used when crafting | ||
| this transaction. | ||
| */ | ||
| int64 sat_per_kw = 1; |
There was a problem hiding this comment.
In addition to this, we need a maximum total fee as well. We don't know how many inputs are needed, so the fee can potentially become (too) large.
There was a problem hiding this comment.
So a max for the request, or a max in the response? Once you know the fee rate, you can use the weight estimator to compute what the final fee will be.
There was a problem hiding this comment.
I was thinking a max for the request. How can I use the weight estimator if I don't know how many inputs are needed?
There was a problem hiding this comment.
There was a problem hiding this comment.
I am suggesting 3. Set a hard cap on the actually paid tx fee if I instruct the wallet to create a certain nof outputs.
There was a problem hiding this comment.
Gotcha, will make an issue to track this as this can be added in a new PR (since it also requires wallet modifications).
| attempt to re-broadcast the transaction on start up, until it enters the | ||
| chain. | ||
| */ | ||
| rpc PublishTransaction(Transaction) returns (PublishResponse); |
There was a problem hiding this comment.
How is this going to work with the rebroadcaster? It needs sign descriptors too.
There was a problem hiding this comment.
Suggestion: instead of PublishTransaction, this could be SendInputs which takes sign descriptors.
There was a problem hiding this comment.
So just to check in again, I think we're find with PublishTransaction and may follow up with the two-stage craft+sign process?
There was a problem hiding this comment.
Yes indeed, we leave it for a follow up.
|
Need a way to persist the |
b505b31 to
3c545bd
Compare
| The number of satoshis per kilo weight that should be used when crafting | ||
| this transaction. | ||
| */ | ||
| int64 sat_per_kw = 1; |
There was a problem hiding this comment.
I was thinking a max for the request. How can I use the weight estimator if I don't know how many inputs are needed?
| attempt to re-broadcast the transaction on start up, until it enters the | ||
| chain. | ||
| */ | ||
| rpc PublishTransaction(Transaction) returns (PublishResponse); |
There was a problem hiding this comment.
Yes indeed, we leave it for a follow up.
| KeyLoc: &signrpc.KeyLocator{ | ||
| KeyFamily: int32(keyDesc.Family), | ||
| KeyIndex: int32(keyDesc.Index), | ||
| }, |
There was a problem hiding this comment.
Pubkey bytes need to be returned? It looks like it currently just returns the request values.
| switch { | ||
| case config.MacService == nil: | ||
| return nil, nil, fmt.Errorf("MacService must be set to " + | ||
| "create WalletKit RPC server") |
There was a problem hiding this comment.
It seems walletkit cannot be used with nomacaroons
7963427 to
9c23d2c
Compare
|
Addressed all lingering comments, PTAL! |
There was a problem hiding this comment.
needs different log tag
There was a problem hiding this comment.
nit: register -> registered
9c23d2c to
60b597c
Compare
cfromknecht
left a comment
There was a problem hiding this comment.
couple last things from a prior review that weren't addressed
There was a problem hiding this comment.
started, stopped, and quit don't do anything, they can be removed
There was a problem hiding this comment.
Start() can just return nil
There was a problem hiding this comment.
Stop can just return nil
|
Didn't you want to add signer permission to the admin macaroon in this pr too? |
There was a problem hiding this comment.
| log.Infof("Making macaroons for WaleltKit RPC Server at: %v", | |
| log.Infof("Baking macaroons for WalletKit RPC Server at: %v", |
😛
In this commit, we add a new sub-RPC server to the existing set of gRPC servers. This new sub-RPC server is the WalletKit. It's a utility toolkit that contains method which allow clients to perform common interactions with a wallet such as getting a new address, or sending a transaction. It also includes some supplementary actions such as fee estimation. One thing to note in the RPC file is that we _import_ the existing signer.proto file in order to get at some existing proto definitions which are useful in our use case.
In this commit, we implement the newly defiend WalletKitServer gRPC service. We use the same template w.r.t build tags as the existing signrpc service.
In this commit, we extend the admin macaroon with signer capabilities in order to allow it to be used with the new signer sub-server. As a result, users will need to clear out their old macaroons in order to have the new improved admin macaroon generated. In the future, we may want to restructure the way the admin macaroon functions: rather than white listing each of these entities and operations, we can instead add a catch all capability. This capability will instead allow access to any call, as each new call would be modified to permit this capabilities and no others.
60b597c to
363b992
Compare
|
Final comments addressed! |
In this PR, we add a new sub-RPC server to the existing set of gRPC
servers. This new sub-RPC server is the WalletKit. It's a utility
toolkit that contains method which allow clients to perform common
interactions with a wallet such as getting a new address, or sending a
transaction. It also includes some supplementary actions such as fee
estimation.
One thing to note in the RPC file is that we import the existing
signer.proto file in order to get at some existing proto definitions
which are useful in our use case.
Depends on #2081.