Skip to content

Commit d8f7cba

Browse files
authored
fix(f3): properly wire up eth v2 APIs for f3 (#13149)
Fixes a problem introduced, but overlooked in #13123 which meant that F3 was never wired into the v2 TipSetProvider. Integration tests failed but we ignored it because we had a common flaky that was related so didn't take notice of it.
1 parent 7f1cb0d commit d8f7cba

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- feat: ExpectedRewardForPower builtin utility function and `lotus-shed miner expected-reward` CLI command ([filecoin-project/lotus#13138](https://github.com/filecoin-project/lotus/pull/13138))
1818
- feat(gateway): add CORS headers if --cors is provided ([filecoin-project/lotus#13145](https://github.com/filecoin-project/lotus/pull/13145))
1919
- feat(spcli): make settle-deal optionally take deal id ranges ([filecoin-project/lotus#13146](https://github.com/filecoin-project/lotus/pull/13146))
20+
- fix(f3): properly wire up eth v2 APIs for f3 ([filecoin-project/lotus#13149](https://github.com/filecoin-project/lotus/pull/13149))
2021

2122
# Node v1.33.0 / 2025-05-08
2223
The Lotus v1.33.0 release introduces experimental v2 APIs with F3 awareness, featuring a new TipSet selection mechanism that significantly enhances how applications interact with the Filecoin blockchain. This release candidate also adds F3-aware Ethereum APIs via the /v2 endpoint. All of the /v2 APIs implement intelligent fallback mechanisms between F3 and Expected Consensus and are exposed through the Lotus Gateway.

node/builder_chain.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ var ChainNode = Options(
192192
Override(new(*lf3.Config), lf3.NewConfig),
193193
Override(new(manifest.ManifestProvider), lf3.NewManifestProvider),
194194
Override(new(lf3.F3Backend), lf3.New),
195+
Override(new(full.F3ModuleAPI), From(new(full.F3API))),
195196
),
196197
)
197198

node/impl/full/f3.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,28 @@ type F3CertificateProvider interface {
2121
F3GetLatestCertificate(ctx context.Context) (*certs.FinalityCertificate, error)
2222
}
2323

24+
type F3ModuleAPI interface {
25+
F3CertificateProvider
26+
27+
F3GetOrRenewParticipationTicket(ctx context.Context, minerID address.Address, previous api.F3ParticipationTicket, instances uint64) (api.F3ParticipationTicket, error)
28+
F3Participate(ctx context.Context, ticket api.F3ParticipationTicket) (api.F3ParticipationLease, error)
29+
F3GetManifest(ctx context.Context) (*manifest.Manifest, error)
30+
F3GetECPowerTable(ctx context.Context, tsk types.TipSetKey) (gpbft.PowerEntries, error)
31+
F3GetF3PowerTable(ctx context.Context, tsk types.TipSetKey) (gpbft.PowerEntries, error)
32+
F3IsRunning(ctx context.Context) (bool, error)
33+
F3GetProgress(ctx context.Context) (gpbft.InstanceProgress, error)
34+
F3ListParticipants(ctx context.Context) ([]api.F3Participant, error)
35+
}
36+
2437
type F3API struct {
2538
fx.In
2639

2740
F3 lf3.F3Backend `optional:"true"`
2841
F3Certs F3CertificateProvider `optional:"true"`
2942
}
3043

44+
var _ F3ModuleAPI = (*F3API)(nil)
45+
3146
func (f3api *F3API) F3GetOrRenewParticipationTicket(ctx context.Context, miner address.Address, previous api.F3ParticipationTicket, instances uint64) (api.F3ParticipationTicket, error) {
3247
if f3api.F3 == nil {
3348
log.Infof("F3GetParticipationTicket called for %v, F3 is disabled", miner)

node/modules/eth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
type TipSetResolverParams struct {
2929
fx.In
3030
ChainStore eth.ChainStore
31-
F3 full.F3CertificateProvider `optional:"true"`
31+
F3 full.F3ModuleAPI `optional:"true"`
3232
}
3333

3434
func MakeV1TipSetResolver(params TipSetResolverParams) full.EthTipSetResolverV2 {

0 commit comments

Comments
 (0)