Reject missing collateral when balancing transactions with Plutus scripts

Aperta
#1,419 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
haskell
Ambito
backend, testing

Direzione di ricerca

Start by reading checkCollateralOnlyWithPlutusScripts and calcReturnAndTotalCollateral, which the issue identifies as the balancing checks involved. Trace how top-level transactions and Dijkstra sub-transactions use those functions, then add regression tests for missing collateral and for the two successful cases described in the issue. Done means balancing returns a clear error when Plutus scripts require collateral but none is supplied, while the successful cases still pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The experimental transaction balancing functions can accept a transaction that runs Plutus scripts but supplies no collateral inputs. The ledger rejects such a transaction.

checkCollateralOnlyWithPlutusScripts rejects collateral inputs when there are no Plutus scripts, but does not check the converse. calcReturnAndTotalCollateral returns Right (Nothing, Nothing) when the collateral-input list is empty, so it does not catch this case either.

Raised by @palas in https://github.com/IntersectMBO/cardano-api/pull/1402#discussion_r4567107853. This is a pre-existing issue and will be addressed in a follow-up PR to #1402.

The follow-up should:

  • Reject transactions that require collateral but supply no collateral inputs, with a clear error from the balancing functions.
  • Cover Plutus scripts in the top-level transaction and in Dijkstra sub-transactions.
  • Add regression tests for missing collateral and preserve successful balancing when the required collateral is supplied or no Plutus scripts are present.
Lingua principale
Haskell
Stelle
41
Fork
33
Merge medio
5g 17h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntersectMBO/cardano-api

Tutte le issue di IntersectMBO/cardano-api

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.