sablier-labs / v2-core

⏳ Core smart contracts of the Sablier V2 token distribution protocol
https://sablier.com
Other
289 stars 38 forks source link

Robust script for estimating the max segment and the tranche counts #872

Closed PaulRBerg closed 1 month ago

PaulRBerg commented 3 months ago

Context

While reviewing Shub's gas estimation script here, it dawned on me that we have been too lax about the values of MAX_SEGMENT_COUNT and MAX_TRANCHE_COUNT.

Basically, we have relied on heuristics and quick-and-dirty scripts to obtain them.

It's about time to develop a robust shell script for estimating the max segment and the tranche counts. My rationale is thus:

Mechanism of Action

The script would work something like this:

A related suggestion is that we may want to turn the maxCount variable into a mapping in BaseScript.

PaulRBerg commented 3 months ago

Relevant information for how to read the block gas limit on OP Stack chains:

https://github.com/foundry-rs/forge-std/issues/535#issuecomment-2031648878

PaulRBerg commented 2 months ago

Are on track to complete this task by the time the private audit finishes in two weeks, @smol-ninja, @andreivladbrg?

smol-ninja commented 2 months ago

Yes. It will be done by then

smol-ninja commented 2 months ago

@PaulRBerg tagging you since its been added in https://github.com/sablier-labs/v2-core/pull/908.