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
eb4f8c4dce3c45d6e510075a63d2115f7198f7b4 expression: move checksum validation into expression parsing (Andrew Poelstra)
bb2e658cabe272e84270a0f30ce28ae0b81e9df2 expression: add explicit well-formedness check to parser (Andrew Poelstra)
9b03043a9e2f73f33188a541881e06404fd30a86 expression: add some unit tests (Andrew Poelstra)
ad85f92fb92cac9beb216f9a29d75ba165264edb expression: implement PartialEq/Eq for trees (Andrew Poelstra)
b0508d864c235fdf4fc03d24aca69acfab8d66e3 checksum: clean up errors and error paths (Andrew Poelstra)
Pull request description:
As a step toward rewriting the expression parser to be non-recursive, add a pre-parsing well-formedness check, which verifies that an expression is well-formed, uses only the correct character set, and that the checksum (if present) is valid.
Along the way, replace the error types returned from the `expression` module with a new more-precise one which can identify the location of parse errors (and identify what the error was in a more correct way). This improves our error reporting and drops many instances of the stringly-typed `BadDescriptor` error.
There is currently a bunch of special logic for Taproot descriptors which have the extra characters `{` and `}`. To the extent possible, this PR doesn't touch that logic. It will be addressed in a later PR.
The benchmarks show a slight slowdown since we essentially added new validation logic without removing the old logic. Later PRs will improve things.
ACKs for top commit:
sanket1729:
ACK eb4f8c4dce3c45d6e510075a63d2115f7198f7b4
Tree-SHA512: cb972e9683aca51f8d18ab61521af8606f47bd1d0bc37dd1ed085101dbc4dd69b382eb05e8e21d2856ac68ebe7d2ca7879ca8a0692dacbea0b22b7b10c9ef987
let invalid_desc = format!("wpkh(tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcL{}fjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/2/*)", sparkle_heart);
0 commit comments