FuelLabs / fuels-ts

Fuel Network Typescript SDK
https://docs.fuel.network/docs/fuels-ts/
Apache License 2.0
44.25k stars 1.34k forks source link

Blob upload optimisations #2917

Open maschad opened 1 month ago

maschad commented 1 month ago

Follow up optimisations for #2827

petertonysmith94 commented 4 weeks ago

Wouldn't this be a breaking change?

If yes, would it be worth basing off #2827 and getting it into the release?

danielbate commented 4 weeks ago

After discussing with @danielbate on the PR

for large contract deployments, we determined it may be possible to do further chunk optimization thus reducing the need for the chunkSizeTolerance parameter. The impetus for this is due to the nature of the chunkSizeTolerance parameter being difficult to set programmatically, given it's based on network fee fluctuations.

The rationale is that if we know the account's balance, the transaction limit, contract limit and maximum configurable request body size, we can determine an accurate cost before deployment, and thus remove the need for this user provided value.

This should also improve the DX as it reduces the probability of a contract deployment failure.

This is a follow up once https://github.com/FuelLabs/fuels-ts/pull/2827 is merged.

IMO the above optimisations that @maschad mentions will definitely reduce the importance of the tolerance level. However unknowns at compile time such as the configurable graph QL body size limit means we should still keep this parameter, and this not introduce a breaking change.

danielbate commented 4 weeks ago

@maschad I'm going to transition this whole issue to blob follow ups.