Skip to content

sweep+rpc+cmd/lncli: expose pending input sweeps over RPC + CLI - #3089

Merged
Roasbeef merged 4 commits into
lightningnetwork:masterfrom
wpaulino:pendingsweeps-rpc
Jun 6, 2019
Merged

sweep+rpc+cmd/lncli: expose pending input sweeps over RPC + CLI#3089
Roasbeef merged 4 commits into
lightningnetwork:masterfrom
wpaulino:pendingsweeps-rpc

Conversation

@wpaulino

Copy link
Copy Markdown
Contributor

In this PR, we expose the set of pending inputs that the UtxoSweeper is currently attempting to sweep. This will serve as preparatory work for allowing users to perform fee bumps. Due to the UtxoSweeper's asynchronous nature, we are not able to quickly report on whether a fee bump succeeded or not, so we resort towards exposing its internal fee rate bucketing system over RPC to give users an indication of what's currently being swept and with what fee rate.

I opted to only expose the sweeping fee rate for each bucket, along with all of the inputs within each bucket and their individual fee rates for now. Looking for feedback on whether we could be exposing this information better.

Depends on #3026.

@wpaulino
wpaulino requested a review from joostjager May 17, 2019 03:02
@wpaulino wpaulino added utxo sweeping cli Related to the command line interface enhancement Improvements to existing features / behaviour fees Related to the fees paid for transactions (both LN and funding/commitment transactions) rpc Related to the RPC interface labels May 17, 2019
Comment thread sweep/sweeper.go Outdated
Comment thread sweep/sweeper.go Outdated
Comment thread sweep/sweeper.go Outdated
@wpaulino

Copy link
Copy Markdown
Contributor Author

PTAL @joostjager.

@wpaulino wpaulino added this to the 0.7 milestone May 17, 2019
@wpaulino
wpaulino requested a review from Roasbeef May 18, 2019 02:53
Comment thread lnrpc/invoicesrpc/invoices.pb.go Outdated
Comment thread lnrpc/rpc.proto Outdated
Comment thread rpcserver.go Outdated
Comment thread sweep/sweeper.go Outdated
Comment thread sweep/sweeper.go Outdated

@Roasbeef Roasbeef left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks pretty good, just a few cosmetics related comments

Comment thread lnrpc/rpc.proto Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Once we circle back and add retargeting, it may be useful to expose what the next fee rate would be.

Comment thread rpcserver.go Outdated
Comment thread cmd/lncli/types.go Outdated
Comment thread cmd/lncli/types.go Outdated
Comment thread sweep/sweeper.go Outdated
Comment thread sweep/sweeper.go Outdated
Comment thread sweep/sweeper.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I had the same thing with creating a snapshot in mission control and introduced separate exported structs for the snapshot. I think it is cleaner. (non blocking)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah that was how the initial design of the PR approached it, but I opted for reusing the same struct to result in less code, though the difference is not much.

@Roasbeef Roasbeef left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested locally, works as advertised!

LGTM contingent in unifying the byte reversal (in lncli as we do elsewhere) 🌊

@cfromknecht cfromknecht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

straightforward diff, some high level comments

Comment thread lnrpc/rpc.swagger.json Outdated
Comment thread rpcserver.go Outdated
@cfromknecht

Copy link
Copy Markdown
Contributor

@wpaulino needs rebase

Comment thread cmd/lncli/types.go Outdated
Comment thread rpcserver.go Outdated
Comment thread sweep/sweeper.go Outdated
@wpaulino

wpaulino commented Jun 5, 2019

Copy link
Copy Markdown
Contributor Author

PTAL @Roasbeef @joostjager.

@joostjager joostjager left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested and found that it works. Only minor comment is that the field name sat_per_byte remains a little vague without reading the comment. But don't know if last_sat_per_byte would be any better.

wpaulino added 3 commits June 5, 2019 12:10
This will serve useful when exposing the pending inputs over RPC, since
we currently don't keep track of the last fee rate used for an input.
@wpaulino

wpaulino commented Jun 5, 2019

Copy link
Copy Markdown
Contributor Author

Only minor comment is that the field name sat_per_byte remains a little vague without reading the comment.

Agreed. This is why bitcoin-cli also includes a description of the command's response. Possibly something we can look into later down the road.

Rebased to address a cmd/lncli conflict.

@cfromknecht cfromknecht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM ✅

Comment thread cmd/lncli/types.go Outdated
@Roasbeef
Roasbeef merged commit aa5156a into lightningnetwork:master Jun 6, 2019
@wpaulino
wpaulino deleted the pendingsweeps-rpc branch June 6, 2019 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command line interface enhancement Improvements to existing features / behaviour fees Related to the fees paid for transactions (both LN and funding/commitment transactions) rpc Related to the RPC interface utxo sweeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants