Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
6ffebb6
Start
bkchr Mar 5, 2026
2f4408e
Updates
bkchr Mar 12, 2026
ef59f58
Updates
bkchr Mar 13, 2026
8eae11f
More updates
bkchr Mar 16, 2026
c004df0
Updates
bkchr Mar 17, 2026
53ecd47
Adds some authorizer example
bkchr Mar 20, 2026
05218e6
Updates
bkchr Mar 26, 2026
d4c5222
Updates
bkchr Mar 27, 2026
6add4c4
Updates
bkchr Apr 2, 2026
4a2b60e
Updates
bkchr Apr 15, 2026
2d9bcc4
Adds parachain registration
bkchr Apr 17, 2026
0bf39fa
Add changes to parachain management
bkchr Apr 20, 2026
129b62d
More on the parachain management
bkchr Apr 22, 2026
51b6a29
More refinements
bkchr Apr 22, 2026
27c08ba
More updates
bkchr Apr 24, 2026
d4180a6
Fix some spelling and other issues
bkchr Apr 24, 2026
b949760
Review comments
bkchr Apr 28, 2026
eed44d5
Some improvements
bkchr Apr 28, 2026
2ec19a1
Make Jan happy
bkchr Apr 30, 2026
dcae898
Move stale upgrade detection to work package processing
bkchr May 25, 2026
d08bff5
Start handling
bkchr Jun 1, 2026
c4a9aaa
Mention staged validator changing
bkchr Jun 4, 2026
39ddf8e
Move file and register the PVF in the preimage registry
bkchr Jun 8, 2026
ee2b0a9
We should include the length of the validation code :)
bkchr Jun 9, 2026
c3e4bb3
Make it clear that overriding upgrades is allowed
bkchr Jun 10, 2026
e3b72ca
Clarify `solicit`/`forget` for active/pending validation code
bkchr Jun 10, 2026
2af3b60
Make designate clearer
bkchr Jun 16, 2026
5a29d46
Start adding a quint spec
bkchr Jun 16, 2026
739cd96
Remove missing features
bkchr Jun 23, 2026
76cdd45
Result => digest
bkchr Jun 23, 2026
f5de068
Include functionality for upgrading the parachain service
bkchr Jun 24, 2026
64b7daf
New error variants and clarifications
bkchr Jun 24, 2026
fb32c90
Introduce more error types
bkchr Jun 24, 2026
0b4b3d2
Integrate the service upgrade into quint
bkchr Jun 24, 2026
b09d978
Change the way we are building messages
bkchr Jun 24, 2026
b0f6d8c
More improvements
bkchr Jun 25, 2026
5cb5fa7
Support always accumulating testing in quint
bkchr Jun 25, 2026
c01f970
Fix set validation code function
bkchr Jun 26, 2026
6ab6d67
Make clear that the value should be hard coded
bkchr Jun 26, 2026
b628367
Correct the state balance calculation
bkchr Jun 26, 2026
4ed4f27
Some clarifications
bkchr Jun 26, 2026
9e15728
Ensure we account for the all the service state
bkchr Jun 26, 2026
2913e0c
Some clarification
bkchr Jun 26, 2026
fc20ea0
Declare MEMO
bkchr Jun 26, 2026
0b3bfd9
Bound the types
bkchr Jun 26, 2026
11eb9fe
Check the work digest size
bkchr Jun 26, 2026
e3b3fce
Add latest changes to quint
bkchr Jun 26, 2026
e62665d
Add a test that checks the incoming transfer bouncing
bkchr Jun 26, 2026
1b9fea4
More tests
bkchr Jun 26, 2026
d9260a9
More improvements
bkchr Jun 26, 2026
c2bc6dc
Support failing refines
bkchr Jun 26, 2026
4e74130
Introduce `set_head` and a dedicated error type
bkchr Jun 27, 2026
b43d61d
Fixes for quint verify
bkchr Jun 29, 2026
4a92979
Rework parachain_log state layout
bkchr Jun 29, 2026
4f002e2
Count bytes for `parachain_log` and bound them to 64KIB
bkchr Jul 1, 2026
e12b96c
Rework the pending authorizers storage entry
bkchr Jul 2, 2026
4ee68e7
Some refactorings
bkchr Jul 3, 2026
3ef242c
Adds a test
bkchr Jul 3, 2026
79afc89
Move always accumulate after refine
bkchr Jul 3, 2026
82cd434
We will not have host functions for trie operations
bkchr Jul 3, 2026
0480e5c
Switch preimage storage to (hash, len)
bkchr Jul 6, 2026
1e9a9ea
Some updates to the storage costs
bkchr Jul 6, 2026
4a12338
Introduce new invariant around log pruning and clarify some things
bkchr Jul 7, 2026
69f37bf
Ensure we are calling `assign` directly.
bkchr Jul 8, 2026
6bada92
Make `SetAssigner` its own variant
bkchr Jul 8, 2026
a85bff8
fix code_activation_releases_old
ggwpez Jul 8, 2026
225d501
Merge remote-tracking branch 'refs/remotes/origin/bkchr-parachain-ser…
bkchr Jul 9, 2026
995b06e
:facepalm:
bkchr Jul 9, 2026
25d55df
Ensure that heads are updated correctly
bkchr Jul 9, 2026
f9752a6
Do not remove messages from stale candidates, they should not be appl…
bkchr Jul 9, 2026
9eb8615
More tests
bkchr Jul 9, 2026
0f2d912
Simplify the authorizer queue update
bkchr Jul 10, 2026
058620c
Fix for apalache
bkchr Jul 10, 2026
92033fc
Simplify the code
bkchr Jul 13, 2026
f43fbb7
Move lookup_anchor into the WorkResult
bkchr Jul 13, 2026
1b9efbc
Introduce a way to transfer recovery funds
bkchr Jul 14, 2026
cc1ac2d
Put the entire validator keys into the baseline footprint of AH
bkchr Jul 14, 2026
692e3f7
Handle `transfer` failed
bkchr Jul 14, 2026
f3e2af5
Extra test
bkchr Jul 14, 2026
473a611
Extra invariant
bkchr Jul 14, 2026
17dd261
Some clarification
bkchr Jul 14, 2026
80d5ad1
Improve storage keys
bkchr Jul 15, 2026
b61875c
Introduce Key/Value storage for parachains
bkchr Jul 15, 2026
c4318d6
Fix upwardmessagesize
bkchr Jul 15, 2026
1a1742f
Some optimizations
bkchr Jul 15, 2026
e29c7fc
Use the new function
bkchr Jul 16, 2026
032de67
Remove the max inner accumulate logs
bkchr Jul 16, 2026
8162ca9
Use `Compact` for balances
bkchr Jul 16, 2026
a5632ec
Bound max upward messages to 1024
bkchr Jul 16, 2026
51818c5
Make it work with the real JAM `forget` process
bkchr Jul 18, 2026
c4d91e5
Improve the code readability by directly forwarding the hashes for fo…
bkchr Jul 19, 2026
afe236d
Convert `ValidationCode` to `Option` in `ParaInfo`
bkchr Jul 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,430 changes: 1,430 additions & 0 deletions designs/parachain-service-on-jam/parachain-service-on-jam.md

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions designs/parachain-service-on-jam/quint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Parachain Service on JAM — Quint Spec

Formal model of the [Parachain Service on JAM](../parachain-service-on-jam.md)
design, written in [Quint](https://quint-lang.org).

## File layout

| File | Models | Source § |
|---|---|---|
| [`types.qnt`](./types.qnt) | Foundational types (`ParaId`, `Hash`, `ValidatorKey`, …) and protocol constants (`ValCount`, `MaxReportVarSize`, …) | — |
| [`messages.qnt`](./messages.qnt) | `UpwardMessage`, `ParachainWorkDigest`, `RefineLog`, `AccumulateLog` | §3.3, §4 |
| [`state.qnt`](./state.qnt) | `ParaInfo`, `PreimageEntry`, `ParachainServiceState` | §3.1 |
| [`state_balance.qnt`](./state_balance.qnt) | `baseline_footprint`, `used`/`total_state_balance` accounting, preimage-registry referencer multiplexing | §6.1 |
| [`code_upgrades.qnt`](./code_upgrades.qnt) | Pending-upgrade lifecycle: request, transition, activation, timeout | §5.2 |
| [`validator_keys.qnt`](./validator_keys.qnt) | Chunked `designate`: `set_validator_keys`, `staged_validator_keys`, finalize/abort | §5.3 |
| [`refine.qnt`](./refine.qnt) | Refine per work-item, abstract PVF execution, `ParachainWorkDigest` assembly | §4 |
| [`accumulate.qnt`](./accumulate.qnt) | Per-work-package and always-accumulate work, upward-message replay | §5.1 |
| [`management.qnt`](./management.qnt) | Coretime-chain-only host calls: `parachain_set_state_balance`, `_set_head`, `_set_validation_code`, `_clean_up` | §6 |
| [`state_vars.qnt`](./state_vars.qnt) | Shared `var` declarations: `svc`, `now`, `jamStagingSet`, `coretimeChain`, `assetHub`, ghost `solicitedSet` — imported by `main.qnt` and `invariants.qnt` so both modules refer to the same state | — |
| [`invariants.qnt`](./invariants.qnt) | Nullary `val: bool` catalogue of every state invariant (balance, preimage-registry, designate, code-upgrade, staged-keys, solicit-bookkeeping) + composite `invariants` | — |
| [`main.qnt`](./main.qnt) | Composition: `init`, `step`, refine-input generators. State variables live in `state_vars.qnt`; invariants in `invariants.qnt`. | — |
| [`tests.qnt`](./tests.qnt) | `run` tests (e.g. `testBounceOnFull` — `incoming_transfers` at capacity bounces the next ingress). | — |

## Scope

**Modeled:**
- All Parachain Service state per §3.1.
- The full upward-message vocabulary the PVF can emit during Refine.
- Accumulate replay semantics: parent-head check, code-upgrade activation,
preimage-registry referencer multiplexing, state-balance accounting,
chunked `designate`.
- Coretime-chain-only host calls for registration, forced updates, clean-up.
- The pending-authorizer-queue cache flush on the always-accumulate path.

**Abstracted:**
- Cryptography (signatures, hashes, Merkle proofs) — opaque opaque types.
- PVF execution — modelled as a nondeterministic choice of result + upward-message
list, constrained by §4.1 invariants only.
- D3L segment storage and DA — out of scope (D3L is the §8 messaging design,
still TBD in the design doc itself).
- The AURA authorizer's per-slot collator logic (§7.1) — we only model the
`assigners`/`assign` calls and the queue draining/flush rule.

**Not modeled (matches design TBDs):**
- Cross-chain messaging (XCMP) — §8 is itself a future design.
- Anchor-timeslot exposure and lookup-anchor posterior state-root access — §9.

## Invariants

The top-level invariants live in [`main.qnt`](./main.qnt). The key ones:

- **`balance_invariant`**: for every live para, `0 ≤ used_state_balance ≤
total_state_balance`.
- **`preimage_referencer_consistency`**: a `ParaId` appears in
`preimage_registry[h].referencers` iff its `ParaInfo` accounts for that
preimage's footprint in `used_state_balance`.
- **`designate_only_on_is_last`**: JAM `designate` is invoked iff Accumulate
just processed a `SetValidatorKeys { is_last: true }` message that passed
the `valcount` check.
- **`staged_keys_owner`**: `staged_validator_keys` is mutated only on a
successful replay of a `SetValidatorKeys` message from Asset Hub.
- **`no_pending_when_code_matches`**: if `ParaInfo.pending_upgrade ==
Some((h, _))` then `ParaInfo.validation_code_hash != h`.
- **`work_result_parent_continuity`**: every accumulated work result's
`parent_head_hash` equals the hash of the para's previous `head_data`.

## Running the spec

```sh
quint typecheck main.qnt # static checks
quint run main.qnt # randomized exploration
quint test --backend=typescript tests.qnt # unit tests
quint verify main.qnt # symbolic model checking (via Apalache)
```
Loading
Loading