testnet: de-list the ephemeral e2e councils after each suite run - #147
Closed
AquiGorka wants to merge 1 commit into
Closed
testnet: de-list the ephemeral e2e councils after each suite run#147AquiGorka wants to merge 1 commit into
AquiGorka wants to merge 1 commit into
Conversation
Both suites leave their per-run council listed on council-platform, so every run adds a junk council to the public network dashboard. Each suite now sweeps all councils owned by its admin key at the end of a passed run; the sweep only covers crashed runs too when MASTER_SECRET is set, since random keys are unrecoverable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every run of the testnet suites creates a listed council (
Testnet E2E <ts>in testnet/main.ts,Testnet Verify <ts>in lifecycle/testnet-verify.ts) and never removes it. Six such councils have accumulated on the public network dashboard (07-27 to 07-28 alone) alongside the pre-audit demo set, so the demo surface shows a junk network. Worse: runs without MASTER_SECRET use random admin keys, and council deletion is ownership-checked, so those leaked councils are permanently orphaned (only DB surgery can remove them).Fix
New shared
testnet/cleanup-councils.ts: at the end of a passed run each suite re-auths as its admin key and deletes every council that key owns viaDELETE /api/v1/council/metadata. Sweeping by owner (not just this run's id) also collects leftovers from earlier crashed runs whenever the suite runs with MASTER_SECRET-deterministic keys. Cleanup is loud but non-fatal: a failed sweep prints a WARNING but does not turn a passed payment/lifecycle flow into a failed suite.Companion action (not in this diff, needs an ops decision): the deployed-testnet invocation (nightly job) should always set MASTER_SECRET, otherwise a run that dies mid-flow still leaks an undeletable council.
Verified
deno lintanddeno fmt --checkclean.deno checkreports only the 8 pre-existing errors on main (stellar-sdk Keypair type mismatch at the deriveKeypair call sites, identical count and locations on a clean checkout); the new code adds none. Not exercised against deployed testnet from here: running the suite creates real councils, which is what this PR exists to stop; the sweep uses the same walletAuth + endpoints the suites already exercise.