Skip to content

fix(#2464): don't register the market until insurance has verified - #2536

Merged
dcccrypto merged 1 commit into
playgroundfrom
fix/2464-launch-ordering
Sep 3, 2026
Merged

fix(#2464): don't register the market until insurance has verified#2536
dcccrypto merged 1 commit into
playgroundfrom
fix/2464-launch-ordering

Conversation

@dcccrypto

Copy link
Copy Markdown
Owner

Closes #2464.

The batched launch started the keeper-register call, then ran the M3b insurance broadcast and its on-chain verification, then awaited the call. So the request was in flight — and could already have completed — while that check was still deciding whether the launch had failed.

A launch that threw "Insurance fund was not seeded" could therefore leave the market listed and keeper-registered anyway: on-chain state, app registry, keeper service and the user-visible result all disagreeing. Exactly as reported.

Fixed by making it a thunk invoked after the insurance gate rather than a promise started before it.

The window is unchanged — which is what made this fixable

The source documents both bounds, and they are why it couldn't simply be moved anywhere:

  • after M3a — a market is listed only once it holds collateral. This is the ANSEM zombie: registration used to fire right after M1, and since "create the market" always succeeds, every failed launch left a listed, unfunded, untradeable market behind.
  • before M4StakeInitPool rotates marketauth away from the deployer, and keeper-register's H1 check requires it to still equal the deployer.

The insurance check sits inside that window, so registration only had to move later within it, not out of it.

The cost, stated rather than hidden

Latency. The round-trip no longer overlaps M3b's broadcast, so the tail sits longer against the shared blockhash.

That is the right trade: the blockhash-expiry path already rebuilds a not-yet-landed tail tx against a fresh blockhash (TailTxDescriptor), whereas an incorrectly published market has no equivalent undo.

Tests

Two existing source-position tests pinned the old ordering. Updated to assert the invocation rather than the declaration — and tightened: the zombie guard now also requires registration to follow the insurance gate, which is the #2464 property itself.

Negative control: restoring the eager start fails both.

Launch suite: 3149 passed / 16 skipped / 0 failed; tsc clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D

The batched launch STARTED the keeper-register call, then ran the M3b insurance
broadcast and its on-chain verification, then awaited the call. So the
registration request was in flight — and could already have completed — while the
check was still deciding whether the launch had failed.

A launch that threw "Insurance fund was not seeded" could therefore leave the
market listed and keeper-registered anyway: on-chain state, app registry, keeper
service and the user-visible result all disagreeing.

Fixed by making it a thunk invoked AFTER the insurance gate rather than a promise
started before it.

THE WINDOW IS UNCHANGED AND STILL SATISFIED, which is what made this fixable at
all. The source documents both bounds:

  * after M3a — so a market is listed only once it actually holds collateral.
    This is the ANSEM zombie: registration used to fire right after M1, and since
    "create the market" always succeeds, EVERY failed launch left a listed,
    unfunded, untradeable market behind.
  * before M4 — StakeInitPool rotates marketauth away from the deployer, and
    keeper-register's H1 check requires marketauth to still equal it.

The insurance check sits inside that window, so registration only had to move
later within it, not out of it.

THE COST IS LATENCY, stated rather than hidden: the round-trip no longer overlaps
M3b's broadcast, so the tail sits longer against the shared blockhash. That is
the right trade — the blockhash-expiry path already REBUILDS a not-yet-landed
tail tx against a fresh blockhash (TailTxDescriptor), whereas an incorrectly
published market has no equivalent undo.

Two existing source-position tests pinned the OLD ordering and are updated to
assert the invocation rather than the declaration — and TIGHTENED: the zombie
guard now also requires registration to follow the insurance gate, which is the
#2464 property itself.

Negative control: restoring the eager start fails both.

Launch suite: 3149 passed / 16 skipped / 0 failed.

Refs: #2464

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
percolator-launch Ready Ready Preview Sep 3, 2026 9:08am UTC
percolator-mainnet Ready Ready Preview Sep 3, 2026 9:08am UTC
percolator-playground Ready Ready Preview Sep 3, 2026 9:08am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 50 minutes.

Check out review usage here.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: b220d60f-eec0-49fd-b033-f12c337575f7

📥 Commits

Reviewing files that changed from the base of the PR and between 4e7f2b5 and 5239ab7.

📒 Files selected for processing (2)
  • app/__tests__/hooks/useCreateMarket-fresh-batched-registration.test.ts
  • app/hooks/useCreateMarket.ts

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

Comment @coderabbitai help to get the list of available commands.

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