onflow / flow-go

A fast, secure, and developer-friendly blockchain built to support the next generation of games, apps, and the digital assets that power them.
GNU Affero General Public License v3.0
531 stars 170 forks source link

[State Sync] Add hardening features to public network bitswap setups #5187

Open peterargue opened 6 months ago

peterargue commented 6 months ago

Blocked by: https://github.com/onflow/flow-go/issues/2795

Problem Definition

The public network requires no stake for participants, so the security model for the p2p network is significantly different from the staked network. To allow running execution sync via bitswap on the public network, some additional hardening features are needed.

Proposed Solution

  1. https://github.com/onflow/flow-go/issues/4403
  2. Add support for peer allow listing. A similar feature is already supported on the staked network: https://github.com/onflow/flow-go/blob/db9383cb887a5f1cad03c9577978a47c0c54a7fe/network/p2p/blob/blob_service.go#L258-L302
  3. Quality of service limits. e.g. limit max resources used by bitswap
  4. Assess other protections that may be needed
bluesign commented 4 months ago

Does this also allow p2p sharing? Observers in between sharing blobs I mean. If so there may need to add some additional protections.

peterargue commented 4 months ago

Does this also allow p2p sharing? Observers in between sharing blobs I mean. If so there may need to add some additional protections.

yes, this would support p2p sharing of execution data between observers and ANs on the public network. What protections did you have in mind?

bluesign commented 4 months ago

I think reputation management for sender can be added, to verify they send correct data, with reasonable speed. ( unless this will be p2p for my own cluster )

peterargue commented 4 months ago

yes, absolutely. bitswap has some notion of reputation built in, and correctness of the data is validated after download. We will need to closely review the limits of the existing protections and fill any gaps.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.