-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement ticket based F3 participation lease #12531
Conversation
da27be4
to
9316263
Compare
e107151
to
40f1170
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some code nits and a few comments, but I'm a bit brain-dead from debugging tests all day so I'll have to leave the full review for tomorrow (hopefully @Kubuxu can get to it before I do).
bc978d4
to
63a1d03
Compare
63a1d03
to
e34e47c
Compare
I think I would like to see the ability of the Miner to set the maximum term of the lease. Fundamentally, the Miner is in control of what they give out. |
80b65c0
to
9a3932b
Compare
Added, where the miner sets the validity term, as well as an upper maximum dictated by node for safety. |
9a3932b
to
017d8c3
Compare
017d8c3
to
3d12ca5
Compare
b36ec70
to
47f6258
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo a few nits that you're free to ignore, and some failing lints.
ec3b3f0
to
3dcdb91
Compare
3dcdb91
to
e7b8b5a
Compare
Implemented enhanced ticket-based participation system for F3 consensus in `F3Participate`. This update introduces a new design where participation tickets grant a temporary lease, allowing storage providers to sign as part of the F3 consensus mechanism. This design ensures that tickets are checked for validity and issuer alignment, handling errors robustly. If there's an issuer mismatch, the system advises miners to retry with the existing ticket. If the ticket is invalid or expired, miners are directed to obtain a new ticket via `F3GetOrRenewParticipationTicket`. Fixes filecoin-project/go-f3#599
To avoid potential of deadlock in case f3Participator is used from multiple goroutines use throw-away timers at the price of higher GC. Also use the cancel function in context explicitly in a unified stop hook that awaits the participation to end before exiting.
Require the start instance of a participation to never decrease if there is an existing lease by the miner.
523dff4
to
cd82c4e
Compare
That way we don't re-use leases across networks. It's a bit racy (we ask for the manifest before we ask for the current progress) but it should be fine because at least we won't create a lease for the new network with a future instance. There's still an ABA problem if we rapidly switch back and forth between two networks but... let's just not do that? At least for the mainnet switchover, that won't be an issue because we enforce a 900 epoch silence period. I have to say, I'm not happy about this. But... we can probably just hard-code it in the future once we get rid of the dynamic manifest.
cd82c4e
to
f1e21bf
Compare
Back off and get a fresh token if F3 is not ready.
034b073
to
73359d6
Compare
* Implement ticket based F3 participation lease Implemented enhanced ticket-based participation system for F3 consensus in `F3Participate`. This update introduces a new design where participation tickets grant a temporary lease, allowing storage providers to sign as part of the F3 consensus mechanism. This design ensures that tickets are checked for validity and issuer alignment, handling errors robustly. If there's an issuer mismatch, the system advises miners to retry with the existing ticket. If the ticket is invalid or expired, miners are directed to obtain a new ticket via `F3GetOrRenewParticipationTicket`. Fixes filecoin-project/go-f3#599 * Use fresh timer every time for F3 backoffs To avoid potential of deadlock in case f3Participator is used from multiple goroutines use throw-away timers at the price of higher GC. Also use the cancel function in context explicitly in a unified stop hook that awaits the participation to end before exiting. * Strictly require start instance to never decrease Require the start instance of a participation to never decrease if there is an existing lease by the miner. * feat(f3): update go-f3 to 0.7.0 and adapt for changes to the API * feat(f3): Include the network name in the lease That way we don't re-use leases across networks. It's a bit racy (we ask for the manifest before we ask for the current progress) but it should be fine because at least we won't create a lease for the new network with a future instance. There's still an ABA problem if we rapidly switch back and forth between two networks but... let's just not do that? At least for the mainnet switchover, that won't be an issue because we enforce a 900 epoch silence period. I have to say, I'm not happy about this. But... we can probably just hard-code it in the future once we get rid of the dynamic manifest. * Handle not ready error gracefully in participator Back off and get a fresh token if F3 is not ready. --------- Co-authored-by: Steven Allen <[email protected]>
Related Issues
Proposed Changes
Implemented enhanced ticket-based participation system for F3 consensus in
F3Participate
. This update introduces a new design where participation tickets grant a temporary lease, allowing storage providers to sign as part of the F3 consensus mechanism. This design ensures that tickets are checked for validity and issuer alignment, handling errorsrobustly. If there's an issuer mismatch, the system advises miners to retry with the existing ticket. If the ticket is invalid or expired, miners are directed to obtain a new ticket via
F3GetOrRenewParticipationTicket
.Additional Info
Checklist
Before you mark the PR ready for review, please make sure that: