Skip to content

Commit

Permalink
feat(blockifier): charge for inner events by VC check
Browse files Browse the repository at this point in the history
  • Loading branch information
dorimedini-starkware committed Nov 17, 2024
1 parent 179fe8c commit 6a9b96c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"segment_arena_cells": true,
"disable_cairo0_redeclaration": false,
"enable_stateful_compression": false,
"charge_for_inner_events": true,
"enable_reverts": false,
"tx_event_limits": {
"max_data_length": 1000000000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"segment_arena_cells": true,
"disable_cairo0_redeclaration": false,
"enable_stateful_compression": false,
"charge_for_inner_events": false,
"enable_reverts": false,
"os_constants": {
"nop_entry_point_offset": -1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"segment_arena_cells": true,
"disable_cairo0_redeclaration": false,
"enable_stateful_compression": false,
"charge_for_inner_events": true,
"enable_reverts": false,
"os_constants": {
"nop_entry_point_offset": -1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"disable_cairo0_redeclaration": true,
"enable_stateful_compression": false,
"charge_for_inner_events": true,
"enable_reverts": false,
"max_recursion_depth": 50,
"segment_arena_cells": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"disable_cairo0_redeclaration": true,
"enable_stateful_compression": false,
"charge_for_inner_events": true,
"max_recursion_depth": 50,
"enable_reverts": false,
"segment_arena_cells": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"disable_cairo0_redeclaration": true,
"enable_stateful_compression": false,
"charge_for_inner_events": true,
"max_recursion_depth": 50,
"enable_reverts": false,
"segment_arena_cells": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"disable_cairo0_redeclaration": true,
"enable_stateful_compression": true,
"charge_for_inner_events": true,
"enable_reverts": true,
"max_recursion_depth": 50,
"segment_arena_cells": false,
Expand Down
10 changes: 8 additions & 2 deletions crates/blockifier/src/execution/call_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl CallInfo {
event_summary
}

pub fn summarize(&self, _versioned_constants: &VersionedConstants) -> ExecutionSummary {
pub fn summarize(&self, versioned_constants: &VersionedConstants) -> ExecutionSummary {
let mut executed_class_hashes: HashSet<ClassHash> = HashSet::new();
let mut visited_storage_entries: HashSet<StorageEntry> = HashSet::new();
let mut event_summary = EventSummary::default();
Expand Down Expand Up @@ -176,7 +176,13 @@ impl CallInfo {
);

// Events.
event_summary += call_info.specific_event_summary();
if versioned_constants.charge_for_inner_events {
event_summary += call_info.specific_event_summary();
}
}

if !versioned_constants.charge_for_inner_events {
event_summary = self.specific_event_summary();
}

ExecutionSummary {
Expand Down
1 change: 1 addition & 0 deletions crates/blockifier/src/versioned_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ pub struct VersionedConstants {
// Transactions settings.
pub disable_cairo0_redeclaration: bool,
pub enable_stateful_compression: bool,
pub charge_for_inner_events: bool,

// Compiler settings.
pub enable_reverts: bool,
Expand Down

0 comments on commit 6a9b96c

Please sign in to comment.