Commit a8f3ce4
proof+tapsend: sanity-check STXO proofs at creation and enforce count
Harden transition proof generation by validating STXO inclusion proofs
at creation time instead of relying solely on later verification.
Changes:
* Require alt leaves for transfer root assets and nonempty prev
witnesses.
* Ensure alt leaf count is at least the number of prev witnesses.
* Validate each STXO proof is non-nil and includes a non-nil AssetProof.
* Enforce a 1:1 count between STXO inclusion proofs and asset input
witnesses.
* Return clear errors for missing alt leaves, prev witnesses, or asset
proofs.
Tests:
* Update `tapsend/proof_test.go` to assert the new failure modes.
* Table test now expects `no alt leaves for transfer root asset` when
STXO proofs are absent and checks error paths before proceeding.
Result:
* Fail fast on malformed proofs.
* Prevents incomplete STXO proofs from entering the pipeline.
* Guarantees proof count matches the number of inputs being spent.1 parent 2db142a commit a8f3ce4
2 files changed
+60
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
210 | 234 | | |
211 | 235 | | |
212 | 236 | | |
213 | 237 | | |
| 238 | + | |
214 | 239 | | |
215 | 240 | | |
216 | 241 | | |
| |||
227 | 252 | | |
228 | 253 | | |
229 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
230 | 268 | | |
231 | 269 | | |
232 | 270 | | |
233 | 271 | | |
234 | 272 | | |
235 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
236 | 285 | | |
237 | 286 | | |
238 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
0 commit comments