fuel_core_upgradable_executor/config.rs
1use fuel_core_executor::executor::ExecutionOptions;
2use fuel_core_types::blockchain::header::StateTransitionBytecodeVersion;
3
4#[derive(Clone, Debug, Default)]
5pub struct Config {
6 /// Default mode for `forbid_fake_coins` in `ExecutionOptions`.
7 pub forbid_fake_coins_default: bool,
8 /// Allow usage of syscall during the execution of the transactions.
9 pub allow_syscall: bool,
10 /// The version of the native executor to determine usage of native vs WASM executor.
11 /// If it is `None`, the `Executor::VERSION` is used.
12 ///
13 /// When a block version matches the native executor version, we use
14 /// the native executor; otherwise, we use the WASM executor.
15 pub native_executor_version: Option<StateTransitionBytecodeVersion>,
16 /// Allow execution using blocks in the past.
17 /// This is rather expensive and not needed for most use cases, so it can be disabled.
18 pub allow_historical_execution: bool,
19}
20
21impl From<&Config> for ExecutionOptions {
22 fn from(value: &Config) -> Self {
23 Self {
24 forbid_fake_coins: value.forbid_fake_coins_default,
25 allow_syscall: value.allow_syscall,
26 }
27 }
28}