policy: allow exact annex padding for simplicity spends #1539
Open
delta1 wants to merge 2 commits intoElementsProject:masterfrom
Open
policy: allow exact annex padding for simplicity spends #1539delta1 wants to merge 2 commits intoElementsProject:masterfrom
delta1 wants to merge 2 commits intoElementsProject:masterfrom
Conversation
Contributor
|
I'll have some more comment later but first and foremost there is no need to amend the Simplicity C code. Instead there is a Have a careful read of the documentation for |
4a9b55e to
4cdb88c
Compare
4cdb88c to
1918260
Compare
Member
Author
|
Thanks @roconnor-blockstream updated |
delta1
added a commit
to delta1/rust-simplicity
that referenced
this pull request
Mar 26, 2026
Cost::get_padding previously always assumed only 1 byte for compactsize encoding when calculating required padding size. For larger differences in cost/budget, this incorrectly resulted in an additional 1 or 2 bytes of padding depending on the difference. I found this when calculating padding for the SimplicityHL hash loop example, where rust-simplicity was calculating a 7426 byte annex padding while libsimplicity required a 7424 byte padding, since the compactsize encoding requires an additional 2 bytes. See ElementsProject/elements#1539
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements BlockstreamResearch/simplicity#290 for Elements standardness policy.
Something concerning to be investigated is that
Cost::get_paddingin rust-simplicity is returning a padding 3 bytes bigger than this calculation.. presumably an error in that method?