From 6903dfde0e2e59025339e8646be1c880061b9080 Mon Sep 17 00:00:00 2001 From: jouzo Date: Tue, 12 Sep 2023 09:31:12 +0100 Subject: [PATCH 1/3] Reject TD TX failing VM validation --- lib/ain-evm/src/executor.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/ain-evm/src/executor.rs b/lib/ain-evm/src/executor.rs index f8642d1d27..301361567c 100644 --- a/lib/ain-evm/src/executor.rs +++ b/lib/ain-evm/src/executor.rs @@ -261,7 +261,13 @@ impl<'backend> AinExecutor<'backend> { } let (tx_response, receipt) = self.exec(&signed_tx, U256::zero()); - + if (!tx_response.exit_reason.is_succeed()) { + return Err(format_err!( + "[apply_queue_tx] Transfer domain failed VM validation {:?}", + tx_response.exit_reason + ) + .into()); + } self.commit(); debug!( @@ -310,6 +316,13 @@ impl<'backend> AinExecutor<'backend> { } let (tx_response, receipt) = self.exec(&signed_tx, U256::zero()); + if (!tx_response.exit_reason.is_succeed()) { + return Err(format_err!( + "[apply_queue_tx] DST20 bridge failed VM validation {:?}", + tx_response.exit_reason + ) + .into()); + } self.commit(); From 8ccc868797794a95c9514dfa129e537f3f4a6401 Mon Sep 17 00:00:00 2001 From: jouzo Date: Tue, 12 Sep 2023 09:32:09 +0100 Subject: [PATCH 2/3] Wording --- lib/ain-evm/src/executor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ain-evm/src/executor.rs b/lib/ain-evm/src/executor.rs index 301361567c..3a69bbd3c4 100644 --- a/lib/ain-evm/src/executor.rs +++ b/lib/ain-evm/src/executor.rs @@ -263,7 +263,7 @@ impl<'backend> AinExecutor<'backend> { let (tx_response, receipt) = self.exec(&signed_tx, U256::zero()); if (!tx_response.exit_reason.is_succeed()) { return Err(format_err!( - "[apply_queue_tx] Transfer domain failed VM validation {:?}", + "[apply_queue_tx] Transfer domain failed VM execution {:?}", tx_response.exit_reason ) .into()); @@ -318,7 +318,7 @@ impl<'backend> AinExecutor<'backend> { let (tx_response, receipt) = self.exec(&signed_tx, U256::zero()); if (!tx_response.exit_reason.is_succeed()) { return Err(format_err!( - "[apply_queue_tx] DST20 bridge failed VM validation {:?}", + "[apply_queue_tx] DST20 bridge failed VM execution {:?}", tx_response.exit_reason ) .into()); From 9e7996cf058d4b6f3ddf975ef79dfeddf787cfda Mon Sep 17 00:00:00 2001 From: jouzo Date: Tue, 12 Sep 2023 09:46:30 +0100 Subject: [PATCH 3/3] Fix lint --- lib/ain-evm/src/executor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ain-evm/src/executor.rs b/lib/ain-evm/src/executor.rs index 3a69bbd3c4..b7247c84d6 100644 --- a/lib/ain-evm/src/executor.rs +++ b/lib/ain-evm/src/executor.rs @@ -261,7 +261,7 @@ impl<'backend> AinExecutor<'backend> { } let (tx_response, receipt) = self.exec(&signed_tx, U256::zero()); - if (!tx_response.exit_reason.is_succeed()) { + if !tx_response.exit_reason.is_succeed() { return Err(format_err!( "[apply_queue_tx] Transfer domain failed VM execution {:?}", tx_response.exit_reason @@ -316,7 +316,7 @@ impl<'backend> AinExecutor<'backend> { } let (tx_response, receipt) = self.exec(&signed_tx, U256::zero()); - if (!tx_response.exit_reason.is_succeed()) { + if !tx_response.exit_reason.is_succeed() { return Err(format_err!( "[apply_queue_tx] DST20 bridge failed VM execution {:?}", tx_response.exit_reason