<aside> 💡 This is an working doc where lotus, fvm and boost team share early what their thoughts on SP frontrunning look like and how they can be solved. It is subjective to change according to discoveries and conversations. Naming here is especially subject to change.

This is also motivation for the development of the v1.0 standard.

</aside>

Problem

Based on the network dynamics observed in the NFT.storage launch on 03/14/23, a core known issue has re-emerged.

We already see a lot of wasted bandwidth on both the client and SP side as many SPs attempt downloading data, but end up not successfully getting the deal since another SP already claimed and published their deal.

See here for more

Proposal

Screen Shot 2023-03-22 at 1.18.37 PM.png


Key components of the SP election process:


Key flow of the SP election process:

  1. CC deployed on chain
    1. Event emitted to show the deployment (called ClientContractDeployed)
    2. SP calls subscribe() for a CC they are interesting in participating in
  2. For every deal proposal:
    1. DealProposalCreate event gets emitted, with a unique proposal id x
    2. CC creates a deterministic ordering of all SPs in the CC SP queue.
      1. This ordering is created with the list of the SPs in the CC SP queue when the DealProposalCreate event gets submitted.
    3. All SPs can call getSPOrdering(id) in order to determine when/if they are chosen to take the deal for a given proposal id
    4. Chosen SP submits an eth_call for getDealProposal(id).
      1. After a delay of 150 epochs [if no PSD message is seen on-chain for x], the next SP in getSPOrdering() gets chosen to receive x.