argotorg / argotorg/sourcify

Let create a Verification with existing onchain bytecodes

Open
#2,181 2 comments 0 reactions 0 assignees View on GitHub
🟢 Low Priority
Dominant language
TypeScript
Stars
949
Forks
542
Avg merge
2d 19h
Merged PRs (30d)
18

Description

When debugging an issue I realized we try to fetch the creationTx of the contract even though the contract was actually not deployed on that chain. The reason is the Sourcify server's VerificationService first tries to find the creationTx (not user provided), then calls `new Verification` with the found creationTx. Whereas always the very first thing we should check is if this contract is deployed at this address at all and bail early.

https://github.com/ethereum/sourcify/blob/4e183eadac2aa18e579e1da10d7055003accde12/services/server/src/server/services/VerificationService.ts#L249-L266

I think this is in line with #2166 where we talked about having PrecomputedCompilation etc. and we can also have a PrefetchedVerification or just a Verification with extra constr. args. that we can initialize it with the bytecode we already fetched.

Alternatively we can move the whole creatorTx fetching inside `lib-sourcify`. Which could also make sense but needs a larger refactor.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with services/server/src/server/services/VerificationService.ts around lines 249-266 and read the discussion in #2166 about PrecomputedCompilation. Trace how the service fetches creationTx before constructing Verification, then define the change so already-fetched onchain bytecodes can initialize Verification and nonexistent deployments exit early.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.