Skip to content

Support NV28#543

Closed
ziscky wants to merge 5 commits into
devfrom
feat/nv28-support
Closed

Support NV28#543
ziscky wants to merge 5 commits into
devfrom
feat/nv28-support

Conversation

@ziscky
Copy link
Copy Markdown
Contributor

@ziscky ziscky commented Apr 9, 2026

Summary

  • Add NV28 (V28) support mapping to v18 builtin-actors (go-state-types v0.18.0-dev)
  • Update all 16 actors with v18 imports, method map entries, and param/return type maps
  • Update dependencies: lotus v1.35.0, go-f3 v0.8.12, Go 1.24.7
  • Add v1.35 to supported node versions
  • Regenerate mocks for updated lotus API
  • V28 uses placeholder upgrade heights (UpgradeXxHeight) — a follow-up PR will set actual heights once announced (similar to Set mainnet V27 height #524)
  • LatestCalibrationVersion set to V28, LatestMainnetVersion remains V27 until mainnet height is confirmed

Notes

  • go-state-types v0.18.0-dev is currently a dev release — will need to update to stable v0.18.0 before merging
  • Upgrade name is placeholder ("Xx") — will be renamed once Filecoin announces the actual upgrade name
  • Follow-up PR needed to set calibration/mainnet heights (like commit 1b532b8)

Test plan

  • go build ./... passes
  • Version mapping tests pass (TestVersionIterator, TestVersionsAfter, TestGetSupportedVersions, TestVersionFromHeight)
  • Actor tests pass (TestABIMethodNumberToMethodName, TestVersionCoverage)
  • Reward params tests pass
  • Full CI pipeline

🤖 Generated with Claude Code

- Update go-state-types to v0.18.0-dev, lotus to v1.35.0, go-f3 to v0.8.12
- Add V28 version mapping with placeholder heights (UpgradeXxHeight)
- Add v18 builtin-actors imports and method/param entries for all 16 actors
- Add v1.35 to supported node versions
- Regenerate mocks for updated lotus API
- Update CI to Go 1.24.7
- Update version tests for V28 calibration support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ziscky ziscky requested a review from emmanuelm41 April 9, 2026 12:55
emmanuelm41 added a commit that referenced this pull request May 5, 2026
builtin-actors v18.0.0 added three exported sector-status methods that
PR #543's actor-by-actor scan missed:

- GenerateSectorLocation(SectorNumber) -> (SectorStatusCode, AuxData)
- ValidateSectorStatus(SectorNumber, Status, AuxData) -> bool
- GetNominalSectorExpiration(SectorNumber) -> ChainEpoch

These are FRC-42 dispatched (deterministic method-hash), so they must be
registered in the miner customMethods() map. Without them, V28+ traces
calling these methods would be parsed as 'unknown method'.

Source: actors/miner/src/lib.rs in builtin-actors v18.0.0:
  GenerateSectorLocationExported = frc42_dispatch::method_hash!(...)
  ValidateSectorStatusExported = frc42_dispatch::method_hash!(...)
  GetNominalSectorExpirationExported = frc42_dispatch::method_hash!(...)

Implementation matches the existing per-version dispatch pattern used
by other V_N-introduced methods (e.g. ProveCommitSectors3, V22+):
- params + return maps in actors/v2/miner/params.go (V28-only entry)
- handler resolves via tools.VersionFromHeight(network, height)
- per-version dispatch lets future v19+ variants drop in cleanly

GenerateSectorLocation/ValidateSectorStatus types come from
go-state-types/builtin/v18/miner directly. GetNominalSectorExpiration
takes bare *abi.SectorNumber and returns abi.ChainEpoch (primitives,
not structs); locally-defined wrappers in actors/v2/miner/types/
provide the UnmarshalCBOR surface required by parseGeneric (same
pattern as existing GetSectorSizeReturn, MaxTerminationFee*, etc.).
emmanuelm41 added a commit that referenced this pull request May 5, 2026
* feat: add NV28 support for all actors

- Update go-state-types to v0.18.0-dev, lotus to v1.35.0, go-f3 to v0.8.12
- Add V28 version mapping with placeholder heights (UpgradeXxHeight)
- Add v18 builtin-actors imports and method/param entries for all 16 actors
- Add v1.35 to supported node versions
- Regenerate mocks for updated lotus API
- Update CI to Go 1.24.7
- Update version tests for V28 calibration support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: handle SectorDeals params breaking change

* fix: prevent adding of extra field to params

* fix: use custom struct for v21

* fix: use custom struct for v21

* feat: lotus v1.36.0-rc1 + NV28 (FireHorse) calibnet height

Bumps lotus to v1.36.0-rc1 on top of the NV28 actor work cherry-picked
from #543. Resolves the placeholders left in #543:

- lotus v1.35.0 -> v1.36.0-rc1
- go-state-types v0.18.0-dev -> v0.18.0 (released)
- Go directive 1.24.7 -> 1.25.7 (transitive requirement)
- V28 calibration height: 999999999999999 placeholder -> 3694534
  (real FireHorse activation epoch on calibnet, sourced from
  lotus@v1.36.0-rc1 build/buildconstants/params_calibnet.go)
- V28 mainnet: buildconstants.UpgradeXxHeight (which doesn't exist)
  -> buildconstants.UpgradeFireHorseHeight (real constant; mainnet
  height itself is still TBD and remains a placeholder upstream)
- V28 comment: 'Xx' -> 'FireHorse'
- parser/v2/parser.go: NodeVersionsSupported += 'v1.36'

Build clean, vet clean, non-Redis tests pass locally. CI will exercise
Redis-backed tests via the REDIS_addr secret.

* feat(miner): handle 3 new v18 FRC-42 methods (NV28 / FireHorse)

builtin-actors v18.0.0 added three exported sector-status methods that
PR #543's actor-by-actor scan missed:

- GenerateSectorLocation(SectorNumber) -> (SectorStatusCode, AuxData)
- ValidateSectorStatus(SectorNumber, Status, AuxData) -> bool
- GetNominalSectorExpiration(SectorNumber) -> ChainEpoch

These are FRC-42 dispatched (deterministic method-hash), so they must be
registered in the miner customMethods() map. Without them, V28+ traces
calling these methods would be parsed as 'unknown method'.

Source: actors/miner/src/lib.rs in builtin-actors v18.0.0:
  GenerateSectorLocationExported = frc42_dispatch::method_hash!(...)
  ValidateSectorStatusExported = frc42_dispatch::method_hash!(...)
  GetNominalSectorExpirationExported = frc42_dispatch::method_hash!(...)

Implementation matches the existing per-version dispatch pattern used
by other V_N-introduced methods (e.g. ProveCommitSectors3, V22+):
- params + return maps in actors/v2/miner/params.go (V28-only entry)
- handler resolves via tools.VersionFromHeight(network, height)
- per-version dispatch lets future v19+ variants drop in cleanly

GenerateSectorLocation/ValidateSectorStatus types come from
go-state-types/builtin/v18/miner directly. GetNominalSectorExpiration
takes bare *abi.SectorNumber and returns abi.ChainEpoch (primitives,
not structs); locally-defined wrappers in actors/v2/miner/types/
provide the UnmarshalCBOR surface required by parseGeneric (same
pattern as existing GetSectorSizeReturn, MaxTerminationFee*, etc.).

* ci: bump go to 1.25.7

go.mod was bumped from 1.24.7 -> 1.25.7 by 'go get lotus@v1.36.0-rc1'
in commit cc5a367. CI workflow uses GOTOOLCHAIN=local so the runner
must already have the required Go version installed; container image
pin needs to match too.

* fix(miner): wire new methods through Parse() + TransactionTypes()

The TestABIMethodNumberToMethodName test (actors/v2/actors_test.go:137)
caught two gaps in the prior commit:

1. The 3 new v18 methods (GenerateSectorLocation, ValidateSectorStatus,
   GetNominalSectorExpiration) were registered in customMethods() but
   missing from miner.Parse() switch and miner.TransactionTypes() map.
   Both are required for the actor's full method-resolution surface.

2. Pre-existing bug surfaced: GetBeneficiaryExported has been the
   FRC-42 dispatch name for the GetBeneficiary method since v16
   builtin-actors, but only MethodGetBeneficiary was registered. The
   test was implicitly relying on dispatch never showing the *Exported
   variant — which it always did. Added MethodGetBeneficiaryExported
   constant + Parse() case + TransactionTypes() entry.

Three places to touch when adding/renaming a miner method:
  a. parser/constants.go            — string constant
  b. actors/v2/miner/miner.go       — handler + customMethods (FRC-42)
                                      OR per-version 'methods' map
  c. actors/v2/miner/parse.go       — Parse() switch + TransactionTypes()
The TestABIMethodNumberToMethodName test enforces (c) is in sync with
the methods registered via (b).

* fix(miner): drop V28-only methods from customMethods + ci: golangci-lint v2

Two CI follow-ups after the prior commit:

1. customMethods() registers methods cross-version (V0..V28). Putting
   the v18-only FRC-42 methods (GenerateSectorLocation, etc.) there
   exposed them at V0-V27 too, where our per-version dispatch returns
   ErrUnsupportedHeight, breaking TestVersionCoverage. Removed them —
   they're already in miner18.Methods so V28 picks them up natively.
   Updated Rule C in fil-parser-upgrade skill to match.

   Note: GetBeneficiary / GetBeneficiaryExported still need to be in
   customMethods because v17 and earlier registered the FRC-42 hash
   under name 'GetBeneficiary' (some version maps), and the constant
   was missing entirely until the prior commit. This case is genuinely
   cross-version and stays.

2. golangci-lint v1.64.8 was the last v1.x release and was built with
   Go 1.24, so it errors out on Go 1.25 code:
     can't load config: the Go language version (go1.24) used to build
     golangci-lint is lower than the targeted Go version (1.25.7)
   Bumped Makefile to v2.12.1. v2 changed several things:
     - gofmt is now a formatter, not a linter (can't be -E'd)
     - default linter set widened to include errcheck/govet/staticcheck
     - exclusion via flags removed; config file required
   Added .golangci.yml that restores v1.64.8 behavior (gosec + gocritic
   only, --default=none equivalent) with documented TODOs for the
   ~70 pre-existing issues v2 surfaces (50 goconst cosmetic,
   ~10 staticcheck QF1008, gosec G115/G304 in legacy code).

Verified locally: go test ./... -short, golangci-lint run, both clean
on the modified packages.

* ci: install golangci-lint v2 via 'go install' instead of install.sh

The upstream install.sh script's sha256 checksum verification fails on
v2.12.1 — both local and CI runs hit:
  err hash_sha256_verify checksum for '...golangci-lint-2.12.1-...tar.gz'
  did not verify <expected> vs <actual>

go install builds from source and avoids the checksum mismatch entirely.
Slightly slower in CI but reliable.

---------

Co-authored-by: Eric Mokaya <emagembe@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@emmanuelm41
Copy link
Copy Markdown
Member

Superseded by #545 (merged) — same NV28 actor surgery cherry-picked, plus three new v18 FRC-42 miner methods (GenerateSectorLocation, ValidateSectorStatus, GetNominalSectorExpiration) that this branch missed, plus lotus v1.36.0-rc1 + go-state-types v0.18.0 (released) + the real NV28 calibnet height (3694534).

Released as v4.3600.0-rc1.

@emmanuelm41 emmanuelm41 closed this May 5, 2026
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