Skip to content

M2 review follow-ups: mainnet labels, deposit post-conditions, green CI#8

Open
jayteemoney wants to merge 3 commits into
mainfrom
fix/m2-review-followups
Open

M2 review follow-ups: mainnet labels, deposit post-conditions, green CI#8
jayteemoney wants to merge 3 commits into
mainfrom
fix/m2-review-followups

Conversation

@jayteemoney
Copy link
Copy Markdown
Owner

Addresses the three follow-ups from the Milestone 2 review.

1. Mainnet labels (prioritized)

The app runs on mainnet, but several surfaces hardcoded "testnet" and told visitors the wrong thing. All now derive from the existing NETWORK config via a new NETWORK_LABEL constant and the network-aware EXPLORER_BASE:

  • Landing CTA copy ("on Stacks testnet" → network-aware)
  • Footer "Hiro Explorer" link + bottom network link (were ?chain=testnet)
  • Sidebar network badge (was hardcoded "Testnet")

No new env var needed — these track NEXT_PUBLIC_NETWORK, which is already mainnet in production.

2. Deny-by-default post-conditions on deposits

create-stream and top-up-stream are the calls where a user's funds leave their wallet, but both used PostConditionMode.Allow. Switched to PostConditionMode.Deny with the existing explicit-amount post-condition bounding the sender's outflow, matching the deny-by-default exit paths (claim / cancel).

3. Green CI on main

The multi-cycle pause/resume property test ("status returns to ACTIVE after each resume") assumed every cycle succeeds. When the random walk lands the block height on/past end-block between pause and resume, the contract correctly rejects resume with ERR-STREAM-ENDED (by design — prevents a zombie ACTIVE state), leaving the stream PAUSED, so the assertion flaked. The loop now breaks once pause/resume is no longer ok; the invariant only applies while the stream is live. The deployed contract is unaffected — this was an over-strict test assertion.

Verification

  • npm test — 125/125 passing
  • tsc --noEmit — no errors in changed frontend files

The app runs on mainnet but several UI surfaces still hardcoded
"testnet", telling visitors the wrong thing:
- landing CTA copy ("on Stacks testnet")
- footer Hiro Explorer link + bottom network link (?chain=testnet)
- sidebar network badge ("Testnet")

Derive all of these from the existing NETWORK config via a new
NETWORK_LABEL constant and the network-aware EXPLORER_BASE, so the
site always reflects the chain it is actually running on.
create-stream and top-up-stream are the calls where a user's funds
leave their wallet, but both used PostConditionMode.Allow. Switch them
to PostConditionMode.Deny with the existing explicit-amount post-
condition bounding the sender's outflow, matching the deny-by-default
exit paths (claim/cancel). The wallet now enforces the exact token and
amount leaving the wallet at signing time.
The "status returns to ACTIVE after each resume" property test assumed
every pause/resume cycle succeeds. When a random walk pushes the block
height onto or past end-block between pause and resume, the contract
correctly rejects resume with ERR-STREAM-ENDED (by design, to avoid a
zombie ACTIVE state), leaving the stream PAUSED — so the assertion
intermittently failed on streams that elapse mid-cycle.

Break out of the cycle loop once pause or resume is no longer ok; the
invariant only applies while the stream is still live. The deployed
contract is unaffected — this was an over-strict test assertion.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stackstream Ready Ready Preview, Comment May 31, 2026 1:40pm

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