Skip to content

Forking - #45

Draft
viatrix wants to merge 35 commits into
devfrom
feat-forking
Draft

viatrix wants to merge 35 commits into
devfrom
feat-forking

Conversation

@viatrix

@viatrix viatrix commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary of this PR:

  1. Forking of the parent universe and lazy spawning of child universes.
  2. Universe states. After implementing nested forks, the Forming status is not needed, the children are spawned as Active. States: NotExisting → Active → Migration → PostFork via advanceForkState, which requires the parent already PostFork. Migration window: 60 days AND parent resolved (nested-fork extension: if the parent’s migration is not over yet then the child migration cannot be completed); spawn window is strictly 60 days.
  3. Counter-based accounting. No live-balance reads: totalMigratedOut (for the parent universe), maxMigratedOut (in a parent, winner by strict max tracked in favoriteChild), totalMigratedIn (in a child), totalQueryFees (unconsumed fees), unmigratedSupply (tokens submitted to Lituus for splitting at fork; supply restoration max supply = totalMigratedOut + unmigratedSupply).
  4. Pot migration. The fork tx parks the contract's entire wREP balance into Zoltar's migration balance (_addPotToMigrationBalance), after excluding the forking query's fee from the total. At each child's spawn, the full fee pot is split into it (per-child Zoltar escrow makes duplication legal), wrapped, and carried as the child's totalQueryFees — funding inherited-query resolutions at birth and re-splitting recursively at the child's own fork. Fee splits are not counted in migration counters. Parent-side claim/claimMultiple are not possible during the fork, later there will be a migration path for them.
  5. Unwrap pause. The forking universe's vault is permanently unwrap-paused in the fork tx; children spawn with unwrapping unpaused; migrateOut is the owner lane for migrating out of a parent during the fork (for submitting the pot to Zoltar).

@viatrix viatrix changed the title Feat forking Forking Sep 22, 2026
@viatrix
viatrix requested a review from Xaleee September 22, 2026 20:34
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.

2 participants