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

CCIP gethwrappers with zkstack support #15477

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open

Conversation

yashnevatia
Copy link

@yashnevatia yashnevatia commented Dec 2, 2024

  • Adding geth wrappers with zksync logic
  • This enables us to use the same wrappers for ethereum and zksync chains
    • It prevents adding if conditions to every deploy method we have across the different tools
  • The existing deployment tools will only have to change the way they instantiate the TransactOps that goes into the deploy method, but from our understanding thats only one once per tool (change given below)

Instead of doing this

auth, err := bind.NewKeyedTransactorWithChainID(ownerKey, big.NewInt(int64(chainID)))

We will now do this, where we add a zksync wallet into the context.value of the TransactOps

auth, err := bind.NewKeyedTransactorWithChainID(ownerKey, big.NewInt(int64(chainID)))
if generated_zks.IsZKSync(client) {
  zkclient := zkSyncClient.NewClient(client.Client())
  wallet, err := zkSyncAccounts.NewWallet(common.Hex2Bytes(privateKeyHex), zkclient, nil)
  ctx := context.WithValue(auth.Context, walletKey, wallet)
  auth.Context = ctx
}

If the above is done, we can simply do the below for deploying to both ethereum and zkstack chains (no special logic for zkstack)

linkTokenAddress, deployTx, token, err := link_token.DeployLinkToken(auth, client)

TODO:

  • zksolc binary setup needs to be done
  • WETH and ICCIPEncodingUtils are not compiling -> need to work on that
  • make the class name and type names in abigen.go constants

WETH9.sol compilation breaks

--> /Users/yashvardhan/chainlink/contracts/src/v0.8/ccip/test/WETH9.sol

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> /Users/yashvardhan/chainlink/contracts/src/v0.8/ccip/test/WETH9.sol


Error: You are using '<address payable>.send/transfer(<X>)' without providing the gas amount.
Such calls will fail depending on the pubdata costs.

Requires

Supports

@yashnevatia yashnevatia requested review from a team as code owners December 2, 2024 16:51
Copy link
Contributor

github-actions bot commented Dec 2, 2024

AER Report: CI Core

aer_workflow , commit , Detect Changes , Clean Go Tidy & Generate , Scheduled Run Frequency , Flakeguard Root Project / Get Tests To Run , lint , Core Tests (go_core_tests) , Flakeguard Deployment Project , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_race_tests) , Core Tests (go_core_fuzz) , Flakeguard Root Project / Run Tests , Flakeguard Root Project / Report , Flakey Test Detection , SonarQube Scan

1. Missing go.sum entry for module

[go_core_race_tests] Build binary 2024-12-08T06:14:36.3772585Z

Source of Error:
../../../go/pkg/mod/github.com/graph-gophers/dataloader@v5.0.0+incompatible/trace.go:6:2: missing go.sum entry for module providing package github.com/opentracing/opentracing-go (imported by github.com/graph-gophers/dataloader); to add:
	go get github.com/graph-gophers/dataloader@v5.0.0+incompatible

Why: The error occurs because the go.sum file is missing an entry for the github.com/opentracing/opentracing-go package, which is required by github.com/graph-gophers/dataloader.

Suggested fix: Run go get github.com/graph-gophers/[email protected]+incompatible to update the go.sum file with the necessary module entry.

[go_core_tests_integration] Build binary 2024-12-08T06:14:30.1346896Z

Source of Error:
../../../go/pkg/mod/github.com/graph-gophers/dataloader@v5.0.0+incompatible/trace.go:6:2: missing go.sum entry for module providing package github.com/opentracing/opentracing-go (imported by github.com/graph-gophers/dataloader); to add:
	go get github.com/graph-gophers/dataloader@v5.0.0+incompatible

Why: The error occurs because the go.sum file is missing an entry for the github.com/opentracing/opentracing-go package, which is required by github.com/graph-gophers/dataloader.

Suggested fix: Run go get github.com/graph-gophers/[email protected]+incompatible to update the go.sum file with the necessary module entry.

[go_core_ccip_deployment_tests] Build binary 2024-12-08T06:14:39.6402913Z

Source of Error:
../../../go/pkg/mod/github.com/graph-gophers/dataloader@v5.0.0+incompatible/trace.go:6:2: missing go.sum entry for module providing package github.com/opentracing/opentracing-go (imported by github.com/graph-gophers/dataloader); to add:
	go get github.com/graph-gophers/dataloader@v5.0.0+incompatible

Why: The error occurs because the go.sum file is missing an entry for the github.com/opentracing/opentracing-go package, which is required by github.com/graph-gophers/dataloader.

Suggested fix: Run go get github.com/graph-gophers/[email protected]+incompatible to update the go.sum file with the necessary module entry.

[Golang Lint] Golang Lint 2024-12-08T06:14:59.4925330Z

Source of Error:
../../../go/pkg/mod/github.com/graph-gophers/dataloader@v5.0.0+incompatible/trace.go:6:2: missing go.sum entry for module providing package github.com/opentracing/opentracing-go (imported by github.com/graph-gophers/dataloader); to add:
	go get github.com/graph-gophers/dataloader@v5.0.0+incompatible

Why: The error occurs because the go.sum file is missing an entry for the github.com/opentracing/opentracing-go package, which is required by github.com/graph-gophers/dataloader.

Suggested fix: Run go get github.com/graph-gophers/[email protected]+incompatible to update the go.sum file with the necessary module entry.

2. Missing file or directory

[make generate] make generate 2024-12-08T06:19:52.4140871Z

Source of Error:
Error while improving abigen output: open ../../../contracts/zksolc/v1.5.6/ARMProxy/ARMProxy.sol/ARMProxy.zbin: no such file or directory

Why: The error occurs because the specified file ../../../contracts/zksolc/v1.5.6/ARMProxy/ARMProxy.sol/ARMProxy.zbin does not exist in the directory.

Suggested fix: Ensure that the file path is correct and that the file exists in the specified directory. If the file is missing, add it to the directory.

3. No such file or directory

[Golang Lint] Golang Lint 2024-12-08T06:14:59.5095704Z

Source of Error:
cat: ./golangci-lint-report.xml: No such file or directory

Why: The error occurs because the file ./golangci-lint-report.xml does not exist in the directory.

Suggested fix: Ensure that the file golangci-lint-report.xml is generated and exists in the specified directory before attempting to read it.

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@yashnevatia yashnevatia requested review from a team as code owners December 2, 2024 17:26
@yashnevatia yashnevatia requested a review from Atrax1 December 2, 2024 17:26
@yashnevatia yashnevatia changed the title adding zk support script and makefile action CCIP gethwrappers with zkstack support Dec 2, 2024
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