Skip to content

Conversation

@pxrl
Copy link
Contributor

@pxrl pxrl commented Aug 7, 2023

This fix uses zkSync-specific packages, which are necessary for contract deployment on zkSync. The zkEthBridge configurable is also removed, since it is no longer needed for SpokePool deployment on zkSync. Note also that there is explicit allowance for delegatecall in this script. It currently incorrectly resolves the upstream AddressUpgradeable contract, rather than the local AddressLibUpgradeable. See the following commit for more details: 02cff2c

The relevant zkSync documentation can be found here:
https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-deploy.html
https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-upgradable.html

This fix uses zkSync-specific packages, which are necessary for contract
deployment on zkSync. The zkEthBridge configurable is also removed,
since it is no longer needed for SpokePool deployment on zkSync. Note
also that there is explicit allowance for delegatecall in this script.
It currently incorrectly resolves the upstream AddressUpgradeable
contract, rather than the local AddressLibUpgradeable. See the following
commit for more details: 02cff2c

The relevant zkSync documentation can be found here:
https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-deploy.html
https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-upgradable.html

Note that there are some outstanding issues, since deploying OZ
upgradeable contracts seems to bypass the normal hardhat-deploy
workflow, meaning that deployment metadata is not saved to
deployments/<network>.
Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

How can we overcome the missing deployment metadata issue?

pxrl added 5 commits August 7, 2023 23:08
These were recreated by fixing the deployment scripts and deploying a
new contract to zkSync. The deployment artifacts are now saved
automatically. It was necessary to update the deployed address before
committing.

As a sanity check, the deployed bytecode for the original deployment and
the 2nd deployment are identical, and both point to implementation
contract 0x21aa92c23BC2A0E2DaB0335F5f864757FE68c0A7.

See the original and 2nd deployments respectively:
explorer.zksync.io/address/0xE0B015E54d54fc84a6cB9B666099c46adE9335FF
explorer.zksync.io/address/0x02D2B95F631E0CF6c203E77f827381B0885F7822
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicholaspai Not sure whether we actually need this, but I added it just to be on the safe side. I saw that you previously added .upgradable for the zksync-goerli deployments, but the fact that it's hidden in a . folder makes me unsure if it really needs to be part of the repo.

@pxrl pxrl requested review from mrice32 and nicholaspai August 8, 2023 12:20
pxrl added 4 commits August 8, 2023 17:08
The Ethereum SpokePool deployment script was unable to correctly resolve
the HubPool address because it assumed that a companionNetworks entry
was defined in the HardhatUserConfig in hardhat.config.ts. Resolve this
by adjusting the Ethereum (HubPool) SpokePool deployment script to avoid
using companionNetworks.

Additionally, the other SpokePool deployment scripts incorrectly logged
the chain ID for the HubPool deployment. This change now factors out the
task of resolving the chain IDs and returns them in an unambiguous form.
This also simplifies most of the deployment scripts.
@pxrl pxrl merged commit 9801b13 into master Aug 8, 2023
@pxrl pxrl deleted the pxrl/zkSyncDeploy branch August 8, 2023 15:34
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.

3 participants