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

Deploy new RFQ Contracts, update script to respond to Ctrl + C, add G… #2255

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

aureliusbtc
Copy link
Contributor

@aureliusbtc aureliusbtc commented Mar 12, 2024

…overnor Role to deploy script

Description
A clear and concise description of the features you're adding in this pull request.

Additional context
Add any other context about the problem you're solving.

Metadata

  • Fixes #[Link to Issue]

Summary by CodeRabbit

  • New Features

    • Expanded configuration options for the bridge protocol, including a new governors entity.
    • Introduced bridge protocol deployments on Arbitrum, mainnet, and Optimism with enhanced functionalities for transaction relaying, dispute handling, role management, and fee setting.
    • Improved deployment and configuration scripts with added interruption handling.
  • Chores

    • Added support for specific chain IDs in Arbitrum, mainnet, and Optimism deployments.

Copy link
Contributor

coderabbitai bot commented Mar 12, 2024

Warning

Rate Limit Exceeded

@trajan0x has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 45 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 5f16395 and 74ebb79.

Walkthrough

The recent updates introduce a new governors entity in the FastBridge configuration, expand the bridge protocol's deployment across Ethereum mainnet, Arbitrum, and Optimism networks with specific chain IDs, and enhance the deployment and configuration scripts with error handling. These changes aim to broaden the protocol's governance, improve its cross-chain functionality, and streamline its deployment process.

Changes

Files Change Summary
.../FastBridge.json, .../.chainId Added governors in config, set chain IDs for Arbitrum (42161), mainnet (1), and Optimism (10), and introduced smart contract deployments for a bridge protocol.
.../ConfigureFastBridge.s.sol Added syncRole call for "governor" role within run function.
.../fb-config.sh, .../fb-deploy.sh Improved script robustness with a trap for SIGINT (Ctrl+C).

"In the realm of code, where bridges span wide,
A rabbit hopped forth, with a gleeful stride.
Across chains it leaped, with ease and grace,
Uniting worlds, in the cyberspace.
🌉🐰✨
'To govern and bridge,' it whispered light,
'In the glow of the moon, and the stars so bright.'"

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: 2

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 9c84da9 and 5f16395.
Files selected for processing (10)
  • packages/contracts-rfq/configs/global/FastBridge.json (1 hunks)
  • packages/contracts-rfq/deployments/arbitrum/.chainId (1 hunks)
  • packages/contracts-rfq/deployments/arbitrum/FastBridge.json (1 hunks)
  • packages/contracts-rfq/deployments/mainnet/.chainId (1 hunks)
  • packages/contracts-rfq/deployments/mainnet/FastBridge.json (1 hunks)
  • packages/contracts-rfq/deployments/optimism/.chainId (1 hunks)
  • packages/contracts-rfq/deployments/optimism/FastBridge.json (1 hunks)
  • packages/contracts-rfq/script/ConfigureFastBridge.s.sol (1 hunks)
  • packages/contracts-rfq/script/fb-config.sh (1 hunks)
  • packages/contracts-rfq/script/fb-deploy.sh (1 hunks)
Files skipped from review due to trivial changes (3)
  • packages/contracts-rfq/deployments/arbitrum/.chainId
  • packages/contracts-rfq/deployments/mainnet/.chainId
  • packages/contracts-rfq/deployments/optimism/.chainId
Additional comments: 5
packages/contracts-rfq/configs/global/FastBridge.json (1)
  • 6-7: The addition of the governors entity in the FastBridge.json configuration file is a significant update that expands the governance capabilities of the FastBridge contracts. Ensure that this addition aligns with the intended governance model and has been thoroughly reviewed for security implications.
packages/contracts-rfq/script/ConfigureFastBridge.s.sol (1)
  • 18-18: The addition of the governor role synchronization within the run function of ConfigureFastBridge.s.sol is a significant update that aligns with the PR's objectives to expand governance capabilities. Ensure that the role ID used (fastBridge.GOVERNOR_ROLE()) correctly matches the intended governance role and that the role synchronization process has been thoroughly reviewed for security implications.
packages/contracts-rfq/deployments/mainnet/FastBridge.json (1)
  • 1-1223: This deployment artifact for the FastBridge contract on mainnet appears comprehensive, including the contract address, constructor arguments, receipt details, and the ABI. Ensure that the deployment details and ABI accurately reflect the actual deployed contract, especially in light of the PR's objectives, such as the addition of the governor role.
