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

fix: add correct holesky + sepolia addrs #145

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

Conversation

MaxMustermann2
Copy link
Collaborator

@MaxMustermann2 MaxMustermann2 commented Jan 27, 2025

Summary by CodeRabbit

  • Configuration Updates
    • Updated contract address for the client gateway logic in the client chain.
    • Added a new configuration section for the Holesky network, including multiple contract deployments.
  • Improvements
    • Enhanced error handling for environment variable retrieval in the deployment process, ensuring fallback defaults are set for critical values.

Copy link
Contributor

coderabbitai bot commented Jan 27, 2025

Walkthrough

The pull request introduces updates to the script/deployedContracts.json file, focusing on two main changes. First, the clientChain section sees an update to the clientGatewayLogic contract address. Secondly, a completely new holesky section is added, which includes multiple contract addresses for various components such as beacons, implementations, oracles, and other blockchain-related contracts. Additionally, the script/integration/1_DeployBootstrap.s.sol file has been modified to streamline the initialization process and improve error handling related to environment variable retrieval.

Changes

File Change Summary
script/deployedContracts.json - Updated clientGatewayLogic address in clientChain section
- Added new holesky section with 14 contract addresses
script/integration/1_DeployBootstrap.s.sol - Removed exos string array and replaced it with a hardcoded array in registerValidators function
- Updated environment variable retrieval for pubkey, signature, and depositDataRoot using vm.envOr function

Possibly related PRs

  • add testnet v5 deployment addresses #95: This PR also modifies the script/deployedContracts.json file, specifically updating the clientChain section and includes changes to the clientGatewayLogic, which is directly related to the changes made in the main PR.
  • docs(testnet-v6): update deployedContracts.json #107: This PR updates the script/deployedContracts.json file, including modifications to the clientChain section and the clientGatewayLogic, making it relevant to the changes in the main PR.

Suggested reviewers

  • bwhour
  • cloud8little
  • adu-web3
  • magj2006

Poem

🐰 In the realm of blockchain's dance,
Contracts shift with each new glance,
Holesky rises, addresses gleam,
A digital landscape, a coder's dream!
Deployed with precision, rabbit's delight 🚀


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 or @coderabbitai title 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.

Copy link

github-actions bot commented Jan 27, 2025

✅ The Solhint workflow has completed successfully. Check the workflow run for details. (ced8e52)

Copy link

github-actions bot commented Jan 27, 2025

✅ The Forge CI workflow has completed successfully. Check the workflow run for details. (ced8e52)

Copy link

github-actions bot commented Jan 27, 2025

✅ The Slither Analysis workflow has completed successfully. Check the workflow run for details. (ced8e52)

Copy link

github-actions bot commented Jan 27, 2025

✅ The Compare Storage Layouts workflow has completed successfully. Check the workflow run for details. (ced8e52)

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: 0

🔭 Outside diff range comments (1)
script/integration/1_DeployBootstrap.s.sol (1)

Line range hint 471-474: Security: Improve random number generation.

The current implementation uses block.timestamp and block.prevrandao for random number generation, which could be manipulated by validators. While this might be acceptable for testing, it should not be used in production.

Consider using a more secure random number generation method:

-    function random(uint256 _range) internal view returns (uint256) {
-        // Basic random number generation; consider a more robust approach for production
-        return (uint256(keccak256(abi.encodePacked(block.timestamp, block.prevrandao))) % (_range - 1)) + 1;
-    }
+    function random(uint256 _range) internal view returns (uint256) {
+        // For testing only - In production, use a secure randomness source like Chainlink VRF
+        bytes32 entropy = keccak256(abi.encodePacked(
+            block.timestamp,
+            block.prevrandao,
+            msg.sender,
+            address(this)
+        ));
+        return (uint256(entropy) % (_range - 1)) + 1;
+    }
🧹 Nitpick comments (1)
script/integration/1_DeployBootstrap.s.sol (1)

Line range hint 67-77: Security: Consider environment variables for test private keys.

The script contains hardcoded private keys for testing. While these are Anvil's default keys, it's generally better to load such values from environment variables to prevent accidental commits of real private keys.

Consider refactoring to use environment variables with fallbacks:

