You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FIP-0092: clarify wording in gas calculation section (#1141)
NI-PoRep, already active in the network. While revisiting the gas calculations
I found this particularly impenetrable when viewed from a per-sector view. This
is my attempt to clear up the confusion for the future visitor who isn't as
privy to the snark/circuit/proof/sector nuances involved.
Copy file name to clipboardExpand all lines: FIPS/fip-0092.md
+55-22Lines changed: 55 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,36 +165,69 @@ NI-PoRep is an *optional* feature that can be opt-in for those interested. The
165
165
166
166
### Gascalculations
167
167
168
-
Accordingto [FIP-0013](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0013.md#gas-calculations), for the verification of N aggregated Groth16 proofs (ie, circuits) the total gas charged is
169
-
- 32GiB sector:449900*N/10+Constant32(N)
170
-
- 64GiB sector:359280*N/10+Constant64(N),
171
-
172
-
whereConstant32(N) andConstant64(N) areasfollows:
168
+
Accordingto [FIP-0013](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0013.md#gas-calculations), for the verification of `N` aggregated Groth16 proofs (ie, circuits) the total gas charged is:
NotethatthesethresholdsdifferfromthoseusedforregularPoRep.Forexample, 3NI-PoRepproofswillusethe `137,559,930` step cost, whereas 3 regular PoRepproofs would have a zero step cost.
186
215
187
-
32GiB sector:44990*126+112356810=118025550
216
+
#### Examples
188
217
189
-
64GiB sector:35928*126+110803030=115329958
218
+
Example 1:Gas cost for 3 aggregated 32GiB NI-PoRep proofs:
Usually `GasUsed*BaseFee` is burned for every message.However, for aggregated batches of proofs (for example, ProveCommitSectorsAggregate and ProveReplicaUpdates3 messages), we charge an additional proportional fee introduced inFIP0013 and updated inFIP0024.WithNI-PoRep, when aggregating at most 5 sectors (i.e. k ≤ 5), the per sector gas cost is already larger than the current value (~34721049), and therefore, in this case, there is no need for any additional fee.On the other hand, when aggregating 6 or more sectors, the additional fee is needed again.In this case, the fee is computed using the current function used for interactive proofs (`PayBatchGasCharge` function, as stated in [FIP0024](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0024.md#specification)) but passing as input the number of proofs - 5.
0 commit comments