Skip to content

fix(devnets): release a deleted devnet's name - #65

Merged
ktechmidas merged 1 commit into
masterfrom
fix/reuse-deleted-devnet-name
Nov 14, 2026
Merged

ktechmidas merged 1 commit into
masterfrom
fix/reuse-deleted-devnet-name

Conversation

@ktechmidas

@ktechmidas ktechmidas commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A devnet created and deleted from the console keeps its name forever. devnet-sakura was deployed and destroyed, and a new request for that name is refused with "already exists; journal records are permanent, pick a new name".

There are two locks on a name. This PR removes the console's. The second is in dash-network-go, whose state table binds a name to its first EC2 plan permanently; that is dashpay/dash-network-go#32, which lets a new plan take over a name only when the old record is addresses-released (what a finished console delete leaves) and unclaimed, and archives the old record instead of deleting it. Until the agent runs a dashnet build with it, a re-created devnet gets through preparation and then fails at "Provision" with dashnet's own "bound to a different plan" error. Nothing is created in that case.

Change

A name whose registry entry is deleted can be requested again. deleting, failed and every live status still refuse. The new devnet shares nothing with the old one:

  • Files. Creation stages resume from files in the devnet's work directory (ec2-plan.json, bootstrap-plan.json, known_hosts, deployment.json, the pinned dashnet). Preparing a creation for a deleted name first moves that directory to private/devnets-deleted/<name>-<time>. It is kept, not removed, and is done once: preparing again does not move the new files.
  • Published facts. data/devnets/<name>/config.json (hosts and masternode identities for members) is removed at the same time, so the old devnet's connection files are never served for the new one.
  • Registry. When the confirmed creation starts, the entry is replaced instead of merged. Addresses, promo codes, the faucet wallet, versions, upgrade scopes and readiness of the old devnet do not carry over. previous keeps who created the old one, when it was deleted and its operation ID (last 20).
  • Who may take the name. Only a creation requested after the deletion, and prepared after it. The operation that built the deleted devnet cannot be resumed into the name, before or after the new devnet exists.
  • Review. The confirmation page says the name was used before. The Core chain name and Platform chain ID are derived from the name, so the new devnet has the same ones as the deleted devnet with a new chain behind them. Anything still configured for the old one (wallets, peers, saved addresses) will not match.
  • The new-devnet form no longer lists deleted names as taken.

Not changed

  • Deleting a devnet. A name is released only by a deletion that finished (DNS removed, instances terminated, addresses released, volumes deleted), which is when the entry becomes deleted.
  • Operation history, trends and incident history are keyed by name and continue under the new devnet.
  • The old devnet's files are kept indefinitely in devnets-deleted/; nothing prunes them.
  • Names that dash-network-go does not release stay unusable even though the console now accepts the request: a devnet without IPAM public addresses, and one whose creation never launched every instance. Those fail closed at "Provision".

Testing

Run locally on Windows (Node 22):

  • node --test: 183 tests, 167 passed, 11 skipped, 5 failed. The same 5 fail on unmodified master on that machine (181 tests, 165 passed). 2 tests added, 1 extended: validation per status; a full prepare and start of a creation on a deleted name against a fake dashnet (old files kept aside and not reused, facts removed, registry replaced, old operation refused, repeat prepare and resume); the form's list.
  • eslint . clean, vite build succeeds.
  • Not exercised: a real creation against AWS, and the new review notice in a browser. Nothing here has been deployed.

🤖 Generated with Claude Code

A devnet created and deleted from the console kept its name forever: the
request was refused with "already exists; journal records are permanent".

A name whose registry entry is `deleted` can now be requested again. The new
devnet shares nothing with the old one:

- Preparation moves the deleted devnet's work directory (plans, host keys,
  secrets, stage journals) aside to devnets-deleted/, once, and removes its
  published connection facts. Creation stages resume from files in that
  directory, so reusing it would have continued the old deployment.
- When the confirmed creation starts, the registry entry is replaced, not
  merged: addresses, promo codes, wallet, versions and readiness of the old
  devnet do not carry over. A short history of who held the name is kept.
- Only a creation requested after the deletion, and prepared, takes the name.
  The creation that built the deleted devnet can no longer be resumed.
- The review says the name, and so the chain name, was used before.

Whether the EC2 journal record may be replaced is decided by dash-network-go
when it provisions. With a dashnet build that keeps records permanent, the
provision step still fails closed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0fef9172-f007-458d-921c-ed4390723f61
Commits

Reviewing files that changed from the base of the PR and between 65e49f1 and c05d1b2.

Files selected for processing: 7

  • README.md
  • agent/agent.test.js
  • agent/devnets.js
  • server/web.js
  • server/web.test.js
  • src/pages/NewDevnet.jsx
  • src/pages/Operation.jsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ktechmidas
ktechmidas merged commit e185c49 into master Nov 14, 2026
4 checks passed
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