-
Notifications
You must be signed in to change notification settings - Fork 20
[Dijkstra] resolve ambiguity: visibility of reference inputs #1014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dijkstra] resolve ambiguity: visibility of reference inputs #1014
Conversation
80b3f68 to
e43b258
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR resolves the ambiguity in the Dijkstra specification (issue #1005) regarding the visibility of reference inputs in batch transactions. It establishes a clear distinction between spending inputs (which must exist in the initial UTxO snapshot) and reference inputs (which may additionally point to outputs from preceding sub-transactions in the batch).
Key changes:
- Introduce two UTxO views:
utxoSpend₀(initial snapshot) andutxoRefView(evolving view for reference lookups) - Update transaction body structure to replace
txRequiredGuardswithtxGuardsand addreqSignerHashesfield - Extend
TxInfowithtxInfoSubTxsfield and introduce purpose-specifictxInfoForPurposefunction - Add minimal UTXO and UTXOW skeleton transition systems for Dijkstra phase-1 checks
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/Ledger/Dijkstra/Specification/Utxow.lagda.md |
New skeleton wrapper around UTXO transition for witnessing layer |
src/Ledger/Dijkstra/Specification/Utxo.lagda.md |
New skeleton UTXO transition with phase-1 guard satisfaction check |
src/Ledger/Dijkstra/Specification/Transaction.lagda.md |
Major updates: dual UTxO views, renamed guard fields, updated function signatures, comprehensive validity documentation |
src/Ledger/Dijkstra/Specification/Script/Validation.lagda.md |
Updated ScriptPurpose, TxInfo structure with guards/subTxs, dual UTxO parameters for script lookups |
src/Ledger/Dijkstra/Specification/Abstract.lagda.md |
Updated indexOfGuard signature to use Credential and List Credential |
src/Ledger/Dijkstra/Specification.lagda.md |
Added module imports for new Utxo and Utxow specifications |
src/Ledger/Conway/Specification/Utxow.lagda.md |
Fixed source_path metadata from .lagda to .lagda.md |
src/Ledger/Conway/Specification/Utxo.lagda.md |
Added missing metadata header |
CHANGELOG.md |
Documented all semantic changes to transaction structure and validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db4a1bc to
7ccd947
Compare
d2e681c to
0e6ef2c
Compare
7ccd947 to
8063211
Compare
0e6ef2c to
20498dc
Compare
8063211 to
72b806c
Compare
20498dc to
0eb3c68
Compare
72b806c to
c0dc0cf
Compare
0eb3c68 to
58fc737
Compare
c0dc0cf to
46039b7
Compare
58fc737 to
d9fd7b5
Compare
36b6346 to
56f60be
Compare
d9fd7b5 to
f2f9003
Compare
26c20b0 to
c070f60
Compare
c070f60 to
ce58826
Compare
38786dc to
3990eed
Compare
ce58826 to
8418eed
Compare
carlostome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
+ Remove contradiction between "ref inputs may refer to earlier tx outputs in the batch" vs "all inputs must exist before applying any tx in the batch." The new text punts the exact constraint to the UTxO rules (where it belongs). + Fix Plutus bullet (old "nor earlier versions" reads like "no Plutus at all"). + Align fees with current Agda (`txFee : InTopLevel …`), but leave room for later CIP-driven updates.
Also highlight that `getDatum` gets the datum of the spent output (look up `txin` in the UTxO; if the output stores a datum hash, look it up in `DataOf tx`). It's a spending-input datum lookup (not a reference-input datum lookup).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
a636905 to
9b4798b
Compare
Description
Stacked PR. The branch for this PR should be rebased on
masteronce PR #1012 is merged.This PR closes issue #1005 by adopting the following interpretation and approach in the Dijkstra spec, resolving the apparent ambiguity in the CIP and matches the "preceding Tx outputs" intent:
Spending inputs (i.e., the ones that are actually consumed) must be present in the initial UTxO snapshot for the batch (the "mempool safety" constraint).
Reference inputs are allowed to refer to:
Reference lookup uses an evolving (tentative) UTxO view, computed by applying prior subtransaction effects for lookup only (still no commitment to change state until the batch succeeds).
This makes the two CIP statements mentioned in Issue #1005 simultaneously true by reading "inputs" as "spending inputs," while still enabling the specific "ref scripts from preceding outputs" behavior the CIP explicitly mentions.
Moreover, we change type signatures where necessary to allow for the two UTxO views:
utxoSpend₀, the initial (static) UTxO;utxoRefView, the evolving UTxO.Checklist
CHANGELOG.md