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: add registry #63

Merged
merged 24 commits into from
Dec 27, 2023
Merged

feat: add registry #63

merged 24 commits into from
Dec 27, 2023

Conversation

gzeoneth
Copy link
Member

This PR feature storing the deployment addresses in the factory upon deployment to allow it to act as a registry of token bridges. Rollup owner can also manually set the registry value for their rollup if they have a non-standard token bridge deployment. Some other changes including:

  • Allow resending the deployment to child chain
  • Replacing getCanonical... getters with inboxToL1Deployment and inboxToL2Deployment
  • Make l2 multi-call template setup like the other templates
  • Shortened salts and removed redundant salt to reduce code size
  • Flattening internal functions to reduce code size
  • Aliasing the rollup owner on child chain if it has code on parent chain
  • Improved e2e ci, test, and deployment scripts

@gzeoneth gzeoneth requested review from yahgwai and gvladika December 19, 2023 09:09
@cla-bot cla-bot bot added the cla-signed label Dec 19, 2023
gzeoneth and others added 5 commits December 19, 2023 17:28
…ecutor-test

chore: add missing UpgradeExecutor test
* Draft implementation of constructor bytecode getter

* Add function for getting the constructor bytecode

* Check constructor size and throw error if unexpected one

* Add constructor check rationale

* Refactor

* Add to CI

* Check CI will fail if constructor is modified

* Revert "Check CI will fail if constructor is modified"

This reverts commit 6389b4a.

* Clean up

* Change _creationCodeFor so that it uses the same constructor as the one compiler would generate

This will enable source code verification of the deployed token bridge contracts on the child chain

* Init logic contract

* Make deployment test more complete

* Remove comment

* Add deployment script

* Calculate properly canonical address of L1 router

* feat: remove canonicalL2FactoryAddress dependency

* docs: explain

* format: fix

* Extract code creation function to lib

* fix: remove create1 import

* fix: fmt

* feat: add create1 util

* feat: remove logic salt

* fix: interface name

* Verify creation code generation

* feat: cache and store deployment

* refactor: lower contract size

* feat: getTokenBridgeDeployment

* Use chai test format

* Add aeWETH/UpgradeExecutor constructor size check

* feat: add e2e tests to CI (#18)

* Add e2e tests to CI

* Use custom testnode branch

* Set testnode ref

* Set correct ref

* Specify main

* Update comment

Co-authored-by: gzeon <hng@offchainlabs.com>

* Remove intermediary function

* Update out-of-date comments

* feat: disable template update

* chore: rename error

* ci: wait-for-l3

* ci: switch back to main

* Test canonical address for multicall, beacon proxy and proxy admin are correct

* refactor: _deployProxyWithSalt

* fix: remove Create1 lib and use empty salt instead

* fix: beacon deploy

* Update local deployment scripts

* Add test info

* Refactor test to support latest contract changes

* Fetch rollup owner from logs

* Update prod deployment script

* Remove unnecessary structs

* refactor: inline internal methods

* refactor: flatten more

* refactor: _computeAddressAtNonce0

* refactor: remove return val

* refactor: separate l1 l2 deployment

* feat: add deployment setter

* fix: l2 multicall template

* Bring deployment and test scripts up to date

* docs: sendRetryable

* fix: remove some redundent logic

* Run e2e tests on chain that uses fee token

* Change action name

* fix: remove getCanonicalL1RouterAddress

* fix: do not set weth when isUsingFeeToken

* docs: add more comments

* docs: _computeAddressAtNonce0

* refactor: trycatch

* rename: event OrbitTokenBridgeDeploymentSet

* feat: L1AtomicTokenBridgeCreator_AlreadyCreated

* Remove unused error

* Add L1AtomicTokenBridgeCreator init tests

* Test setTemplates

* refactor: calc salt in deploySeedProxy

* refactor: inline oneline methods

* Add L1AtomicTokenBridgeCreator init tests

* Test setTemplates

* Update nitro-contracts ref for testing

* Add createTokenBridge tests

* Add more L1 creator tests

* Test ERC20 chain

* Add skeleton for L2AtomicTokenBridgeFactory tests

* Add more checks for L2 factory

* fix: unsalted deployment

* Complete L2 factory tests

* Add init check for StandardArbERC20 logic

* Fix L2 multicall address prediction

* test: AtomicTokenBridgeCreator in foundry

* test: deployment fail case

* feat: allow retry

* fix: typo

* test: fix new test

* docs: more comments

* docs: explain more

* refactor: rename to resend

* If rollupOwner is a contract, alias its address when sending to L2

* Move aliasing rollupOwner to L1 creator

* Add more L1 factory tests

* Add missing L1 factory tests

* refactor: scope chainId to reduce stack size

* Stack too deep fix

* Adapt tests

---------

Co-authored-by: gzeon <hng@offchainlabs.com>
Co-authored-by: gzeon <im@gzeon.dev>
Copy link
Contributor

@gvladika gvladika left a comment

Choose a reason for hiding this comment

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

LGTM

@gzeoneth gzeoneth merged commit eebc6ac into main Dec 27, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants