Skip to content

Commit

Permalink
refactor(blockifier): remove WORD_WIDTH from blockifier, use starkn e…
Browse files Browse the repository at this point in the history
…t_api instead
  • Loading branch information
avivg-starkware committed Nov 12, 2024
1 parent 2d81fe6 commit e759d81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/blockifier/src/fee/eth_gas_constants.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use starknet_api::core::WORD_WIDTH;

// Calldata.
pub const GAS_PER_MEMORY_ZERO_BYTE: usize = 4;
pub const GAS_PER_MEMORY_BYTE: usize = 16;
// TODO(AvivG): use starknet_api::core::WORD_WIDTH instead.
pub const WORD_WIDTH: usize = 32;
pub const GAS_PER_MEMORY_WORD: usize = GAS_PER_MEMORY_BYTE * WORD_WIDTH;

// Blob Data.
Expand Down
4 changes: 2 additions & 2 deletions crates/blockifier/src/fee/receipt_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use rstest::{fixture, rstest};
use starknet_api::core::WORD_WIDTH;
use starknet_api::execution_resources::GasVector;
use starknet_api::transaction::fields::GasVectorComputationMode;
use starknet_api::transaction::L2ToL1Payload;
Expand Down Expand Up @@ -85,8 +86,7 @@ fn test_calculate_tx_gas_usage_basic<'a>(
.gas_per_code_byte;
let code_gas_cost = (gas_per_code_byte
* u64_from_usize(
(class_info.bytecode_length() + class_info.sierra_program_length())
* eth_gas_constants::WORD_WIDTH
(class_info.bytecode_length() + class_info.sierra_program_length()) * WORD_WIDTH
+ class_info.abi_length(),
))
.to_integer()
Expand Down

0 comments on commit e759d81

Please sign in to comment.