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

deployed stargate to gnosis #993

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

0xDEnYO
Copy link
Contributor

@0xDEnYO 0xDEnYO commented Feb 12, 2025

Which Jira task belongs to this PR?

https://lifi.atlassian.net/browse/LF-12362

Why did I implement it this way?

Checklist before requesting a review

Checklist for reviewer (DO NOT DEPLOY and contracts BEFORE CHECKING THIS!!!)

  • I have checked that any arbitrary calls to external contracts are validated and or restricted
  • I have checked that any privileged calls (i.e. storage modifications) are validated and or restricted
  • I have ensured that any new contracts have had AT A MINIMUM 1 preliminary audit conducted on by <company/auditor>

Copy link
Contributor

coderabbitai bot commented Feb 12, 2025

Warning

Rate limit exceeded

@0xDEnYO has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 30 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

Reviewing files that changed from the base of the PR and between 2f9be22 and 4a2138c.

📒 Files selected for processing (4)
  • config/stargate.json (1 hunks)
  • deployments/_deployments_log_file.json (2 hunks)
  • deployments/gnosis.diamond.json (2 hunks)
  • script/deploy/_targetState.json (1 hunks)

Walkthrough

This pull request updates multiple configuration and deployment files. In config/stargate.json, the tokenMessaging section is revised by updating various chain addresses and support statuses, along with restoring some entries. The deployments log is enhanced with new gnosis entries for production versions, and new facet entries are added in deployments/gnosis.json. Additionally, the script/deploy/_targetState.json file now includes updates to the LiFiDiamond configuration across multiple blockchain environments, adding new facets and updating existing facet versions.

Changes

File Path(s) Change Summary
config/stargate.json Modified the tokenMessaging section: removed and re-added the polygon entry, added new entries for aurora, avalanche, base, gnosis, gravity, kaia, linea, and scroll, and updated the fantom entry to indicate lack of support by Stargate V2.
deployments/_deployments_log_file.json, deployments/gnosis.json Added new deployment log entries for gnosis with production versions 1.0.1 and 1.1.0, and appended new facet entries (StargateFacetV2 and ReceiverStargateV2) to the configuration in deployments/gnosis.json.
script/deploy/_targetState.json Updated the LiFiDiamond configuration across multiple environments: added new facets (i.e., StargateFacetV2 and ReceiverStargateV2) and updated several facet versions (including CalldataVerificationFacet, ERC20Proxy, Executor, LiFuelFeeCollector, TokenWrapper, and LiFiDEXAggregator in sonic).

Possibly related PRs

  • Deploy LIFI to Worldchain #861: Introduces a configuration section for "worldchain" that aligns with similar changes in the config/stargate.json file.
  • Redeploy stargate v2 #763: Updates addresses and deployment entries related to the StargateFacetV2 contract, showing a direct code-level connection.

Suggested labels

AuditNotRequired, AuditCompleted

Suggested reviewers

  • ezynda3
  • maxklenk

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>, please review it.
    • Generate unit testing code 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@lifi-action-bot lifi-action-bot marked this pull request as draft February 12, 2025 09:56
@0xDEnYO 0xDEnYO marked this pull request as ready for review February 12, 2025 09:56
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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
deployments/_deployments_log_file.json (1)

24472-24473: Consider using deterministic deployment with SALT.

The SALT field is empty for both deployments. Consider using a deterministic deployment approach with CREATE2 by providing a SALT value. This helps in verifying that the same contract is deployed across different environments.

Also applies to: 24766-24767

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 520e416 and 2f9be22.

📒 Files selected for processing (4)
  • config/stargate.json (1 hunks)
  • deployments/_deployments_log_file.json (2 hunks)
  • deployments/gnosis.json (1 hunks)
  • script/deploy/_targetState.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
script/deploy/_targetState.json (2)
Learnt from: mirooon
PR: lifinance/contracts#985
File: script/deploy/_targetState.json:0-0
Timestamp: 2025-02-12T09:44:12.961Z
Learning: The bsca network intentionally maintains different facet versions between staging and production environments, specifically:
1. CalldataVerificationFacet: v1.1.1 in staging vs v1.1.2 in production
2. EmergencyPauseFacet: present only in production
3. Permit2Proxy: present only in production
Learnt from: ezynda3
PR: lifinance/contracts#807
File: script/deploy/_targetState.json:164-164
Timestamp: 2024-12-03T11:01:57.084Z
Learning: Version differences in `CalldataVerificationFacet` between staging and production are acceptable and not an issue.
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: enforce-min-test-coverage
  • GitHub Check: run-unit-tests
  • GitHub Check: run-unit-tests
  • GitHub Check: enforce-min-test-coverage
  • GitHub Check: generate-tag
🔇 Additional comments (5)
deployments/gnosis.json (1)

38-40: LGTM! Stargate facets deployed to gnosis.

The addresses for StargateFacetV2 and ReceiverStargateV2 match the configuration in script/deploy/_targetState.json for the gnosis production environment.

config/stargate.json (1)

57-57: Note: Fantom is not supported by Stargate V2.

The configuration indicates that Fantom is not supported by Stargate V2. Please ensure that any existing integrations with Fantom are properly handled or disabled.

script/deploy/_targetState.json (1)

