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
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const GET_BLOCK_HASH_GAS_COST = 10810;
const GET_CLASS_HASH_AT_GAS_COST = 10000;
const GET_EXECUTION_INFO_GAS_COST = 11240;
const LIBRARY_CALL_GAS_COST = 88660;
const REPLACE_CLASS_GAS_COST = 10670;
const REPLACE_CLASS_GAS_COST = 10000;
// TODO(Yoni, 1/1/2026): take into account Patricia updates and dict squash.
const STORAGE_READ_GAS_COST = 24070;
const STORAGE_WRITE_GAS_COST = 59970;
Expand Down
2 changes: 1 addition & 1 deletion crates/apollo_starknet_os_program/src/program_hash.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"os": "0x77bc8c7e1299ba48af772cc93b3adcf80a9234b417ab246f6bba13bf9d7eb62",
"os": "0x7295d1b71ceaae707f97f40aea51737858a868080640ff737711904577ae53d",
"virtual_os": "0x5891e31f2ecaef526289d8606707cde731bc4eae584e9f62ee50847d846cb3d",
"aggregator": "0x700786d51b3854af43d8e12180380bda3029be6c1767e007858de6ca2edac40",
"aggregator_with_prefix": "0xe08d300e3f5996e43d6d7cc5a20068e0e58cf1309089f2348317ac580f6c1f"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
}
},
"ReplaceClass": {
"n_steps": 106,
"n_steps": 92,
"n_memory_holes": 0,
"builtin_instance_counter": {
"range_check_builtin": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
~ /os_resources/execute_syscalls/KeccakRound/n_steps: 316
~ /os_resources/execute_syscalls/LibraryCall/n_steps: 874
~ /os_resources/execute_syscalls/MetaTxV0/constant/n_steps: 1307
~ /os_resources/execute_syscalls/ReplaceClass/n_steps: 92
~ /os_resources/execute_syscalls/Sha256ProcessBlock/n_steps: 1854
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn positive_flow(runnable_version: RunnableCairo1) {
l2_to_l1_messages: [],
cairo_native: false,
failed: false,
gas_consumed: 14150,
gas_consumed: 13480,
}
"#]]
.assert_debug_eq(&execution);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod OsResourcesTestContract {
use starknet::info::SyscallResultTrait;
use starknet::syscalls::{
call_contract_syscall, deploy_syscall, emit_event_syscall, get_execution_info_v3_syscall,
keccak_syscall, library_call_syscall, sha256_process_block_syscall,
keccak_syscall, library_call_syscall, replace_class_syscall, sha256_process_block_syscall,
};
use starknet::{ClassHash, ContractAddress, get_block_hash_syscall, get_class_hash_at_syscall};

Expand Down Expand Up @@ -113,5 +113,8 @@ mod OsResourcesTestContract {
let mut input = BoxTrait::new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
let mut state = sha256_state_handle_init(BoxTrait::new(SHA256_INITIAL_STATE));
let _ = sha256_process_block_syscall(state, input).unwrap_syscall();

// replace class syscall.
replace_class_syscall(stable_class_hash).unwrap_syscall();
}
}
3 changes: 1 addition & 2 deletions crates/starknet_os_flow_tests/src/os_resources_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use crate::test_manager::{
use crate::tests::NON_TRIVIAL_RESOURCE_BOUNDS;

// TODO(Dori): Delete this, or at least reduce it to a minimal set of unmeasurable syscalls.
const UNMEASURABLE_SYSCALLS: [Selector; 25] = [
const UNMEASURABLE_SYSCALLS: [Selector; 24] = [
Selector::DelegateCall,
Selector::DelegateL1Handler,
Selector::GetBlockNumber,
Expand All @@ -59,7 +59,6 @@ const UNMEASURABLE_SYSCALLS: [Selector; 25] = [
Selector::GetTxSignature,
Selector::Sha512ProcessBlock,
Selector::LibraryCallL1Handler,
Selector::ReplaceClass,
Selector::Secp256k1Add,
Selector::Secp256k1GetPointFromX,
Selector::Secp256k1GetXy,
Expand Down
Loading