-
Notifications
You must be signed in to change notification settings - Fork 913
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
Update emergency.recover after every 'commitment_revocation' so that user can sweep funds by penalty transaction. #7772
base: master
Are you sure you want to change the base?
Conversation
bbea1f1
to
ca3b3de
Compare
6c70397
to
eeb239f
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.
Nice! Only one minor cleanup suggestion.
I'll rebase now...
wallet/wallet.c
Outdated
|
||
for (u32 pos = 0; pos < chain->chain.num_valid; pos++) { | ||
struct secret s; | ||
memcpy(&s, &chain->chain.known[pos].hash, sizeof(s)); |
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.
We have a new macro for, this: CROSS_TYPE_ASSIGNMENT(&s, &chain->chain.known[pos].hash). It checks the two types are same size...
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.
Fixed it. Thanks!!
eeb239f
to
98b6ae4
Compare
Rebased on master with simple API fixes. |
84bebbf
to
7f13d7b
Compare
7f13d7b
to
6020851
Compare
This doesn't work for old scb files (as you can tell, from the test!) It should... |
4312f07
to
51d0031
Compare
1ca3c9b
to
e20a2c3
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.
seems like a sensible and reasonable change. the commits were very easy to read through, kudos on that!
very cool that we're basically turning peers into watchtowers for ourselves.
2a19613
to
3a967d4
Compare
This change will allow subtypes in wiregen files to have tlvstreams. Shifting tlv structs above subtypes in header_template is done to prevent forward declaration. Since generate-wire prepends 'tlv_' in tlvname, we have to modify fromwire_subtype_field and towire_subtype_field in impl_template to accommodate this.
…rgencyrecover to create penalty txn when peer publishes an old revoked state.
3a967d4
to
814dede
Compare
814dede
to
573f818
Compare
…chan() - Added field to store commitment secret chain in - Added field to hold counterparty's basepoint information - Added field to indicate the channel initiator's side (local or remote) These fields enhance 'stub_chan' to make channels which are capable to create penalty transaction in case the peer broadcasts an old revoked state.
…directly to the database - Adds 'wallet_stub_shachain_init' function to store a retrieved shachain in the database. - Saves initial metadata ('min_index' and 'num_valid') to the 'shachains' table. - Iterates through known shachain secrets, adding each entry to 'shachain_known' with position, index, and hash. This function enables direct persistence of shachain data, ensuring all relevant information is saved upon retrieval.
…mergency.recover using staticbackup RPC
…pdate emergency.recover everytime we get a revocation secret.
Add test to check if we can successfully create a penalty transaction when we recover a channel using emergencyrecover and the peer publishes an old state. Changelog-Added: Now the emergency.recover file would keep track of all the revocation secrets when any channel advances it's state.
573f818
to
80f83bf
Compare
This PR would enable nodes to create penalty transaction when the peer publishes an old revoked state using the emergency.recover.
Addresses: #7696