You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #747: refactor: check the node syntax before size limit
3cdc711 test: ensure multi fragment panic before size limit panic (ChrisCho-H)
da806be refactor: check the node syntax before size limit (Chris Hyunhum Cho)
Pull request description:
I’m not 100% sure if it’s intended, but the behavior of `check_global_consensus_validity`, which checks the script size limit first and then node could confuse the user-side.
For example, If `sh` or `wsh` descriptor uses `multi_a` with 999 public key(e.g. `descriptor::Wsh::from_str("wsh(multi_a(pk1...pk999)")`), it will throw an error on the size limit, not the fragment `multi_a`. It might be a bit more efficient in case of size overflow, but
1. As miniscript functions as a language, syntax or grammar check should precedes stack limit. While the most of syntax are checked before `check_global_consensus_validity`, Syntax of which validity differ on context(e.g. `multi` and `multi_a`) are not.
2. It’s more helpful to debug for user if blocked by wrong syntax first.
3. It’s weird to check the script size which could be possibly wrong script upon context.
While descriptor itself is kinda helper tool which uses miniscript, it would worth checking syntax first.
ACKs for top commit:
apoelstra:
ACK 3cdc711 successfully ran local tests
Tree-SHA512: 664bbd1fecba523a6b4a8e1ede46ef3129917bbd1602000560071321c73704fb2a686660d1f6a3cd903920514e1aac7109bfa045d235b249125dab81a58bb315
0 commit comments