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 @@ -190,6 +190,13 @@
"syscall_base_gas_cost": 1,
"memory_hole_gas_cost": 0
},
"DeployV2": {
"step_gas_cost": 0,
"range_check": 0,
"bitwise": 0,
"syscall_base_gas_cost": 0,
"memory_hole_gas_cost": 0
},
"EmitEvent": {
"step_gas_cost": 10,
"range_check": 0,
Expand Down Expand Up @@ -409,6 +416,11 @@
"pedersen_builtin": 7
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 19,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@
"syscall_base_gas_cost": 1,
"memory_hole_gas_cost": 0
},
"DeployV2": {
"step_gas_cost": 0,
"range_check": 0,
"bitwise": 0,
"syscall_base_gas_cost": 0,
"memory_hole_gas_cost": 0
},
"EmitEvent": {
"step_gas_cost": 10,
"range_check": 0,
Expand Down Expand Up @@ -409,6 +416,11 @@
"pedersen_builtin": 7
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@
"syscall_base_gas_cost": 1,
"memory_hole_gas_cost": 0
},
"DeployV2": {
"step_gas_cost": 0,
"range_check": 0,
"bitwise": 0,
"syscall_base_gas_cost": 0,
"memory_hole_gas_cost": 0
},
"EmitEvent": {
"step_gas_cost": 10,
"range_check": 0,
Expand Down Expand Up @@ -409,6 +416,11 @@
"pedersen_builtin": 7
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@
"syscall_base_gas_cost": 1,
"memory_hole_gas_cost": 0
},
"DeployV2": {
"step_gas_cost": 0,
"range_check": 0,
"bitwise": 0,
"syscall_base_gas_cost": 0,
"memory_hole_gas_cost": 0
},
"EmitEvent": {
"step_gas_cost": 10,
"range_check": 0,
Expand Down Expand Up @@ -409,6 +416,11 @@
"pedersen_builtin": 7
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@
"syscall_base_gas_cost": 1,
"memory_hole_gas_cost": 0
},
"DeployV2": {
"step_gas_cost": 0,
"range_check": 0,
"bitwise": 0,
"syscall_base_gas_cost": 0,
"memory_hole_gas_cost": 0
},
"EmitEvent": {
"step_gas_cost": 10,
"range_check": 0,
Expand Down Expand Up @@ -409,6 +416,11 @@
"pedersen_builtin": 7
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@
"syscall_base_gas_cost": 1,
"memory_hole_gas_cost": 0
},
"DeployV2": {
"step_gas_cost": 0,
"range_check": 0,
"bitwise": 0,
"syscall_base_gas_cost": 0,
"memory_hole_gas_cost": 0
},
"EmitEvent": {
"step_gas_cost": 10,
"range_check": 0,
Expand Down Expand Up @@ -409,6 +416,11 @@
"pedersen_builtin": 7
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@
"pedersen_builtin": 7
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@
}
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@
}
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@
}
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@
}
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@
}
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@
}
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {
"range_check_builtin": 0,
"bitwise_builtin": 0
}
},
"EmitEvent": {
"n_steps": 61,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@
}
}
},
"DeployV2": {
"n_steps": 0,
"n_memory_holes": 0,
"builtin_instance_counter": {
"range_check_builtin": 0,
"bitwise_builtin": 0
}
},
"EmitEvent": {
"n_steps": 47,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,23 @@
}
}
},
"DeployV2": {
"constant": {
"n_steps": 1173,
"n_memory_holes": 0,
"builtin_instance_counter": {
"range_check_builtin": 21,
"pedersen_builtin": 7
}
},
"calldata_factor": {
"n_steps": 8,
"n_memory_holes": 0,
"builtin_instance_counter": {
"pedersen_builtin": 1
}
}
},
"EmitEvent": {
"n_steps": 47,
"n_memory_holes": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
~ /os_constants/allowed_proof_versions/0: "0x50524f4f4631"
~ /os_constants/allowed_virtual_os_program_hashes/0: "0x53f6c9fcfd31d27279ff7d7e422b44623550a732b59fe193354a7316a96daa1"
~ /os_constants/execute_max_sierra_gas: 1110000000
+ /os_resources/execute_syscalls/DeployV2/builtin_instance_counter/bitwise_builtin: 0
+ /os_resources/execute_syscalls/DeployV2/builtin_instance_counter/range_check_builtin: 0
+ /os_resources/execute_syscalls/Sha512ProcessBlock/builtin_instance_counter/bitwise_builtin: 3320
+ /os_resources/execute_syscalls/Sha512ProcessBlock/builtin_instance_counter/range_check_builtin: 65
~ /os_resources/execute_syscalls/Sha512ProcessBlock/n_steps: 4737
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
~ /os_constants/allowed_virtual_os_program_hashes/0: "0xfedbf2b6504b9217026ba2bf9b2a33e8e28ed38e5b0f84eef59075b02174b8"
+ /os_resources/execute_syscalls/DeployV2/calldata_factor: {"builtin_instance_counter":{"pedersen_builtin":1},"n_memory_holes":0,"n_steps":8}
+ /os_resources/execute_syscalls/DeployV2/constant: {"builtin_instance_counter":{"pedersen_builtin":7,"range_check_builtin":21},"n_memory_holes":0,"n_steps":1173}
- /os_resources/execute_syscalls/DeployV2/builtin_instance_counter
- /os_resources/execute_syscalls/DeployV2/n_memory_holes
- /os_resources/execute_syscalls/DeployV2/n_steps
~ /os_resources/execute_txs_inner/Declare/n_steps: 3946
~ /os_resources/execute_txs_inner/DeployAccount/constant/n_steps: 5017
~ /os_resources/execute_txs_inner/InvokeFunction/constant/n_steps: 4787
3 changes: 3 additions & 0 deletions crates/blockifier/src/blockifier_versioned_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ impl SyscallGasCost {
pub struct SyscallGasCosts {
pub call_contract: SyscallGasCost,
pub deploy: SyscallGasCost,
pub deploy_v2: SyscallGasCost,
pub get_block_hash: SyscallGasCost,
pub get_execution_info: SyscallGasCost,
pub library_call: SyscallGasCost,
Expand Down Expand Up @@ -941,6 +942,7 @@ impl SyscallGasCosts {
let gas_cost = match *selector {
SyscallSelector::CallContract => self.call_contract,
SyscallSelector::Deploy => self.deploy,
SyscallSelector::DeployV2 => self.deploy_v2,
SyscallSelector::EmitEvent => self.emit_event,
SyscallSelector::GetBlockHash => self.get_block_hash,
SyscallSelector::GetExecutionInfo => self.get_execution_info,
Expand Down Expand Up @@ -1111,6 +1113,7 @@ impl GasCosts {
let syscalls = SyscallGasCosts {
call_contract: summarize(SyscallSelector::CallContract),
deploy: summarize(SyscallSelector::Deploy),
deploy_v2: summarize(SyscallSelector::DeployV2),
get_block_hash: summarize(SyscallSelector::GetBlockHash),
get_execution_info: summarize(SyscallSelector::GetExecutionInfo),
library_call: summarize(SyscallSelector::LibraryCall),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ pub fn execute_deprecated_syscall_from_selector<T: DeprecatedSyscallExecutor>(
// Explicitly list unsupported syscalls, so compiler can catch if a syscall is missing.
DeprecatedSyscallSelector::GetBlockHash
| DeprecatedSyscallSelector::GetClassHashAt
| DeprecatedSyscallSelector::DeployV2
| DeprecatedSyscallSelector::GetExecutionInfo
| DeprecatedSyscallSelector::Keccak
| DeprecatedSyscallSelector::KeccakRound
Expand Down
3 changes: 3 additions & 0 deletions crates/blockifier/src/execution/deprecated_syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub enum DeprecatedSyscallSelector {
DelegateCall,
DelegateL1Handler,
Deploy,
DeployV2,
EmitEvent,
GetBlockHash,
GetBlockNumber,
Expand Down Expand Up @@ -89,6 +90,7 @@ impl DeprecatedSyscallSelector {
| Self::DelegateCall
| Self::DelegateL1Handler
| Self::Deploy
| Self::DeployV2
| Self::LibraryCall
| Self::LibraryCallL1Handler
| Self::MetaTxV0
Expand All @@ -108,6 +110,7 @@ impl TryFrom<Felt> for DeprecatedSyscallSelector {
b"DelegateCall" => Ok(Self::DelegateCall),
b"DelegateL1Handler" => Ok(Self::DelegateL1Handler),
b"Deploy" => Ok(Self::Deploy),
b"DeployV2" => Ok(Self::DeployV2),
Comment thread
cursor[bot] marked this conversation as resolved.
b"EmitEvent" => Ok(Self::EmitEvent),
b"GetBlockHash" => Ok(Self::GetBlockHash),
b"GetBlockNumber" => Ok(Self::GetBlockNumber),
Expand Down
11 changes: 10 additions & 1 deletion crates/blockifier/src/execution/native/syscall_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ use cairo_native::starknet::{
use num_bigint::BigUint;
use starknet_api::block::BlockNumber;
use starknet_api::contract_class::EntryPointType;
use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, L1Address};
use starknet_api::core::{
AddressDerivationHash,
ClassHash,
ContractAddress,
EntryPointSelector,
L1Address,
};
use starknet_api::execution_resources::GasAmount;
use starknet_api::state::StorageKey;
use starknet_api::transaction::fields::{
Expand Down Expand Up @@ -388,6 +394,9 @@ impl StarknetSyscallHandler for &mut NativeSyscallHandler<'_> {
Calldata(Arc::new(calldata.to_vec())),
deploy_from_zero,
remaining_gas,
// The deploy_v2 syscall (Blake2 derivation) has no cairo-native handler until the
// upstream `StarknetSyscallHandler` trait exposes it.
AddressDerivationHash::Pedersen,
)
.map_err(|err| self.handle_error(remaining_gas, err))?;

Expand Down
Loading
Loading