-
Notifications
You must be signed in to change notification settings - Fork 904
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...
|
||
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. |
…rgencyrecover to create penalty txn when peer publishes an old revoked state.
…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 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.
84bebbf
to
7f13d7b
Compare
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.
7f13d7b
to
6020851
Compare
This doesn't work for old scb files (as you can tell, from the test!) It should... |
This PR would enable nodes to create penalty transaction when the peer publishes an old revoked state using the emergency.recover.
Addresses: #7696