fix: add missing network epochs in Filecoin.StateGetNetworkParams#6028
fix: add missing network epochs in Filecoin.StateGetNetworkParams#6028LesnyRumcajs merged 1 commit intomainfrom
Filecoin.StateGetNetworkParams#6028Conversation
WalkthroughAdds Teep and Tock upgrade heights to ForkUpgradeParams and populates them from ChainConfig for StateGetNetworkParams. Updates a test snapshot reference and appends a changelog entry noting the fix. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant R as RPC: StateGetNetworkParams
participant CFG as ChainConfig
participant RESP as ForkUpgradeParams
C->>R: Request network params
R->>CFG: Read height_infos
CFG-->>R: Upgrade heights (incl. Teep, Tock)
R->>RESP: Build ForkUpgradeParams { ... , upgrade_teep_height, upgrade_tock_height }
R-->>C: Return ForkUpgradeParams
note over R,RESP: New fields included in response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
84a7fbe to
db579c4
Compare
db579c4 to
94224ef
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/rpc/methods/state.rs (1)
3007-3009: Guard against missing heights across networks.If any ChainConfig lacks Teep/Tock, StateGetNetworkParams will error. Confirm all supported networks define these heights (even as sentinel values) in height_infos. If there’s any network without them, consider documenting the requirement or mapping absent entries to a conventional sentinel (e.g., -1) to match existing practice for historical upgrades.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
CHANGELOG.md(1 hunks)src/rpc/methods/state.rs(2 hunks)src/tool/subcommands/api_cmd/test_snapshots.txt(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: LesnyRumcajs
PR: ChainSafe/forest#5907
File: src/rpc/methods/state.rs:523-570
Timestamp: 2025-08-06T15:44:33.467Z
Learning: LesnyRumcajs prefers to rely on BufWriter's Drop implementation for automatic flushing rather than explicit flush() calls in Forest codebase.
📚 Learning: 2025-09-02T14:23:53.766Z
Learnt from: akaladarshi
PR: ChainSafe/forest#5923
File: src/tool/subcommands/api_cmd/test_snapshots.txt:206-252
Timestamp: 2025-09-02T14:23:53.766Z
Learning: In the Forest project, .rpcsnap.json.zst snapshot files listed in src/tool/subcommands/api_cmd/test_snapshots.txt are not stored in the repository itself but are downloaded from a DigitalOcean (DO) bucket when needed. The manifest file serves as an index/catalog of available snapshots.
Applied to files:
src/tool/subcommands/api_cmd/test_snapshots.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: cargo-publish-dry-run
- GitHub Check: Build MacOS
- GitHub Check: Build Ubuntu
- GitHub Check: All lint checks
- GitHub Check: Build forest binaries on Linux AMD64
- GitHub Check: tests
- GitHub Check: tests-release
- GitHub Check: Analyze (rust)
- GitHub Check: Analyze (go)
🔇 Additional comments (3)
CHANGELOG.md (1)
46-47: LGTM — concise and user-facing.Entry clearly states the fix and points to the PR. No nits.
src/tool/subcommands/api_cmd/test_snapshots.txt (1)
87-87: Verify the new snapshot is available and includes Teep/Tock fields.Since .rpcsnap files are fetched from the DO bucket at runtime, please confirm this artifact exists and that the payload contains UpgradeTeepHeight and UpgradeTockHeight under ForkUpgradeParams.
src/rpc/methods/state.rs (1)
2960-2962: Adding Teep/Tock to ForkUpgradeParams — looks correct.Fields are appended consistently and will serialize as PascalCase for JSON/OpenRPC.
Summary of changes
Changes introduced in this pull request:
Filecoin.StateGetNetworkParamsmethod.Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Summary by CodeRabbit