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

Promote Shared Singleton Signer Implementation #413

Merged
merged 2 commits into from
May 13, 2024

Conversation

nlordell
Copy link
Collaborator

@nlordell nlordell commented May 6, 2024

This PR promotes the shared singleton signer implementation to the 4337 directory instead of being a "test" contract. This involves:

  • Adding it to the deployments
  • Moving and renaming the contract to remove the Test prefix

I also took this opportunity to rename it to a "shared" signer instead of "singleton" signer, so that it does not get confused with the other singleton contract (the SafeWebAuthnSignerSingleton) that already exists in this repository.

Additionally, I moved some of the test files around in order to clearly differentiate between E2E tests and unit tests in the test/4337 directory.

Unit tests for 100% coverage of the SafeWebAuthnSharedSigner will be added in a follow up PR.

@nlordell nlordell requested a review from a team as a code owner May 6, 2024 10:34
@nlordell nlordell requested review from akshay-ap, mmv08 and remedcu and removed request for a team May 6, 2024 10:34
@coveralls
Copy link

coveralls commented May 10, 2024

Pull Request Test Coverage Report for Build 9062104545

Details

  • 1 of 15 (6.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-8.4%) to 77.833%

Changes Missing Coverage Covered Lines Changed/Added Lines %
modules/passkey/contracts/4337/SafeWebAuthnSharedSigner.sol 1 15 6.67%
Totals Coverage Status
Change from base Build 9031345321: -8.4%
Covered Lines: 122
Relevant Lines: 147

💛 - Coveralls

Copy link
Member

@remedcu remedcu left a comment

Choose a reason for hiding this comment

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

How was the address for SAFE_WEBAUTHN_SHARED_SIGNER_ADDRESS and SAFE_SIGNER_LAUNCHPAD_ADDRESS calculated?

I tried with npx hardhat deploy on localhost, and got this:

deploying "SafeSignerLaunchpad" (tx: 0x0840238cfc0f8e1703a410d914e714e36e8aa60445c77e00ea74796319320b70)...: deployed at 0x7a17673482dbB4586A29dBE60BCF20602F5a21b2 with 1265339 gas
deploying "SafeWebAuthnSharedSigner" (tx: 0x7576a804108f00275b06f738d7939c071923b649f4ed55ac77a19604713c3716)...: deployed at 0x7CB04FC7EDc8a701924024F46937b55C971E3156 with 681440 gas

@nlordell
Copy link
Collaborator Author

I suspect there was a small change in comments or something related to the rebase. I created a GH issue to track this, so we can redeploy the contracts once the audit is complete (as the addresses may change yet again when we incorporate audit comments):

#418

Base automatically changed from 408/use-self-storage to 308/single-setup-unit-tests May 13, 2024 11:09
@nlordell nlordell force-pushed the 308/single-setup-unit-tests branch from bec13b0 to 8a7eab4 Compare May 13, 2024 11:15
@nlordell nlordell changed the base branch from 308/single-setup-unit-tests to 408/use-self-storage-2 May 13, 2024 11:15
Fixes #408

This PR reworks the WebAuthn singleton signer to use the account storage
instead of its own storage for signer configuration (x, y, and verifiers
configuration values). This allows the shared signer to work **without**
a staked factory 🎉!

We also rename the methods a bit to be more consistent with our signer
factory implementation, and adjust the E2E test accordingly (noting that
a staked factory is no longer needed).

This also required some small adjustments to the
`4337-passkeys-singleton-signer` example for the new code (but overall
simplification - no need for a staked factory anymore).
This PR promotes the shared singleton signer implementation to the 4337
directory instead of being a "test" contract. This involves:
- Adding it to the deployments
- Moving and renaming the contract to remove the `Test` prefix

I also took this opportunity to rename it to a "shared" signer instead
of "singleton" signer, so that it does not get confused with the other
singleton contract (the `SafeWebAuthnSignerSingleton`) that already
exists in this repository.

Additionally, I moved some of the test files around in order to clearly
differentiate between E2E tests and unit tests in the `test/4337`
directory.

Unit tests for 100% coverage of the `SafeWebAuthnSharedSigner` will be
added in a follow up PR.
@nlordell nlordell changed the base branch from 408/use-self-storage-2 to main May 13, 2024 11:29
@nlordell nlordell merged commit 771fc27 into main May 13, 2024
10 checks passed
@nlordell nlordell deleted the 407/promote-shared-signer branch May 13, 2024 11:34
@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants