-
Notifications
You must be signed in to change notification settings - Fork 895
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
Do complete fee tracking. #3329
Commits on Dec 12, 2019
-
common: add fee_states state machine for update_fee.
This uses the same state machine as HTLCs, but they're only ever added, not removed. Since we can only have one in each state, we use a simple array; mostly NULL. We could make this more space-efficient by folding everything into the first 5 states, but that would be more complex than just using the identical state machine. One subtlety: we don't send uncommitted fee_states over the wire. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 5ad0477 - Browse repository at this point
Copy the full SHA 5ad0477View commit details -
channeld: cleanup: use the channel_feerate() accessor everywhere.
And also move it to initial_channel, so we can use it there. This saves churn in the next patch. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 809003a - Browse repository at this point
Copy the full SHA 809003aView commit details -
channeld: generate revoke_and_ack before telling lightningd about com…
…mitment. The `channel_got_commitsig` we send the lightningd also implies we sent the revoke_and_ack, as an optimization. It doesn't currently matter, since channel_sending_revoke_and_ack doesn't do anything important to the state, but that changes once we start uploading the entire fee_states. So now we move our state machine *before* sending to lightningd, in preparation for sending fee_states too. Unfortunately, we need to marshall the info to send before we increment the state, as lightningd expects that. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 62670ef - Browse repository at this point
Copy the full SHA 62670efView commit details -
channeld: use fee_states internally.
This is an intermediary step: we still don't save it to the database, but we do use the fee_states struct to track it internally. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 321118a - Browse repository at this point
Copy the full SHA 321118aView commit details -
channeld: remove changes_pending flags.
These used to be necessary as we could have feerate changes which we couldn't track: now we do, we don't need these flags. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 0872bea - Browse repository at this point
Copy the full SHA 0872beaView commit details -
wallet: add per-channel feerate_state to the database.
The upgrade here is a bit tricky: we map the two values into the feerate_state. This is trivial if they're both the same, but if they're different we don't know exactly what state they're in (this being the source of the bug!). So, we assume that the have received the update and not acked it, as that would be the normal case. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 8cc1a43 - Browse repository at this point
Copy the full SHA 8cc1a43View commit details -
lightningd: save the fee_states into the database.
This is the final step: we pass the complete fee_states to and from channeld. Changelog-Fixed: "Bad commitment signature" closing channels when we sent back-to-back update_fee messages across multiple reconnects. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for abdfd95 - Browse repository at this point
Copy the full SHA abdfd95View commit details -
devtools: fix example at top of mkcommit.
The norm for channels is a 1% reserve. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 740bb27 - Browse repository at this point
Copy the full SHA 740bb27View commit details