Skip to content

Commit

Permalink
Merge branch 'master' into hal3e/bump-forc-63
Browse files Browse the repository at this point in the history
  • Loading branch information
segfault-magnet authored Aug 20, 2024
2 parents f73c1c8 + 1103ef4 commit 4d1ebbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/fuels-test-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ fuel-core = { workspace = true, default-features = false, features = [
fuel-core-chain-config = { workspace = true, features = ["test-helpers"] }
fuel-core-client = { workspace = true }
fuel-core-poa = { workspace = true }
fuel-core-types = { workspace = true }
fuel-core-services = { workspace = true }
fuel-crypto = { workspace = true }
fuel-tx = { workspace = true }
Expand Down
11 changes: 11 additions & 0 deletions packages/fuels-test-helpers/src/fuel_bin_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{
use fuel_core_chain_config::{ChainConfig, SnapshotWriter, StateConfig};
use fuel_core_client::client::FuelClient;
use fuel_core_services::State;
use fuel_core_types::blockchain::header::LATEST_STATE_TRANSITION_VERSION;
use fuels_core::{error, types::errors::Result as FuelResult};
use portpicker::{is_free, pick_unused_port};
use tempfile::{tempdir, TempDir};
Expand Down Expand Up @@ -76,6 +77,16 @@ impl ExtendedConfig {
let body_limit = self.node_config.graphql_request_body_bytes_limit;
args.push(format!("--graphql-request-body-bytes-limit={body_limit}"));

// This ensures forward compatibility when running against a newer node with a different native executor version.
// If the node detects our older version in the chain configuration, it defaults to using the wasm executor.
// However, since we don't include a wasm executor, this would lead to code loading failure and a node crash.
// To prevent this, we force the node to use our version number to refer to its native executor.
let executor_version = self
.chain_config
.genesis_state_transition_version
.unwrap_or(LATEST_STATE_TRANSITION_VERSION);
args.push(format!("--native-executor-version={executor_version}"));

args.extend(
[
(self.node_config.vm_backtrace, "--vm-backtrace"),
Expand Down

0 comments on commit 4d1ebbf

Please sign in to comment.