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 Passkey Verification #486

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Fix Passkey Verification #486

merged 1 commit into from
Aug 20, 2024

Conversation

nlordell
Copy link
Collaborator

@nlordell nlordell commented Aug 19, 2024

In deploying the Passkey v0.2.1 contracts, I noticed that the local verification script wasn't working as well as Etherscan verification of the FCL verifier contract. This PR fixes both of these things and is related to a few issues:

  1. The solc package version was not correctly specified for each localVerify script. It was pulling in a solc version based on transient dependencies which doesn't necessarily match what the contracts are compiled with (and thus affects local verification). This was an issue shared by all Solidity packages.
  2. Local verification was not correctly building the Solidity compiler input JSON. It turns out that the way we build compiler input would sometimes only pass in the Keccak-256 hash of the source instead of the actual Solidity source - so we add an additional condition in the task to read the source from disk if necessary (this is a hardhat-deploy inconsistency).
  3. The etherscan-verify task from the hardhat-deploy package does not work for contracts with Solidity compiler settings overrides such as the FCL P-256 verifier contract (which has different compiler settings from the rest of the contracts). We have a special manual hardhat-verify plugin call in the deploy-all task to work around the issue.

@nlordell nlordell requested a review from a team as a code owner August 19, 2024 16:32
@nlordell nlordell requested review from akshay-ap, mmv08 and remedcu and removed request for a team August 19, 2024 16:32
@coveralls
Copy link

coveralls commented Aug 19, 2024

Pull Request Test Coverage Report for Build 10457753594

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 10419780384: 0.0%
Covered Lines: 92
Relevant Lines: 92

💛 - Coveralls

In deploying the contracts, I noticed that the local verification script
wasn't working as well as Etherscan verification of the FCL verifier
contract. This PR fixes both of these things and is related to a couple
issues:

1. The `solc` package version was not correctly specified for each
   `localVerify` script. It was pulling in a `solc` version based on
   transient dependencies which doesn't necessarily match what the
   contracts are compiled with (and thus affects local verification).
   This was an issue shared by all Solidity packages.
2. Local verification was not correctly building the Solidity compiler
   input JSON. It turns out that the way we build compiler input would
   sometimes only pass in the Keccak-256 hash of the source instead of
   the actual Solidity source - so we add an additional condition in the
   task to read the source from disk if necessary.
3. The `etherscan-verify` task from the `hardhat-deploy` package does
   not work for contracts with Solidity compiler settings overrides such
   as the FCL P-256 verifier contract (which has different compiler
   settings from the rest of the contracts). We have a special manual
   `hardhat-verify` plugin call in the `deploy-all` task to work around
   the issue.
@nlordell nlordell force-pushed the chore/fix-passkey-verification branch from 09d3b77 to 9ba9186 Compare August 19, 2024 17:07
@@ -4,15 +4,14 @@ coverage/
coverage.json
deployments/
dist/
typechain-types
typechain-types/
venv/
Copy link
Member

Choose a reason for hiding this comment

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

we do python now?

Copy link
Collaborator Author

@nlordell nlordell Aug 20, 2024

Choose a reason for hiding this comment

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

The certora verification uses pip for installing the Certora CLI (source:

run: pip install -r modules/4337/certora/requirements.txt
)

Copy link
Member

Choose a reason for hiding this comment

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

I am not a Python expert, but it doesn't seem like the virtual env gets initialised anywhere in the script?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No it does not - I use it locally, since our different projects use different versions of certora-cli, so installing it globally isn't great. I basically follow the instructions from:

https://github.com/safe-global/safe-locking?tab=readme-ov-file#formal-verification

@nlordell nlordell merged commit dfd3b05 into main Aug 20, 2024
19 checks passed
@nlordell nlordell deleted the chore/fix-passkey-verification branch August 20, 2024 14:10
@github-actions github-actions bot locked and limited conversation to collaborators Aug 20, 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