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 75 commits into
base: main
Choose a base branch
from

Conversation

mshojaei-txfusion
Copy link

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.

Copy link

changeset-bot bot commented Oct 22, 2024

⚠️ No Changeset found

Latest commit: 59bff45

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@paulbalaji paulbalaji changed the title Feat/zksync support feat: zksync support Oct 22, 2024
Copy link
Contributor

@paulbalaji paulbalaji left a comment

Choose a reason for hiding this comment

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

some quick comments from first glance

Comment on lines +45 to +58
export const HookTypeToContractNameMap: Record<
Exclude<HookType, HookType.CUSTOM>,
string
> = {
[HookType.MERKLE_TREE]: 'merkleTreeHook',
[HookType.INTERCHAIN_GAS_PAYMASTER]: 'interchainGasPaymaster',
[HookType.AGGREGATION]: 'staticAggregationHook',
[HookType.PROTOCOL_FEE]: 'protocolFee',
[HookType.OP_STACK]: 'opStackHook',
[HookType.ROUTING]: 'domainRoutingHook',
[HookType.FALLBACK_ROUTING]: 'fallbackDomainRoutingHook',
[HookType.PAUSABLE]: 'pausableHook',
[HookType.ARB_L2_TO_L1]: 'arbL2ToL1Hook',
};
Copy link
Contributor

Choose a reason for hiding this comment

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

thank you so much - this has been on my wishlist for so long and it's great to have it fixed finally

): Promise<any> {
const { apiUrl, family } = this.multiProvider.getExplorerApi(chain);

const url = new URL(apiUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

I see we're not switching on the explorer type anymore here, has this verifier been tested against the zksync instance of blockscout? https://zksync.blockscout.com/

would be good to check against zksync etherscan too https://era.zksync.network/

@@ -415,6 +420,7 @@ export class EvmIsmModule extends HyperlaneModule<
factory: new TrustedRelayerIsm__factory(),
contractName: IsmType.TRUSTED_RELAYER,
constructorArgs: [this.args.addresses.mailbox, config.relayer],
implementationAddress: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: omit if undefined

Comment on lines +449 to +485
// TODO: handle logging part
protected async deployStorageMessageIdMultisigIsm({
config,
logger,
}: {
config: MultisigIsmConfig;
logger: Logger;
}): Promise<IMultisigIsm> {
const signer = this.multiProvider.getSigner(this.chain);

const contract = await this.deployer.deployContractFromFactory({
chain: this.chain,
factory: new StorageMessageIdMultisigIsm__factory(),
contractName: IsmType.STORAGE_MESSAGE_ID_MULTISIG,
constructorArgs: [config.validators, config.threshold],
});
return IMultisigIsm__factory.connect(contract.address, signer);
}

// TODO: handle logging part
protected async deployStorageMultisigIsm({
config,
logger,
}: {
config: MultisigIsmConfig;
logger: Logger;
}): Promise<IMultisigIsm> {
const signer = this.multiProvider.getSigner(this.chain);

const contract = await this.deployer.deployContractFromFactory({
chain: this.chain,
factory: new StorageMerkleRootMultisigIsm__factory(),
contractName: IsmType.STORAGE_MERKLE_ROOT_MULTISIG,
constructorArgs: [config.validators, config.threshold],
});
return IMultisigIsm__factory.connect(contract.address, signer);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd combine these two into a single deployStorageMultisigIsm fn, similar to what the deployMultisigIsm function does below

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

Successfully merging this pull request may close these issues.

4 participants