F3 participation lease API has drifted from Lotus: lotus-miner cannot decode or renew its lease
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 46/100
Direzione di ricerca
Start with the F3 lease handlers and types in src/rpc/methods/f3.rs and src/rpc/methods/f3/types.rs; compare their behavior with the linked Lotus lease implementation and error codes. Add the requested lease rule tests and JSON snapshot, then check that the ticket and participation replies match the expected network name, remaining term, renewal rules, and error codes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[!WARNING]
Below is issue is filled using AI, It is verified partially so read carefully and make sure to verify it before making any changes.
Describe the bug
lotus-miner (and Curio, which uses the same three calls) takes part in F3 by holding a short lease on a node. The node then signs F3 votes with the miner's worker key. Forest's lease API (Filecoin.F3GetOrRenewParticipationTicket and Filecoin.F3Participate) does not behave like Lotus v1.38.1 in four ways:
| Lotus v1.38.1 | Forest main | What the miner sees | |
|---|---|---|---|
| 1 | The lease's Network is the F3 manifest network name, a JSON string (api_full.go) |
It is Forest's chain enum, sent as {"type":"calibnet"} (types.rs, NetworkChain) |
It cannot decode any F3Participate reply |
| 2 | F3Participate returns the lease as of now: FromInstance is the current instance, ValidityTerm the instances left (participation_lease.go) |
It returns the lease as submitted (f3.rs) |
It never sees "2 instances left", so it does not renew before the lease ends |
| 3 | A new ticket is refused only when the previous one is still live and came from another node (participation_lease.go) |
It is refused for any previous ticket from another node or network, expired or not (types.rs) |
A miner that moves to Forest from another node gets no ticket until it restarts |
| 4 | Failures carry codes 4 to 9 (api_errors.go) |
Every failure is -32603 |
It takes its generic retry path, and it polls a node that has F3 off forever |
How the lease works
- The miner asks for a ticket: "miner M, from the current instance, for 5 instances".
- It calls
F3Participate(ticket). While the lease is live (current instance <= from + term) the node signs for M. - It calls
F3Participateagain with the same ticket every 15 to 45 s. The answer says how many instances are left. At 2 or fewer it gets a new ticket (participation.go), so two leases overlap and there is no gap. - It compares the lease's
NetworkwithF3GetManifest().NetworkNameand asks for a new ticket when they differ (participation.go). - It picks its next step from the error code (
participation.go).
What happens today
Measured with Lotus v1.38.1's own participation loop and RPC client against Forest's handlers. The F3 sidecar was replaced by a stub that serves the manifest and an instance counter.
- At one instance per 30 s the node holds a lease for the miner 88% of the time, with a 10 to 35 s hole about every 3 minutes.
It works at all only because Forest stores the lease before it answers and lotus-miner retries the unreadable reply for 188 s before it asks for a new ticket, while a lease lasts 180 s. - With shorter instances the share drops: 45% at one instance per 15 s (F3 catching up) and 13% at one per 4 s (a devnet).
- In 25 minutes the miner reads 0 of 63
F3Participatereplies and logs 119 WARN and ERROR lines. - After a move from a Lotus node the miner gets no lease (watched for 15 minutes).
- With F3 off on the node the miner polls once a minute forever. Given code 4, which is what Lotus answers, it logs
Cannot participate in F3 as it is disabled.and stops.
With the four points fixed the same runs give 100% and the same calls as against Lotus's own leaser.
Log output
lotus-miner v1.38.1 against Forest main
WARN rpc [email protected]/client.go:718 unmarshaling failed {"message": "{\"Network\":{\"type\":\"calibnet\"},\"Issuer\":\"…\",\"MinerID\":1000,\"FromInstance\":1000,\"ValidityTerm\":5}"}
ERROR f3 lf3/participation.go:203 Unexpected error while attempting F3 participation. Retrying after backoff {"err": "RPC client error: unmarshaling result: json: cannot unmarshal object into Go struct field F3ParticipationLease.Network of type gpbft.NetworkName"}
ERROR f3 lf3/participation.go:200 Too many failures while attempting to check F3 progress. Restarting participation. {"err": "RPC error (-32603): the ticket has been expired"}
To reproduce
- Run a Forest node with the F3 sidecar enabled.
- Call
Filecoin.F3GetOrRenewParticipationTicketwith["<miner ID address>", null, 5]. - Call
Filecoin.F3Participatewith["<the ticket>"]and look atNetworkin the result. Call it again a few instances later:FromInstanceandValidityTermhave not moved.
Or point lotus-miner v1.38.1 at the node and read its log.
Expected behaviour
The same as against a Lotus node:
- The ticket and the lease carry the F3 manifest network name, and the lease JSON has it as a string.
-
F3ParticipatereturnsFromInstanceas the current instance andValidityTermas the instances left. -
F3GetOrRenewParticipationTicketissues a new ticket when the previous one has expired or is for another F3 network, and
refuses only a live ticket from another node. - Failures use Lotus's codes 4 to 9 and messages, and with F3 off both methods answer code 4.
- A JSON snapshot of the lease and unit tests for the lease rules, because nothing compares this with Lotus today.
Environment
- Forest main v0.39.0.
- Lotus and lotus-miner v1.38.1.
Other information and links
- Found while working on #7669.
- History: Forest ported the ticket API in #4920 (2024-10-23, for #4861) from Lotus master of that week. Two days later Lotus
changed the contract in filecoin-project/lotus#12640: the miner polls by callingF3Participateagain and the node returns
the lease as of now. Forest did not follow. Points 1, 3 and 4 have differed since the port. - Why it went unseen:
api compareonly checks that the ticket is bytes and does not compareF3Participate
(api_compare_tests.rs), both methods are on the snapshot ignore list, and the devnet that signs F3 messages makes the miner a permanent participant instead of using a lease
(docker-compose.yml). - Not part of this issue; each could be its own:
- An end-to-end check: F3 on in
scripts/devnet-forest-minerand a miner test that the lease is held and certificates advance. Filecoin.F3GetPowerTableByInstance, Lotus's name, answers "Method not found"; Forest registersFilecoin.F3GetF3PowerTableByInstance.- With F3 off, the other
Filecoin.F3*methods answer a transport error where Lotus answers code 4.
- An end-to-end check: F3 on in
- Lingua principale
- Rust
- Stelle
- 700
- Fork
- 201
- Merge medio
- 1g 17h
- PR unite (30g)
- 65
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ChainSafe/forest
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 20/100
I maintainer di solito rispondono entro 1 giorno
-
[automated] `cargo deny check advisories` failure @ 20/11/26 00:01Forse già presa @akaladarshi l’ha presa oggi. ApertaBug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 15/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
-
FIP-0119 implementation in `builtin-actors`Forse già presa @LesnyRumcajs l’ha presa 2 giorni fa. ApertaType: Task
ChainSafe/forest#7886 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ChainSafe/forest
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
benchmark-review
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
[App Request] ZaptideApertaapp-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
flatpark/flatpark#1423 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
area:image documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno