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

feat: zksync support #4725

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

Conversation

mshojaei-txfusion
Copy link
Collaborator

Description

This PR introduces a series of changes aimed at enhancing zkSync support within the codebase. Key updates include the addition of the zksolc compiler for zkSync, integration of contract artifacts, CLI automation for core deployment, and compatibility adjustments in tests for the zkSync environment. It also includes improvements in contract verification on zkSync explorer and handling gas limits for zkSync deployments.

Drive-by changes

  • Added support for the zksolc compiler.
  • Decoupled Hardhat configuration for EVM from zkSync.
  • Enabled the export of zkSync-related contract artifacts.
  • Verified compatibility of different deployment components based on the chain’s technical stack.
  • Integrated zkSync provider and signer.
  • Added support for contract verification on the zkSync explorer.
  • Blacklisted static contracts from deployment on zkSync, as they are not supported.

Related issues

No related issue

Backward compatibility

Yes

Testing

Manual testing and some automated tests were performed, including end-to-end tests on zkSync for warp read and apply functionalities.

ljankovic-txfusion and others added 30 commits September 12, 2024 12:23
Copy link

mergify bot commented Dec 12, 2024

⚠️ The sha of the head commit of this PR conflicts with #4914. Mergify cannot evaluate rules on this PR. ⚠️

solidity/test/lib/mailboxes.ts Outdated Show resolved Hide resolved
typescript/cli/scripts/run-e2e-test.sh Outdated Show resolved Hide resolved
@@ -927,9 +928,10 @@ export class EvmHookModule extends HyperlaneModule<
// deploy fallback hook
const fallbackHook = await this.deploy({ config: config.fallback });
// deploy routing hook with fallback
routingHook = await this.deployer.deployContract(
routingHook = await this.deployer.deployContractWithName(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default deployContract just uses the enum value, but here the enum value doesn't match the actual contract name (hence the type->name mapping)

its also non trivial to just change the enum because it affects other places, i hit this once before with the ism factory

.changeset/ten-spiders-trade.md Show resolved Hide resolved
@@ -30,7 +31,7 @@ export enum ChainTechnicalStack {
OpStack = 'opstack',
PolygonCDK = 'polygoncdk',
PolkadotSubstrate = 'polkadotsubstrate',
ZkSync = 'zksync',
ZKSync = 'zksync',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we we keep this as ZkSync and update all the ZKSync -> ZkSync for naming elsewhere as well for consistency?

imo it should generally be ZkXYZ rather than ZKXYZ, @ltyu wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We sure can, but zksync did the rebranding and is actually the owner of "ZK" trademark, so at the end the value should be ZKsync. But at the end it really doesn't matter, whatever you guys prefer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no opinions here. if it doesn't impact anything, then i'm okay with the change.


import { Annotated, ProtocolType } from '@hyperlane-xyz/utils';

export enum ProviderType {
ZKSync = 'zksync',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto depending on the outcome of the ZKSync -> ZkSync comment earlier

solidity/test/merkle.test.ts Outdated Show resolved Hide resolved
solidity/test/message.test.ts Outdated Show resolved Hide resolved
solidity/test/mockMailbox.test.ts Outdated Show resolved Hide resolved
solidity/test/testrecipient.test.ts Outdated Show resolved Hide resolved

// For static ISM types it checks whether the technical stack supports static contract deployment
assert(
!isIsmStatic[ismType] || isStaticDeploymentSupported(technicalStack),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a difference between this cond and isIsmCompatible()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

8 participants