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

Fix: Correct JSON path for consensus max_gas setting #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xosnet
Copy link

@xosnet xosnet commented Apr 2, 2025

Fix: Correct JSON path for consensus max_gas setting

Issue

The current implementation in local_node.sh uses an incorrect JSON path to set the maximum gas limit for blocks in the genesis file. This results in the max_gas parameter remaining at the default value -1 (unlimited) instead of being set to the intended value of 10000000.

Root Cause

The script is using the path .consensus_params["block"]["max_gas"] which doesn't match the actual structure in the genesis.json file. The correct path should be .consensus.params.block.max_gas.

Changes

  • Updated the jq command in local_node.sh to use the correct JSON path structure
  • Changed from:
    jq '.consensus_params["block"]["max_gas"]="10000000"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
  • To:
    jq '.consensus.params.block.max_gas="10000000"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"

Testing

I've tested this change by:

  1. Running the updated script
  2. Verifying the genesis.json file has the correct value set:
    "consensus": {
      "params": {
        "block": {
          "max_bytes": "22020096",
          "max_gas": "10000000"
        },
  3. Confirming the chain starts with the intended gas limit

This fix ensures that nodes are properly configured with the specified block gas limit rather than using unlimited gas, which could lead to block processing issues.

@xosnet xosnet requested a review from a team as a code owner April 2, 2025 07:54
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

Successfully merging this pull request may close these issues.

1 participant