Skip to content

Conversation

@williamdemeo
Copy link
Member

@williamdemeo williamdemeo commented Dec 21, 2025

Description

Stacked PR. The branch for this PR should be rebased on master once #1009 is merged.

This PR closes issue #1002 by introducing a predicate for testing that required top-level guards are present among the top-level guards and

  • defining a minimal UTXOS rule as a stub/hook (so UTXO can call something),
  • defining a minimal UTXO rule with just the new phase-1 premise (plus an explicit "calls UTXOS"),
  • defining a minimal UTXOW; just a wrapper over UTXO for now.

Copilot-generated Description (manually reviewed and revised)

This pull request introduces minimal "skeleton" modules for the Dijkstra-era UTxO and UTxOW transition systems, setting up the structure for future development of phase-1 checks and witnessing logic. It also adds a phase-1 structural check (CIP-0118) to ensure that all credentials required by subtransactions are present in the top-level transaction. The changes include new files, imports, and some refactoring of helper functions to support these checks.

New Dijkstra UTxO and UTxOW skeleton modules:

  • Added src/Ledger/Dijkstra/Specification/Utxo.lagda.md as a minimal skeleton for the Dijkstra UTxO transition system, including the new phase-1 structural check (requiredTopLevelGuardsSatisfied) to enforce that all subTx-required credentials are present in the top-level transaction.
  • Added src/Ledger/Dijkstra/Specification/Utxow.lagda.md as a minimal skeleton for the Dijkstra witnessing layer, currently acting as a wrapper around UTxO with no additional premises.

Phase-1 structural check and helper refactoring:

  • In src/Ledger/Dijkstra/Specification/Transaction.lagda.md, refactored and added helper functions (subTxTaggedGuards, subTxGuardCredentials) and implemented the requiredTopLevelGuardsSatisfied condition for phase-1 validation.

Documentation and import updates:

  • Added imports for the new UTxO and UTxOW modules in src/Ledger/Dijkstra/Specification.lagda.md.
  • Updated metadata headers for Conway and Dijkstra UTxO/UTxOW specification files to use .md extensions. [1] [2]

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Any semantic changes to the specifications are documented in CHANGELOG.md
  • Code is formatted according to CONTRIBUTING.md
  • Self-reviewed the diff

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@williamdemeo williamdemeo changed the base branch from master to 1001-dijkstra-subtxbody-redesign January 6, 2026 03:47
@williamdemeo williamdemeo changed the title [Dijkstra] phase 1 requiredTopLevelGuards (stacked PR) [Dijkstra] phase 1 requiredTopLevelGuards Jan 6, 2026
@williamdemeo williamdemeo force-pushed the 1001-dijkstra-subtxbody-redesign branch from c5accc8 to 3c15d84 Compare January 6, 2026 05:11
@williamdemeo williamdemeo force-pushed the 1002-dijkstra-phase-1-requiredtoplevelguards-stacked branch from 29516cc to 2ba8844 Compare January 6, 2026 05:49
@williamdemeo williamdemeo force-pushed the 1001-dijkstra-subtxbody-redesign branch from b0d5934 to 1b1144b Compare January 7, 2026 01:34
@williamdemeo williamdemeo force-pushed the 1002-dijkstra-phase-1-requiredtoplevelguards-stacked branch from deeb8ad to df6879c Compare January 7, 2026 01:53
@williamdemeo williamdemeo force-pushed the 1001-dijkstra-subtxbody-redesign branch from 1b1144b to 05daaae Compare January 7, 2026 13:24
@williamdemeo williamdemeo force-pushed the 1002-dijkstra-phase-1-requiredtoplevelguards-stacked branch 2 times, most recently from 43ce03e to ec362bc Compare January 7, 2026 14:02
@williamdemeo williamdemeo force-pushed the 1001-dijkstra-subtxbody-redesign branch from 42b6d12 to 1ab3ec6 Compare January 7, 2026 14:14
@williamdemeo williamdemeo force-pushed the 1002-dijkstra-phase-1-requiredtoplevelguards-stacked branch from ec362bc to 5a88696 Compare January 7, 2026 14:16
Copy link
Collaborator

@carlostome carlostome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I left a minor comment that we can address later on if necessary

Comment on lines +494 to +501
-- Phase-1 condition (CIP-0118):
-- every credential required by a subTx body must appear in the top-level txGuards set.
requiredTopLevelGuardsSatisfied : TopLevelTx → List SubLevelTx → Type
requiredTopLevelGuardsSatisfied topTx subTxs = requiredCreds ⊆ TxBody.txGuards (TxBodyOf topTx)
where
concatMapˡ : {A B : Type} → (A → ℙ B) → List A → ℙ B
concatMapˡ f as = proj₁ $ unions (fromList (map f as))
-- (maybe move concatMapˡ to src-lib-exts or agda-sets)
Copy link
Collaborator

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?

Base automatically changed from 1001-dijkstra-subtxbody-redesign to master January 8, 2026 15:32
+ a minimal `UTXOS` rule as a stub/hook (so `UTXO` can call something),
+ a minimal `UTXO` rule with just the new phase-1 premise (plus an explicit "calls UTXOS"),
+ a minimal `UTXOW`; just a wrapper over `UTXO` for now.
@williamdemeo williamdemeo force-pushed the 1002-dijkstra-phase-1-requiredtoplevelguards-stacked branch from 5a88696 to 2dbea3f Compare January 8, 2026 15:38
@williamdemeo williamdemeo merged commit cd76009 into master Jan 8, 2026
2 of 3 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Dijkstra formal spec Jan 8, 2026
@williamdemeo williamdemeo deleted the 1002-dijkstra-phase-1-requiredtoplevelguards-stacked branch January 8, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dijkstra] phase-1 check: requiredTopLevelGuards in top-level guards

3 participants