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

Adding debugging feature for failed signatures #70

Closed
psiemens opened this issue Aug 4, 2021 · 0 comments · Fixed by #79
Closed

Adding debugging feature for failed signatures #70

psiemens opened this issue Aug 4, 2021 · 0 comments · Fixed by #79
Assignees
Labels
Feature A new user feature or a new package API Feedback

Comments

@psiemens
Copy link
Contributor

psiemens commented Aug 4, 2021

Issue To Be Solved

The emulator throws an error when it receives in an invalid transaction signature, but does not specify why the signature was invalid. Given that the emulator is a development tool, it should be able to perform an extra check to provide more diagnostics information to help the developer.

(Optional): Suggest A Solution

A transaction signature can be invalid for one of the following reasons:

  1. signature was generated with the wrong private key
  2. signature was generated by hashing the transaction with the wrong hash algorithm (e.g. on-chain account says SHA2, client used SHA3)
  3. transaction was mutated after the signature was generated (e.g. sign the transaction, then set the gas limit, but submit the old signature)

Scenario 1 is difficult to report without knowing the original private key.

Scenario 2 can be detected by attempting to verify the signature with each other hash algorithm.

Scenario 3 cannot be reliably detected, but the emulator can print out a log of the transaction structure that was signed, which the developer can then compare against the transaction that their client prepares.

@psiemens psiemens added Feature A new user feature or a new package API Feedback labels Aug 4, 2021
@psiemens psiemens self-assigned this Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A new user feature or a new package API Feedback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant