Skip to content

Conversation

@Roasbeef
Copy link
Member

No description provided.

Roasbeef and others added 2 commits October 10, 2022 11:47
In this commit, we fix a bug that would cause nodes to be unable to
parse a given block from the wire. The block would be properly accepted
if fed in via other mechanisms.

The issue here is that the old checks for the maximum witness size,
circa segwit v0 where placed in the wire package _as well_ as the tx
engine. This check should only be in the engine, since it's properly
gated by other related scrip validation flags.

The fix itself is simple: limit witnesses only based on the maximum
block size in bytes, or ~4MB.
This changes isDust to IsDust so other golang projects (btcwallet
or lnd) can use the precise dust calculation used by btcd.
@Roasbeef Roasbeef force-pushed the v-0-22-branch branch 2 times, most recently from ae4a951 to f9ca8c0 Compare October 10, 2022 18:57
This commit modifies no behavior and would allow other projects to
retrieve the dust limit for a particular output type before the
amount of the output is known. This is particularly useful in the
Lightning Network for channel negotiation.
Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Looks good to me!
I checked that all important commits are in this branch vs. e344999 which was the last commit used in lnd v0.14.3-beta. Everything that seems to be of importance is present. I assume 73f7eac isn't strictly required for our use cases?

@Roasbeef
Copy link
Member Author

Roasbeef commented Oct 10, 2022

CI seems to be failing since a file that's assumed in the CI checks is no longer in the repo?

edit: aaaand CI is gone all together?

@Roasbeef
Copy link
Member Author

Tacked that commit on above in the end.

@Roasbeef
Copy link
Member Author

Tests all pass for me locally, but it's using an ancient version of Go in the CI since that's what we had checked in at the time.

@Roasbeef Roasbeef merged commit 2ca4f4c into btcsuite:v0.22 Oct 10, 2022

// TestDust tests the isDust API.
// TestDust tests the IsDust API.
func TestDust(t *testing.T) {

Choose a reason for hiding this comment

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

Search

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.

5 participants