fix(dao): wire V2 cost model into advance/cosign/vote/stake_destroy
Same trap that hit proposal_create yesterday: every spending tx that
witnesses a PlutusV2 script (Agora's proposal_validator, stake_validator,
proposalSt policy on burn) needs language_view in the tx body so the
chain-side script_data_hash matches the off-chain one. Without this the
chain rejects with PPViewHashesDontMatch.
proposal_create got the fix in 044ebd23. The other four builders shipped
without it, so dao_proposal_advance_unsigned (Draft → Finished on
preprod_test #0) hit PPViewHashesDontMatch on submit. Mirror the same
language_view + ScriptKind::PlutusV2 + PLUTUS_V2_COST_MODEL_PREPROD
wiring into the remaining four staging chains.
This commit is contained in:
parent
1bc4e949ab
commit
5e6cb7056b
4 changed files with 35 additions and 4 deletions
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
use pallas_codec::minicbor;
|
||||
use pallas_crypto::hash::Hash;
|
||||
use pallas_txbuilder::{BuildConway, Input, Output, StagingTransaction};
|
||||
use pallas_txbuilder::{BuildConway, Input, Output, ScriptKind, StagingTransaction};
|
||||
|
||||
use crate::agora::proposal::{
|
||||
ProposalDatum, ProposalRedeemer, ProposalStatus, ProposalThresholds,
|
||||
|
|
@ -437,6 +437,16 @@ pub fn build_unsigned_proposal_advance(
|
|||
|
||||
staging = staging.fee(args.fee_lovelace).network_id(network_id);
|
||||
|
||||
// Wire V2 cost model so pallas computes script_data_hash. Without
|
||||
// this the chain rejects with PPViewHashesDontMatch — same trap
|
||||
// proposal_create + plutus_mint hit. All Agora validators we
|
||||
// witness here (proposal_validator, proposalSt policy when burning)
|
||||
// are PlutusV2 on the preprod linker output.
|
||||
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}")))?;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
use pallas_codec::minicbor;
|
||||
use pallas_crypto::hash::Hash;
|
||||
use pallas_txbuilder::{BuildConway, Input, Output, StagingTransaction};
|
||||
use pallas_txbuilder::{BuildConway, Input, Output, ScriptKind, StagingTransaction};
|
||||
|
||||
use crate::agora::proposal::{
|
||||
ProposalDatum, ProposalRedeemer, ProposalStatus, ProposalThresholds,
|
||||
|
|
@ -415,6 +415,13 @@ pub fn build_unsigned_proposal_cosign(
|
|||
|
||||
staging = staging.fee(args.fee_lovelace).network_id(network_id);
|
||||
|
||||
// Wire V2 cost model — same fix as proposal_create / proposal_advance.
|
||||
// Without this the chain rejects with PPViewHashesDontMatch.
|
||||
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}")))?;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
|
||||
use pallas_codec::minicbor;
|
||||
use pallas_crypto::hash::Hash;
|
||||
use pallas_txbuilder::{BuildConway, Input, Output, StagingTransaction};
|
||||
use pallas_txbuilder::{BuildConway, Input, Output, ScriptKind, StagingTransaction};
|
||||
|
||||
use crate::agora::proposal::{
|
||||
ProposalDatum, ProposalRedeemer, ProposalStatus, ProposalVotes,
|
||||
|
|
@ -499,6 +499,13 @@ pub fn build_unsigned_proposal_vote(
|
|||
|
||||
staging = staging.fee(args.fee_lovelace).network_id(network_id);
|
||||
|
||||
// Wire V2 cost model — same fix as proposal_create / proposal_advance / proposal_cosign.
|
||||
// Without this the chain rejects with PPViewHashesDontMatch.
|
||||
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}")))?;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
use pallas_codec::minicbor;
|
||||
use pallas_crypto::hash::Hash;
|
||||
use pallas_txbuilder::{BuildConway, Input, Output, StagingTransaction};
|
||||
use pallas_txbuilder::{BuildConway, Input, Output, ScriptKind, StagingTransaction};
|
||||
|
||||
use crate::agora::stake::{Credential, StakeRedeemer};
|
||||
use crate::config::{DaoConfig, DaoNetwork};
|
||||
|
|
@ -246,6 +246,13 @@ pub fn build_unsigned_stake_destroy(
|
|||
|
||||
staging = staging.fee(args.fee_lovelace).network_id(network_id);
|
||||
|
||||
// Wire V2 cost model — same fix as the proposal builders.
|
||||
// stake_validator + stakeSt policy are PlutusV2.
|
||||
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}")))?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue