From a6b95519d032d0d9b0f41496be9dd54cde877075 Mon Sep 17 00:00:00 2001 From: Pinelliaw Date: Tue, 25 Apr 2023 21:26:28 +0800 Subject: [PATCH 1/2] fix: not fail on signature checks for read-only txns --- libraries/chain/authorization_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/chain/authorization_manager.cpp b/libraries/chain/authorization_manager.cpp index 6f3e598d19..69312b4c10 100644 --- a/libraries/chain/authorization_manager.cpp +++ b/libraries/chain/authorization_manager.cpp @@ -559,7 +559,7 @@ namespace eosio { namespace chain { } - if( !allow_unused_keys || check_but_dont_fail) { + if( !allow_unused_keys && !check_but_dont_fail) { EOS_ASSERT( checker.all_keys_used(), tx_irrelevant_sig, "transaction bears irrelevant signatures from these keys: ${keys}", ("keys", checker.unused_keys()) ); From a3589123ec4405cbeb853e3aa0d97df2d6c46c2c Mon Sep 17 00:00:00 2001 From: Pinelliaw Date: Wed, 26 Apr 2023 01:04:02 +0800 Subject: [PATCH 2/2] refactor: include the time it takes for checker.all_keys_used() --- libraries/chain/authorization_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/chain/authorization_manager.cpp b/libraries/chain/authorization_manager.cpp index 69312b4c10..9cb4580a0c 100644 --- a/libraries/chain/authorization_manager.cpp +++ b/libraries/chain/authorization_manager.cpp @@ -559,8 +559,8 @@ namespace eosio { namespace chain { } - if( !allow_unused_keys && !check_but_dont_fail) { - EOS_ASSERT( checker.all_keys_used(), tx_irrelevant_sig, + if( !allow_unused_keys ) { + EOS_ASSERT( checker.all_keys_used() || check_but_dont_fail, tx_irrelevant_sig, "transaction bears irrelevant signatures from these keys: ${keys}", ("keys", checker.unused_keys()) ); }