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

[anchors] anchors resolutions #3920

Closed

Conversation

halseth
Copy link
Contributor

@halseth halseth commented Jan 16, 2020

Builds on #3821

@halseth halseth removed the request for review from Roasbeef January 16, 2020 13:28
// The anchor chennel type MUST be tweakless.
if chanState.ChanType.HasAnchors() && !chanState.ChanType.IsTweakless() {
panic("invalid channel type combination")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChanType.Validate?

@halseth halseth force-pushed the pluggable-anchors-resolutions branch from 309bd49 to d42b40a Compare January 23, 2020 10:35
halseth and others added 17 commits January 23, 2020 11:48
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.
@halseth halseth force-pushed the pluggable-anchors-resolutions branch from d42b40a to 8a66a32 Compare January 23, 2020 10:49
}

// Fetch the two latest commitments.
localCommit, remoteCommit, err := chanState.LatestCommitmentsFrom(
Copy link
Contributor

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,
Copy link
Contributor

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.

@Roasbeef Roasbeef added this to the 0.10.0 milestone Jan 23, 2020
@Roasbeef Roasbeef added the v0.10 label Jan 23, 2020
@joostjager
Copy link
Contributor

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

@joostjager joostjager closed this Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants