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

lib-sourcify refactoring (w/ rebase) #935

Merged
merged 56 commits into from
Feb 21, 2023

Conversation

kuzdogan
Copy link
Member

@kuzdogan kuzdogan commented Feb 21, 2023

Clean PR for #898

Cleans up the double commits occurred during rebasing to staging. Since some files (e.g. services/core/sourcify-chains.ts) etc were removed by these changes and modified by staging, a manual rebase was required.

View in Huly HI-708

kuzdogan and others added 30 commits February 21, 2023 15:04
Move sourcify-chains out of @ethereum-sourcify/core to server.
export supported- and monitoredChainsMap and -Array.

Create new-VerificationService to wrap the lib-sourcify verification
methods and hold supported chains.

Update sourcify-chains types

new-VerificationController initially with legacyVerify endpoint.
All util functions are moved to new-VerificationController-util.
Only endpoint functions will be in VerificationController to keep clean.
Add RepositoryService and Controller for repository related endpoints.
Most of the code from previous core/FileService.

Move event manager to src/services from core

Add types used internally by the server
Rename new-VerificationController* to VerificationController and
rename VerificationController to VerificationController.old.ts

Use the new Verification- and Repository- -Service and -Controller
in routes.ts

Store verified contracts in refactored legacyVerifyEndpoint and add the
necessary new funcitons to RepositoryService.

Change `chain` to `chainId` everywhere
Write reusable (DRY) tests in verification.spec.ts for
deploying and verifying contract.

Structure the tests to always have metadata.json
sources/
artifact.json

Move the UsingLibrary test from server to lib-sourcify.
Instead of doing in two separate functions, run deploy and verify in a
single function in tests
Also move metadata-inliner.json as it's placed there mistakenly.

Remove timeout from tests acompilers it can take longer to download the
compiler with slower networks
(like airport WiFi 😒)
kuzdogan and others added 25 commits February 21, 2023 15:04
Do assertions on Match with a single function `expectMatch`.
For that, return deployedAddress from
deployCheckAndVerify
Also change "inject" function name in monitor.ts. Don't pass bytecode
into "inject" function
Since many files are moved and some code parts
changed places, we need to rebase and sync with the head manually

Adds the missing functons to find the creatorTx of a contract.

Find and pass the
creatorTx to the next verification step if verif. fails.

Updates chains.json as in d43746

Updates added chains as was in d43746

Removes SOLC_REPO_TMP
Since the new UI of the Etherscan, the txRegex was broken for the
updated Etherscan deployments.

Fix the regex to fit both old and new version.
Use ethers `getContractAddress` instead of own function.
The old expected behavior of the API is returning an error with 500 when
Bytecodes don't match and can't verify.

The changes were returning a match to check and verify once
again with the creatorTx.

Instead go back to the old way and check the thrown error message
for re-verifying with creatorTx.
@kuzdogan kuzdogan marked this pull request as ready for review February 21, 2023 14:08
@kuzdogan kuzdogan changed the title Sourcify refactoring kaan rebase lib-sourcify refactoring (w/ rebase) Feb 21, 2023
@kuzdogan kuzdogan merged commit 2a2fcd1 into staging Feb 21, 2023
@kuzdogan kuzdogan deleted the sourcify-refactoring-kaan-rebase branch May 10, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants