Closed FrancoGiachetta closed 2 months ago
✅ Code is now correctly formatted.
Update: Changed the events count from the execution to be 1 more than the actual value. This is because, currently, the events counting is missing the events the produced by the main call, including just the one produced by its inner_calls:
sequencer/crates/blockifier/src/transaction/objects.rs:435
fn calculate_events_resources<'a>(
call_infos: impl Iterator<Item = &'a CallInfo> + Clone,
) -> (usize, u128, u128) {
let mut total_event_keys = 0;
let mut total_event_data_size = 0;
let mut n_events = 0;
for call_info in call_infos.clone() {
for inner_call in call_info.iter() {
for OrderedEvent { event, .. } in inner_call.execution.events.iter() {
total_event_data_size += u128_from_usize(event.data.0.len());
total_event_keys += u128_from_usize(event.keys.len());
}
n_events += inner_call.execution.events.len();
}
}
(n_events, total_event_keys, total_event_data_size)
}
Due to this, the events count from the execution would never match the ones from the rpc. Thus, it would always show an error message.
This PR adds the root of the error, if it was the case. It could be because the execution status diverged or the events and messages count. Due to this, it shows which one of the four ( there could be a case where both events and messages count fail) has happend, having more precedence the execution status error.