feat(fip-0118): actor changes and migration - #462
Conversation
There was a problem hiding this comment.
Pull request overview
Implements the FIP-0118 reward actor stream accounting additions for builtin v19 in go-state-types, including new state/type representations, CBOR tuple encodings, invariants, and a v18→v19 migration path (with fixtures/tests aligned to the Rust actor serialization vectors).
Changes:
- Added stream-related reward state/types (streams, distributions, pending writes, accruals) plus invariants/projection validation helpers.
- Updated reward actor state to include stream/SWA fields and switched reward totals to canonical code constants (vs state fields).
- Introduced a dedicated reward actor migrator configurable via
RewardMigrationConfig, with tests and updated CBOR generator inputs.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| builtin/v19/reward/streams.go | Adds core stream/distribution/pending-write/accrual types and bounds. |
| builtin/v19/reward/stream_invariants.go | Implements validation/projection rules mirroring the Rust reward streams logic and migration bootstrap validation. |
| builtin/v19/reward/reward_types.go | Adds method param/return types for stream operations and improves docs on existing params/returns. |
| builtin/v19/reward/reward_types_test.go | Ports Rust CBOR golden vectors and asserts method-number registration for new exported methods. |
| builtin/v19/reward/reward_state.go | Extends reward state with minted/burn/explicit totals and stream/SWA roots; updates constructor to persist empty streams state. |
| builtin/v19/reward/reward_logic.go | Moves reward totals to canonical code constants and updates reward computation to use them. |
| builtin/v19/reward/methods.go | Registers new exported (FRC) stream-related methods on the reward actor. |
| builtin/v19/reward/invariants.go | Extends invariants to validate stream/SWA state and explicit liabilities against balances/totals. |
| builtin/v19/reward/invariants_test.go | Adds invariants test coverage for both valid state and corruption cases. |
| builtin/v19/reward/cbor_gen.go | Regenerates CBOR tuple encoders/decoders for new state and method types. |
| builtin/v19/migration/top.go | Plumbs a reward migration config into the v19 migration entrypoint and wires the reward migrator. |
| builtin/v19/migration/reward.go | Adds the v18→v19 reward actor migration implementation (streams bootstrap + new fields). |
| builtin/v19/migration/reward_test.go | Adds unit tests validating the reward migration and config rejection cases. |
| builtin/v19/gen/gen.go | Updates CBOR codegen inputs to include new reward stream/state/method types. |
Files not reviewed (1)
- builtin/v19/reward/cbor_gen.go: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #462 +/- ##
==========================================
+ Coverage 3.83% 4.68% +0.85%
==========================================
Files 871 874 +3
Lines 172072 174091 +2019
==========================================
+ Hits 6592 8158 +1566
+ Misses 162611 162362 -249
- Partials 2869 3571 +702
🚀 New features to boost your workflow:
|
|
Renamed this issue to cover all of it, it'll be our feature branch |
* state representation * msg param & return type representation * migration * golden test fixtures ported from rust for cbor representations Ref: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0118.md Ref: filecoin-project/builtin-actors#1774 Closes: #460
Correctly identifying FIP-0074 behaviour.
|
This branch is now ~complete. It has all the f02 stuff, and now it also has the miner and market actor changes. There's a migration for the market actor to remove The only thing outstanding from here is any migration handling of verifreg and datacap actors. Currently the FIP says to remove root_key and verifiers but we're either not going to do anything with it cause it's "frozen" or do a full migration. Pending decision. |
Ref: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0118.md
Ref: filecoin-project/builtin-actors#1774
Closes: #460
Does not yet include miner actor changes