Skip to content

fix(f3): prepare for f3 network name change on calibnet#6362

Merged
hanabi1224 merged 1 commit intomainfrom
hm/prepare-for-f3-network-change
Dec 18, 2025
Merged

fix(f3): prepare for f3 network name change on calibnet#6362
hanabi1224 merged 1 commit intomainfrom
hm/prepare-for-f3-network-change

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Dec 18, 2025

Summary of changes

(Manually verified the change on both calibnet and mainnet)

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Summary by CodeRabbit

  • Refactor

    • Consolidated network manifest initialization by simplifying how network identifiers are derived and looked up internally. This streamlines the network configuration process while maintaining existing functionality.
  • Chores

    • Removed redundant utility functions to reduce internal code complexity.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Walkthrough

Refactors network name derivation and manifest mapping lookup across multiple files. Replaces local getNetworkName helper with direct gpbft.NetworkName() calls, removes dynamic manifest population in favor of a static RawNetwork2PredefinedManifestMappings with predefined keys, and updates all references accordingly. Maintains existing fallback behavior for LocalDevnet.

Changes

Cohort / File(s) Summary
Manifest mapping consolidation
f3-sidecar/manifest.go
Removes dynamic Network2PredefinedManifestMappings (derived from manifest content) and introduces static RawNetwork2PredefinedManifestMappings with hard-coded keys ("testnetnet", "calibrationnet", "butterflynet", "2k")
Network name and manifest lookup updates
f3-sidecar/import.go, f3-sidecar/run.go
Replaces getNetworkName(rawNetwork) with gpbft.NetworkName(rawNetwork) and updates manifest lookups to use RawNetwork2PredefinedManifestMappings; preserves fallback to LocalDevnet manifest with assigned NetworkName
Helper removal
f3-sidecar/utils.go
Removes getNetworkName helper function and its associated gpbft import

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Areas requiring attention:
    • manifest.go: Verify that the hard-coded keys align with actual embedded manifest file names
    • import.go and run.go: Confirm that fallback behavior (LocalDevnet initialization with assigned NetworkName) is functioning correctly and preserves prior semantics

Suggested reviewers

  • elmattic
  • LesnyRumcajs
  • sudo-shashank

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main change: replacing dynamic network name mapping with static mappings and using gpbft.NetworkName() instead of a local helper, which is preparation for F3 network name changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hm/prepare-for-f3-network-change

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies"


Comment @coderabbitai help to get the list of available commands and usage tips.

@hanabi1224 hanabi1224 marked this pull request as ready for review December 18, 2025 08:04
@hanabi1224 hanabi1224 requested a review from a team as a code owner December 18, 2025 08:04
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and akaladarshi and removed request for a team December 18, 2025 08:04
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e00fde8 and a8308c9.

📒 Files selected for processing (4)
  • f3-sidecar/import.go (2 hunks)
  • f3-sidecar/manifest.go (1 hunks)
  • f3-sidecar/run.go (1 hunks)
  • f3-sidecar/utils.go (0 hunks)
💤 Files with no reviewable changes (1)
  • f3-sidecar/utils.go
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 6057
File: src/cli/subcommands/f3_cmd.rs:0-0
Timestamp: 2025-09-09T10:37:17.947Z
Learning: hanabi1224 prefers having default timeouts (like 10m for --no-progress-timeout) to prevent commands from hanging indefinitely, even when the timeout flag isn't explicitly provided by users. This fail-fast approach is preferred over requiring explicit flag usage.
🧬 Code graph analysis (2)
f3-sidecar/import.go (1)
f3-sidecar/manifest.go (1)
  • RawNetwork2PredefinedManifestMappings (11-11)
f3-sidecar/run.go (1)
f3-sidecar/manifest.go (1)
  • RawNetwork2PredefinedManifestMappings (11-11)
⏰ 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). (3)
  • GitHub Check: Coverage
  • GitHub Check: tests-release
  • GitHub Check: Build forest binaries on Linux AMD64
🔇 Additional comments (3)
f3-sidecar/import.go (2)

10-10: LGTM: Import added for network name conversion.

The gpbft import is necessary for the gpbft.NetworkName() call on line 26.


26-32: LGTM: Network name derivation and manifest lookup correctly refactored.

The change from getNetworkName() to gpbft.NetworkName() and the use of RawNetwork2PredefinedManifestMappings aligns with the new static mapping approach. The LocalDevnet fallback correctly assigns the derived networkName to preserve network identity.

f3-sidecar/run.go (1)

61-79: LGTM: Network name derivation and manifest lookup correctly refactored.

The change from getNetworkName() to gpbft.NetworkName() and the use of RawNetwork2PredefinedManifestMappings aligns with the new static mapping approach. The LocalDevnet fallback with EC timing configuration and networkName assignment is correctly preserved.

Copy link
Member

@LesnyRumcajs LesnyRumcajs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A changelog entry would be useful.

@hanabi1224
Copy link
Contributor Author

@LesnyRumcajs This is an internal change. The actual network name update will come later once the name is decided.

@hanabi1224 hanabi1224 added this pull request to the merge queue Dec 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2025
@hanabi1224 hanabi1224 added this pull request to the merge queue Dec 18, 2025
Merged via the queue into main with commit 4628a7f Dec 18, 2025
50 checks passed
@hanabi1224 hanabi1224 deleted the hm/prepare-for-f3-network-change branch December 18, 2025 14:26
@coderabbitai coderabbitai bot mentioned this pull request Feb 5, 2026
4 tasks
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.

2 participants