Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blockifier): charge for inner events by VC check #2123

Merged
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 @@ -8,6 +8,7 @@
"segment_arena_cells": true,
"disable_cairo0_redeclaration": false,
"enable_stateful_compression": false,
"ignore_inner_event_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_event_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_event_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_event_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_event_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_event_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_event_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_event_resources {
event_summary += call_info.specific_event_summary();
}
}

if versioned_constants.ignore_inner_event_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_event_resources: bool,

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