Skip to content

[BFT-A][R4] Rework genesis to initialize zero-state CBE curve economics #1927

@umwelt

Description

@umwelt

Title

[BFT-A][R4] Rework genesis to initialize zero-state CBE curve economics

Category

  • R4 Crash Safety

Authoritative Inputs

  • CBE Bonding Curve — Rust Implementation Specification sections 2 and 3
  • Team decision: GRAD_THRESHOLD = 2_745_966 * SCALE
  • Team decision: band storage uses p_start, not signed intercept b

Problem

The current issue assumes genesis must initialize a broader native economics stack. The new docs narrow this to the curve protocol and its immutable band/config state.

Current Behavior

Genesis/runtime still rely on legacy CBE bootstrapping patterns instead of initializing the documented curve state directly.

Required Behavior

Genesis must initialize the curve protocol with:

  • s_c = 0
  • reserve_balance = 0
  • treasury_balance = 0
  • graduated = false
  • sell_enabled = false
  • immutable band table loaded at genesis/config
  • band 0 p_start configured explicitly
  • later band p_start values derived by continuity at initialization
  • curve constants (SCALE, RHO, ALPHA, P0_GENESIS, S_MAX, fee constants)
  • GRAD_THRESHOLD = 2_745_966 * SCALE

This issue is not about zero-state s_sov or approved-asset/oracle bootstrapping.

Safety Impact

If genesis loads the wrong state/config shape, every later curve transaction runs against the wrong economics model.

Proposed Fix

Extend genesis config and initialization so the documented curve state and immutable configuration become the authoritative starting point.

Dependencies

Acceptance Criteria

  • Zero-state curve economics is initialized at genesis
  • Band table and curve constants are committed in genesis/config
  • Band 0 p_start is config-driven and later band p_start values are derived by continuity at initialization
  • sell_enabled is initialized to false
  • GRAD_THRESHOLD is wired as 2_745_966 * SCALE
  • Legacy bootstrapping is no longer authoritative for curve state

Test Plan

  • Identical genesis bytes produce identical curve state
  • Startup validation for band/config invariants
  • Continuity derivation tests for post-band-0 p_start values
  • Genesis hash includes the curve economics config

Cleanup After

  • Remove legacy genesis assumptions that conflict with s_c = 0, zero balances, genesis-loaded band configuration, or signed intercept storage

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions