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

😶‍🌫️ Mystery Factor in Gas Estimation Script #123

Open
JaredBorders opened this issue Aug 9, 2024 · 1 comment
Open

😶‍🌫️ Mystery Factor in Gas Estimation Script #123

JaredBorders opened this issue Aug 9, 2024 · 1 comment

Comments

@JaredBorders
Copy link

JaredBorders commented Aug 9, 2024

📄 Summary

following refers to arbitrum-tutorials/packages/gas-estimation/scripts/exec.ts

After a thorough review of the gas-estimation script tutorial, including an analysis of the commit history and an organization-wide search, I have been unable to locate a clear explanation for why the following variable is multiplied by a factor of 16:

const l1EstimatedPrice = gasEstimateComponents.l1BaseFeeEstimate.mul(16);

I have examined the detailed documentation (👏) related to the gas formula and the section titled How do we get all parts of that equation. However, the documentation repeatedly states, "and multiply by 16" without providing a precise explanation for this multiplication.

🔎 Interpretation

This factor likely pertains to unit conversion, such as converting from units of size to units of gas. However, neither the tutorial nor the repository offers a clear and specific explanation for this multiplication.

💊 Remedy

To improve clarity, I suggest the following steps:

  1. Define a constant with a descriptive name for this factor.
  2. Provide sufficient documentation explaining the purpose and usage of the new constant.
  3. Update the detailed documentation within gasEstimator() to reference the factor of 16 and clearly explain its purpose.
@JaredBorders
Copy link
Author

cc: @TucksonDev

I noticed that you were the author of the script in question. I’m unsure where it would be best to discuss this further, but I have additional questions regarding on-chain gas estimation, future changes, and precompiles. These are all relevant to a migrating protocol that will rely on this information to operate correctly on-chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant