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

fix: not fail on signature checks for dry-run txns #1081

Merged
merged 4 commits into from
Apr 26, 2023
Merged
Changes from 2 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
2 changes: 1 addition & 1 deletion libraries/chain/authorization_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ namespace eosio { namespace chain {

}

if( !allow_unused_keys || check_but_dont_fail) {
if( !allow_unused_keys && !check_but_dont_fail) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same change should be made at line 548 above, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.But EOS_ASSERT will only throw the error when the first argument is false. Since check_but_dont_fail should never throw the error when it is true, there is no need to modify at line 548.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, what was I thinking!

EOS_ASSERT( checker.all_keys_used(), tx_irrelevant_sig,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, I think the EOS_ASSERT should be modified, since we would ideally want to include the time it takes for checker.all_keys_used()

      if( !allow_unused_keys ) {
         EOS_ASSERT( checker.all_keys_used() || check_but_dont_fail, tx_irrelevant_sig,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have resubmitted the code and updated the PR description

"transaction bears irrelevant signatures from these keys: ${keys}",
("keys", checker.unused_keys()) );
Expand Down