From 3c3243a63ca75ce98a75f736b250e799d0c206ea Mon Sep 17 00:00:00 2001 From: Nic-dorman Date: Thu, 14 May 2026 13:37:22 +0100 Subject: [PATCH] feat(ant-dev): expose --preset flag on `ant dev start` (default: small) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ant dev start` previously hardcoded `ant-devnet --preset default` (25 nodes). On a cold-cache fresh start that reproducibly hits the manifest-wait timeout (#73) — even after #81's stop-time cleanup — because spinning up 25 nodes exceeds the 6-min wait window. New contributors following SETUP.md hit `Timed out waiting for devnet manifest` on their first run with no obvious cause. `--preset small` (10 nodes) finishes in seconds and is plenty for SDK development. Switch the default to `small` and expose `--preset` so users can opt back into `default` / `large` for stress runs. ## Why default changes (not just a new flag) Defaults should make the documented happy path actually work. With `default` as the default, `ant dev start --ant-node-dir …` per SETUP.md fails on cold cache; with `small`, it works. The proper fix is #73 Option A in `WithAutonomi/ant-node` (`tempfile::TempDir` + tokio signal handler in `ant-devnet/main.rs`) — once that lands and `default` works reliably, this flag still gives users a fast option for tight iteration loops. ## Test plan - [x] `ant dev start --ant-node-dir ~/Projects/ant-node` (no --preset) → uses `small`, devnet ready in ~10s - [x] `ant dev start --preset default --ant-node-dir …` → reproduces #73 manifest-timeout symptom (as expected — the underlying ant-devnet bug is unchanged) - [x] `ant dev start --help` shows the new flag with all three choices - [x] Cross-SDK e2e harness (15/15 SDKs) green with the default preset change Co-Authored-By: Claude Opus 4.7 (1M context) --- ant-dev/src/ant_dev/cli.py | 5 +++++ ant-dev/src/ant_dev/cmd_start.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ant-dev/src/ant_dev/cli.py b/ant-dev/src/ant_dev/cli.py index 6d436dc..2b02a40 100644 --- a/ant-dev/src/ant_dev/cli.py +++ b/ant-dev/src/ant_dev/cli.py @@ -24,6 +24,11 @@ def main(argv: list[str] | None = None) -> None: help="Path to ant-node repo") p.add_argument("--no-build", action="store_true", help="Skip build (use existing binaries)") p.add_argument("--enable-evm", action="store_true", help="Enable EVM payment enforcement") + # `default` (25 nodes) reproducibly hits the manifest-wait timeout on + # cold-cache fresh starts (#73). `small` (10 nodes) is plenty for SDK + # development and starts in seconds. + p.add_argument("--preset", default="small", choices=["small", "default", "large"], + help="ant-devnet size preset (default: small)") # ant dev stop dev_sub.add_parser("stop", help="Tear down all local processes") diff --git a/ant-dev/src/ant_dev/cmd_start.py b/ant-dev/src/ant_dev/cmd_start.py index 5870b2c..0c641a5 100644 --- a/ant-dev/src/ant_dev/cmd_start.py +++ b/ant-dev/src/ant_dev/cmd_start.py @@ -86,7 +86,7 @@ def run(args) -> None: devnet_cmd = [ "cargo", "run", "--release", "--bin", "ant-devnet", "--", - "--preset", "default", + "--preset", args.preset, "--enable-evm", "--manifest", str(DEVNET_MANIFEST), ]