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 blockchain anvil zksync #1651

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Add blockchain anvil zksync #1651

wants to merge 14 commits into from

Conversation

ilanolkies
Copy link
Collaborator

@ilanolkies ilanolkies commented Feb 21, 2025

Adding blockchain anvil-zksync that allows to test with a zk vm.

The goal is to be able to call it from chainlink/deployment environment

Screenshot 2025-02-21 at 12 15 09 PM

The implementation requires to write a custom Dockerfile because there are no official public distributions. I decided to put the Dockerfile in a temporary folder and delete it after spinning up the container.

containers.go has Anvils duplicated code

blockchain_test.go adds unit test for Anvil and Anvil Zksync

Screenshot 2025-02-21 at 12 25 17 PM --- **Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.**

Why

The changes simplify the newAnvil function by removing unnecessary context and container setup, focusing on creating a generic Ethereum Virtual Machine (EVM) container. Additionally, they introduce support for a new blockchain simulation environment, anvil-zksync, including a way to build its Docker image from source due to the lack of public images. This extension enhances the framework's capabilities to include zkSync development environments.

What

  • framework/components/blockchain/anvil.go
    • Removed imports related to Docker and testcontainers that are no longer used.
    • Simplified newAnvil function to use createGenericEvmContainer without direct Docker container management code.
  • framework/components/blockchain/anvilZksync.go
    • Added new file to support anvil-zksync with functions defaultAnvilZksync and newAnvilZksync for setting up and creating anvil-zksync Docker containers.
  • framework/components/blockchain/blockchain.go
    • Added "anvil-zksync" case to NewBlockchainNetwork switch statement to handle anvil-zksync blockchain setups.
  • framework/components/blockchain/blockchain_test.go
    • Added new file for testing blockchain component, specifically testing anvil and anvil-zksync setups.
  • framework/components/blockchain/containers.go
    • Added new file to provide common container setup functions baseRequest and createGenericEvmContainer to streamline the creation of blockchain simulation environments.

@cl-sonarqube-production
Copy link

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.

1 participant