Skip to content

Conversation

@shanejonas
Copy link
Contributor

@shanejonas shanejonas commented May 2, 2025

User description

looks like we were commenting out this misconfigured gas estimate config when deploying.

fixes: https://linear.app/shm/issue/SHARD-2337/api-stagenetshardeumorg-returning-incorrect-gas-estimate-via-json-rpc


PR Type

bug_fix


Description

  • Remove default value for staticGasEstimate in config

  • Prevent static gas from overriding dynamic estimation

  • Addresses incorrect gas estimate issue in API


Changes walkthrough 📝

Relevant files
Bug fix
config.ts
Remove default value for staticGasEstimate in config         

src/config.ts

  • Removed default value for staticGasEstimate in config
  • Now uses only environment variable if set
  • Prevents unintended override of gas estimation logic
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link

    github-actions bot commented May 2, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🏅 Score: 95
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Configuration Change

    The removal of the default value for staticGasEstimate means that if process.env.STATIC_GAS_ESTIMATE is not set, the value will be undefined. Ensure that all code paths that access CONFIG.staticGasEstimate handle the undefined case correctly and do not assume a default value.

    staticGasEstimate: process.env.STATIC_GAS_ESTIMATE,

    @github-actions
    Copy link

    github-actions bot commented May 2, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    urnotsam
    urnotsam previously approved these changes May 2, 2025
    @shanejonas shanejonas merged commit 08ab6f9 into mainnet-launch May 2, 2025
    5 checks passed
    @justin-shardeum justin-shardeum changed the title fix: do not set static gas as it overrides not falls back SHARD-2337 - fix: do not set static gas as it overrides not falls back May 2, 2025
    @mhanson-github mhanson-github deleted the fix/estimate-gas branch May 20, 2025 03:43
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants