Skip to content

Commit 6472b9d

Browse files
committed
fix: be precise about simple & baseline consts and how to validate
1 parent 4c64573 commit 6472b9d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

docs/f02-design.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Pos Field Change
2222
9 total_minted_reward Renamed from total_storage_power_reward, position kept.
2323
Accrues the full block reward, all streams (was
2424
miners-only in FIP). FilMined reads it unchanged.
25-
10,11 simple_total, Deleted, retired to code constants (code comment
26-
baseline_total suggests this "in a subsequent upgrade").
25+
10 simple_total Deleted; use SIMPLE_TOTAL = 330,000,000 FIL.
26+
11 baseline_total Deleted; use canonical BASELINE_TOTAL below.
2727
2828
new total_burn_minted Cumulative burn (w0 residual + fold dust).
2929
new total_service_minted Cumulative service accrual, all explicit streams.
@@ -36,6 +36,8 @@ new swa_timelock_epochs Per-network hold (7 days mainnet, short on calibne
3636
new streams_root (CID) Everything below.
3737
```
3838

39+
Reward calculation uses `SIMPLE_TOTAL = TokenAmount::from_whole(330_000_000)` and `BASELINE_TOTAL = TokenAmount::from_atto(768335872210768889362796814u128)`. The latter is the exact mainnet value fixed by the actors-v2 baseline migration; that migration made the value history-dependent, and Solstice deliberately canonicalises mainnet's value across networks rather than carrying either field forward.
40+
3941
Net roughly +63B on the 165B current f02 state root block (+91B added, -28B from the two deleted totals).
4042

4143
Serialisation is the Filecoin norm of only tuple representation, so "keyed by `(stream_id, wallet)`" is logical only: lookups scan the streams array matching on the stored `id`, and each explicit stream owns its own recipient arrays, so streams can't collide on a shared wallet and a claim rewrites only its own stream's rows. `id`s are SWA-supplied at `RegisterStream` and opaque to f02, which enforces uniqueness across `streams[]`, `tombstones[]`, and pending `RegisterStream` writes, checked at queue time. The SWA keeps the `id`-to-purpose mapping, where `id`s have meaning. Migration pins consensus = 1 and service = 2, matching the w1/w2 subscripts; 0 is reserved (in case we make burn an identified stream later).
@@ -210,3 +212,7 @@ w2 (service, id 2, EXPLICIT): { v_start 0.05, slope +0.45/(9*EPOCHS_PER_QUART
210212
```
211213

212214
The slopes cancel over Q1 so nothing burns during bootstrap, and w2 hits its cap exactly at the Q1 boundary, auto-exiting the bootstrap ramp with no scheduled write needed. The service stream starts with the single-orchestrator share map (one wallet, share = 1) and the SRA as designated writer. `swa_timelock_epochs` is set per network here (the only place it's ever written).
215+
216+
## Testing
217+
218+
* **Reward constants after upgrade:** query f02 at two consecutive non-null tipsets whose stored `epoch` increases by one. Compute reward theta for each state from `effective_network_time`, `effective_baseline_power`, `cumsum_realized`, and `cumsum_baseline`; then require `compute_reward(post.epoch, pre_theta, post_theta, SIMPLE_TOTAL, BASELINE_TOTAL)` to equal the post-state `this_epoch_reward` exactly.

0 commit comments

Comments
 (0)