From 4472007daee8bbcb462bd198003c13fd22fb38c0 Mon Sep 17 00:00:00 2001 From: Kayos Date: Fri, 8 May 2026 07:12:04 -0700 Subject: [PATCH] fix(core): bump WITNESS_OVERHEAD_BYTES from 128 to 256 128 underbid by ~144 bytes on a 3-input plutus_mint with inline V2 policy CBOR (preprod_test2 governor bootstrap 2026-05-08, hit FeeTooSmallUTxO 6353 lovelace short). The original constant covered the vkey witness alone but missed redeemer ex_units final-pass inflation + CBOR length-prefix shifts between unsigned (def-length) and signed (often indef-length) witness-set arrays. 256 is plenty for any single-vkey case and still cheap fee-wise (56-lovelace difference at the Cardano per-byte rate). For multi-sig flows we'd revisit, but plutus_mint's only signer is the wallet's own payment key. --- crates/aldabra-core/src/plutus_mint.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/aldabra-core/src/plutus_mint.rs b/crates/aldabra-core/src/plutus_mint.rs index 658d489..aed6e88 100644 --- a/crates/aldabra-core/src/plutus_mint.rs +++ b/crates/aldabra-core/src/plutus_mint.rs @@ -191,7 +191,13 @@ fn hash_to_hex_32(h: &[u8; 32]) -> String { s } -const WITNESS_OVERHEAD_BYTES: u64 = 128; +// Generous overhead for the vkey witness + redeemer ex_units inflation + +// CBOR length-prefix flips between unsigned (def-length) and signed +// (indef-length) array tags. Original 128 underbid by ~144 bytes on a +// 3-input + inline-V2-policy mint (preprod_test2 governor bootstrap +// 2026-05-08, FeeTooSmallUTxO @ 6353 lovelace short). 256 is plenty +// for any single-vkey signing case. +const WITNESS_OVERHEAD_BYTES: u64 = 256; /// Build + sign a Plutus-policy mint with a fully-specified output. ///