Skip to content
Open
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `--gas-report` flag to display a table of L2 gas breakdown for each contract and selector

#### Changed

- Oracles are fully supported for Scarb versions >= 2.13.1. Bugs related to oracles' output handling have been fixed.
Removed the `--experimental-oracles` flag.`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Technically should be under Removed section 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know but the changelog will be more difficult to read this way, because all of these are related to the same feature.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you


## [0.52.0] - 2025-11-05

### Forge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ pub struct ForgeExtension<'a> {
pub environment_variables: &'a HashMap<String, String>,
pub contracts_data: &'a ContractsData,
pub fuzzer_rng: Option<Arc<Mutex<StdRng>>>,
/// Whether `--experimental-oracles` flag has been enabled.
pub experimental_oracles_enabled: bool,
pub oracle_hint_service: OracleHintService,
}

Expand All @@ -87,14 +85,6 @@ impl<'a> ExtensionLogic for ForgeExtension<'a> {
.oracle_hint_service
.accept_cheatcode(selector.as_bytes())
{
if !self.experimental_oracles_enabled {
return Err(anyhow!(
"Oracles are an experimental feature. \
To enable them, pass `--experimental-oracles` CLI flag."
)
.into());
}

let output = self
.oracle_hint_service
.execute_cheatcode(oracle_selector, input_reader.into_remaining());
Expand Down
3 changes: 0 additions & 3 deletions crates/forge-runner/src/forge_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub struct TestRunnerConfig {
pub contracts_data: ContractsData,
pub environment_variables: HashMap<String, String>,
pub tracked_resource: ForgeTrackedResource,
pub experimental_oracles: bool,
}

#[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -91,7 +90,6 @@ pub struct RuntimeConfig<'a> {
pub contracts_data: &'a ContractsData,
pub environment_variables: &'a HashMap<String, String>,
pub tracked_resource: &'a ForgeTrackedResource,
pub experimental_oracles: bool,
}

impl<'a> RuntimeConfig<'a> {
Expand All @@ -104,7 +102,6 @@ impl<'a> RuntimeConfig<'a> {
contracts_data: &value.contracts_data,
environment_variables: &value.environment_variables,
tracked_resource: &value.tracked_resource,
experimental_oracles: value.experimental_oracles,
}
}
}
1 change: 0 additions & 1 deletion crates/forge-runner/src/running.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ pub fn run_test_case(
environment_variables: runtime_config.environment_variables,
contracts_data: runtime_config.contracts_data,
fuzzer_rng,
experimental_oracles_enabled: runtime_config.experimental_oracles,
oracle_hint_service: OracleHintService::new(Some(versioned_program_path.as_std_path())),
};

Expand Down
10 changes: 0 additions & 10 deletions crates/forge/src/combine_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub fn combine_configs(
forge_config_from_scarb: &ForgeConfigFromScarb,
additional_args: &[OsString],
trace_args: TraceArgs,
experimental_oracles: bool,
) -> ForgeConfig {
let execution_data_to_save = ExecutionDataToSave::from_flags(
save_trace_data || forge_config_from_scarb.save_trace_data,
Expand All @@ -53,7 +52,6 @@ pub fn combine_configs(
contracts_data,
tracked_resource,
environment_variables: env::vars().collect(),
experimental_oracles,
}),
output_config: Arc::new(OutputConfig {
trace_args,
Expand Down Expand Up @@ -86,7 +84,6 @@ mod tests {
&ForgeConfigFromScarb::default(),
&[],
TraceArgs::default(),
false,
);
let config2 = combine_configs(
false,
Expand All @@ -104,7 +101,6 @@ mod tests {
&ForgeConfigFromScarb::default(),
&[],
TraceArgs::default(),
false,
);

assert_ne!(config.test_runner_config.fuzzer_seed, 0);
Expand Down Expand Up @@ -133,7 +129,6 @@ mod tests {
&ForgeConfigFromScarb::default(),
&[],
TraceArgs::default(),
false,
);
assert_eq!(
config,
Expand All @@ -148,7 +143,6 @@ mod tests {
cache_dir: Utf8PathBuf::default(),
contracts_data: ContractsData::default(),
environment_variables: config.test_runner_config.environment_variables.clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: false,
Expand Down Expand Up @@ -192,7 +186,6 @@ mod tests {
&config_from_scarb,
&[],
TraceArgs::default(),
false,
);
assert_eq!(
config,
Expand All @@ -207,7 +200,6 @@ mod tests {
cache_dir: Utf8PathBuf::default(),
contracts_data: ContractsData::default(),
environment_variables: config.test_runner_config.environment_variables.clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: true,
Expand Down Expand Up @@ -255,7 +247,6 @@ mod tests {
&config_from_scarb,
&[],
TraceArgs::default(),
false,
);

assert_eq!(
Expand All @@ -271,7 +262,6 @@ mod tests {
cache_dir: Utf8PathBuf::default(),
contracts_data: ContractsData::default(),
environment_variables: config.test_runner_config.environment_variables.clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: true,
Expand Down
4 changes: 0 additions & 4 deletions crates/forge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,6 @@ pub struct TestArgs {
#[arg(last = true)]
additional_args: Vec<OsString>,

/// Enable experimental oracles support.
#[arg(long, default_value_t = false, env = "SNFORGE_EXPERIMENTAL_ORACLES")]
experimental_oracles: bool,

#[command(flatten)]
scarb_args: ScarbArgs,
}
Expand Down
1 change: 0 additions & 1 deletion crates/forge/src/run_tests/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ impl RunForPackageArgs {
&forge_config_from_scarb,
&args.additional_args,
args.trace_args.clone(),
args.experimental_oracles,
));

let test_filter = TestsFilter::from_flags(
Expand Down
1 change: 0 additions & 1 deletion crates/forge/tests/e2e/oracles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ fn wasm() {
let output = test_runner(&temp)
// Output of oracle is different depending on the env, and Intellij sets it automatically
.env_remove("RUST_BACKTRACE")
.arg("--experimental-oracles")
.assert()
.code(1);

Expand Down
2 changes: 0 additions & 2 deletions crates/forge/tests/integration/setup_fork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ fn fork_aliased_decorator() {
.unwrap(),
tracked_resource: ForgeTrackedResource::CairoSteps,
environment_variables: test.env().clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: false,
Expand Down Expand Up @@ -248,7 +247,6 @@ fn fork_aliased_decorator_overrding() {
.unwrap(),
tracked_resource: ForgeTrackedResource::CairoSteps,
environment_variables: test.env().clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: false,
Expand Down
1 change: 0 additions & 1 deletion crates/forge/tests/utils/running_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ pub fn run_test_case(
contracts_data: ContractsData::try_from(test.contracts(&ui).unwrap()).unwrap(),
tracked_resource,
environment_variables: test.env().clone(),
experimental_oracles: false,
}),
output_config: Arc::new(OutputConfig {
detailed_resources: false,
Expand Down
4 changes: 0 additions & 4 deletions docs/src/appendix/snforge/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ Use Scarb release profile.
## `--dev`
Use Scarb dev profile.

## `--experimental-oracles`

Enable experimental [oracles](../../snforge-advanced-features/oracles.md) support.

## `-h`, `--help`

Print help.
4 changes: 2 additions & 2 deletions docs/src/snforge-advanced-features/oracles.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

> ⚠️ **Warning**
>
> Oracles are an experimental feature.
> To enable them, you must pass the `--experimental-oracles` flag to `snforge`.
> Oracles are fully supported starting from Scarb 2.13.1.
> Using oracles in Starknet Foundry with older versions of Scarb is not supported and may result in unexpected behavior.

An [oracle][oracle docs] is an external process (like a script, binary, or web service)
that exposes custom logic or data to a Cairo program at runtime. You use it to perform tasks the Cairo VM can't, such as
Expand Down
Loading