user2068: 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 ?

user1275: 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.

user7343: 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

user2068: 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);


user4627: 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

2068: <p>My smart contracts deployed in testnet stoped working after the Vasil Hardfork. i get this error:</p>
<blockquote>
<p>&quot;&quot;transaction submit error ShelleyTxValidationError
ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure
(FromAlonzoUtxowFail (WrappedShelleyEraFailure
(ExtraneousScriptWitnessesUTXOW (fromList [ScriptHash
&quot;84017e78c2e887e8fac3fdf270110464aebd67f9cfc73453714b62f6&quot;])))),UtxowFailure
(FromAlonzoUtxowFail (WrappedShelleyEraFailure
(MissingScriptWitnessesUTXOW (fromList [ScriptHash
&quot;9e9807f4d1532b1f6853ad9e9cbea957727c8c0c3b5e89fae60961f9&quot;])))),UtxowFailure
(FromAlonzoUtxowFail (NonOutputSupplimentaryDatums (fromList [SafeHash
&quot;1c48b6a92c64e2c4ac4408620c5a33df9a456b0e58ed422cc7eee51f5ee356b3&quot;])
(fromList [SafeHash
&quot;07e6205f926822d79c530e7e331de123d9050c44afe292a0167fdc9fa943a481&quot;]))),UtxowFailure
(FromAlonzoUtxowFail (ExtraRedeemers [RdmrPtr Spend 24])),UtxowFailure
(FromAlonzoUtxowFail (PPViewHashesDontMatch (SJust (SafeHash
&quot;9835cece923eb8a48e0018bb9ad0901aea26b0575a64a15df1817328ef466620&quot;))
(SJust (SafeHash
&quot;3f52ec17e7d530f1730cc6d5c3bb83f397af30ed16ece7af1fc4314f2ab2d36b&quot;))))])&quot;&quot;</p>
</blockquote>
<p>I think that the relevant part is</p>
<blockquote>
<p>PPViewHashesDontMatch (SJust (SafeHash
&quot;9835cece923eb8a48e0018bb9ad0901aea26b0575a64a15df1817328ef466620&quot;))
(SJust (SafeHash
&quot;3f52ec17e7d530f1730cc6d5c3bb83f397af30ed16ece7af1fc4314f2ab2d36b&quot;))))])&quot;</p>
</blockquote>
<p>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:</p>
<pre><code>const cost_model_vals = [
</code></pre>
<p>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,
];</p>
<p>Then :</p>
<pre><code>const costModel = wasm.CostModel.new();
cost_model_vals.forEach((x, i) =&gt; 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);  
</code></pre>
<p>Now all my smart contracts do not work anymore.. has anyone solved this issue in CSL ?</p>
 1275: <p>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.</p>
 7343: <p>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.</p>
<p><code>cardano-cli query protocol-parameters --testnet-magic 1097911063</code></p>
 2068: <p>For solving the issue: <strong>Update CSL to 11</strong> then change pp code with this one:</p>
<pre><code>    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);
</code></pre>
 4627: <p>You probably need to update your version of the Serialization Lib, the latest currently is <a href="https://github.com/Emurgo/cardano-serialization-lib/releases/tag/11.0.0-rc.6" rel="nofollow noreferrer">11.0.0-rc.6</a> <em>(on npm <a href="https://www.npmjs.com/package/@emurgo/cardano-serialization-lib-nodejs/v/11.0.0-rc.6" rel="nofollow noreferrer">here</a>)</em>.</p>
<p>Plenty of changes making it babbage compatible: <a href="https://github.com/Emurgo/cardano-serialization-lib/pull/478" rel="nofollow noreferrer">https://github.com/Emurgo/cardano-serialization-lib/pull/478</a></p>
