F3 participation lease API has drifted from Lotus: lotus-miner cannot decode or renew its lease
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 46/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[!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
- Lenguaje dominante
- Rust
- Estrellas
- 700
- Forks
- 201
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 65
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ChainSafe/forest
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 3/5 1-2 días Aptitud para principiantes 20/100
Los mantenedores suelen responder en 1 día
-
[automated] `cargo deny check advisories` failure @ 20/11/26 00:01Posiblemente ocupada @akaladarshi la tomó hoy. AbiertoBug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
-
FIP-0119 implementation in `builtin-actors`Posiblemente ocupada @LesnyRumcajs la tomó hace 2 días. AbiertoType: Task
ChainSafe/forest#7886 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de ChainSafe/forest
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
benchmark-review
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[App Request] ZaptideAbiertoapp-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
flatpark/flatpark#1423 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
area:image documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día