-
Notifications
You must be signed in to change notification settings - Fork 81
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
Feature: Implement a Passkey SignatureValidator
factory
#306
Feature: Implement a Passkey SignatureValidator
factory
#306
Conversation
Pull Request Test Coverage Report for Build 8177592072Details
💛 - Coveralls |
d59f4f5
to
cd78a75
Compare
e273052
to
a966519
Compare
@@ -5,7 +5,6 @@ pragma solidity >=0.8.0; | |||
import {SignatureValidatorConstants} from "./SignatureValidatorConstants.sol"; | |||
import {IUniqueSignerFactory} from "./SafeSignerLaunchpad.sol"; | |||
import {SignatureValidator} from "./SignatureValidator.sol"; | |||
import {SignatureValidatorConstants} from "./SignatureValidatorConstants.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed a duplicated import
}, | ||
"exclude": ["node_modules"], | ||
"exclude": ["node_modules"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the formatter wanted me to do it
* @dev Interface for creating and verifying ECDSA signers. This is a generalized interface that should be | ||
* compatible with curves of any order size. Currently not used in the project and exists here for reference. | ||
*/ | ||
interface ICustomECSignerFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, this isn't an EC signer - in particular, it would support an interface to passkey with RSA key.
a838c9d
to
a966519
Compare
modules/passkey/.env.sample
Outdated
@@ -0,0 +1,2 @@ | |||
# Entrypoint address to use for the Safe 4337 module deployment in 4337 tests. Default is the canonical EntryPoint v0.7 address | |||
TESTS_4337_MODULE_DEPLOYMENT_ENTRY_POINT_ADDRESS="0x0000000071727De22E5E9d8BAf0edAc6f37da032" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing trailing newline.
} | ||
} | ||
|
||
interface SafeSetup { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we move this to an ISafe
file?
a966519
to
7e21926
Compare
* @title ICustom256BitECSignerFactory | ||
* @dev Interface for creating and verifying ECDSA signers using 256-bit elliptic curves. | ||
*/ | ||
interface ICustom256BitECSignerFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing as ICustomECSignerFactory
isn't used at all, I would actually suggest removing it. It feels a bit like we are trying to future proof, even if there is no demand for using passkeys with algorithms other than ECDSA over the P-256 curve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I mentioned in the @dev
natspec that it's just kept for the future reference. I can remove it.
@@ -0,0 +1,12 @@ | |||
FROM docker.io/library/node:18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can ln-s
this file, so it is always the same as the 4337 file. It is a lightweight way to share the docker file between both projects 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was researching whether it works on Windows and can't find a concrete answer. Example: https://unix.stackexchange.com/questions/63172/does-windows-recognize-linuxs-symbolic-links
Do you know if it works across different OS? I know we don't have anyone on the team on Windows but for the sake of good open-source etiquette wanna check it
modules/passkey/src/deploy/4337.ts
Outdated
} else if (!ENTRY_POINT) { | ||
throw new Error('TESTS_4337_MODULE_DEPLOYMENT_ENTRY_POINT_ADDRESS must be set') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is for testing, do we ever even need this? Might be simpler to always deploy the EntryPoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... we need it for the launchpad contract. In that case, I think it should be DEPLOYMENT_ENTRY_POINT
, since when we deploy it for real on Polygon for example, it feels weird to use a TEST_*
variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't read the second comment 🤦 will restore it
84b2878
to
64a6bc2
Compare
d1e4049
to
56f09b4
Compare
56f09b4
to
6a7f007
Compare
6a7f007
to
d355e21
Compare
I'm not sure why e2e tests fail; they work on my machine (including with a fresh dependency installation). I will debug it later today, |
Maybe related to fresh vs cached docker compose image? |
6444076
to
c7c79a6
Compare
c7c79a6
to
8a814f6
Compare
I fixed the first one (I could reproduce it in the end; it required removing all the build files and reinstalling dependencies from scratch), but now there's a new one with a |
102d665
to
ac86d21
Compare
This PR is a partial solution for #288. What needs to be added is a proper test suite for the factory. It only has one migrated end-to-end test from the 4337 module package.
What was done:
ICustomECSignerFactory
andICustom256BitECSignerFactory
interfaces for custom signer factories. The first is generic and should work with signing algorithms of any key length, while the second is optimized for EC signing and 256-bit key sizes. The first one is not used in the project and is kept as an example or for future reference.WebAuthnVerifier
and make it use the new P256Library introduced in Introduce P-256 Verifier Contract #298SafeSignerLaunchpad
contract and make it implement theICustom256BitECSignerFactory
interface thus making itSafe256BitECSignerLaunchpad
To be done: