Skip to content

A singleton contract maintaning upload/download URLs for each SP #20

@bajtos

Description

@bajtos

A follow-up for this Slack discussion..

In the Pandora Service contract implemented by #14:

  • SPs can register with their owner address, PDP upload URL and piece retrieval URL.
  • The contract owner can then approve/reject the SP and SP gets assigned a unique ID on approval.

I see two concerns mixed together:

  • A Service contract wants to have a way which SPs it do business with. (This is the approve/reject part.)
  • FS components (Synapse SDK, FilCDN, Spark Checker) need to find PDP Upload and Piece Retrieval URLs for a given SP.

I am concerned that the current approach will create a lot of friction for people building new services. When they fork & modify the Pandora contract to implement different service logic, they will then have to:

  • Teach Curio & Venus how to submit PDP Upload and Piece Retrieval URLs to the new service contract
  • Teach components like Synapse SDK and FilCDN how to find those URLs in the new service contract

I am proposing a different design to be implemented post-M1:

  • Extract the registry mapping SPs to their URLs into a standalone smart contract.
    • This smart contract will be a singleton, similar to PDPVerifier, which is also a singleton.
    • In Curio & Venus, there will only be one smart contract where to submit upload & retrieval URLs.
    • FWIW, Curio already supports a similar smart contract - see MinerPeerIDMapping Smart Contract
  • Let all components use this singleton smart contract to look up PDP Upload and Piece Retrieval URLs
    • Synapse SDK
    • FilCDN
    • Spark Checker
    • etc.
  • Modify the Pandora Service contract to maintain only the registry of approved SPs.

I am arguing such a design will make it much easier for others to build & deploy their own FS Service contracts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🎉 Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions