-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[anchors] anchors resolutions #3920
[anchors] anchors resolutions #3920
Conversation
// The anchor chennel type MUST be tweakless. | ||
if chanState.ChanType.HasAnchors() && !chanState.ChanType.IsTweakless() { | ||
panic("invalid channel type combination") | ||
} |
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.
ChanType.Validate
?
309bd49
to
d42b40a
Compare
It takes into account the necessary variables and will prepare us for doing commitment type dependent script generation later.
This fixes an error case that wouldn't have been caught, since vm.Execute applies more rules than the individual steps (most notably the clean stack rule). Instead we execute the engine as normal, and only step through if we decide that the outcome is unexpected.
With this commitment type, we'll add extra anchor outputs to the commitment transaction if the anchor channel type is active.
… type Based on the channel type, the commitment weight will be calculated.
If we are the initiator, we check that our starting balance after subtracting fees are not less than two times the default dust limit. This commit adds a similar check for the non-initiator case, checking that the remote party has a starting balance of reasonable size.
Preparing for funding flow to be able to set anchor type if agreed upon.
…from confirmed bucket Co-authored-by: Joost Jager <[email protected]>
d42b40a
to
8a66a32
Compare
} | ||
|
||
// Fetch the two latest commitments. | ||
localCommit, remoteCommit, err := chanState.LatestCommitmentsFrom( |
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.
Aren't these two already present in chanState.LocalCommitment
and chanState.RemoteCommitment
?
|
||
// RemoteCommitChainTip returns the "tip" of the current remote commitment | ||
// chain. The confirmed bool indicates which bucket to retrieve the data from. | ||
func (c *OpenChannel) RemoteCommitChainTipFrom(confirmed bool) (*CommitDiff, |
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.
If we do #3952, the ...From()
isn't needed.
Moved to more conservative way of dealing with the anchor resolution, which simplifies the changes introduced in this pr. Closing this and made the change part of #3758 |
Builds on #3821