Skip to content

YNU-774: Updated Contract Integration#588

Merged
dimast-x merged 6 commits intomainfrom
feat/new-contract-support
Feb 25, 2026
Merged

YNU-774: Updated Contract Integration#588
dimast-x merged 6 commits intomainfrom
feat/new-contract-support

Conversation

@dimast-x
Copy link
Copy Markdown
Contributor

@dimast-x dimast-x commented Feb 25, 2026

Summary by CodeRabbit

  • New Features

    • Added capability to register node validators with the network.
  • Configuration

    • Updated hub contract address across deployment configurations.

@dimast-x dimast-x requested a review from a team as a code owner February 25, 2026 13:47
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

This pull request updates contract deployment configurations for Ethereum Sepolia testnet, introduces new deployment artifacts and broadcast records for ChannelEngine, ChannelHub, and escrow engine contracts, and adds a Forge script for registering node validators with ChannelHub. The configuration changes update contract address references to reflect new deployments.

Changes

Cohort / File(s) Summary
Configuration & Address Updates
README.md, clearnode/chart/config/v1-rc/blockchains.yaml
Added documentation comment and updated ChannelHub contract address from 0xB5E7D2B8... to 0x09ffB9eA... in blockchain configuration.
Deployment Metadata
contracts/deployments/11155111/ChannelEngine.sol_ChannelEngine/..., contracts/deployments/11155111/ChannelHub.sol_ChannelHub/..., contracts/deployments/11155111/EscrowDepositEngine.sol_EscrowDepositEngine/..., contracts/deployments/11155111/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/...
Added four new deployment metadata files recording contract deployment details including deployer, transaction hash, timestamp, and linked contract references for Sepolia testnet (chain 11155111).
Broadcast Artifacts
contracts/broadcast/RegisterNodeValidator.s.sol/11155111/run-1772029057181.json, contracts/broadcast/RegisterNodeValidator.s.sol/11155111/run-latest.json
Added two broadcast execution artifacts capturing registerNodeValidator transaction calls with corresponding receipts and event logs on Sepolia testnet.
Validator Registration Script
contracts/script/RegisterNodeValidator.s.sol
Implemented new Forge script contract for registering node validators with ChannelHub, including EIP-191 message signing, environment variable configuration, and validation checks for addresses and keys.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • philanton

Poem

🐰 A validator's tale in scripts and deploys,
With ChannelHub's new address—oh, what joys!
Metadata and broadcasts dance in the chain,
Smart contracts registered, none in vain,
Ethereum Sepolia gets its new gain! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'YNU-774: Updated Contract Integration' is vague and generic, using the non-descriptive term 'Updated Contract Integration' without clarifying the primary change, despite multiple significant updates including new deployment metadata, contract registration scripts, and configuration changes. Revise the title to be more specific about the main change, such as 'Add RegisterNodeValidator script and deploy ChannelHub contracts' or 'Integrate ChannelHub and related contract deployments on Sepolia testnet'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/new-contract-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @dimast-x, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request, despite its title "New Contract Integration," primarily involves a minor update to the README.md file. The change introduces an HTML comment that appears to be a temporary note regarding a branch intended for future updates related to smart contracts ("sc"), clearnode, and SDK components. No functional code changes or actual contract integrations are present in this pull request.

Highlights

  • Discrepancy between Title and Changes: The pull request is titled "New Contract Integration," suggesting a significant feature, but the actual changes are limited to adding a single HTML comment in the README.md file.
  • README Update: An HTML comment was added to the README.md file, indicating a branch for future updates related to "sc," "clearnode," and "sdk."
Changelog
  • README.md
    • Added an HTML comment to the end of the file.
Activity
  • No review comments or activity have been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dimast-x dimast-x changed the title New Contract Integration Updated Contract Integration Feb 25, 2026
@dimast-x dimast-x changed the title Updated Contract Integration Updated Contract Integration (Contract, Clearnode, SDK) Feb 25, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a minor change to the README.md file, adding an HTML comment. Since this change doesn't introduce any functional changes or potential issues, the review focuses on ensuring the change doesn't negatively impact the document's readability or maintainability.

Copy link
Copy Markdown
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: 2

🧹 Nitpick comments (3)
contracts/script/RegisterNodeValidator.s.sol (2)

6-6: Remove the unused MessageHashUtils import and using declaration.

The import on line 6 and the using MessageHashUtils for bytes declaration on line 33 are unused in this contract — the EIP-191 hashing is performed inside TestUtils.signEip191. Remove both to improve clarity.

