feat(fip-0118): add reward actor changes - #462
Open
rvagg wants to merge 2 commits into
Open
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.37% +0.54%
==========================================
Files 871 873 +2
Lines 172072 173948 +1876
==========================================
+ Hits 6592 7616 +1024
- Misses 162611 162974 +363
- Partials 2869 3358 +489
🚀 New features to boost your workflow:
|
* 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
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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