F3 participation lease API has drifted from Lotus: lotus-miner cannot decode or renew its lease
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 46/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[!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
- Ngôn ngữ chính
- Rust
- Star
- 700
- Fork
- 201
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 65
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ChainSafe/forest
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[automated] `cargo deny check advisories` failure @ 20/11/26 00:01Có thể đã có người làm @akaladarshi đã nhận hôm nay. Đang mởBug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 15/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
Maintainer thường phản hồi trong vòng 1 ngày
-
FIP-0119 implementation in `builtin-actors`Có thể đã có người làm @LesnyRumcajs đã nhận 2 ngày trước. Đang mởType: Task
ChainSafe/forest#7886 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ChainSafe/forest
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
eandualem/agent-interface#290 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
benchmark-review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày