-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Batch Fee For Precommit, Lower BatchBalancer and Remove Gas-limited Constraints #1094
base: master
Are you sure you want to change the base?
Conversation
We are proposing a FIP to support more batching/aggregation as low hanging fruit to give some onboarding gas saving in the short term cc @AxCortesCubero @zixuanzh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lacking some reasoning for the chosen numbers for the batchBalancer but otherwise seems good.
FIPS/fip-lowerbatchBal.md
Outdated
At precommit there are two options: (1) "simple" batching as in precommit (ie, one message for ≥ 2 sectors) where there is a porep proof for each sector in the batch, and (2) batching with aggregation, where there is one unique aggregated porep proof. | ||
Batching for provecommit is already rational (cost-effective), as the batch fee applies only to aggregated proofs (opposed to precommit, where the batch balancer applies to batching). | ||
|
||
On the other hand, aggregation is rational only when the base fee exceeds 0.065 nanoFIL. Lowering the value of `batchBalancer` from 5 to 2 nanoFIL will reduce the crossover point to 0.026 nanoFIL, making the aggregation rational across a broader range of base fee values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2 nanoFIL? And why 0.026 nanoFIL for the crossover? Any modelling to back these choices versus other values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More info here https://docs.google.com/document/d/17FYnKIGf1uf1cCUwfKd30pQpTq8fAux5YghRIlfqrdE/edit?tab=t.0#bookmark=id.4gq3p5g7oyn8
could you @ZX @AxCortesCubero please add a short recap of that to the FIP text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I would like to see the reasoning for the value choice in the FIP so that anyone future person reading this FIP can understand the full context without needing to hunt down gdoc links.
@irenegia very tiny nit: it might be good to make the casing of "batchBalancer" more consistent across the doc. In the authoritative code (builtin-actors), it's |
fip: "00XX" | ||
title: Remove Batch Fee For Precommit and Lower batchBalancer | ||
author: irene, ZX, AX | ||
discussions-to: https://github.com/filecoin-project/FIPs/discussions/1092 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please create a separate discussion dedicated to this proposal - so that it is easier to capture a discussion that is specific to what is proposed here?
FIPS/fip-lowerbatchBal.md
Outdated
At precommit there are two options: (1) "simple" batching as in precommit (ie, one message for ≥ 2 sectors) where there is a porep proof for each sector in the batch, and (2) batching with aggregation, where there is one unique aggregated porep proof. | ||
Batching for provecommit is already rational (cost-effective), as the batch fee applies only to aggregated proofs (opposed to precommit, where the batch balancer applies to batching). | ||
|
||
On the other hand, aggregation is rational only when the base fee exceeds 0.065 nanoFIL. Lowering the value of `batchBalancer` from 5 to 2 nanoFIL will reduce the crossover point to 0.026 nanoFIL, making the aggregation rational across a broader range of base fee values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, aggregation is rational only when the base fee exceeds 0.065 nanoFIL. Lowering the value of `batchBalancer` from 5 to 2 nanoFIL will reduce the crossover point to 0.026 nanoFIL, making the aggregation rational across a broader range of base fee values. | |
On the other hand, aggregation is rational only when the base fee exceeds 0.065 nanoFIL today. Lowering the value of `batchBalancer` from 5 to 2 nanoFIL will reduce the crossover point to 0.026 nanoFIL, making the aggregation rational across a broader range of base fee values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you specify how you get the 0.065 nanoFIL number? If this is true - it sounds like SP client like lotus-miner should change their default immediately or miners should manually update their cocnfig so that aggregation is enabled whenever base fee is higher than 0.065 nanoFIL and start saving (and the network does have >0.065nanoFIL base fee sometimes atm).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [Msg 2](https://www.filutils.com/en/message/bafy2bzaceah7m6jzravjoswo2pljzit36euu3sgz5jzbnpkcfp23b76texiv6): ProveCommitSectors3 for 4 sectors, batched (no aggregation): 96.M/4 = 24M per sector | ||
- [Msg 3](https://www.filutils.com/en/message/bafy2bzacedeh74ds4x4l5nlfahmlvwn4obfukhgqnf6rxlaargvsm56sljune): ProveCommitSectors3 for 4 sectors, aggregated[^*]: 217M/4 = 54M per sector | ||
|
||
[^*]: In practice, aggregation is currently giving less gas saving respect to batching due to a bug causing single proofs to be charged an incorrect amount of gas units. So currently, batching is to be preferred with respect to aggregation. Once this code bug is fixed, batching will cost more gas units and aggregation would be the option with the largest gas unit saving per sector. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[^*]: In practice, aggregation is currently giving less gas saving respect to batching due to a bug causing single proofs to be charged an incorrect amount of gas units. So currently, batching is to be preferred with respect to aggregation. Once this code bug is fixed, batching will cost more gas units and aggregation would be the option with the largest gas unit saving per sector. | |
[^*]: In practice, aggregation is currently giving less gas saving respect to batching due to a bug causing single proofs to be charged an incorrect amount of gas units. So currently, batching is to be preferred with respect to aggregation. Once this bug in the ref-fvm implementation is addressed, proof aggregation will be the most gas-efficient approach if one can onboard 4 or more sectors at the same time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can onboard 4 or more sectors at the same time.
technical: @irenegia can you confirm whether this is still correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, working on that
On a high level, this FIP is technically sound. However, I think it needs to document how the authors are getting/choosing the numbers mentioned in this FIP better & some editorial fixes. |
Co-authored-by: Adrian Lanzafame <[email protected]> Co-authored-by: Jiaying Wang <[email protected]>
Co-authored-by: Rod Vagg <[email protected]> Co-authored-by: Adrian Lanzafame <[email protected]>
Co-authored-by: Rod Vagg <[email protected]> Co-authored-by: Adrian Lanzafame <[email protected]>
Co-authored-by: Jiaying Wang <[email protected]> Co-authored-by: Adrian Lanzafame <[email protected]>
Changed to BatchBalancer everywhere |
editorial changes + added links to precommit and provecommit msgs with deals
I'm proposing expanding scope of this PR slightly in this PR: #1098 |
This looks pretty good to me too after a final round of comment resolution. Please do open a separate discussion thread dedicated to this specific proposal. |
FIPS/fip-lowerbatchBal.md
Outdated
|
||
|
||
## Implementation | ||
Specs-actors PR: TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specs-actors PR: TODO | |
builtin-actors PR: https://github.com/filecoin-project/builtin-actors/pull/1595 |
FIPS/fip-lowerbatchBal.md
Outdated
- Certain test cases (similar to as FIP24) may need to be adjusted when changing the BatchBalancer value. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Certain test cases (similar to as FIP24) may need to be adjusted when changing the BatchBalancer value. | |
- Remove test cases from [FIP-0024](./fip-0024.md) that related to testing PreCommit and the 25%/75% split in batch fee between PreCommit and ProveCommit. | |
- Remove expectations that rely on the `SinglePreCommitGasUsage = 16433324.1825` value originating from [FIP-0024](./fip-0024.md). The remaining gas charge for commits be `SingleProveCommitGasUsage = 49299.972.5475`, i.e. applied only on ProveCommit. | |
- Decrease test expectations involving the batch balancer in ProveCommit from a value of `5` to `2`. |
* Add removal of gas-limited constraints to gas-savings proposal Ref: #1094 Ref: filecoin-project/builtin-actors#1586 Ref: filecoin-project/builtin-actors#1268 Ref: filecoin-project/lotus#10612 * fixup! Add removal of gas-limited constraints to gas-savings proposal
We are proposing a FIP to support more batching/aggregation as low hanging fruit to give some onboarding gas saving in the short term
cc @AxCortesCubero @zixuanzh