Diff
-import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
-
 import {TestUtils} from "../test/TestUtils.sol";
 contract RegisterNodeValidator is Script {
-    using MessageHashUtils for bytes;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contracts/script/RegisterNodeValidator.s.sol` at line 6, Remove the unused
OpenZeppelin import and using declaration: delete the line importing
MessageHashUtils and the `using MessageHashUtils for bytes` declaration in
RegisterNodeValidator.s.sol, since EIP-191 hashing is already handled by
TestUtils.signEip191 and those symbols (MessageHashUtils / using
MessageHashUtils for bytes) are never referenced in this contract.

8-8: Reconsider necessity of TestUtils import in deployment script.

RegisterNodeValidator.s.sol is the only non-test file that imports TestUtils. While TestUtils lives in the test directory, the actual risk of tight coupling is minimal—only signEip191 and buildAndSignValidatorRegistration are used by this script, and any removal of TestUtils would fail at compile time, not silently. Consider whether extracting these signing utilities to a shared src/ library is worth the refactoring effort, but this is not a critical architectural concern given the current scope of usage.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contracts/script/RegisterNodeValidator.s.sol` at line 8,
RegisterNodeValidator.s.sol currently imports TestUtils only to use signEip191
and buildAndSignValidatorRegistration; extract those two functions into a shared
source library (e.g., SigningUtils or ValidatorSigning in src/) and update
RegisterNodeValidator.s.sol to import that new src library instead of the
test-only TestUtils, then remove the TestUtils import; ensure the new library
exposes signEip191 and buildAndSignValidatorRegistration with the same
signatures so RegisterNodeValidator.s.sol compiles unchanged.
contracts/broadcast/RegisterNodeValidator.s.sol/11155111/run-1772029057181.json (1)

67-69: Consider reducing timestamped artifact churn in VCS.

If historical replay artifacts are not strictly required, consider committing only run-latest.json (or documenting a retention policy) to reduce merge conflicts and repository noise.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@contracts/broadcast/RegisterNodeValidator.s.sol/11155111/run-1772029057181.json`
around lines 67 - 69, The repository currently commits timestamped replay
artifacts (e.g., RegisterNodeValidator.s.sol/.../run-1772029057181.json), which
causes churn; update the process to commit only a stable artifact like
run-latest.json (or add a documented retention policy) and remove or gitignore
historical timestamped run-*.json files, ensuring build/replay tooling writes
timestamped files to a local artifacts/ or tmp/ directory instead of the VCS;
update any references in CI or docs to read run-latest.json or follow the
retention policy.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@contracts/script/RegisterNodeValidator.s.sol`:
- Around line 35-42: The call in run() that does
uint8(vm.envUint("VALIDATOR_ID")) can silently wrap values >255; before casting,
read the uint256 from vm.envUint("VALIDATOR_ID"), validate it is within 1..255
(or your allowed range) and only then cast to uint8 and assign to validatorId;
update the overloaded run call to use the validated uint8 and handle/report
out-of-range values (e.g., revert or vm.stop/emit) so invalid env inputs cannot
bypass the validatorId != 0 guard.

In `@README.md`:
- Around line 146-147: Delete the stray HTML comment "<!-- Branch for updatinc
sc and further fixes on clearnode and sdk -->" from the README (it's a dev
reminder with a typo) so it isn't merged into main; simply remove that comment
line and ensure no other development-only HTML comments remain in README.md.

---

Nitpick comments:
In
`@contracts/broadcast/RegisterNodeValidator.s.sol/11155111/run-1772029057181.json`:
- Around line 67-69: The repository currently commits timestamped replay
artifacts (e.g., RegisterNodeValidator.s.sol/.../run-1772029057181.json), which
causes churn; update the process to commit only a stable artifact like
run-latest.json (or add a documented retention policy) and remove or gitignore
historical timestamped run-*.json files, ensuring build/replay tooling writes
timestamped files to a local artifacts/ or tmp/ directory instead of the VCS;
update any references in CI or docs to read run-latest.json or follow the
retention policy.

In `@contracts/script/RegisterNodeValidator.s.sol`:
- Line 6: Remove the unused OpenZeppelin import and using declaration: delete
the line importing MessageHashUtils and the `using MessageHashUtils for bytes`
declaration in RegisterNodeValidator.s.sol, since EIP-191 hashing is already
handled by TestUtils.signEip191 and those symbols (MessageHashUtils / using
MessageHashUtils for bytes) are never referenced in this contract.
- Line 8: RegisterNodeValidator.s.sol currently imports TestUtils only to use
signEip191 and buildAndSignValidatorRegistration; extract those two functions
into a shared source library (e.g., SigningUtils or ValidatorSigning in src/)
and update RegisterNodeValidator.s.sol to import that new src library instead of
the test-only TestUtils, then remove the TestUtils import; ensure the new
library exposes signEip191 and buildAndSignValidatorRegistration with the same
signatures so RegisterNodeValidator.s.sol compiles unchanged.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cea67a5 and af64b84.

📒 Files selected for processing (9)
  • README.md
  • clearnode/chart/config/v1-rc/blockchains.yaml
  • contracts/broadcast/RegisterNodeValidator.s.sol/11155111/run-1772029057181.json
  • contracts/broadcast/RegisterNodeValidator.s.sol/11155111/run-latest.json
  • contracts/deployments/11155111/ChannelEngine.sol_ChannelEngine/2026-02-25T13-52-01.json
  • contracts/deployments/11155111/ChannelHub.sol_ChannelHub/2026-02-25T13-59-25.json
  • contracts/deployments/11155111/EscrowDepositEngine.sol_EscrowDepositEngine/2026-02-25T13-52-50.json
  • contracts/deployments/11155111/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/2026-02-25T13-53-36.json
  • contracts/script/RegisterNodeValidator.s.sol

@dimast-x dimast-x force-pushed the feat/new-contract-support branch from 2e44234 to f5ca30d Compare February 25, 2026 15:55
@dimast-x dimast-x force-pushed the feat/new-contract-support branch from f5ca30d to d55c2c8 Compare February 25, 2026 15:56
@dimast-x dimast-x changed the title Updated Contract Integration (Contract, Clearnode, SDK) YNU-774: Updated Contract Integration (Contract, Clearnode, SDK) Feb 25, 2026
@dimast-x dimast-x changed the title YNU-774: Updated Contract Integration (Contract, Clearnode, SDK) YNU-774: Updated Contract Integration Feb 25, 2026
@dimast-x dimast-x merged commit 0b6ce95 into main Feb 25, 2026
10 checks passed
@dimast-x dimast-x deleted the feat/new-contract-support branch February 25, 2026 15:58
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants