Open AuHau opened 1 year ago
While this could definitely be done, this would require more gas to emit during requestStorage
. Is the gas penalty on the client worth the saving of a request during SaleDownloading
?
Is this still current/important, guys?
This is still current, and probably easily fixed.
In the SalePreparing
state, we (1) retrieve the request, then we (2) check availability, and then (3) do a reservation.
Both (2) and (3) can be done with just the request ask. If we change the order to be (2), (3), (1), then we only retrieve the request when needed.
To add to Mark's reply though, this is more of an optimization and not really "bug - bug" ;-)
Marketplace contract emits
StorageRequested
event that contains theStorageAsk
object, which represents the basic parameters of theStorageRequest
. The idea presented to me by @markspanbroek is that the host nodes should use this object to make decision-making on whether it wants to accept the Request and fill its slot or not.Currently, though, it downloads the whole Request in the
SaleDownloading
state, which is unnecessary.