Skip to content
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

proposal: reject deals with an expiration date beyond 540d from now #6959

Open
raulk opened this issue Jul 30, 2021 · 5 comments
Open

proposal: reject deals with an expiration date beyond 540d from now #6959

raulk opened this issue Jul 30, 2021 · 5 comments
Labels
area/markets Area: Markets LM-tech-debt P1 P1: Must be resolved team/curio

Comments

@raulk
Copy link
Member

raulk commented Jul 30, 2021

Some miners have begun to see this error:

  2021-07-30T14:59:43.549Z    WARN    sectors storage-sealing/fsm.go:609  sector
  1460 got error event sealing.SectorChainPreCommitFailed: precommit batch
  error: sending message failed: GasEstimateMessageGas error: estimating gas
  used: message execution failed: exit 16, reason: invalid expiration 2556588,
  cannot be more than 1555200 past current epoch 978360 (RetCode=16)
  
  2021-07-30T14:59:43.549Z    WARN    sectors storage-sealing/fsm.go:609  sector
  1459 got error event sealing.SectorChainPreCommitFailed: precommit batch
  error: sending message failed: GasEstimateMessageGas error: estimating gas
  used: message execution failed: exit 16, reason: invalid expiration 2556588,
  cannot be more than 1555200 past current epoch 978360 (RetCode=16)

This is caused by a client setting a deal expiry that's too far out into the future. Concretely, if the expiry epoch is later than 540d away from the time the sector is being precommitted, the precommit will fail with that message.

In the exhibit case, Estuary was setting:

  • a start date 7 days from when the deal was proposed (to give miners plenty time to seal the sector)
  • an end date that is the maximum sector duration (540d) + start date (7d) = 547d (!) from the proposal time.

If a client wants to make a deal with the longest lifetime possible, the only safe option is to make it with an expiry 540d from now (i.e. from the time the deal is proposed), not from the start date. The reason is that the client doesn't know when the miner will pack the deal into a sector and will precommit that sector. For all it knows it could be instantaneous (technically, e.g. if the miner already has the piece and doesn't need to transfer it?).


The simple solution to protect miners from this failure by default is to reject deals with an expiration date higher than 540d from the time the deal is proposed.

The harder (but more correct) solution is to accept the deal if the slack left by expiration - start is deemed enough to precommit and seal the sector in time. This might be useful if I want to schedule a deals into the future (e.g. start date 80 days from now, with an expiration of 500 days from then [this would be 580d from now], which gives me 40 days to precommit and seal the deal: days 40-80). However, in practice this is worthless because miners will reject deals with a start date too late into the future.

@magik6k magik6k added the P1 P1: Must be resolved label Aug 2, 2021
@ribasushi
Copy link
Collaborator

Related: the "time from now" should possibly be checked against 538 as per filecoin-project/filecoin-docs#879 (comment)
Need to double-check with actors what is the real maximum safe value here.

@jennijuju
Copy link
Member

Related: the "time from now" should possibly be checked against 538 as per filecoin-project/filecoin-docs#879 (comment)
Need to double-check with actors what is the real maximum safe value here.

That comment is outdated since #6803 is introducted.

@benjaminh83
Copy link

Got an precommit batch error on a sector that holds a single 32GiB dealbot 180 day deal.. I have not seen this before. This is from lotus-miner logs:

2021-08-10T00:20:41.018+0200	WARN	sectors	storage-sealing/fsm.go:609	sector 5919 got error event sealing.SectorChainPreCommitFailed: precommit batch error: sending message failed: GasEstimateMessageGas error: estimating gas used: message execution failed: exit 16, reason: invalid expiration 2563912, cannot be more than 1555200 past current epoch 1008042 (RetCode=16)
2021-08-10T00:20:41.018+0200	WARN	sectors	storage-sealing/fsm.go:609	sector 5917 got error event sealing.SectorChainPreCommitFailed: precommit batch error: sending message failed: GasEstimateMessageGas error: estimating gas used: message execution failed: exit 16, reason: invalid expiration 2563912, cannot be more than 1555200 past current epoch 1008042 (RetCode=16)
2021-08-10T00:20:41.018+0200	WARN	sectors	storage-sealing/fsm.go:609	sector 5918 got error event sealing.SectorChainPreCommitFailed: precommit batch error: sending message failed: GasEstimateMessageGas error: estimating gas used: message execution failed: exit 16, reason: invalid expiration 2563912, cannot be more than 1555200 past current epoch 1008042 (RetCode=16)
2021-08-10T00:20:41.018+0200	WARN	sectors	storage-sealing/fsm.go:609	sector 5920 got error event sealing.SectorChainPreCommitFailed: precommit batch error: sending message failed: GasEstimateMessageGas error: estimating gas used: message execution failed: exit 16, reason: invalid expiration 2563912, cannot be more than 1555200 past current epoch 1008042 (RetCode=16)

And some background info on whats in the sector:

$ lotus-miner sectors status 5919
SectorID:	5919
Status:		PreCommitFailed
CIDcommD:	baga6ea4seaqlbeyja4lgtzohdjllu3opp3uobiewet6kxu2jfbrcdgh5544oopy
CIDcommR:	bagboea4b5abcbjefeqz7fku2ybtymxroswbku7yryvs6xjtyiw45nrnx22kqjr23
Ticket:		01e2dd28b9d83e5794251d841a7bcdf4af5877c9282a2c2d418e5f078b3c48a8
TicketH:	1006553
Seed:		
SeedH:		0
Precommit:	<nil>
Commit:		<nil>
Proof:		
Deals:		[2251584]
Retries:	0
lotus-miner storage-deals list -v | tail -n20 | grep 584
Aug  9 18:23:49  true   bafyreihx6lg23flx5s5osfqkx6q6jrqmunxm6z6c6w66bw6grks46ncigq  2251584  StorageDealAwaitingPreCommit             f1wdxdpqh3hirrhp353i4o6ld7bsw6evh3v7i5jtq                                               32GiB     0 FIL                     519419   12D3KooWJu2XpAS9fzxGgMWpje1brMXCUc2ownpDy4XVdao2oFPd-12D3KooWR8nkLuyBc4VFsN5r8EYWoVHuE9z8SZJRq85z562Hpw5J-1628267834989707277  

@pooja
Copy link
Contributor

pooja commented Aug 11, 2021

In the meantime while we're working on a fix for this, should we recommend clients set a reasonably safe deal duration (i.e. around 500 days or so for those that are looking for ~1.5 years of storage)?

@arajasek
Copy link
Contributor

I'd like to posit that the real issue here is that the max duration of a deal and of a sector is the same (540 days). It's virtually impossible for a storage provider to land such a deal.

@rjan90 rjan90 added this to the LM-Tech-Debt-Legacy-Markets milestone Mar 24, 2023
@rjan90 rjan90 moved this to 🛑 Removed/Closed/Invalid/Outdated in Lotus-Miner-V2 Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/markets Area: Markets LM-tech-debt P1 P1: Must be resolved team/curio
Projects
Status: 🛑 Removed/Closed/Invalid/Outdated
Development

No branches or pull requests

8 participants