mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
miniscript: adapt resources checks depending on context
Under Tapscript, there is: - No limit on the number of OPs - No limit on the script size, it's implicitly limited by the maximum (standard) transaction size. - No standardness limit on the number of stack items, it's limited by the consensus MAX_STACK_SIZE. This requires tracking the maximum stack size at all times during script execution, which will be tackled in its own commit. In order to avoid any Miniscript that would not be spendable by a standard transaction because of the size of the witness, we limit the script size under Tapscript to the maximum standard transaction size minus the maximum possible witness and Taproot control block sizes. Note this is a conservative limit but it still allows for scripts more than a hundred times larger than under P2WSH.
This commit is contained in:
parent
9cb4c68b89
commit
f4f978d38e
2 changed files with 40 additions and 5 deletions
|
|
@ -6,11 +6,11 @@
|
|||
#include <vector>
|
||||
#include <script/script.h>
|
||||
#include <script/miniscript.h>
|
||||
#include <serialize.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
namespace miniscript {
|
||||
|
||||
namespace internal {
|
||||
|
||||
Type SanitizeType(Type e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue