Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
FM-163: fix use_cache and config
Browse files Browse the repository at this point in the history
  • Loading branch information
adlrocha committed Aug 3, 2023
1 parent b1493d0 commit 641b6f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions fendermint/app/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ port = 26658
# Keep unlimited history by default.
state_hist_size = 0

# FVM configuration
[fvm]
# Overestimation rate applied to gas estimations to ensure that the
# message goes through
gas_overestimation_rate = 1.25
# Gas search step increase used to find the optimal gas limit.
# It determines how fine-grained we want the gas estimation to be.
gas_search_step = 1.25

# Ethereum API facade
[eth]
# Maximum time allowed between polls for filter changes, in seconds, before the subscription is canceled.
Expand Down
6 changes: 4 additions & 2 deletions fendermint/vm/interpreter/src/fvm/state/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ where
F: FnOnce(&mut FvmExecState<ReadOnlyBlockstore<DB>>) -> anyhow::Result<T>,
{
let mut cache = self.exec_state.borrow_mut();
if let Some(exec_state) = cache.as_mut() {
return f(exec_state);
if use_cache {
if let Some(exec_state) = cache.as_mut() {
return f(exec_state);
}
}

let mut exec_state = FvmExecState::new(
Expand Down

0 comments on commit 641b6f7

Please sign in to comment.