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

Add Vyper support to Sourcify #1784

Draft
wants to merge 10 commits into
base: staging
Choose a base branch
from
Draft

Conversation

marcocastignoli
Copy link
Member

@marcocastignoli marcocastignoli commented Dec 12, 2024

Adds vyper support, here the initial PR: #1760. Below the related tasks:

After merging:

  • publish new docs

marcocastignoli and others added 9 commits December 9, 2024 11:12
…new endpoint `/verify/vyper` in server (#1760)

* add VyperCheckedContract

* rename CheckedContract.solidity to sources

* refactor checkedcontract into an abstract class

* refactor AbstractCheckedContract in server

* use AbstractCheckedContract type in StorageServices

* add /verify/vyper endpoint

* successfully store is database and repository vyper match

* dynamically download the vyper compiler

* fix lib-sourcify-tests

* enable all tests in server

* improve comments for IVyperCompiler

* fix pr suggestions

* rename checkFiles to CheckFilesWithMetadata

* rename useCompiler to useSolidityCompiler

* fix pr suggestions
Finalize vyper api: openapi spec + error handling
* Only log Vyper downloaded on success

* add architecture checks for vyper compiler on mac and improve logging
* Add lib-sourcify tests for Vyper support

* Add server tests for Vyper support
…kedContract (#1783)

* Add support for Vyper cbor auxdata in bytecode-utils and consequently in VyperCheckedContract

* handle vyper incorrect semver versions, support auxdata position also for versions < 0.3.10

* Refactor Solidity and Vyper contract handling to improve auxdata extraction

- Changed `auxdataStyle` in `SolidityCheckedContract` to be a static readonly property.
- Updated bytecode decoding in both `SolidityCheckedContract` and `VyperCheckedContract` to use the static `auxdataStyle`.
- Simplified `generateCborAuxdataPositions` method in `VyperCheckedContract` by introducing a helper function for auxdata position generation.
- Added comments to clarify the use of `AuxdataStyle.SOLIDITY` for bytecode decoding in `ChainMonitor` and session state handlers.
- Ensured that `generateCborAuxdataPositions` is called when necessary in `AbstractDatabaseService` to maintain data integrity.

* add comment to explain `generateCborAuxdataPositions` return conditions

* Refactor bytecode decoding to enhance auxdata handling for Vyper versions. Updated the `decode` function to support various auxdata styles, including specific handling for Vyper versions < 0.3.10 and < 0.3.5. Improved error messages for missing auxdata in bytecode. Updated tests to reflect changes in auxdata style usage.

* Refactor bytecode decoding to replace `compiler` with `vyperVersion` in Vyper-related types and tests.
* Add Vyper documentation in READMEs

* improve lib-sourcify readme

* improve lib-sourcify readme

* improve lib-sourcify documentation

* fix version type in docs
* Add support for immutables

* Remove exclusive test execution for Vyper in verification.spec.ts

* future-proof getImmutableReferences

* - Introduced `auxdataStyle` as an abstract property in `AbstractCheckedContract`
- Updated bytecode decoding methods to utilize instance-specific `auxdataStyle` instead of static references.
- Enhanced `ImmutablesTransformation` to accept dynamic transformation types: replace and insert.
- Adjusted tests to reflect changes in auxdata handling and transformation types.
Don't store full source content in mocked metadata object
* Add database tests for Vyper contract auxdata

* Add database test for Vyper constructor arguments and immutables transformations

* Add verify endpoint test for auxdata transformation with wrong integrity hash

* Add verify endpoint tests for auxdata transformation with wrong vyper version

* Add lib-sourcify test for auxdata transformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

2 participants