cgra: asciilifeform: re your ada piece, i hand-crafted two versions of #1 block (although with invalid hash and merkle tree, had to temporarily disable those specific checks to experiment).
cgra: one of them had ~1MB output script, the other had ~112k outputs, and they both got accepted by trb (fresh install, 0% synced). i saw much tighter limits set in your code
cgra: and something about VarInt: 1) trb's ReadCompactSize() sets a 32M upper value limit, maybe worth coding down explicitly as a VarInt hard limit.
cgra: 2) as trb's VarInt values are strictly only about sizes, how about naming it "VarSize" instead?
cgra: just FYI, i don't know how much of these points were already considered