packages/contracts-rfq/deployments/arbitrum/FastBridge.json (1)
  • 1-1223: The JSON file appears to be well-structured and correctly formatted, representing the ABI (Application Binary Interface) of the FastBridge smart contract along with deployment details such as the contract address, constructor arguments, and transaction receipt. Here are some specific observations and recommendations:
  1. Contract Address and Constructor Arguments: Ensure that the contract address (0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) and constructor arguments are correct and correspond to the intended deployment on the Arbitrum network. It's crucial that these values are double-checked to prevent any issues related to interacting with the wrong contract instance.

  2. Receipt Details: The transaction receipt includes the transaction hash and block number. Verify that these details accurately reflect the transaction that deployed the contract. This information is essential for auditing and tracking the deployment history.

  3. ABI Completeness: The ABI provided is extensive and covers a wide range of functions, events, and errors. It's important to ensure that the ABI matches the latest version of the compiled contract. Any discrepancies between the ABI and the actual contract code could lead to failed transactions or incorrect interactions with the contract.

  4. Security Considerations: Given the sensitive nature of smart contracts, especially those involved in bridging and financial transactions, it's critical to ensure that all roles and permissions are correctly configured. Pay particular attention to roles like GOVERNOR_ROLE, GUARD_ROLE, and RELAYER_ROLE to ensure they are assigned to the appropriate addresses and that their permissions align with the intended governance model.

  5. Event and Error Definitions: The events and errors defined in the ABI should be reviewed to ensure they cover all necessary scenarios. This includes successful operations, common errors, and edge cases. Properly defined events and errors are crucial for monitoring contract behavior and diagnosing issues.

Overall, the JSON file seems to be in good order. However, due to the critical nature of smart contracts and the irreversible consequences of errors, it's recommended to conduct a thorough audit and testing of the contract and its deployment configuration before finalizing the deployment.

packages/contracts-rfq/deployments/optimism/FastBridge.json (1)
  • 1-1223: The JSON file appears to be well-structured and contains a comprehensive ABI for the FastBridge smart contract, along with deployment details such as the contract address, constructor arguments, and transaction receipt. The ABI includes a wide range of functions and events that cover various aspects of the contract's functionality, including role management, transaction bridging, dispute handling, and fee management.

It's important to ensure that the contract address (0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) and constructor arguments are correct and correspond to the intended deployment on the Optimism network. Additionally, the transaction receipt details, such as the transaction hash and block number, should be verified for accuracy.

The ABI definitions are extensive and seem to cover all necessary functions and events for the FastBridge contract's operation. It includes role-based access control, transaction bridging and relaying, fee management, and error handling through custom error types. Each function and event is clearly defined with input and output parameters, making it easier for developers to interact with the contract.

Overall, the file meets the objectives outlined in the PR description by providing the necessary infrastructure for deploying and interacting with the FastBridge smart contracts on the Optimism network. However, it's crucial to perform additional validations, such as verifying the contract address and constructor arguments against deployment records and testing the contract interactions based on the ABI definitions to ensure everything functions as expected.

packages/contracts-rfq/script/fb-config.sh Outdated Show resolved Hide resolved
packages/contracts-rfq/script/fb-deploy.sh Outdated Show resolved Hide resolved
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 47.91074%. Comparing base (58f7665) to head (74ebb79).
Report is 45 commits behind head on master.

Files Patch % Lines
...ges/contracts-rfq/script/ConfigureFastBridge.s.sol 0.00000% 1 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #2255         +/-   ##
===================================================
- Coverage   47.91251%   47.91074%   -0.00178%     
===================================================
  Files            366         366                 
  Lines          27066       27067          +1     
  Branches         132         132                 
===================================================
  Hits           12968       12968                 
- Misses         12757       12758          +1     
  Partials        1341        1341                 
Flag Coverage Δ
solidity 53.76344% <0.00000%> (-0.29061%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cloudflare-workers-and-pages bot commented Mar 12, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 74ebb79
Status: ✅  Deploy successful!
Preview URL: https://743f3229.sanguine-fe.pages.dev
Branch Preview URL: https://rfq-deploy-new.sanguine-fe.pages.dev

View logs

Copy link
Collaborator

@ChiTimesChi ChiTimesChi left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@ChiTimesChi ChiTimesChi merged commit b3a51e2 into master Mar 15, 2024
66 of 69 checks passed
@ChiTimesChi ChiTimesChi deleted the rfq/deploy-new branch March 15, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants