-
Notifications
You must be signed in to change notification settings - Fork 20
[Dijkstra] phase 1 requiredTopLevelGuards
#1010
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
Merged
williamdemeo
merged 4 commits into
master
from
1002-dijkstra-phase-1-requiredtoplevelguards-stacked
Jan 8, 2026
+184
−3
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| --- | ||
| source_branch: master | ||
| source_path: src/Ledger/Dijkstra/Specification/Utxo.lagda.md | ||
| --- | ||
|
|
||
| # UTxO | ||
|
|
||
| (Dijkstra skeleton) | ||
|
|
||
| This is a **minimal skeleton** of the Dijkstra-era UTxO transition system. | ||
|
|
||
| It exists primarily to host **phase-1 structural checks** that are specific to | ||
| Dijkstra (CIP-0118 / CIP-0112), without yet committing to the full batch semantics | ||
| (issue #1007) or phase-2 execution model (issue #1006). | ||
|
|
||
| <!-- | ||
| ```agda | ||
| {-# OPTIONS --safe #-} | ||
|
|
||
| open import Ledger.Prelude | ||
| open import Ledger.Dijkstra.Specification.Abstract | ||
| open import Ledger.Dijkstra.Specification.Transaction | ||
|
|
||
| module Ledger.Dijkstra.Specification.Utxo | ||
| (txs : _) (open TransactionStructure txs) | ||
| (abs : AbstractFunctions txs) (open AbstractFunctions abs) | ||
| where | ||
|
|
||
| open import Ledger.Dijkstra.Specification.Certs govStructure | ||
| open import Ledger.Dijkstra.Specification.Script.Validation txs abs | ||
| ``` | ||
| --> | ||
|
|
||
| ## Environments and states | ||
|
|
||
| (copied shape from Conway; semantics TBD) | ||
|
|
||
| ```agda | ||
| record UTxOEnv : Type where | ||
| field | ||
| slot : Slot | ||
| pparams : PParams | ||
| treasury : Treasury | ||
|
|
||
| record UTxOState : Type where | ||
| field | ||
| utxo : UTxO | ||
| fees : Fees | ||
| deposits : Deposits | ||
| donations : Donations | ||
| ``` | ||
|
|
||
| <!-- | ||
| ```agda | ||
| private variable | ||
| Γ : UTxOEnv | ||
| s s' : UTxOState | ||
| tx : TopLevelTx | ||
| ``` | ||
| --> | ||
|
|
||
| ## UTXOS | ||
|
|
||
| (skeleton/stub) | ||
|
|
||
| `UTXOS` will eventually process the batch (top-level tx + its subTxs) and handle | ||
| phase-2 success/failure behavior. For now it is merely a hook point. | ||
|
|
||
| ```agda | ||
| data _⊢_⇀⦇_,UTXOS⦈_ : UTxOEnv → UTxOState → TopLevelTx → UTxOState → Type where | ||
| UTXOS-stub : | ||
| ──────────────────────────────── | ||
| Γ ⊢ s ⇀⦇ tx ,UTXOS⦈ s | ||
| ``` | ||
|
|
||
| ## UTXO | ||
|
|
||
| (skeleton with the new phase-1 check) | ||
|
|
||
| This is the intended home of Dijkstra "phase-1 structural checks." | ||
|
|
||
| ```agda | ||
| data _⊢_⇀⦇_,UTXO⦈_ : UTxOEnv → UTxOState → TopLevelTx → UTxOState → Type where | ||
|
|
||
| UTXO-inductive : | ||
| let txb = Tx.txBody tx | ||
| subTxs = TxBody.txSubTransactions txb | ||
| in | ||
| ∙ requiredTopLevelGuardsSatisfied tx subTxs | ||
| ∙ Γ ⊢ s ⇀⦇ tx ,UTXOS⦈ s' | ||
| ──────────────────────────────── | ||
| Γ ⊢ s ⇀⦇ tx ,UTXO⦈ s' | ||
| ``` | ||
|
|
||
| **Note.** The premise `requiredTopLevelGuardsSatisfied tx subTxs` | ||
| is explicitly a **phase-1** condition (CIP-0118): every guard credential requested by | ||
| subTx bodies must appear in the top-level `txGuards` set. | ||
|
|
||
| A couple of details to notice: | ||
|
|
||
| - `txb` is computed via `Tx.txBody tx` (no reliance on `TxBodyOf` instances). | ||
| - `UTXOS-stub` returns the **same** state (so we can typecheck | ||
| everything without inventing semantics prematurely). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| source_branch: master | ||
| source_path: src/Ledger/Dijkstra/Specification/Utxow.lagda.md | ||
| --- | ||
|
|
||
| # UTxOW (Dijkstra skeleton) | ||
|
|
||
| This is a **minimal skeleton** of the Dijkstra-era witnessing layer. | ||
|
|
||
| It currently acts as a wrapper around `UTXO`, mirroring Conway's shape, but without | ||
| committing to full witnessing checks yet. | ||
|
|
||
| <!-- | ||
| ```agda | ||
| {-# OPTIONS --safe #-} | ||
|
|
||
| open import Ledger.Prelude | ||
| open import Ledger.Dijkstra.Specification.Abstract | ||
| open import Ledger.Dijkstra.Specification.Transaction | ||
|
|
||
| module Ledger.Dijkstra.Specification.Utxow | ||
| (txs : _) (open TransactionStructure txs) | ||
| (abs : AbstractFunctions txs) (open AbstractFunctions abs) | ||
| where | ||
|
|
||
| open import Ledger.Dijkstra.Specification.Utxo txs abs | ||
|
|
||
| private variable | ||
| Γ : UTxOEnv | ||
| s s' : UTxOState | ||
| tx : TopLevelTx | ||
| ``` | ||
| --> | ||
|
|
||
| ```agda | ||
| data _⊢_⇀⦇_,UTXOW⦈_ : UTxOEnv → UTxOState → TopLevelTx → UTxOState → Type where | ||
|
|
||
| UTXOW-inductive : | ||
| ∙ Γ ⊢ s ⇀⦇ tx ,UTXO⦈ s' | ||
| ──────────────────────────────── | ||
| Γ ⊢ s ⇀⦇ tx ,UTXOW⦈ s' | ||
| ``` | ||
|
|
||
| This file intentionally contains **no** additional premises yet. As Dijkstra witnessing | ||
| evolves, this is where signature / script / datum / language constraints can be added. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe this simple condition can be inlined somehow in the rule?