feat: add padding keyword to increase program size#226
Draft
stringhandler wants to merge 1 commit intoBlockstreamResearch:masterfrom
Draft
feat: add padding keyword to increase program size#226stringhandler wants to merge 1 commit intoBlockstreamResearch:masterfrom
stringhandler wants to merge 1 commit intoBlockstreamResearch:masterfrom
Conversation
Collaborator
|
I'm not wild about it, but do see how it could be useful 🤷
It seems maybe the fee output value is being hardcoded either here or in hal-simplicity, while it should be calculated from If you're using |
Author
|
Thanks, I managed to adjust the fee |
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.
This might be controversial, but I wanted to see if this was possible and what it might look like.
The problem I'm aiming to solve is the annex padding issue, which basically boils down to the transaction being padded with some data increase the budget for the CPU cost of the program.
It doesn't really make sense to increase the simplicity program size, however, developers who are unaware of this problem might add random code to the simplicity program. This adds formal syntax to SimplicityHL in the hopes that developers will find this keyword instead of adding random code. This allows us to remove this padding in future compilers cleanly.
A very common set of programs that need padding are ones using
for_while.Here is the example
hashloopprogramThe addition of
paddingin this case avoids the error of "Program's execution cost could exceed budget" , however it is still not relayed due toRPC error -26: min relay fee not met, 100 < 1226, which I'll investigate further. This could just be some setting inhal-simplicityI am missing.The instructions that
paddingadds at the moment are fairly arbitrary. If we decide to go ahead with this, I'm open to suggestions.For this program (p2pkh.simf):
The program without padding:
And with padding: