Skip to content

feat(core): ERA has two decimals (SoFi Amendment S18); storage requests time out - #1087

Closed
cryptskii wants to merge 5 commits into
mainfrom
feat/era-two-decimals-and-token-unit-amounts
Closed

cryptskii wants to merge 5 commits into
mainfrom
feat/era-two-decimals-and-token-unit-amounts

Conversation

@cryptskii

Copy link
Copy Markdown
Collaborator

Owner ruling, 2026-10-01, from the phone-rig SoFi run: ERA is divisible to hundredths. The fee model is unchanged: the fee comes out of the input and the trader pays it.

What changes

Spec and records

  • SoFi Amendment S18 added.
  • MR-SOFI-0335 rewritten (decimals 2; supply 8,000,000,000,000 base units).
  • MR-SOFI-0349 added, Partial: the SoFi routes and their screen still take base units. That part is SOFI's; it moves to Met when they take token units.
  • MASTER §1 re-pinned; CONFORMANCE §7 totals regenerated.

ERA's policy

  • Decimals 2. The supply is 8,000,000,000,000 base units, which is 80,000,000,000.00 ERA.
  • New commitment NNG176RZ6ACTWCDPRNYHXZK2DCZ72SPA9Q6XWGRGQ9JGKZYTESG0, a clean cut from JXPMPGJH….
  • The ERA reserve id hashes the policy commitment (native_reserve::era_reserve_id). The new ERA therefore has its own reserve chain from genesis. The fleet's old releases are under other cell keys, nothing mixes, and the nodes need no wipe.

Amounts people know are unchanged

  • Faucet: 10,000 base units, which is 100.00 ERA.
  • Token creation fee: 1,000, which is 10.00 ERA.

Token units

  • The SDK's parse_display_amount_to_base_units and format_base_units_for_display are the one conversion. The core duplicate I added first is removed in this branch.

Storage-member HTTP client

  • Connects within 10 s and completes a request within 30 s.
  • On the rig, a position write sat with no member answering and no error. A member that never answers is now a member that did not answer.

Tests

  • Funding is stated through economic_fixtures::whole_era(n), which scales by ERA's committed decimals.
  • Sends, burns, trades and reserves stay in base units, as written.
  • Display expectations are at two decimals.

Board (release, local)

  • dsm lib 1370/0, plus all 21 dsm integration binaries passing.
  • dsm_sdk lib 1040/0 (2 ignored), plus all 11 dsm_sdk integration binaries passing.
  • The 41 SDK tests the ERA change first turned red now pass.
  • make lint exit 0.
  • Frontend AccountsScreen.tokens 24/0.
  • Merged with main d19ea36 (frontend only; no Rust inputs changed).

After merge

  • Rig phones need a wipe and re-provision. ERA's identity changed, so nothing under the old commitment carries over. Then re-run SoFi, plus the trade → pay path (A8/P15-9 on hardware).
  • Repin from CI's code map: era_policy and the reserve constants changed bytes.
  • Frontend fixtures still describe ERA as decimals: 0 (practice mode and several jest mocks). They are queued for the frontend sweep; this PR doesn't change them.

… base units

Owner ruling, 2026-10-01: an amount is entered and shown in whole tokens
with the token's decimals after a point, e.g. `10000.00` for a
two-decimal token, never as base units with the zeros typed by hand.

- `parse_token_units(text, decimals) -> u128`:
  - whole tokens, plus up to `decimals` fraction digits;
  - a bare integer is whole tokens;
  - refused: empty input, any character that is not a digit or the
    point, a second point, more fraction digits than the token has, and
    overflow.
- `format_token_units(base, decimals)` always shows every decimal place,
  and round-trips through the parser.

Every route and screen that takes or shows an amount goes through these,
with the decimals from the token's committed policy.
dsm_sdk's wallet_routes already owns the conversion between typed
amounts and base units: parse_display_amount_to_base_units and
format_base_units_for_display. It does exact string arithmetic against
the token's decimals, and it already serves sends, balances, history and
offline cash. 2d529fe added a second copy in Core, and two owners of
one rule is what that module's comment forbids. The SoFi routes' amount
fields go through the SDK's functions instead.
…ts time out

Owner ruling, 2026-10-01, from the phone-rig run: ERA is divisible to
hundredths.

- **Spec.** SoFi Amendment S18; MR-SOFI-0335 rewritten; MR-SOFI-0349
  added (Partial until the SoFi routes take amounts in token units).
  MASTER §1 re-pinned.
- **ERA's policy.** It carries decimals 2, and its supply in base units
  (8,000,000,000,000, which is 80,000,000,000.00 ERA). Its commitment is
  NNG176RZ6ACTWCDPRNYHXZK2DCZ72SPA9Q6XWGRGQ9JGKZYTESG0, a clean cut from
  JXPMPGJH…. Nothing under the old commitment carries over.
- **The faucet** pays 10,000 base units (100.00 ERA), and the token
  creation fee is 1,000 (10.00 ERA). The amounts people know are
  unchanged.
- **Test fixtures.**
  - The two-device fixture funds in whole ERA, one faucet claim per
    payout.
  - The reserve tests and the current-state test use the payout
    constant instead of a literal.
- **The storage-member HTTP client** connects within 10 s and finishes a
  request within 30 s. On the rig, a position write sat with no request
  answered and no error. A member that never answers is now a member
  that did not answer.
The dependent sweep for SoFi Amendment S18. Funding is in whole ERA
through `economic_fixtures::whole_era`, which scales by ERA's committed
decimals. A test that speaks in ERA therefore keeps its meaning. Sends,
burns, trades and vault reserves stay in base units, as written. Comments
that called a base-unit amount "10 ERA" now say so.

- Balances that come from the faucet or the creation fee are stated as
  `whole_era(n) ± base units`. Covers the faucet, sender admission,
  bilateral finality, offline step, node e2e and frontier verification
  tests, plus the restart and projection-repair tests.
- Display expectations are at two decimals: history "1.00" and "100.00";
  the inbox preview "0.10 ERA"; the pending step "0.03"; the transaction
  render "-1.00"; the balance row and the frontend ERA fixture "264.00" /
  "80000000000.00".
- ERA's reported facts: decimals 2, and the anchor is the new commitment
  NNG176RZ6ACTWCDPRNYHXZK2DCZ72SPA9Q6XWGRGQ9JGKZYTESG0.
- The offline load is entered as "20.00", which is 2,000 base units.

The 41 SDK tests the ERA change turned red now pass:
126 passed / 0 failed across their modules, release.
cryptskii added a commit that referenced this pull request Oct 1, 2026
…e SoFi PR

One PR for the three branches: the SoFi rig fixes, STORAGE's mirror
liveness and route-chain records (#1088), and CORE's ERA with two decimals
(#1087).

- MASTER: CORE's MR-SOFI-0349 beside MR-SOFI-0350–0359; §1 re-pinned to the
  merged SoFi specification (S16, S19 and S18); 928 canonical requirements.
- CONFORMANCE: MR-SOFI-0349 is Met. The SoFi routes take amounts as text in
  token units and report their display form, which was the part S18 left
  Partial. Totals regenerated.
- node tests: CORE's whole_era arithmetic, and the new SoFi tests' ERA
  balances moved to whole_era.
@cryptskii

Copy link
Copy Markdown
Collaborator Author

Included in #1089, which merged this branch's commits (and the trace fix 9dc6f84 for #1087) and repinned once at the combined head. One PR, one merge, at the owner's direction.

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