-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Signature Validation (#1873)
This PR is a follow-up to #1871 Specifically, that PR added error handling for the `eth_call` simulation such that reverts are properly classified as `SignatureValidationError::Invalid`. The `Signatures.sol` contract was _supposed to_ handle all reverts from signature verifiers, so that error classification shouldn't have been needed. **However**, it turns out I made some assumptions about the Solidity `try ... catch` semantics that turned out to be invalid and cause the `Signatures.sol` to still revert in some cases. In particular, `Signatures::validate` will revert if: - `signer` is not a contract - `signer.isValidSignature` returns less than 32 bytes of data With this in mind, it doesn't really make sense to try and handle revert errors in both the Solidity code and the Rust code, so just handle all revert errors in Rust in the `signature_validation::simulation::Validator` code and get rid of the `try ... catch` in the Solidity code. I also refactored the `From<ethcontract::ExecutionError>` implementation into the existing `From<web3::Error>` (which was no longer being used, and IMO made more sense to be there). Furthermore, #1842 removed some `signature_validator::{arguments, web3}` submodules whose files were accidentally left behind, so I removed them here as well. ### Test Plan CI - the existing E2E tests for signature validation continue to pass, and added a new one to check that errors are correctly detected.
- Loading branch information
Nicholas Rodrigues Lordello
authored
Sep 14, 2023
1 parent
4b68572
commit 58308af
Showing
7 changed files
with
60 additions
and
259 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.