265-267: Verify version differences between environments.

The gnosis environment uses different versions compared to other environments:

  • StargateFacetV2: v2.2.0 (others use v1.0.1)
  • ReceiverStargateV2: v1.1.0 (others use v1.0.0 or v1.1.0)

Please confirm if these version differences are intentional.

Run the following script to check version differences:

❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Description: Check version differences for StargateFacetV2 and ReceiverStargateV2 across environments.

echo "StargateFacetV2 versions:"
rg -A 1 '"StargateFacetV2":'

echo -e "\nReceiverStargateV2 versions:"
rg -A 1 '"ReceiverStargateV2":'

Length of output: 22645


Confirmed: Version discrepancies exist between environments.

The grep output shows that while most environment configurations in script/deploy/_targetState.json use:

  • StargateFacetV2: "1.0.1"
  • ReceiverStargateV2: "1.0.0"

there is a distinct block—presumably for the gnosis environment—that sets:

  • StargateFacetV2: "2.2.0"
  • ReceiverStargateV2: "1.1.0"

Please verify with the team that these version differences are intentional.

deployments/_deployments_log_file.json (2)

24470-24470: ⚠️ Potential issue

Fix incorrect deployment timestamps.

Both deployment entries have timestamps set in the future (2025). This appears to be incorrect as deployments should have current or past timestamps.

Please update the timestamps to reflect the actual deployment dates.

Also applies to: 24764-24764

⛔ Skipped due to learnings
Learnt from: ezynda3
PR: lifinance/contracts#823
File: deployments/_deployments_log_file.json:10542-10543
Timestamp: 2024-11-21T08:17:27.878Z
Learning: When reviewing deployment timestamps in `deployments/_deployments_log_file.json`, ensure that the timestamps are accurately compared with the current date to avoid incorrectly flagging valid timestamps as future deployment dates.
Learnt from: ezynda3
PR: lifinance/contracts#861
File: deployments/_deployments_log_file.json:22488-22488
Timestamp: 2024-11-22T07:19:51.143Z
Learning: In `deployments/_deployments_log_file.json`, deployment timestamps may appear to be set in the future and should not be flagged as invalid.

24471-24471: Verify constructor arguments and contract addresses.

The constructor arguments contain multiple addresses that should be verified for correctness. Let's validate these addresses and their roles:

Also applies to: 24765-24765

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Verify the addresses in constructor args and deployment addresses

# Extract and decode constructor args
echo "Version 1.0.1 constructor args:"
echo "0x000000000000000000000000af368c91793cb22739386dfcbbb2f1a9e4bcbebf" | \
  python3 -c "import sys; print('Address:', '0x' + sys.stdin.read().strip()[26:])"

echo -e "\nVersion 1.1.0 constructor args (multiple addresses):"
ARGS="0x000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f0000000000000000000000002dfadab8266483bed9fd9a292ce56596a2d1378d000000000000000000000000af368c91793cb22739386dfcbbb2f1a9e4bcbebf0000000000000000000000001a44076050125825900e736c501f859c50fe728c00000000000000000000000000000000000000000000000000000000000186a0"
for i in {0..3}; do
  start=$((26 + i*64))
  echo "Address $((i+1)): 0x${ARGS:$start:40}"
done
echo "Value: 0x${ARGS:282:64}"

# Check if these addresses have code deployed
echo -e "\nChecking deployment addresses on Gnosis chain:"
echo "Version 1.0.1: 0xCB68AAcEb848E5007B56b1ff09D240CE8946B4EC"
echo "Version 1.1.0: 0x0dC56076590CdF0efc37114273f02f45A96B5500"

Length of output: 1798


Verification Complete: Constructor Arguments and Deployment Addresses Are Correct

  • Version 1.0.1 constructor arg correctly decodes to:
    0xaf368c91793cb22739386dfcbbb2f1a9e4bcbebf
  • Version 1.1.0 constructor arguments correctly extract the following addresses:
    • Address 1: 0x156cebba59deb2cb23742f70dcb0a11cc775591f
    • Address 2: 0x2dfadab8266483bed9fd9a292ce56596a2d1378d
    • Address 3: 0xaf368c91793cb22739386dfcbbb2f1a9e4bcbebf
    • Address 4: 0x1a44076050125825900e736c501f859c50fe728c
  • The parsed value is as expected (0x00000000000000000000000000000000000186a0)
  • Deployment addresses on the Gnosis chain are correctly listed:
    • Version 1.0.1: 0xCB68AAcEb848E5007B56b1ff09D240CE8946B4EC
    • Version 1.1.0: 0x0dC56076590CdF0efc37114273f02f45A96B5500

All extracted addresses and deployment addresses appear to have been processed correctly. No issues were identified during the verification.

config/stargate.json Show resolved Hide resolved
@lifi-action-bot
Copy link
Collaborator

Test Coverage Report

Line Coverage: 78.66% (2238 / 2845 lines)
Function Coverage: 84.71% ( 388 / 458 functions)
Branch Coverage: 39.60% ( 221 / 558 branches)
Test coverage (78.66%) is above min threshold (78%). Check passed.

@0xDEnYO 0xDEnYO enabled auto-merge (squash) February 12, 2025 10:05
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.

4 participants