-        ANVIL_VALIDATORS[0] = uint256(0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80);
-        ANVIL_VALIDATORS[1] = uint256(0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d);
-        ANVIL_VALIDATORS[2] = uint256(0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a);
+        ANVIL_VALIDATORS[0] = uint256(vm.envOr("TEST_VALIDATOR_KEY_1", "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"));
+        ANVIL_VALIDATORS[1] = uint256(vm.envOr("TEST_VALIDATOR_KEY_2", "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"));
+        ANVIL_VALIDATORS[2] = uint256(vm.envOr("TEST_VALIDATOR_KEY_3", "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"));
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d000963 and ced8e52.

📒 Files selected for processing (1)
  • script/integration/1_DeployBootstrap.s.sol (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: setup / install
🔇 Additional comments (4)
script/integration/1_DeployBootstrap.s.sol (4)

245-246: LGTM! Helpful comments added.

The added comments provide useful guidance for debugging deposit-related issues by checking addresses and validator configuration values.


147-150: Verify the hardcoded signature fallback value.

The default signature value is used when the environment variable is not set. Ensure this is a valid test signature and not accidentally copied from production.

✅ Verification successful

✓ The signature is confirmed to be test-specific

The signature is only used in the integration test script and does not appear anywhere else in the codebase, confirming it's a test-specific value and not a production signature.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any other occurrences of this signature in the codebase
# to ensure it's not used in production configurations
rg -l "922a316bdc3516bfa66e88259d5e93e339ef81bc85b70e6c715542222025a28fa1e3644c853beb8c3ba76a2c5c03b726081bf605bde3a16e1f33f902cc1b6c01093c19609de87da9383fa4b1f347bd2d4222e1ae5428727a7896c8e553cc8071"

Length of output: 243


142-145: Verify the hardcoded pubkey fallback value.

The default pubkey value is used when the environment variable is not set. Ensure this is a valid test key and not accidentally copied from production.

✅ Verification successful

The hardcoded pubkey fallback appears to be a safe test value

The pubkey is isolated to the integration deployment script and isn't used anywhere else in the codebase, suggesting it's specifically designated for testing purposes. The vm.envOr pattern allows for easy override via environment variables when needed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any other occurrences of this pubkey in the codebase
# to ensure it's not used in production configurations
rg -l "98db81971df910a5d46314d21320f897060d76fdf137d22f0eb91a8693a4767d2a22730a3aaa955f07d13ad604f968e9"

Length of output: 147


Script:

#!/bin/bash
# Search for any documentation or test files mentioning this pubkey
rg -t md -t txt -l "98db81971df910a5d46314d21320f897060d76fdf137d22f0eb91a8693a4767d2a22730a3aaa955f07d13ad604f968e9"

# Check test files
fd -e t.sol -x rg -l "98db81971df910a5d46314d21320f897060d76fdf137d22f0eb91a8693a4767d2a22730a3aaa955f07d13ad604f968e9" {}

Length of output: 242


152-154: Verify the hardcoded depositDataRoot fallback value.

The default depositDataRoot value is used when the environment variable is not set. Ensure this is a valid test value and not accidentally copied from production.

✅ Verification successful

✓ Confirmed: This is a valid test-specific depositDataRoot value

The depositDataRoot is correctly used as a default test value in the integration script:

  • It's only used in test code and is overridable via the INTEGRATION_DEPOSIT_DATA_ROOT environment variable
  • The script includes documentation explaining its relationship with specific test addresses
  • Production code doesn't contain any hardcoded depositDataRoot values
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any other occurrences of this depositDataRoot in the codebase
# to ensure it's not used in production configurations
rg -l "456934ced8f08ff106857418a6d885ba69d31e1b7fab9a931be06da25490cd1d"

Length of output: 115


Script:

#!/bin/bash
# Search for other depositDataRoot occurrences to understand its usage pattern
rg -i "depositDataRoot" -A 2 -B 2

Length of output: 7223

Copy link
Collaborator

@bwhour bwhour left a comment

Choose a reason for hiding this comment

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

looks good.

@@ -6,7 +6,7 @@
"bootstrapLogic": "0xB97A39004Ba6900FAE801Ac04F8ce4DA70689879",
"capsuleBeacon": "0xB8D032a30a3B950CBcc6c1689E2381ab4290D4BB",
"capsuleImplementation": "0x8638502De2001e0dF71BbB5dd503E2008b2Ae948",
"clientGatewayLogic": "0x92A645a44DFf3e5499F9e6A1d6738520971267AA",
"clientGatewayLogic": "0x591433Ba4bD17973bbD02F201D4256e42fed141B",
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we change the key clientChain to sepolia since we have two client chains right now, and jobs in workflow may also need to be updated if the key changed

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.

4 participants