Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed state transition bytecode from the local testnet #2215

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ benches/benches-outputs/src/test_gas_costs_output.rs
node_modules/
package-lock.json
package.json
bin/fuel-core/chainspec/local-testnet/state_transition_bytecode.wasm

Binary file not shown.
18 changes: 11 additions & 7 deletions crates/chain-config/src/config/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Default for ChainConfig {
fuel_core_types::blockchain::header::LATEST_STATE_TRANSITION_VERSION,
),
// Note: It is invalid bytecode.
state_transition_bytecode: vec![123; 1024],
state_transition_bytecode: vec![],
consensus: ConsensusConfig::default_poa(),
}
}
Expand All @@ -78,13 +78,17 @@ impl ChainConfig {
})?;

let bytecode_path = path.with_file_name(BYTECODE_NAME);
let bytecode = std::fs::read(bytecode_path).map_err(|e| {
anyhow::Error::new(e).context(format!(
"an error occurred while loading the state transition bytecode: {:?}",
path.to_str()
))
})?;

let bytecode = if bytecode_path.exists() {
std::fs::read(bytecode_path).map_err(|e| {
anyhow::Error::new(e).context(format!(
"an error occurred while loading the state transition bytecode: {:?}",
path.to_str()
))
})?
} else {
Vec::new()
};
chain_config.state_transition_bytecode = bytecode;

Ok(chain_config)
Expand Down
2 changes: 0 additions & 2 deletions tests/tests/local_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use fuel_core_types::{
blockchain::header::LATEST_STATE_TRANSITION_VERSION,
fuel_tx::GasCosts,
};
use fuel_core_upgradable_executor::WASM_BYTECODE;
use test_helpers::fuel_core_driver::FuelCoreDriver;

#[test]
Expand All @@ -29,7 +28,6 @@ fn local_chainconfig_validity() -> anyhow::Result<()> {
.set_gas_costs(benchmark_gas_costs);

if env::var_os("OVERRIDE_CHAIN_CONFIGS").is_some() {
chain_config.state_transition_bytecode = WASM_BYTECODE.to_vec();
chain_config.genesis_state_transition_version =
Some(LATEST_STATE_TRANSITION_VERSION);
std::fs::remove_file(&stored_snapshot.chain_config)?;
Expand Down
Loading