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

wire: increase max witness items per input #1907

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions wire/msgtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ const (

// maxWitnessItemsPerInput is the maximum number of witness items to
// be read for the witness data for a single TxIn. This number is
// derived using a possble lower bound for the encoding of a witness
// derived using a possible lower bound for the encoding of a witness
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice example of the "boy/girl scout rule" :D

// item: 1 byte for length + 1 byte for the witness item itself, or two
// bytes. This value is then divided by the currently allowed maximum
// "cost" for a transaction.
maxWitnessItemsPerInput = 500000
// "cost" for a transaction. We use this for an upper bound for the
// buffer and consensus makes sure that the weight of a transaction
// cannot be more than 4000000.
maxWitnessItemsPerInput = 4_000_000

// maxWitnessItemSize is the maximum allowed size for an item within
// an input's witness data. This value is bounded by the largest
Expand Down