Skip to content

Let child universes fork at any time and move fork phases into Statoblast - #1905

Open
KillariDev wants to merge 2 commits into
mainfrom
t3/parent-fork-response-period
Open

KillariDev wants to merge 2 commits into
mainfrom
t3/parent-fork-response-period

Conversation

@KillariDev

Copy link
Copy Markdown
Collaborator

What and why

Zoltar should not know about Statoblast's fork phases. It had a 10-week parent-fork cooldown made of Statoblast's choice and recapitalization periods plus one more week. Forking a child immediately after its parent is intended, so the cooldown is removed and Statoblast now owns its own schedule.

Zoltar

  • forkUniverse has no cooldown: a deployed child can fork at any time. An unknown universe reverts with Unknown universe.
  • Removed getEarliestForkTime, getForkChoiceDeadline, getForkRecapitalizationDeadline and the FORK_RESPONSE_TIME, FORK_CHOICE_TIME and FORK_RECAPITALIZATION_TIME constants.

Statoblast SecurityPoolForkCoordinator

  • New getForkChoiceDeadline / getForkRecapitalizationDeadline. Both start at the later of the native fork and the universe's own branch activation, and return 0 until both have happened.
  • A child that forks before its branch activates still gives pool owners the full 8-week choice window. Before this change the owner could get 0 seconds, and their backing went to the repair auction or was burned.

Fixes for issues a security review found on the early-fork path

Each one has a regression test that failed before its fix.

  • Repair auction cancelled by a child fork (Medium). A native fork of the child no longer cancels that child's collateral repair auction: bidding and price reports continue to the fixed close, and winners join the child's own fork. Consumers updated: shared SDK, Statoblast auction UI, liquidator bot.
  • Fork-question finality could be stalled indefinitely (Medium). The question a parent fork decided is final in its child from the branch's activation; the former 3-day wait is gone. This holds even if the child forked before activating, so its shares redeem and its reporters are paid in that child instead of being pushed down generations.
    • Activation counts as one second of security-pool time, so inherited games resume at activation − 1.
    • The escalation game now decides finality, and freezes its curve, on that same security-pool clock. That keeps it consistent with the reporter and settlement ledgers, including for a game whose deadline was the parent's fork second.
  • UI treated a zero deadline as passed (Low). The recovery checks run just before sending a transaction now refuse a zero coordinator deadline. The panel says the choice window opens after the branch activates, instead of showing "closed" or "Recovery open".

Consumers

Shared Statoblast SDK, Statoblast and Zoltar UIs, the chaos and liquidator bots (the chaos bot now gates migration and claims on on-chain finality rather than native timestamps), docs and docs tooling, pinned runtime hashes, deployment manifests and bot ABIs.

UI

The Zoltar fork page for a child universe of a forked genesis (forked-categorical simulation) no longer blocks forking with a "parent fork response" reason.

Desktop, 1440×900:

Child universe fork page, desktop

Mobile, 390×844 (full-page capture, so the fixed bottom navigation is drawn mid-page):

Child universe fork page, mobile

Validation

  • bun run test:run: 6751 pass, 0 fail, 13 skipped (run after merging current main)
  • Bots: chaos 1124, liquidator 398, arbitrager 606
  • Also passing: bun run tsc, format:check, check, knip, check:generated-clean, git diff --check
  • Layout scan of the Zoltar and Statoblast UIs: 0 findings
  • Documentation, visual and final code reviews: no open High or Medium findings

…last

Zoltar no longer has a parent-fork cooldown: a deployed child universe can fork
immediately. getEarliestForkTime, getForkChoiceDeadline,
getForkRecapitalizationDeadline and the FORK_*_TIME constants are removed.

Statoblast's SecurityPoolForkCoordinator now owns the branch-choice and
recapitalization schedule. Both start at the later of the native fork and the
universe's own branch activation, so a child that forks early still gives pool
owners the whole choice window.

Fixes for issues the early-fork path exposed:
- A native fork of a child no longer cancels that child's collateral repair
  auction; bidding and preparation price reports continue to the fixed close.
- The question a parent fork fixed in a child is final from the branch's
  activation (the three-day wait is removed), even when the child forked before
  activating. Activation counts as one second of security pool time, and the
  escalation game decides finality and freezes its curve on that clock so it
  agrees with the reporter and settlement ledgers.
- UI pre-send rechecks no longer treat a zero coordinator deadline as passed.

Consumers (shared SDK, Statoblast and Zoltar UIs, chaos and liquidator bots,
docs and docs tooling, pinned runtime hashes, deployment manifests) are updated.
…se-period

# Conflicts:
#	bots/shared/src/contracts/abi.generated.ts
#	docs/mainnet-deployment-addresses.json
#	docs/mainnet-no-deployment-addresses.json
#	docs/sepolia-deployment-addresses.json
#	docs/sepolia-no-deployment-addresses.json
#	solidity/ts/tests/fixtures/escalationGameBytecode.snapshot.json
#	tooling/contracts/bootstrap-descendant-hashes.mts
#	tooling/contracts/deployment-plan.mts
#	tooling/docs/contract-reference-metadata.mts
#	ui/statoblastShared/ts/protocol/deployment.ts
#	ui/zoltarShared/ts/protocol/deployment.ts

This branch has not been deployed

No deployments
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