Non Interactive PoRep: improving onboarding pipeline allowing for a real separation between storage and proving, without compromising security #854
Replies: 13 comments 27 replies
-
How would this impact the hardware spec for sealing boxes? Would current hardware setups still be relevant?
Do you mean the consensus pledge of a sector will remain? AFAIU, initial pledge refers to the 20 day expected reward of a sector. |
Beta Was this translation helpful? Give feedback.
-
Finally! I appreciate the introduction of this FIP, I've eagerly anticipated it for years! In essence, this FIP will enable a complete separation between sealing and storage tasks. Currently, despite 'Sealing as a Service', there remains a dependency on the storage provider: the provider needs to cover the PC1 deposit and supply all sector information. Looking at the bigger picture, sealing and storage represent two distinct operations that, ideally, shouldn't have been merged and executed by a single entity. However, due to practical considerations at the network's launch, it was impractical to segregate them. This FIP fixes that. In conclusion, the execution of this FIP facilitates the following advancements:
|
Beta Was this translation helpful? Give feedback.
-
FIPS 854 is critical to further dis-aggregating the lotus stack to streamline pipeline data ingress for the Filecoin network. The further we can decompose the individual steps and states of the data pipeline, the better we can optimize the orchestration and implementation of those transformations. |
Beta Was this translation helpful? Give feedback.
-
There is a draft FIP PR at #891. The new onboarding method proposed there follows the FIP-0076 ProveCommitSectors2 method in supplying sector activation manifests etc. This means it combines sector capacity activation with data commitments, notifications to markets etc. The idea of cleanly separating these two actions has come up independently from a number of angles (e.g. it's covered in these discussions 1, 2 from FilDev Singapore, and was similarly affirmed at FilDev Iceland). The introduction of NI-PoRep seems like the right opportunity to introduce this. For SAAS flows especially, it's apparent that shipping all the data over to the sealer so they can seal, then ship it all back is a very significant burden. It's much easier to seal and distribute CC sectors and then the SP can snap the data later. So we don't expect many users of this new method to ever want to supply data at the same time anyway. If I roughly recall, some arguments in favour of supporting only onboarding CC sectors and snapping data later:
The NI-PoRep onboarding method could be much simpler if it only supports CC sectors. And this is the target use case anyway. If widely adopted, we may be able to deprecate older non-interactive onboarding to realise a great simplification of both on-chain and storage pipeline code (which reduces risk and improves development velocity). This flow depends on efficient Snap Deals, but I believe that will be addressed by FIP-0082 - Aggregate replica proofs. |
Beta Was this translation helpful? Give feedback.
-
Resolved |
Beta Was this translation helpful? Give feedback.
-
Here is a statement from the Decentralized Storage Alliance (DSA) in support of this FIP (FIP-854).
Full statement can be found here: |
Beta Was this translation helpful? Give feedback.
-
Hey 👋 We’re currently exploring/writing up a project timeline for the reamining pieces of NI-PoRep work. And we want to gather feedback if you or your team foresee benefits from having NI-PoRep included in the network version 23 upgrade that is planned to happen on June 20th - 2024? Your support and opinions are crucial in advocating for the inclusion of NI-PoPep in a given network upgrade. |
Beta Was this translation helpful? Give feedback.
-
I just wanted to include here additional spec details for this FIP that is currently opened as a PR in the FIPs repo. HERE. This new PR adds fields for specifying sealer actor id and sealer actor specified sector number to the NI porep method. This still forms part of the FIP draft once approved and merged by FIP Editors. |
Beta Was this translation helpful? Give feedback.
-
There's a discrepancy that I think needs to be discussed and resolved in some way, ideally with clarification in 0090, arising out of that last pull request @luckyparadise mentioned above, #1000.
It would be good if we could get clarity into 0090 on:
I'd be happy to do a PR to 0090 with some language but it's unclear from the various activities outlined above what the expected behaviour and format of parameters should be. @ZenGround0 perhaps this is one for you? |
Beta Was this translation helpful? Give feedback.
-
Given that the size of the NI-PoRep proofs is quite large, I'd like to raise the possibility of removing the ability to submit batch proofs and always require aggregates, in all cases, to simplify this FIP even more. A single 32 or 64G sector proof submitted via the new method is going to be So, could we get rid of batch, simply the messages, simplify the actors implementation, simplify the miner software implementation, simplify the gas modelling that users have to apply, and simplify all our testing requirements?
becomes
|
Beta Was this translation helpful? Give feedback.
-
Removing the batch option would be beneficial for process optimization. |
Beta Was this translation helpful? Give feedback.
-
Another discussion topic for possible amendment or inclusion in 0092: FIP-0090 currently specifies During a review, @irenegia and @lucaniz suggested that |
Beta Was this translation helpful? Give feedback.
-
I am glad to see that FIP-0092 is proposing changes to simplify the protocol even more & ease SP operations. That said, I am a little 😞 that batch balancer is still being introduced to this new onboarding method, and seems like the reason it is added is b/c "we have been doing it elsewhere, so why not here too" instead of a clear benefit to the network or the SPs - if there is one, I would love to learn. I am also a bit skeptical of the parameters chosen as it is based on data from FIP0024, which I think may be outdated & needs a re-evaluation for post-fvm + current network condition. |
Beta Was this translation helpful? Give feedback.
-
Motivation
PoRep is currently interactive and it is composed by two steps:
PreCommit
andProveCommit
.At
PreCommit
SP puts down a collateral (PCD) and wait 150 epochs in order to receive a challenge seed from the chain which enables theProveCommit
step. This means thatProveCommit
needs to happen within a time window lasting.MaxSectorDuration
epochs. Note that betweenPreCommit
andProveCommit
a waiting time of 150 epochs is needed for security reasons.PreCommit
needs a collateral (PCD), there is no real possible trustless separation between the entity which stores the sector and the entity which actually proves it. This means that if anyone wants to outsource the task of proving a sector, then the entity which proves and the entity which outsources the task need to agree on who puts down the collateral (trusting the other part).A first step to mitigate PoRep bottlenecks was the introduction of Synthetic PoRep (See FIP-0059). Nevertheless, if we really want to remove the aforementioned limitations, NI-PoRep is the way to go: indeed, Non Interactive PoRep would remove the
PreCommit
step (and PCD), without compromising security, allowing for a simplified pipeline which can reduce costs and enable a full separation between storage and proving. Note that this is particularly relevant for Sealing as a Service (SaaS) and SupraSeal software throughput.Protocol Specification
NI-PoRep allows to remove on-chain interaction when onboarding sector by changing the way PoRep challenges are generated.
We allow SP to locally generate challenges instead of using on-chain randomness.
On one hand, this feature of the protocol allows for drastically simplify the onboarding pipeline. On the other hand, higher security guarantee than today are needed in order to preserve network security.
We consider 128 bits of security as a robust level of security long term. It is possible to lower down security guarantees, but if we want a long term solution, 128 bits of security is the way to go.
In practice, this translates in an higher number of PoRep challenges (2253 per SDR layer instead of the current 176 per SDR layer) compared with today (12.8x).
NI-PoRep protocol can be summarized as follows:
Graph Labelling and commitments (similar to the current
PC1
andPC2
computation)ReplicaID
(which containsCommD
), SP computes the labels for all layers and the replica R;CommC
,CommRLast
and finally computesCommR=Poseidon_2(CommC, CommRLast)
;Storage Provider locally generates
NI_ChallengesNumber
challenges and vanilla proofs;ch_i = H(prefix, commR, tag, i)
;NI_ChallengesNumber
challenges, which result inNI_ChallengesNumber
vanilla proofs;Storage Provider publishes the new
NI_ProveCommitSector
proofNI_ChallengesNumber
vanilla proofs and computes the corresponding SNARK proofs for these challenges.CommR
(either in individual or aggregated form).Chain verifies proof
CommR
as a seed, the chain generatesNI_ChallengesNumber
challenges and this are fed into proof verificationHow to get there
There are two ways we can get to NI-PoRep
In order to have NI-PoRep as soon as possible, we opt for re-using existing circuit, and we consider that scenario in the following sections.
Impact on Filecoin
There are multiple venues where NI-PoRep would be beneficial for Filecoin. We’ll elaborate on those below
Cost Reduction: removing complexity reduces costs and enables the full potential of SupraSeal improvements
Removing interaction translates into a simplified pipeline
PreCommit
method and message, onlyProveCommit
will stay (only one method and one message needed to add sectors to the network);PCD
(PreCommit Deposit)InitialPledge
will remain);PreCommit
andProveCommit
Simplification of the pipeline and more flexible
ProveCommit
Step would allow for maximizing throughputTrustless SaaS Enabled
Removal of
PCD
allows for Proving and Storing to be now decoupledPoRep secured Cryptographically and not Rationally
Chain cryptographic security gets increased: NI-PoRep would make misbehaving cryptographically infeasible rather than irrational.
PoRep Security now independent from Consensus
Current PoRep is interactive and needs to get randomness form the chain. Moreover, in order to be secure, 150 epochs are needed between
PreCommit
andProveCommit
. This is due to the fact that some Consensus attacks need to be infeasible (as putting those attacks in place would allow for faking storage).In NI-PoRep, since randomness is derived locally, there is no link anymore between PoRep and consensus attacks. This mean that
Backward compatibility
Security Considerations
Fiat-Shamir Heuristic and its effects
NI-PoRep is based on the well-known Fiat-Shamir Heuristic, which allows for having a non interactive protocol starting from any 3-message interactive protocol. However, the heuristic requires the interactive protocol to have at least 80 bits of security (instead of the current 10), and preferably 128. In order to have long term security we propose to opt for 128 bits: this means that for NI-PoRep we need
NI_ChallengesNumber128bit
= 2253.Sectors need to be anchored to the chain: how to take
SealRandomness
?Interactive PoRep
The epoch in which sealing took place is identified by the corresponding chain reference, called
SealRandomness
which is the anchor of the sector to the chain.SealRandomness
must be taken from the VRF chain, in order to ensure that no other fork can replay the Seal.On one hand,
SealRandomness
needs to be taken from finalized blocks, but on the other hand it can not be taken farther back than necessary (in order to protect against long-range attacks). This means thatSealRandomness
needs to be verified.Due to current on-chain interaction, randomness verification is not too complicated and works as follows.
Given:
F
– Finality (number of epochs)X
– epoch in which sealing startsZ
– epoch in which the sealed sector appears (in a block)Y
– epoch announced incommitSector
(should be X, but an SP could use any Y <= X)T
– estimated time for sealing, dependent on sector sizeG = T + variance
– necessary flexibility to account for network delay and sealing time variance.When starting to prepare a seal in epoch X, the SP should draw randomness from X-F with which to compute the seal.
When verifying a seal in round Z, a verifier should ensure that the ticket used to seal the sector is found in the range of epochs
[Z-F-G, Z-T-F+G]
.In practice, the Filecoin protocol includes a
MaxSealDuration
for each sector size and proof type.As a result, each epoch determines the oldest seal challenge epoch that will be accepted in that epoch, defined as
sealChallengeEarliest
=currEpoch
-ChainFinality
-MaxSealDuration
NI-PoRep
If interaction is removed,
SealRandomness
verification becomes more difficult, but still necessary to protect the chain against the same class of attacks mentioned above.We'll set up an interval similar to what we have today, which holds for all the sectors committed onchain together.
This means that, if PC1, PC2, C1, C2 happen locally over time resulting into different sectors sealed in different moments in time and committed on-chain at the end of the process, all sectors committed together should have a randomness which verifies against the same time window, which is set to be 30 days, as it is today. See FIP-0013
This means that we have de facto a
MaxNI-SealDuration
, which could be potentially set as larger than today, in order to haveNI-sealChallengeEarliest
=currEpoch
-ChainFinality
-MaxNI-SealDuration
to be wide enough to fit meaningful use cases, while still preserving security (research needed here in order to find the right value, considering both security and use cases that will be covered).Note that we could also use the same values as today as an initial step, relaxing the randomness sampling rule for the single sector, while keeping the same
sealChallengeEarliest
. In this case we'd have a NI-PoRep step to be completed withinsealChallengeEarliest
epochs overall to be valid.Potential concerns (and mitigations) due to interaction removal
One point to take into account when dealing with NI-PoRep, compared with the status quo, is that a malicious party willing to take over the network could potentially keep accumulating sectors locally onboarding them to the network all in a sudden.
Does such an attack have immediate effects?
Even if it is true that sectors can be accumulated over time and onboarded all in a sudden, we know that power is granted to onboarded sector with some delay. Specifically, there are 900 epochs of
PowerTableLookback
. This means that at epochT
we refer to the ctive power at timeT
- 900.As a consequence, even with NI-PoRep we have a minimum of 7.5h delay between the moment when sectors are onboarded and the moment when they actually acquire power.
In case of Interactive PoRep we have additional 75min given by the needed window of time between
PreCommit
andProveCommit
What is the real difference with respect to Interactive PoRep?
The answer really depends on the threat model we want to consider. In what follows we present four different scenarios with four different adversaries, from the less to the most powerful one.
Note that when we get security against the most powerful adversary, we automatically obtain security against less powerful adversaries as well. For this reason, after presenting the different scenarios, we'll focus on Scenario 4.
Scenario 1: Adversary limited in hardware and pledge
No security risks in this case.
Scenario 2: Adversary limited in hardware but not in pledge
We consider a window of time of 30 days (i.e.
MaxProveCommitDuration
)PreCommit
messages need to be put on chain over time. Note that an adversary of this kind can always put in place the attack using sibling, making detection much more difficult.PreCommit
messages, sectors can be added all in a sudden. Detection window is 7.5h before the adversary actually gets his power.Due to consensus security, this scenario does not represent a security issue (see "On feasibility of adversary not limited by pledge" below for further details).
Scenario 3: Adversary limited in hardware but not in pledge
As we did in Scenario 2, We consider a window of time of 30 days (i.e.
MaxProveCommitDuration
)Due to consensus security, this scenario does not represent a security issue (see "On feasibility of adversary not limited by pledge" below for further details).
Adversary not limited in hardware, nor in pledge
Due to consensus security, this scenario does not represent a security issue (see "On feasibility of adversary not limited by pledge" below for further details).
On feasibility of adversary not limited by pledge
It is true that with NI-PoRep and the associated removal of
PreCommit
traceability of sectors that will be added to the network is not possible anymore when adversary limited in hardware but not in pledge. Nevertheless, we are convinced that accumulating sectors and suddenly post them onchain is actually a feasible way to attack the network.Indeed, NI-PoRep removes
PreCommit
and PCD, but keeps IP as it is today. This means that adding EiBs of sectors results in a massive costs both in terms of hardware and pledge. Latest analysis from CryptoNet lab show that network today is mostly secured by pledge, and this is not going to change with NI-PoRep. See [2023Q3] Consensus Security: summary doc and related analysis.On similar attack which an Adversary with unlimited datacap and not limited by pledge could put in place today
A similar attack to the one mentioned in this section is (in theory) already possible today for an adversary who is not limited in pledge and has datacap. This adversary can takeover the network by upgrading a massive amount of CC sectors via SnapDeals. In this case the detection window is the same as NI-PoRep sectors, meaning
PowerTableLookback
= 900 epochs ~ 7.30hOn current feasibility of the attack given storage onboarding rate
Even if an adversary willing to takeover the network exists, current storage onboarding rate suggests that this attack is not feasible in practice today.
Latest analysis on onboarding (see here) suggests that the Filecoin network can optimistically onboard only 7.4PiB/day deal data.
Moreover, at the moment aggregation is dysfunctional, and even if it worked, it could increase the data onboarding capability only by 11%.
The real onboarding capability is probably the ~6PiB/day we observe in the network. See here for details.
This means that the amount of storage which can be onboarded into the network is currently capped by 240 PiB/month which makes impossible to takeover the network without getting noticed (given current network size).
Note that this represent a bug and we assume it will be resolved. As a consequence, we can not consider current (temporary) limited onboarding rate as a security guarantee by any mean.
On the other hand, it is true that limiting onboarding rate would mitigate the issue, but this would represent a change in Filecoin which should be acknowledged and designed ad hoc.
For all the above, we are convinced NI-PoRep does not introduce additional risks for the network.
What if we are still concerned there is a security issue?
Assume that after all we detailed above, we are still concerned there can be a security issue and we want to protect Filecoin against it.
In this case we should protect the network against the Scenario 4 adversary (given it is the most powerful one and all other scenarios would be covered once Scenario 4 is covered).
We have two issues we want to analyze:
Early Detection
If the feature we want consists in having the power to detect massive onboarding, then we need to consider the following:
So, we need to understand how wide a detection window should be.
Massive Onboarding
Note that the adversary we are considering has unlimited hardware and pledge, thus can add massive number of sectors. In this case, what we should do is to limit the daily total onboarding by design.
Gas and Proving Overhead Implications
Gas Costs Analysis
PoRep challenges are generated outside Snark Circuits and passed as inputs at verification time. These inputs need to be generated on the spot in order for verification to happen.
With Non Interactive PoRep, with 128 bits of security the number of challenges is multiplied by either 12.8x.
We analyze the concrete impact of NI-PoRep proving overhead on gas costs for SPs. We figured out that Removing PreCommit makes NI-PoRep and Interactive PoRep gas costs comparable.
In particular,
Single Sectors (i.e. using SnarkPack for NI-PoRep only, considering a single sector [worst case for NI-PoRep])
PreCommit
(and associated gas costs), the difference between NI-PoRep with 128 bits of security and current PoRep goes down to < 36M gas units (123M Vs (34+53)M gas units)Aggregated Sectors (i.e. using SnarkPack both for Interactive and NI-PoRep)
PreCommit
(and associated gas costs), Current sectors are 2.1x more expensive than NI-PoRep sectors with 128 bits of security (53M + 17M gas units for current sectors, 32M gas units for NI-PoRep sectors).Note also that estimated gas cost for
PreCommit
~53M gas is optimistic (i.e. it is usually higher). This means that NI-PoRep is probably performing even better than what this analysis shows, compared with current PoRep.See full analysis here
Proving Overhead Cost Analysis
NI-PoRep allows for removing interaction at the cost of augmenting the number of challenges by a factor of 12.8, considering 128 bits of security.
The 12.8x number of challenges translates into an 12,8x Snark proving overhead. We analyzed how this snark computation overhead affects overall costs.
The conclusion is that considering PC1+PC2+C1+C2 and Storage costs (i.e. not considering maintenance costs), a 128 bits of security NI-PoRep sector is 5% more expensive overall than a Interactive PoRep sector when sector duration is 3y.
See full analysis here
Beta Was this translation helpful? Give feedback.
All reactions