Skip to content

asteria-stub: minimal test-composer host for property experimentation#74

Merged
paolino merged 1 commit intomainfrom
chore/asteria-stub
Apr 30, 2026
Merged

asteria-stub: minimal test-composer host for property experimentation#74
paolino merged 1 commit intomainfrom
chore/asteria-stub

Conversation

@paolino
Copy link
Copy Markdown
Collaborator

@paolino paolino commented Apr 27, 2026

Green baseline: a tiny asteria-stub container hosts composer scripts (parallel_driver_heartbeat, eventually_alive, finally_alive) that emit SDK assertions without real workload. Used to evolve property checks before touching the real asteria-player. Real game logic stays in #67.

The 1h test on this branch was clean: 44 properties pass, 0 failed — https://cardano.antithesis.com/report/pr8n2PnMt9dgEWH-J38RYKV0/HAuvbkC8isytvseFh78pnE7b8Mi4ZWZg-cjTN8rxNM8.html?auth=v2.public.eyJzY29wZSI6eyJSZXBvcnRTY29wZVYxIjp7ImFzc2V0IjoiSEF1dmJrQzhpc3l0dnNlRmg3OHBuRTdiOE1pNFpXWmctY2pUTjhyeE5NOC5odG1sIiwicmVwb3J0X2lkIjoicHI4bjJQbk10OWRnRVdILUozOFJZS1YwIn19LCJuYmYiOiIyMDI2LTA0LTI5VDA5OjU4OjMyLjEzODc1NTEwNVoifcrbtMMLMUPPaefiRjpvlw9gLXXnOYkW4HlIfXBVeRUK3aFH0RNhdE9WDgB_Zsl5KZa-GnGc0vvBHJuJh0fQdwc

Single commit, rebased on post-PR #82 main.

@paolino paolino force-pushed the chore/asteria-stub branch 5 times, most recently from 7d32546 to c926dec Compare April 29, 2026 11:30
paolino added a commit that referenced this pull request Apr 29, 2026
Drop the asteria-stub harness — it served its purpose as the green
baseline (PR #74 iter 5 was the proof). Replace it with the actual
asteria-player workload from #67 (asteria-spawn-v2 HEAD ab1a462):

  - components/asteria-player/ — Haskell binaries (asteria-bootstrap
    + asteria-player), Aiken validators, composer scripts at
    composer/asteria/{eventually_asteria_alive, helper_sdk_lib,
    parallel_driver_asteria_bootstrap, parallel_driver_asteria_player}.sh

Compose adds three services (asteria-bootstrap one-shot + 2 long-
running players) and the asteria-sdk volume that connects them. The
image is pinned by content digest to the build of #67's HEAD —
ghcr.io/.../asteria-player@sha256:2cf2b33f… — so we run exactly the
bytes #67 produced. The branch tag (:asteria-spawn-v2) which #67's
own compose still uses is a tag-mutability footgun that #71's
discipline eliminates here.

Future bumps: change the source under components/asteria-player/,
let publish-images build a new image at the new commit, then update
this digest. publish-images already supports digest-only entries via
PR #71's script change (skipped, image already exists).
@paolino paolino changed the title asteria-stub: minimal test-composer host for property experimentation asteria-player: real workload from PR #67, digest-pinned Apr 29, 2026
@paolino paolino force-pushed the chore/asteria-stub branch 2 times, most recently from 6a02715 to c926dec Compare April 29, 2026 11:43
@paolino paolino changed the title asteria-player: real workload from PR #67, digest-pinned asteria-stub: minimal test-composer host for property experimentation Apr 29, 2026
@paolino paolino force-pushed the chore/asteria-stub branch 2 times, most recently from 084f878 to 8e4a285 Compare April 29, 2026 14:35
@paolino paolino force-pushed the chore/asteria-stub branch from 8e4a285 to 9958981 Compare April 30, 2026 11:08
The asteria-stub container becomes the long-running chain-following
indexer. Its main process is upstream `utxo-indexer` from
lambdasistemi/cardano-node-clients PR #98
(035-indexer-n2c-reconnect at 5707836b), pinned via a flake input
and baked into the image by `nix build .#docker-image`. The indexer
follows relay1's chain over N2C, persists state to RocksDB at
/idx-db, exposes ready/utxos_at/await on /tmp/idx.sock, and now
auto-reconnects in-process when the N2C peer closes the socket
(supervisor + exponential-backoff retry from upstream issue #97).

Replaces the per-component Dockerfile + apt + cardano-cli setup
with a pure-nix build (flake.nix + nix/docker-image.nix). cardano-cli
is no longer needed in this image because composer scripts now
query the indexer's socket directly.

Composer scripts (kept in their stub shape):
  - parallel_driver_heartbeat.sh — pings indexer's `ready`,
    Sometimes-true on processedSlot==tipSlot
  - eventually_alive.sh — post-fault: same probe with retries
  - finally_alive.sh — post-workload: same probe with retries

Compose: mount relay1-state:/state:ro for the indexer's N2C peer
and add asteria-stub-db named volume for RocksDB persistence. No
restart: always — the supervisor handles transient peer churn.
@paolino paolino force-pushed the chore/asteria-stub branch from 9958981 to b102cfd Compare April 30, 2026 11:30
@paolino paolino merged commit 3b6fb0e into main Apr 30, 2026
10 checks passed
paolino added a commit that referenced this pull request Apr 30, 2026
PR 1 of 2 toward the real asteria workload. Scope-limited to the
rename + Haskell source lift + nix scaffolding so the binaries
build alongside the existing utxo-indexer. Bootstrap is iteration
5b — *not safe for repeat invocation* — that gap is explicitly the
subject of PR 2.

Rename:
  components/asteria-stub/ → components/asteria-game/
  service asteria-stub      → asteria-game
  volume  asteria-stub-db   → asteria-game-db

Lift from #67 (asteria-spawn-v2):
  components/asteria-game/aiken/         (validators + apply-params)
  components/asteria-game/src/Asteria/   (game state, datums, validators, wallet, providers, RNG, SDK)
  components/asteria-game/app/{BootstrapMain.hs, PlayerMain.hs}
  components/asteria-game/asteria-game.cabal      (renamed package)
  components/asteria-game/cabal.project           (cardano-node-clients SRP bumped to PR #98 head 5707836b)

Build infra:
  flake.nix — extends prior asteria-stub flake with haskell.nix /
    iohk-nix overlays so local Haskell packages compile, while
    keeping the upstream cardano-node-clients flake input that
    supplies the prebuilt utxo-indexer (PR #98 supervisor).
  nix/project.nix — lifted from PR #67, package renamed.
  nix/docker-image.nix — bundles utxo-indexer + asteria-bootstrap
    + asteria-game (player) execs + composer scripts + bash/jq/
    socat; entrypoint stays utxo-indexer.

KNOWN GAP — admin_mint validator is the always-true placeholder
PR #67 ships. Without an on-chain one-shot guarantee, every
container restart could mint another admin NFT. Bootstrap is *not*
wired into compose in this PR for that reason. PR 2 patches the
Aiken admin_mint to take an OutputReference parameter, runs
apply-params at bootstrap-time, and adds defence-in-depth detection
in Bootstrap.hs.

Composer scripts (composer/stub/{parallel_driver_heartbeat,
eventually_alive, finally_alive, helper_sdk}.sh) unchanged from
the green stub baseline so this PR stays bisect-safe and in
property terms identical to commit 3b6fb0e (PR #74's merged head).
paolino added a commit that referenced this pull request Apr 30, 2026
PR 1 of 2 toward the real asteria workload. Scope-limited to the
rename + Haskell source lift + nix scaffolding so the binaries
build alongside the existing utxo-indexer. Bootstrap is iteration
5b — *not safe for repeat invocation* — that gap is explicitly the
subject of PR 2.

Rename:
  components/asteria-stub/ → components/asteria-game/
  service asteria-stub      → asteria-game
  volume  asteria-stub-db   → asteria-game-db

Lift from #67 (asteria-spawn-v2):
  components/asteria-game/aiken/         (validators + apply-params)
  components/asteria-game/src/Asteria/   (game state, datums, validators, wallet, providers, RNG, SDK)
  components/asteria-game/app/{BootstrapMain.hs, PlayerMain.hs}
  components/asteria-game/asteria-game.cabal      (renamed package)
  components/asteria-game/cabal.project           (cardano-node-clients SRP bumped to PR #98 head 5707836b)

Build infra:
  flake.nix — extends prior asteria-stub flake with haskell.nix /
    iohk-nix overlays so local Haskell packages compile, while
    keeping the upstream cardano-node-clients flake input that
    supplies the prebuilt utxo-indexer (PR #98 supervisor).
  nix/project.nix — lifted from PR #67, package renamed.
  nix/docker-image.nix — bundles utxo-indexer + asteria-bootstrap
    + asteria-game (player) execs + composer scripts + bash/jq/
    socat; entrypoint stays utxo-indexer.

KNOWN GAP — admin_mint validator is the always-true placeholder
PR #67 ships. Without an on-chain one-shot guarantee, every
container restart could mint another admin NFT. Bootstrap is *not*
wired into compose in this PR for that reason. PR 2 patches the
Aiken admin_mint to take an OutputReference parameter, runs
apply-params at bootstrap-time, and adds defence-in-depth detection
in Bootstrap.hs.

Composer scripts (composer/stub/{parallel_driver_heartbeat,
eventually_alive, finally_alive, helper_sdk}.sh) unchanged from
the green stub baseline so this PR stays bisect-safe and in
property terms identical to commit 3b6fb0e (PR #74's merged head).
paolino added a commit that referenced this pull request Apr 30, 2026
PR 1 of 2 toward the real asteria workload. Scope-limited to the
rename + Haskell source lift + nix scaffolding so the binaries
build alongside the existing utxo-indexer. Bootstrap is iteration
5b — *not safe for repeat invocation* — that gap is explicitly the
subject of PR 2.

Rename:
  components/asteria-stub/ → components/asteria-game/
  service asteria-stub      → asteria-game
  volume  asteria-stub-db   → asteria-game-db

Lift from #67 (asteria-spawn-v2):
  components/asteria-game/aiken/         (validators + apply-params)
  components/asteria-game/src/Asteria/   (game state, datums, validators, wallet, providers, RNG, SDK)
  components/asteria-game/app/{BootstrapMain.hs, PlayerMain.hs}
  components/asteria-game/asteria-game.cabal      (renamed package)
  components/asteria-game/cabal.project           (cardano-node-clients SRP bumped to PR #98 head 5707836b)

Build infra:
  flake.nix — extends prior asteria-stub flake with haskell.nix /
    iohk-nix overlays so local Haskell packages compile, while
    keeping the upstream cardano-node-clients flake input that
    supplies the prebuilt utxo-indexer (PR #98 supervisor).
  nix/project.nix — lifted from PR #67, package renamed.
  nix/docker-image.nix — bundles utxo-indexer + asteria-bootstrap
    + asteria-game (player) execs + composer scripts + bash/jq/
    socat; entrypoint stays utxo-indexer.

KNOWN GAP — admin_mint validator is the always-true placeholder
PR #67 ships. Without an on-chain one-shot guarantee, every
container restart could mint another admin NFT. Bootstrap is *not*
wired into compose in this PR for that reason. PR 2 patches the
Aiken admin_mint to take an OutputReference parameter, runs
apply-params at bootstrap-time, and adds defence-in-depth detection
in Bootstrap.hs.

Composer scripts (composer/stub/{parallel_driver_heartbeat,
eventually_alive, finally_alive, helper_sdk}.sh) unchanged from
the green stub baseline so this PR stays bisect-safe and in
property terms identical to commit 3b6fb0e (PR #74's merged head).
paolino added a commit that referenced this pull request May 1, 2026
PR 1 of 2 toward the real asteria workload. Scope-limited to the
rename + Haskell source lift + nix scaffolding so the binaries
build alongside the existing utxo-indexer. Bootstrap is iteration
5b — *not safe for repeat invocation* — that gap is explicitly the
subject of PR 2.

Rename:
  components/asteria-stub/ → components/asteria-game/
  service asteria-stub      → asteria-game
  volume  asteria-stub-db   → asteria-game-db

Lift from #67 (asteria-spawn-v2):
  components/asteria-game/aiken/         (validators + apply-params)
  components/asteria-game/src/Asteria/   (game state, datums, validators, wallet, providers, RNG, SDK)
  components/asteria-game/app/{BootstrapMain.hs, PlayerMain.hs}
  components/asteria-game/asteria-game.cabal      (renamed package)
  components/asteria-game/cabal.project           (cardano-node-clients SRP bumped to PR #98 head 5707836b)

Build infra:
  flake.nix — extends prior asteria-stub flake with haskell.nix /
    iohk-nix overlays so local Haskell packages compile, while
    keeping the upstream cardano-node-clients flake input that
    supplies the prebuilt utxo-indexer (PR #98 supervisor).
  nix/project.nix — lifted from PR #67, package renamed.
  nix/docker-image.nix — bundles utxo-indexer + asteria-bootstrap
    + asteria-game (player) execs + composer scripts + bash/jq/
    socat; entrypoint stays utxo-indexer.

KNOWN GAP — admin_mint validator is the always-true placeholder
PR #67 ships. Without an on-chain one-shot guarantee, every
container restart could mint another admin NFT. Bootstrap is *not*
wired into compose in this PR for that reason. PR 2 patches the
Aiken admin_mint to take an OutputReference parameter, runs
apply-params at bootstrap-time, and adds defence-in-depth detection
in Bootstrap.hs.

Composer scripts (composer/stub/{parallel_driver_heartbeat,
eventually_alive, finally_alive, helper_sdk}.sh) unchanged from
the green stub baseline so this PR stays bisect-safe and in
property terms identical to commit 3b6fb0e (PR #74's merged head).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant