matter-labs / zksync-era

zkSync era
Apache License 2.0
3.11k stars 2.08k forks source link

Add API endpoint exposing estimation gas scale factors #2257

Open zeapoz opened 5 months ago

zeapoz commented 5 months ago

🌟 Feature Request

📝 Description

Add an API endpoint that exposes the following environment variables:

  1. API_WEB3_JSON_RPC_ESTIMATE_GAS_SCALE_FACTOR
  2. API_WEB3_JSON_RPC_ESTIMATE_GAS_ACCEPTABLE_OVERESTIMATION
  3. API_WEB3_JSON_RPC_GAS_PRICE_SCALE_FACTOR

🤔 Rationale

In the era-test-node project, we've encountered an issue relating to the fact that the estimation gas scale factors we use are hardcoded. However, as these values differ between different networks and deployments we ideally need a way to dynamically procure these values from the upstream source.

MexicanAce commented 4 months ago

This can be accomplished by updating the response object of zks_getFeeParams to include the following: