From a67283e752ce39118b6ed7b0dcb7cac07abe275c Mon Sep 17 00:00:00 2001 From: FrancoGiachetta Date: Wed, 18 Sep 2024 17:37:51 -0300 Subject: [PATCH 1/5] print root_of_error --- replay/src/main.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/replay/src/main.rs b/replay/src/main.rs index cc482e45..ebadb63f 100644 --- a/replay/src/main.rs +++ b/replay/src/main.rs @@ -306,11 +306,24 @@ fn show_execution_data( ); if !status_matches || !events_msgs_match { + let root_of_error = if !status_matches { + "EXECUTION STATUS DIVERGED" + } else if !events_match { + "EVENT COUNT DIVERGED" + } else if !msgs_match { + "MESSAGE COUNT DIVERGED" + } else if !(events_match || msgs_match) { + "MESSAGE AND EVENT COUNT DIVERGED" + } else { + unreachable!() + }; + error!( transaction_hash = tx_hash, chain = chain, execution_status, rpc_execution_status, + root_of_error = root_of_error, execution_error_message = execution_info.revert_error, n_events_and_messages = events_and_msgs, rpc_n_events_and_msgs = rpc_events_and_msgs, From c66f1a881b45fa2a3d42e6da74cb8a74559a94fe Mon Sep 17 00:00:00 2001 From: FrancoGiachetta Date: Wed, 18 Sep 2024 17:49:17 -0300 Subject: [PATCH 2/5] print root_of_error --- replay/src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/replay/src/main.rs b/replay/src/main.rs index ebadb63f..2edd60af 100644 --- a/replay/src/main.rs +++ b/replay/src/main.rs @@ -308,14 +308,12 @@ fn show_execution_data( if !status_matches || !events_msgs_match { let root_of_error = if !status_matches { "EXECUTION STATUS DIVERGED" - } else if !events_match { - "EVENT COUNT DIVERGED" - } else if !msgs_match { - "MESSAGE COUNT DIVERGED" } else if !(events_match || msgs_match) { "MESSAGE AND EVENT COUNT DIVERGED" + } else if !events_match { + "EVENT COUNT DIVERGED" } else { - unreachable!() + "MESSAGE COUNT DIVERGED" }; error!( From 0310e2509b45232231e15e73714c4b6aada850be Mon Sep 17 00:00:00 2001 From: FrancoGiachetta Date: Wed, 18 Sep 2024 17:51:22 -0300 Subject: [PATCH 3/5] format --- replay/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/replay/src/main.rs b/replay/src/main.rs index 2edd60af..af454ec2 100644 --- a/replay/src/main.rs +++ b/replay/src/main.rs @@ -315,7 +315,7 @@ fn show_execution_data( } else { "MESSAGE COUNT DIVERGED" }; - + error!( transaction_hash = tx_hash, chain = chain, From ee69acce989032fb5f4ebeb7af0a8c8128cb7d1a Mon Sep 17 00:00:00 2001 From: FrancoGiachetta Date: Thu, 19 Sep 2024 12:10:32 -0300 Subject: [PATCH 4/5] count missing event --- replay/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/replay/src/main.rs b/replay/src/main.rs index af454ec2..bb2fa8ff 100644 --- a/replay/src/main.rs +++ b/replay/src/main.rs @@ -281,7 +281,7 @@ fn show_execution_data( let events_and_msgs = format!( "{{ events_number: {}, l2_to_l1_messages_number: {} }}", - exec_rsc.n_events, + exec_rsc.n_events + 1, exec_rsc.message_cost_info.l2_to_l1_payload_lengths.len(), ); let rpc_events_and_msgs = format!( @@ -290,7 +290,7 @@ fn show_execution_data( rpc_receipt.messages_sent.len(), ); - let events_match = exec_rsc.n_events == rpc_receipt.events.len(); + let events_match = exec_rsc.n_events + 1 == rpc_receipt.events.len(); let msgs_match = rpc_receipt.messages_sent.len() == exec_rsc.message_cost_info.l2_to_l1_payload_lengths.len(); From cceac05d39b540ea5c1abf4fe75834744d335a5c Mon Sep 17 00:00:00 2001 From: FrancoGiachetta Date: Fri, 20 Sep 2024 10:03:10 -0300 Subject: [PATCH 5/5] add a comment on why adding 1 to the exec events --- replay/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/replay/src/main.rs b/replay/src/main.rs index bb2fa8ff..73e3d5f5 100644 --- a/replay/src/main.rs +++ b/replay/src/main.rs @@ -290,6 +290,8 @@ fn show_execution_data( rpc_receipt.messages_sent.len(), ); + // currently adding 1 because the sequencer is counting only the + // events produced by the inner calls of a callinfo let events_match = exec_rsc.n_events + 1 == rpc_receipt.events.len(); let msgs_match = rpc_receipt.messages_sent.len() == exec_rsc.message_cost_info.l2_to_l1_payload_lengths.len();