Skip to content

Commit

Permalink
node: Provide block_gas_limit getters
Browse files Browse the repository at this point in the history
  • Loading branch information
Goshawk committed Aug 14, 2024
1 parent 9feb3c4 commit bfa3ade
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions node/default.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ db_path = '/tmp/rusk-harness/'
consensus_keys_path = '/tmp/consensus_bls.keys'
generation_timeout = '3s'
max_queue_size = 5000
block_gas_limit = 5000000000

[chain.db_options]
enable_debug = false
Expand Down
4 changes: 4 additions & 0 deletions node/src/chain/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,8 @@ impl<DB: database::DB, VM: vm::VMExecution> Operations for Executor<DB, VM> {

Ok(())
}

async fn get_block_gas_limit(&self) -> u64 {
self.vm.read().await.get_block_gas_limit()
}
}
3 changes: 3 additions & 0 deletions node/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ pub trait VMExecution: Send + Sync + 'static {
/// Returns last finalized state root
fn get_finalized_state_root(&self) -> anyhow::Result<[u8; 32]>;

/// Returns block gas limit
fn get_block_gas_limit(&self) -> u64;

fn revert(&self, state_hash: [u8; 32]) -> anyhow::Result<[u8; 32]>;
fn revert_to_finalized(&self) -> anyhow::Result<[u8; 32]>;
}

0 comments on commit bfa3ade

Please sign in to comment.