4

My smart contracts deployed in testnet stoped working after the Vasil Hardfork. i get this error:

""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure (ExtraneousScriptWitnessesUTXOW (fromList [ScriptHash "84017e78c2e887e8fac3fdf270110464aebd67f9cfc73453714b62f6"])))),UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure (MissingScriptWitnessesUTXOW (fromList [ScriptHash "9e9807f4d1532b1f6853ad9e9cbea957727c8c0c3b5e89fae60961f9"])))),UtxowFailure (FromAlonzoUtxowFail (NonOutputSupplimentaryDatums (fromList [SafeHash "1c48b6a92c64e2c4ac4408620c5a33df9a456b0e58ed422cc7eee51f5ee356b3"]) (fromList [SafeHash "07e6205f926822d79c530e7e331de123d9050c44afe292a0167fdc9fa943a481"]))),UtxowFailure (FromAlonzoUtxowFail (ExtraRedeemers [RdmrPtr Spend 24])),UtxowFailure (FromAlonzoUtxowFail (PPViewHashesDontMatch (SJust (SafeHash "9835cece923eb8a48e0018bb9ad0901aea26b0575a64a15df1817328ef466620")) (SJust (SafeHash "3f52ec17e7d530f1730cc6d5c3bb83f397af30ed16ece7af1fc4314f2ab2d36b"))))])""

I think that the relevant part is

PPViewHashesDontMatch (SJust (SafeHash "9835cece923eb8a48e0018bb9ad0901aea26b0575a64a15df1817328ef466620")) (SJust (SafeHash "3f52ec17e7d530f1730cc6d5c3bb83f397af30ed16ece7af1fc4314f2ab2d36b"))))])"

wich has to do with Protocol Parameters, I am using Cardano serialization Lib. and I use 10.04 and I think the problem might be in my cost models now:

const cost_model_vals = [

197209, 0, 1, 1, 396231, 621, 0, 1, 150000, 1000, 0, 1, 150000, 32, 2477736, 29175, 4, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 100, 100, 29773, 100, 150000, 32, 150000, 32, 150000, 32, 150000, 1000, 0, 1, 150000, 32, 150000, 1000, 0, 8, 148000, 425507, 118, 0, 1, 1, 150000, 1000, 0, 8, 150000, 112536, 247, 1, 150000, 10000, 1, 136542, 1326, 1, 1000, 150000, 1000, 1, 150000, 32, 150000, 32, 150000, 32, 1, 1, 150000, 1, 150000, 4, 103599, 248, 1, 103599, 248, 1, 145276, 1366, 1, 179690, 497, 1, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 148000, 425507, 118, 0, 1, 1, 61516, 11218, 0, 1, 150000, 32, 148000, 425507, 118, 0, 1, 1, 148000, 425507, 118, 0, 1, 1, 2477736, 29175, 4, 0, 82363, 4, 150000, 5000, 0, 1, 150000, 32, 197209, 0, 1, 1, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 3345831, 1, 1, ];

Then :

const costModel = wasm.CostModel.new();
cost_model_vals.forEach((x, i) => costModel.set(i, wasm.Int.new_i32(x)));

const costModels = wasm.Costmdls.new();
costModels.insert(wasm.Language.new_plutus_v1(), costModel);

const scriptDataHash = wasm.hash_script_data(redeemers, costModels, datums);
txBody.set_script_data_hash(scriptDataHash);  

Now all my smart contracts do not work anymore.. has anyone solved this issue in CSL ?

5 Answers 5

2

You probably need to update your version of the Serialization Lib, the latest currently is 11.0.0-rc.6 (on npm here).

Plenty of changes making it babbage compatible: https://github.com/Emurgo/cardano-serialization-lib/pull/478

1

I’ll 10/10 recommend bringing this up to the IOG discord in case it turns out to be the effect of some breaking change somewhere. Probably best to ping Becky Hopwood, she’s the Technical community lead in the discord and responds super fast.

1
  • Already asked there, i will try to look for Becky Hopwood as you suggested, thank you! Commented Jul 17, 2022 at 10:24
1

PPViewHashesDontMatch error means that Protocol Parameters hash does not match. Simply deleting your old protocol.json and replacing it with a new one (babbage era) should solve the problem.

cardano-cli query protocol-parameters --testnet-magic 1097911063

1
  • I am afraid in CSL is a little bit more difficult than in Cli. But i hope i can post an answer with detailed code in the next hours.. just in case it helps someone else Commented Jul 20, 2022 at 2:37
1

For solving the issue: Update CSL to 11 then change pp code with this one:

    const costModel = wasm.TxBuilderConstants.plutus_vasil_cost_models().get(
  wasm.Language.new_plutus_v1()
);

const costModels = wasm.Costmdls.new();
costModels.insert(wasm.Language.new_plutus_v1(), costModel);



const scriptDataHash = wasm.hash_script_data(redeemers, costModels, datums);
txBody.set_script_data_hash(scriptDataHash);
0

have you solved the issue? After the HF the cardano-cli transaction build command should include --babbage-era. Adding this, I was able to spend smart contract utxo.

1
  • Yes I solved using the code i auto answered :) and updating to CSL 11 Commented Jul 20, 2022 at 13:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.