Skip to content

Conversation

@0xMuang
Copy link
Collaborator

@0xMuang 0xMuang commented Jan 26, 2026

Summary

Block gas limit is now read from genesis configuration instead of being hardcoded to 30,000,000.

Changes

node.rs

  1. Added DEFAULT_GAS_LIMIT constant (30,000,000)
  2. Added gas_limit: u64 field to Node struct
  3. In bootstrap_validators_from_genesis(): store genesis.gas_limit converted to u64
  4. Updated create_genesis_block(timestamp, gas_limit) to take gas_limit parameter
  5. Updated execution_result_to_block(block_number, result, gas_limit) to take gas_limit parameter
  6. Updated run_event_loop() to pass gas_limit to block creation

How it works

Genesis JSON → bootstrap_validators_from_genesis() → self.gas_limit
                                                          ↓
                        create_genesis_block(timestamp, gas_limit)
                                                          ↓
                        execution_result_to_block(num, result, gas_limit)

Test Plan

  • cargo check passes

Closes #132

- Add gas_limit field to Node struct with default value 30_000_000
- Read gas_limit from genesis configuration during bootstrap
- Pass gas_limit to block creation functions instead of hardcoding
- Add DEFAULT_GAS_LIMIT constant for clarity
@0xMuang 0xMuang force-pushed the fix/132-configurable-gas-limit branch from f9c3532 to 58d09f4 Compare January 26, 2026 16:38
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.

[TODO] Gas limit hardcoded instead of configurable

2 participants