input-output-hk / nami

Nami Wallet is a browser based wallet extension to interact with the Cardano blockchain. Support requests: https://iohk.zendesk.com/hc/en-us/requests/new
https://namiwallet.io
Apache License 2.0
374 stars 168 forks source link

ConwayUtxowFailure #943

Closed ariady-putra closed 2 months ago

ariady-putra commented 2 months ago

Hello, I'm developing a dApp and I'm facing the following error when submitting a transaction:

... "ShelleyBasedEraConway","error":["ConwayUtxowFailure (UtxoFailure (UtxosFailure (ValidationTagMismatch (IsValid True) (FailedUnexpectedly (PlutusFailure \"\nThe PlutusV2 script failed ... "kind":"ShelleyTxValidationError"},"tag":"TxValidationErrorInCardanoMode"},"tag":"TxCmdTxSubmitValidationError"},"tag":"TxSubmitFail"}

the full log: https://gist.githubusercontent.com/ariady-putra/99d8a4592ce8aa1cdc7348a7d2a16640/raw/a390bc8fd5b2137b36c224a2b700d4f853cfd430/nami

The script used to work before Chang, during Chang it was the collateral issue, and now this.

Nami v3.8.1 - Preprod

My code:

// "lucid-cardano": "0.10.10" - it's released yesterday
// I haven't been able to successfully convert my whole project using a different offchain library

async function constructTx(...) {
  ...

  //#region compose Tx
  let newTx = lucid.newTx().validFrom(time).addSigner(address);
  if (spendVaultValidator) newTx = newTx.attachSpendingValidator(spendVaultValidator); // otherwise the script is referenced instead
  if (refInputUTXOs.length) newTx = newTx.readFrom(refInputUTXOs);
  if (inputUTXOs.length) newTx = newTx.collectFrom(inputUTXOs, redeemer).payToContract(vaultAddress, { inline: datum }, vaultLockToken);
  if (feeAmount) newTx = newTx.payToAddress(treasuryAddress, { [feeToken || "lovelace"]: BigInt(feeAmount) });
  //#endregion

  const tx = await newTx.complete();
  return { tx, updatedVault };
}

async function submitTx({ tx, updatedVault }: TxConstructed): Promise<TxSubmitted> {
  const signedTx = await tx.sign().complete();
  const txHash = await signedTx.submit();
  return { txHash, updatedVault };
}

Is there any clue regarding the ConwayUtxowFailure? Thanks

ariady-putra commented 2 months ago

I'm closing for now, not sure whether it's a wallet issue or library issue.

ariady-putra commented 2 months ago

I just noticed this in the middle of the error messages,

The machine terminated part way through evaluation due to overspending the budget.
The budget when the machine terminated was:
({cpu: -40662\\n| mem: 1000})
Negative numbers indicate the overspent budget;

Weird, it used to work before Chang. Need to rework the script on my side