-
Notifications
You must be signed in to change notification settings - Fork 28
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
Deploy: blast SynapseRouter
with verification
#319
Deploy: blast SynapseRouter
with verification
#319
Conversation
WalkthroughThe recent updates focus on enhancing the deployment process for the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to path filters (5)
deployments/blast/SynapseRouter.json
is excluded by:!**/*.json
script/bytecode/SwapQuoter.json
is excluded by:!**/*.json
script/configs/Create2Factory.salts.json
is excluded by:!**/*.json
script/configs/blast/SynapseRouter.dc.json
is excluded by:!**/*.json
script/solc/SynapseRouter.json
is excluded by:!**/*.json
Files selected for processing (6)
- script/router/DeployRouterV1.CREATE2.s.sol (1 hunks)
- script/router/DeployRouterV1.s.sol (3 hunks)
- script/router/deploy-router.sh (1 hunks)
- script/sh/solc.sh (2 hunks)
- script/templates/BasicSynapse.s.sol (2 hunks)
- script/templates/BasicUtils.sol (1 hunks)
Additional comments: 9
script/router/deploy-router.sh (1)
- 8-11: The script includes a temporary fix for a Foundry bug and uses
solc.sh
for compilingSynapseRouter
. Ensure that thesolc.sh
script correctly handles the compilation and bytecode generation as expected. Additionally, verify that theDeployRouterV1.s.sol
script is correctly set up to receive and process the passed arguments for deployment.script/sh/solc.sh (1)
- 23-23: The script saves the bytecode in a new directory (
./script/solc/
). Ensure that all references to bytecode files in other scripts or parts of the project have been updated to reflect this change in directory structure.script/router/DeployRouterV1.CREATE2.s.sol (1)
- 6-25: The
DeployRouterV1CREATE2
contract uses thedeployAndSave
method with a callback to deploy theSynapseRouter
contract using CREATE2. Ensure that thegetConstructorArgs
function correctly encodes the constructor arguments forSynapseRouter
. Additionally, verify that the deployment salt and address uniqueness are properly managed to avoid collisions or unintended overwrites.script/router/DeployRouterV1.s.sol (2)
- 14-19: The
deployAndSave
method is used to deploy theSynapseRouter
contract with constructor arguments obtained fromgetConstructorArgs
. Ensure that thedeploySolcGenerated
method correctly deploys the contract using bytecode generated by solc. Additionally, verify that the constructor arguments are correctly encoded and passed to the contract.- 41-41: The
getConstructorArgs
function is introduced to handle the constructor arguments forSynapseRouter
. Ensure that the addresses forSynapseBridge
andOWNER_ADDR
are correctly retrieved and encoded. This is crucial for the correct initialization of theSynapseRouter
contract.script/templates/BasicUtils.sol (1)
- 120-125: The
getSolcBytecode
function is added to retrieve contract bytecode generated by solc. Ensure that the path constructed (script/solc/
) matches the directory structure used by thesolc.sh
script for saving bytecode files. Additionally, verify that the JSON structure of the saved bytecode files correctly matches the expected format for reading the.bytecode
key.script/templates/BasicSynapse.s.sol (3)
- 115-126: The
deploySolcGenerated
function is a valuable addition, enabling deployment usingsolc
-generated bytecode. This aligns with the PR's objectives to improve the deployment process. However, consider the following:
- Ensure that
getSolcBytecode
securely retrieves the bytecode and handles errors gracefully.- Verify that the constructor arguments are correctly formatted and encoded with the bytecode.
- Confirm that this method of deployment has been thoroughly tested, especially for contracts with complex constructor arguments.
- 156-170: The
deploySolcGeneratedCreate2
function introduces deterministic deployment usingcreate2
andsolc
-generated bytecode, which is a significant enhancement. Consider the following:
- Ensure that
getSolcBytecode
is secure and error-resistant.- Validate the handling and generation of
nextDeploymentSalt
for predictability and uniqueness.- It's important to test this function extensively, particularly for contracts that might have edge cases in their constructor arguments or deployment logic.
- 136-136: The updated error message in the
deployCode
function to "Deployment failed" is a minor but positive change, enhancing clarity on deployment issues. Ensure that this message is consistent with other error handling practices throughout the deployment scripts.
# This script saves bytecode for a contract into "./script/solc/<contract>.json" | ||
# Usage: ./script/sh/solc.sh <contract> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script's purpose is clearly stated, and the usage message is helpful. However, ensure that the directory ./script/solc/
is created before attempting to save bytecode files to it, as the script does not currently check for or create the directory if it does not exist.
Pull Request Test Coverage Report for Build 8174755715Details
💛 - Coveralls |
Description
Redeploys
SynapseRouter
on Blast, as due to the Foundry bug the previously deployed bytecode wasn't matching the compiled bytecode during verification.Checklist
Summary by CodeRabbit
SynapseRouter
contract for improved efficiency and reliability.0.8.17
for all relevant scripts and contracts.