From 6c9a32d786e7278c311f81db65ccd3f3bc1f9f6b Mon Sep 17 00:00:00 2001 From: Aviv Greenburg Date: Wed, 4 Sep 2024 14:50:32 +0300 Subject: [PATCH] chore(blockifier): have limit_steps_by_resources flag represent charge_fee flag &enforce_fee ret val --- crates/blockifier/src/blockifier/stateful_validator.rs | 2 +- crates/blockifier/src/execution/entry_point.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/blockifier/src/blockifier/stateful_validator.rs b/crates/blockifier/src/blockifier/stateful_validator.rs index 7cbe0644a3..634db6d655 100644 --- a/crates/blockifier/src/blockifier/stateful_validator.rs +++ b/crates/blockifier/src/blockifier/stateful_validator.rs @@ -115,7 +115,7 @@ impl StatefulValidator { let mut execution_resources = ExecutionResources::default(); let tx_context = Arc::new(self.tx_executor.block_context.to_tx_context(tx)); - let limit_steps_by_resources = true; + let limit_steps_by_resources = tx.create_tx_info().enforce_fee(); //aviv: was true; let validate_call_info = tx.validate_tx( self.tx_executor.block_state.as_mut().expect(BLOCK_STATE_ACCESS_ERR), &mut execution_resources, diff --git a/crates/blockifier/src/execution/entry_point.rs b/crates/blockifier/src/execution/entry_point.rs index 0f43522e2f..a8cdc45ed4 100644 --- a/crates/blockifier/src/execution/entry_point.rs +++ b/crates/blockifier/src/execution/entry_point.rs @@ -183,7 +183,8 @@ impl EntryPointExecutionContext { .expect("Failed to convert invoke_tx_max_n_steps (u32) to usize."), }; - if !limit_steps_by_resources || !tx_info.enforce_fee() { + if !limit_steps_by_resources { + // aviv: was with '|| !tx_info.enforce_fee()' return block_upper_bound; }