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 19, 2024
1 parent d525dc2 commit 91fc715
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 3 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,
"ignore_inner_events_resources": false,
"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,
"ignore_inner_events_resources": 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 @@ -41,6 +41,7 @@
"segment_arena_cells": true,
"disable_cairo0_redeclaration": false,
"enable_stateful_compression": false,
"ignore_inner_events_resources": 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 @@ -39,6 +39,7 @@
},
"disable_cairo0_redeclaration": true,
"enable_stateful_compression": false,
"ignore_inner_events_resources": false,
"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,
"ignore_inner_events_resources": false,
"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,
"ignore_inner_events_resources": false,
"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,
"ignore_inner_events_resources": false,
"enable_reverts": true,
"max_recursion_depth": 50,
"segment_arena_cells": false,
Expand Down
14 changes: 11 additions & 3 deletions crates/blockifier/src/execution/call_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,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 @@ -196,8 +196,16 @@ impl CallInfo {
.map(|message| message.message.payload.0.len()),
);

// Events.
event_summary += call_info.specific_event_summary();
// Events: all event resources in the execution tree, unless executing a 0.13.1 block.
if !versioned_constants.ignore_inner_events_resources {
event_summary += call_info.specific_event_summary();
}
}

if versioned_constants.ignore_inner_events_resources {
// For reexecution of 0.13.1 blocks, we ignore inner events resources - only outermost
// event data will be processed.
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 ignore_inner_events_resources: bool,

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

0 comments on commit 91fc715

Please sign in to comment.