From 044ebd237906abc5523a7523816377b2eff5aa8c Mon Sep 17 00:00:00 2001 From: Kayos Date: Thu, 7 May 2026 16:57:05 -0700 Subject: [PATCH] fix(dao): wire V2 cost model into proposal_create staging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without staging.language_view(), pallas does not compute script_data_hash. Chain rejects the tx with PPViewHashesDontMatch. Same trap that plutus_mint hit on 2026-05-07 — same fix here. Caught attempting first dao_proposal_create_unsigned on preprod_test DAO 2026-05-07 PM after deploying governor + proposal validator ref UTxOs via the new file-path workaround for the MCP large-string bug. --- crates/aldabra-dao/src/builder/proposal_create.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/aldabra-dao/src/builder/proposal_create.rs b/crates/aldabra-dao/src/builder/proposal_create.rs index 18ccc62..3a5ebe0 100644 --- a/crates/aldabra-dao/src/builder/proposal_create.rs +++ b/crates/aldabra-dao/src/builder/proposal_create.rs @@ -43,7 +43,7 @@ use pallas_codec::minicbor; use pallas_codec::utils::KeyValuePairs; use pallas_crypto::hash::Hash; use pallas_primitives::PlutusData; -use pallas_txbuilder::{BuildConway, ExUnits, Input, Output, StagingTransaction}; +use pallas_txbuilder::{BuildConway, ExUnits, Input, Output, ScriptKind, StagingTransaction}; use crate::agora::governor::GovernorDatum; use crate::agora::proposal::{ @@ -589,6 +589,17 @@ pub fn build_unsigned_proposal_create( staging = staging.fee(args.fee_lovelace).network_id(network_id); + // Wire the V2 cost model so pallas computes script_data_hash. Without + // this the chain rejects with PPViewHashesDontMatch — same trap the + // plutus_mint path tripped over on 2026-05-07. All Agora validators + // we witness here (governor, stake, proposalSt policy) are PlutusV2 + // on the current preprod linker output, so a single language_view + // entry covers all three. + staging = staging.language_view( + ScriptKind::PlutusV2, + aldabra_core::plutus_cost_models::PLUTUS_V2_COST_MODEL_PREPROD.to_vec(), + ); + let built = staging .build_conway_raw() .map_err(|e| DaoError::Backend(format!("build_conway_raw: {e}")))?;