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

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

Merged
merged 4 commits into from Jun 6, 2019

Conversation

Projects
None yet
4 participants
@wpaulino
Copy link
Collaborator

commented May 17, 2019

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.

Show resolved Hide resolved sweep/sweeper.go
Show resolved Hide resolved sweep/sweeper.go Outdated
Show resolved Hide resolved sweep/sweeper.go Outdated

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from dd7a59c to 394bd91 May 17, 2019

@wpaulino

This comment has been minimized.

Copy link
Collaborator Author

commented May 17, 2019

PTAL @joostjager.

@wpaulino wpaulino added this to the 0.7 milestone May 17, 2019

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 394bd91 to 6ec7bb9 May 18, 2019

@wpaulino wpaulino requested a review from Roasbeef May 18, 2019

Show resolved Hide resolved lnrpc/invoicesrpc/invoices.pb.go Outdated
Show resolved Hide resolved lnrpc/rpc.proto Outdated
Show resolved Hide resolved rpcserver.go Outdated
Show resolved Hide resolved sweep/sweeper.go Outdated

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 6ec7bb9 to 9118e3c May 22, 2019

Show resolved Hide resolved sweep/sweeper.go Outdated

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 9118e3c to 9fd0c47 May 23, 2019

@Roasbeef
Copy link
Member

left a comment

Looks pretty good, just a few cosmetics related comments

sweep transaction of the output.
*/
uint32 next_broadcast_height = 6 [json_name = "next_broadcast_height"];
}

This comment has been minimized.

Copy link
@Roasbeef

Roasbeef May 25, 2019

Member

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

Show resolved Hide resolved rpcserver.go Outdated
Show resolved Hide resolved cmd/lncli/types.go Outdated
Show resolved Hide resolved cmd/lncli/types.go Outdated
Show resolved Hide resolved sweep/sweeper.go Outdated

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 9fd0c47 to 22b401b May 27, 2019

Show resolved Hide resolved sweep/sweeper.go Outdated
for _, pendingInput := range s.pendingInputs {
// Only the exported fields are set, as we expect the response
// to only be consumed externally.
pendingInputs = append(pendingInputs, &PendingInput{

This comment has been minimized.

Copy link
@joostjager

joostjager May 28, 2019

Collaborator

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)

This comment has been minimized.

Copy link
@wpaulino

wpaulino May 28, 2019

Author Collaborator

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.

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 22b401b to 1c340b9 May 28, 2019

@Roasbeef
Copy link
Member

left a comment

Tested locally, works as advertised!

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

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 1c340b9 to cfcc0b9 May 29, 2019

@cfromknecht
Copy link
Collaborator

left a comment

straightforward diff, some high level comments

Show resolved Hide resolved lnrpc/rpc.swagger.json Outdated
Show resolved Hide resolved rpcserver.go Outdated
@cfromknecht

This comment has been minimized.

Copy link
Collaborator

commented Jun 1, 2019

@wpaulino needs rebase

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 0b6541a to 70b32d5 Jun 1, 2019

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 70b32d5 to 0c525ca Jun 3, 2019

Show resolved Hide resolved rpcserver.go Outdated
Show resolved Hide resolved sweep/sweeper.go Outdated

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 0c525ca to fcb0467 Jun 4, 2019

@wpaulino

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 5, 2019

@joostjager
Copy link
Collaborator

left a comment

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 some commits May 27, 2019

sweep: add lastFeeRate field to PendingInput
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 force-pushed the wpaulino:pendingsweeps-rpc branch from fcb0467 to 26230cd Jun 5, 2019

@wpaulino

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 5, 2019

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.

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch 3 times, most recently from ebecc4f to ab1491f Jun 6, 2019

@cfromknecht
Copy link
Collaborator

left a comment

LGTM

Show resolved Hide resolved cmd/lncli/types.go Outdated

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from ab1491f to 71f3ee1 Jun 6, 2019

@wpaulino wpaulino force-pushed the wpaulino:pendingsweeps-rpc branch from 71f3ee1 to 1d8b70e Jun 6, 2019

@Roasbeef Roasbeef merged commit aa5156a into lightningnetwork:master Jun 6, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.008%) to 60.909%
Details

@wpaulino wpaulino deleted the wpaulino:pendingsweeps-rpc branch Jun 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.