Skip to content

[Milestone] Refactoring the Verification Flow #1665

Description

@kuzdogan

While rethinking the verification flow we should keep in mind the following features:

  • Multiple languages support: we recently added Vyper support. The new verification flow should abstract away the language of the contract
  • Not focused on metadata: we need a “std-json based” verification. Metadata should be an opt-in feature, not the foundation of the verification flow. We should also consider support for alternatives such as Vyper's integrity field.
  • Compiler package: we already extracted the compilers code from lib-sourcify. But we are not shipping the compiler code in any package. We need to maintain a new package @ethereum-sourcify/compilation.
  • APIV2: it is important to keep in mind all the new fields needed by APIV2. Also, the new verification flow will be executed in an async environment by the server, but it will probably doesn't affect much the architecture of the new verification.

@kuzdogan is currently suggesting the following new structure:

1. Validation step

  • 📋MetadataContract object
    • previously CheckedContract and validate.ts
    • Does the validation, source fetching, preparing the compilation with the metadata.json, tryToFindPerfectMetadata()
    • input:
      • metadata.json
      • sources
    • creates:
      • ⚙️Compilation object
  • MetadataValidation
  • IntegrityValidation

2. Compilation step

  • ⚙️Compilation object:
    • input:
      • std-json
      • ISolidityCompiler / IVyperCompiler
      • contract identifier (for the output)
    • compile()
      • output:
        • creationBytecode
        • runtimeBytecode
        • metadata
        • other compilation artifacts
        • compilation metadata: duration, hardware?
  • SolidityCompilation
  • VyperCompilation

3. Verification step

  • ✔Verification object
    • input:
      • SourcifyChain / chainId
      • address
      • ⚙️Compilation
    • output:
      • match status
      • transformations
      • ⚙️Compilation properties
    • Other things like findAuxdataPositions
### Tasks
- [ ] https://github.com/ethereum/sourcify/issues/1318
- [ ] https://github.com/ethereum/sourcify/issues/1712
- [ ] https://github.com/ethereum/sourcify/issues/1348
- [ ] https://github.com/ethereum/sourcify/issues/1821
- [ ] https://github.com/ethereum/sourcify/issues/1822
- [ ] https://github.com/ethereum/sourcify/issues/1823
- [ ] https://github.com/ethereum/sourcify/issues/1824
- [ ] https://github.com/ethereum/sourcify/issues/1985
- [ ] Remove process.env.variables
- [ ] https://github.com/ethereum/sourcify/issues/1989

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status
Sprint - Done

Relationships

None yet

Development

No branches or pull requests

Issue actions