-
Notifications
You must be signed in to change notification settings - Fork 177
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
Add a batched PreCommitSectors method #25
Comments
|
I approve the spirit of this change. One thing to note is that in the future (may not belong to this FIP), a PreCommitBatched could contain PreCommits from other miners and the batched method would be verifying the signature on those PreCommits (similarly to what we do for deals). In this way, smaller miners could get together to jointly submit PreCommits. |
I mentioned during all dev that batched precommits may give miners with high sealing throughput an advantage over miners who are smaller in scale. It is unclear if the cost saving is worth the tradeoff. On second thought, the number of sectors that we are batching is probably small enough that it wouldn't make much of a difference. Can we quantify the difference? Of course allowing different miners' PreCommits to batch will be great but that's also extra work and hurdle that presents challenges to smaller miners. |
This FIP ensures that a miner can organize their PreCommits so that they can amortize their gas costs. The gas saving is pretty substantial. For example if you submit 32 sectors instead of 1, you may end up paying ~32x less gas (likely less than that). This is a good concern, but since this is a "one-off" cost, I dont think this will have major impact in the total cost of mining of a small miner vs larger miner. Extending this FIP in the future to support PreCommit from multiple miners will only benefit the miners. |
It's a "one-off" cost that can be incurred repeatedly and the cost savings can add up, e.g. a miner who can submit 32 sectors at a time has a cost advantage over miners who can't. This is a structural force that can advantage larger miners more than smaller ones. However, I can be convinced if most miners can comfortably submit 32 sectors at a time. |
Let me put it differently, the goal here is to reduce gas spent and not cost.
|
Thinking about this more, I think introducing this FIP at this moment will do more harm to the network than the potential cost savings it brings. The network is onboarding more than 15 PiB per day but most of that storage is not useful and it takes time to build applications on the network. In addition, FIP5 is already making PreCommit cheaper so committing storage is not too expensive or too slow per se. We can revisit this FIP in a few months once demand for storage on Filecoin has picked up (Filecoin Plus is operating successfully) and more applications are built on Filecoin. If teams want to push for this FIP, we should push harder on the other fronts first. We should however make it cheaper to do SubmitWindowPoSt and PublishStorageDeals. |
The fact that the network is on-boarding 15PiB per day (of which most of it is not useful) won't change with this fix; this FIPs makes sure that even if the network onboards 15PiB, ~1/3 (IIRC) of the block is freer than currently. If we don't do this, fees could increase for everyone. What would be the list of questions that we should answer to gain confidence on this? As I said before, having a node that aggregates PreCommit from multiple miners could also be done - although more complex. |
Economies of scale are real. We can't pretend they don't exist just because that's "unfair" to parties that don't have the scale to enjoy them. This is a very minor one in the big picture of Filecoin mining. Economies of scale is the very premise behind Filecoin's vision of abundant cheap storage. We should lean into them and get as much as possible! As @nicola says, this will make no difference to the high growth rate of the network. High-growth miners are much more likely to be limited by cost of sealing hardware than the gas cost of pre-commits, so reducing that gas cost won't change anything except making the whole network's consensus more efficient and freeing up bandwidth for other messages. |
We should land this at the same time or after we land ProveCommitBatched. The reason is that the decreased cost in PreCommitBatched could lead miners to think that they could submit many times more PreCommits, and this will lead to a more congested chain. |
The FIP draft for this has landed (#27), but the team is generally agreed that we should postpone implementation until after first addressing Window PoSt affordability. |
We finally have a more affordable WindowPoSt. PreCommit is currently 23% of the gas used. This FIP would be great in combination with FIP0013! |
It is not clear to me whether the pre commit batch affects sealing. While precommit commit messages are waiting for release (expiration of "PreCommitBatchWait") are those sectors held from further processing/sealing? As an example is PreCommitBatchWait = 8 hours will PC2 sectors queue up on sealing disks until the timer expires? If so, miners will need to be advised to set the wait timer low enough to not run out of disk capacity and cause worker to idle waiting for timer to expire. |
@stuberman this is an implementation concern so your question will be best addressed by filing an issue with the implementation you are using (sounds like https://github.com/filecoin-project/lotus is the right place) |
Also can be a great question for next weeks deep dive AMA! |
Tagged inactive due to the passage of FIP0008. |
The miner
PreCommitSector
method only supports committing a single sector at a time. It's one of the two highest frequency methods observed on the chain at present (the other being ProveCommitSector). High-growth miners commit sectors at rates exceeding 1 per epoch. It's also a relatively expensive method, with multiple internal sends and loading and storing state including:AllocatedSectors
bitfield (read and modify)PrecommittedSectors
HAMT (read and modify)Sectors
AMT (read)PreCommittedSectorsExpiry
AMT (read and modify)A
PreCommitSectorsBatch
method has potential to amortize some of these costs across multiple sectors. If miner operators implemented a relatively short batch aggregation period (a few epochs), the number of invocations could be reduced significantly, and some of the state manipulations above reduced in proportion.The text was updated successfully, but these errors were encountered: