Skip to content

Commit

Permalink
Fixed logging of the WASM executor (#1930)
Browse files Browse the repository at this point in the history
We don't log WASM execution in all cases.

### Before requesting review
- [x] I have reviewed the code myself
  • Loading branch information
xgreenx authored Jun 3, 2024
1 parent 5db3e19 commit 91b6b52
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/services/upgradable-executor/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ where
}
} else {
let module = self.get_module(block_version)?;
Self::trace_block_version_warning(block_version);
self.wasm_produce_inner(&module, block, options, dry_run)
}
}
Expand Down Expand Up @@ -415,18 +414,17 @@ where
}
} else {
let module = self.get_module(block_version)?;
Self::trace_block_version_warning(block_version);
self.wasm_validate_inner(&module, block, self.config.as_ref().into())
}
}

#[cfg(feature = "wasm-executor")]
fn trace_block_version_warning(block_version: StateTransitionBytecodeVersion) {
fn trace_block_version_warning(&self, block_version: StateTransitionBytecodeVersion) {
tracing::warn!(
"The block version({}) is different from the native executor version({}). \
The WASM executor will be used.",
block_version,
Self::VERSION
self.native_executor_version()
);
}

Expand Down Expand Up @@ -465,6 +463,9 @@ where
coinbase_recipient,
gas_price,
} = component;
self.trace_block_version_warning(
header_to_produce.state_transition_bytecode_version,
);

let source = Some(transactions_source);

Expand Down Expand Up @@ -502,6 +503,9 @@ where
block: &Block,
options: ExecutionOptions,
) -> ExecutorResult<Uncommitted<ValidationResult, Changes>> {
self.trace_block_version_warning(
block.header().state_transition_bytecode_version,
);
let storage = self.storage_view_provider.latest_view();
let relayer = self.relayer_view_provider.latest_view();

Expand Down

0 comments on commit 91b6b52

Please sign in to comment.