Skip to content

[BFT-A][EPIC] Implement CBE Curve Spec in Ordered Rollout #1935

@umwelt

Description

@umwelt

Title

[BFT-A][EPIC] Implement CBE Curve Spec in Ordered Rollout

Purpose

This meta issue is the authoritative execution-order controller for the CBE curve work defined by:

  • CBE Bonding Curve — Complete Formula Reference
  • CBE Bonding Curve — Rust Implementation Specification

It does not replace the implementation issues. It defines the sequence they must land in so the branch converges on one canonical curve engine without scope drift.

Locked Team Decisions

  • GRAD_THRESHOLD = 2_745_966 * SCALE
  • SELL_CBE is controlled by explicit protocol flag sell_enabled: bool
  • sell_enabled = false at genesis and may become true later by config/upgrade
  • treasury_locked is out of scope on this branch
  • SELL_CBE solvency is reserve-only

Ordered Rollout

Phase 1: Canonical Shapes

  1. [BFT-A][R8] Establish canonical CBE curve types and fixed-point state model #1923 [BFT-A][R8] Establish canonical CBE curve types and fixed-point state model
  • Define authoritative types in lib-types
  • Lock canonical mutable curve state and u48 nonce representation
  1. [BFT-A][R9] Replace curve arithmetic with 18-decimal U256 fixed-point math and deterministic integer sqrt #1924 [BFT-A][R9] Replace curve arithmetic with 18-decimal U256 fixed-point math and deterministic integer sqrt
  • Lock arithmetic contract before implementing execution
  1. [BFT-A][R8] Collapse CBE curve math to one canonical piecewise-linear engine #1925 [BFT-A][R8] Collapse CBE curve math to one canonical piecewise-linear engine
  • Build one pure math engine for price, buy, and sell computations

Phase 2: Wire Format and State Authority

  1. [BFT-A][R9] Add fixed-width BUY_CBE and SELL_CBE transaction payloads #1928 [BFT-A][R9] Add fixed-width BUY_CBE and SELL_CBE transaction payloads
  • Lock byte-level transaction format
  1. [BFT-A][R4] Persist canonical CBE curve state and restart reconstruction inputs #1926 [BFT-A][R4] Persist canonical CBE curve state and restart reconstruction inputs
  • Establish persisted state authority for restart/replay
  1. [BFT-A][R4] Rework genesis to initialize zero-state CBE curve economics #1927 [BFT-A][R4] Rework genesis to initialize zero-state CBE curve economics
  • Make genesis/config authoritative for zero-state curve deployment

Phase 3: Execution Cutover

  1. [BFT-A][R8] Add dedicated CBE curve executor lane and remove disabled legacy dispatch #1929 [BFT-A][R8] Add dedicated CBE curve executor lane and remove disabled legacy dispatch
  • Introduce canonical execution lane
  1. [BFT-A][R9] Implement canonical BUY_CBE issuance per mint-on-buy spec #1930 [BFT-A][R9] Implement canonical BUY_CBE issuance per mint-on-buy spec
  • Land the canonical buy path first
  1. [BFT-A][R8] Implement canonical SELL_CBE redemption and solvency checks #1931 [BFT-A][R8] Implement canonical SELL_CBE redemption and solvency checks
  • Land canonical sell path with sell_enabled gating and reserve-only solvency

Phase 4: Hardening and Governance Boundary

  1. [BFT-A][R9] Remove runtime/background mutation and isolate curve graduation to block execution #1932 [BFT-A][R9] Remove runtime/background mutation and isolate curve graduation to block execution
  • Remove non-canonical runtime mutation paths
  1. [BFT-A][R6] Freeze immutable curve logic and gate curve parameter changes behind protocol upgrade #1933 [BFT-A][R6] Freeze immutable curve logic and gate curve parameter changes behind protocol upgrade
  • Lock immutable-vs-upgrade-gated boundary after core implementation is stable

Implementation Rule

Do not skip ahead in a way that makes later issues rewrite earlier authoritative work.

Allowed parallelism:

  • Minor prep work is allowed if it does not change authoritative state/math/tx behavior.
  • Canonical execution should follow the phase order above.

Done Criteria

  • All linked issues are complete in the order above
  • The branch implements one canonical CBE curve engine matching the two authoritative docs
  • No legacy/generalized path remains authoritative for curve consensus behavior

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