Skip to content

YNU-922: deploy stress test v1.3.0#774

Merged
philanton merged 18 commits into
mainfrom
feat/stress-env-v1-3-0
May 21, 2026
Merged

YNU-922: deploy stress test v1.3.0#774
philanton merged 18 commits into
mainfrom
feat/stress-env-v1-3-0

Conversation

@nksazonov
Copy link
Copy Markdown
Contributor

@nksazonov nksazonov commented May 19, 2026

Summary

Stress-env v1.3.0 cut: redeploys + supporting SDK / cerebro / examples / nitronode fixes uncovered while running stress traffic against the new ChannelHub on Ethereum Sepolia + Base Sepolia.

Contracts / deployments

  • feat(contracts/script): add DepositToNode batch top-up scripts — single-chain + multi-chain batch deposit tooling with dry-run + alt signing modes; README updated.
  • feat(contracts/script): take library address params — deploy scripts now accept linked library addresses instead of redeploying them.
  • fix(deployments): redeploy ChH with 1 min activation delay for stress env
  • fix(deployments): redeploy ChH for stress test sepolia with correct default sig val
  • chore(nitronode/chart): drop unused locking_contract_address for stress-v1 ethereum sepolia

Nitronode

  • fix(nitronode/store): pass applicationId into GetAppSessionKeyOwner — fixes a chicken-and-egg failure on create_app_session where the owner-recovery path looked up the application via a subquery on the not-yet-inserted app_sessions row. Callers now pass the application ID directly (from the signed AppDefinitionV1 on create, from the loaded AppSessionV1 on post-create flows). Updates the DBStore query, Store interfaces (channel + app_session_v1), MockStore, README, and existing tests; adds a regression test that exercises lookup-by-application-id when the app session row does not yet exist.

SDK — Go

  • fix(sdk/go): treat finalized state as channel-absent in create/transfer/close pathsDeposit, Withdraw, Transfer, CloseHomeChannel previously checked only state == nil || state.HomeChannelID == nil when deciding whether a new channel needs to be created. A finalized state still has both fields populated, so subsequent calls reused the closed channel instead of opening a new one. Predicate now also checks state.IsFinal().

SDK — TypeScript

  • fix(sdk/ts): tear down WebSocket in Client.close()Client.close() only resolved its internal exit promise; it never invoked rpcClient.close(), so the WebSocket stayed open and Node never exited. Now also awaits this.rpcClient.close() so graceful shutdown actually terminates the transport.

Examples

  • feat(sdk/go/examples): expand app_sessions + add channel_session_key lifecycle

  • feat(sdk/ts/examples): expand app_sessions + add channel_session_key lifecycle

    Both:

    • app_sessions/lifecycle: rewrite requirements doc, swap USDC/WETH → YUSD/YELLOW for the stress env, probe apps.v1 via GetApps / getApps() and skip RegisterApp + the unregistered-app fail-case (Step 9) when the registry is disabled, add ensureChannelOpen() (auto-calls Acknowledge if the wallet has funds but no acknowledged channel) so the example only assumes a minimum off-chain balance instead of a pre-opened channel.
    • channel_session_key/lifecycle (new): registers a channel session key, deposits/withdraws via a session-key-backed client (ChannelSessionKeySignerV1 / ChannelSessionKeyStateSigner), narrows the asset allow-list across v2/v3, verifies revocation (v4 with empty assets) blocks every channel operation. Includes checkpointAndWait() that polls GetHomeChannel.StateVersion after each Checkpoint so the next state transition does not race the node's on-chain event ingestion.
    • TS only: polyfills globalThis.WebSocket from ws because Node <22 does not expose a stable global WebSocket and the SDK dialer uses new WebSocket(url) directly.

Cerebro

  • fix(cerebro): clean up REPL exit + restore terminal modes properly — go-prompt left the tty in raw mode and never disabled bracketed-paste / alt-screen / mouse-tracking escapes, so the next program in the same tab inherited broken paste and an unresponsive Ctrl-C. handleExit now emits the matching disable sequences and wipes the leftover ghost prompt + completion-menu rows. Added SIGINT/SIGTERM/SIGHUP handler so abnormal termination still restores the terminal. Drove exit through go-prompt's ExitChecker so the prompt's own teardown runs before the farewell is printed. Documented the remaining upstream c-bata/go-prompt scrollback-loss bug (#206) in cerebro/README.md along with the plan to replace go-prompt with chzyer/readline or peterh/liner.

Test plan

  • go test ./...
  • cd sdk/ts && npm run test:all
  • cd contracts && forge test
  • Manual: go run ./sdk/go/examples/app_sessions against the stress env end-to-end.
  • Manual: go run ./sdk/go/examples/channel_session_key against the stress env end-to-end (deposits, narrowing, revocation steps all behave as expected).
  • Manual: npm run lifecycle in both sdk/ts/examples/app_sessions and sdk/ts/examples/channel_session_key — both exit cleanly after === Example Complete === (no hang).
  • Manual: launch cerebro, type exit — single clean farewell line, no stray prompts or completion artefacts; subsequent shell commands behave normally in the same tab.

Note on history rewrite

The temp commit was reworded to chore(nitronode/chart): drop unused locking_contract_address for stress-v1 ethereum sepolia via git filter-branch, so all commit SHAs from that point forward have shifted. Reviewers who already pulled the branch will need a git fetch && git reset --hard origin/feat/stress-env-v1-3-0 after the force-push.

Summary by CodeRabbit

  • New Features

    • Added deposit and batch-deposit scripts for simplified token management across networks.
    • Introduced complete session-key lifecycle examples (Go and TypeScript) demonstrating key generation, registration, and asset-specific access control.
    • Enhanced SDK with WebSocket support for Node environments.
  • Bug Fixes

    • Improved channel state finalization handling in SDK operations.
    • Enhanced CLI terminal cleanup and exit behavior.
  • Documentation

    • Updated examples with new asset names and pre-flight validation helpers.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds ChannelHub deployment artifacts for Sepolia and Base, scopes app-session key ownership lookups to specific applications via a new applicationId parameter, introduces deposit helper scripts and batch tooling, improves cerebro CLI terminal handling, fixes SDK channel final-state handling, and adds comprehensive Go and TypeScript examples demonstrating session-key lifecycle workflows.

Changes

ChannelHub deployments and script enhancements

Layer / File(s) Summary
DeployChannelHub library address reuse enhancement
contracts/script/DeployChannelHub.s.sol
Script now accepts optional env vars (CHANNEL_ENGINE_ADDR, ESCROW_DEPOSIT_ENGINE_ADDR, ESCROW_WITHDRAWAL_ENGINE_ADDR) to reuse pre-deployed library addresses, with fallback to deterministic CREATE2 computation and code validation.
Sepolia (11155111) broadcast and deployment metadata
contracts/broadcast/DeployChannelHub.s.sol/11155111/run-*.json, contracts/deployments/11155111/**/stress-*.json
Broadcast run JSONs and per-contract stress test metadata capturing four contract deployments on Sepolia, including deployment addresses, transaction hashes, timestamps, and commit identifiers.
Base (84532) broadcast and deployment metadata
contracts/broadcast/DeployChannelHub.s.sol/84532/run-*.json, contracts/deployments/84532/**/stress-*.json
Broadcast run JSONs and per-contract stress test metadata capturing contract deployments on Base, mirroring Sepolia structure with chain-specific addresses and timestamps.
Node chart blockchain config update
nitronode/chart/config/stress-v1/blockchains.yaml
Updated ChannelHub address and signature validator references for ethereum_sepolia and base_sepolia; removed locking_contract_address from ethereum_sepolia.

AppSession key ownership: application scoping

Layer / File(s) Summary
API docs and interface
nitronode/api/app_session_v1/README.md, nitronode/api/app_session_v1/interface.go, nitronode/store/database/interface.go
Store/DatabaseStore interface methods updated to include applicationId parameter in GetAppSessionKeyOwner(sessionKey, appSessionId, applicationId).
Handler and CreateAppSession wiring
nitronode/api/app_session_v1/create_app_session.go, nitronode/api/app_session_v1/handler.go
CreateAppSession and verifyQuorum now pass applicationID alongside appSessionId when looking up key owner, narrowing ownership resolution to the specific app session and application.
Database implementation
nitronode/store/database/app_session_key_state.go
GetAppSessionKeyOwner signature updated; SQL now left-joins both app-session and app-permission link tables, filtering by provided appSessionId or applicationId with an OR condition; error messages include application context.
MockStore and unit test updates
nitronode/api/app_session_v1/testing.go, nitronode/store/database/app_session_key_state_test.go
MockStore and all test calls updated to pass applicationId parameter; new test added for application-binding-only lookup when app session not persisted.

DepositToNode script and batch tooling

Layer / File(s) Summary
Single-chain DepositToNode script
contracts/script/DepositToNode.s.sol
Forge script with IChannelHub interface; run(hub, token, amount) approves ERC-20 to hub and calls depositToNode(token, amount).
Batch tooling documentation
contracts/script/batchDepositToNode.md
Comprehensive documentation specifying config.json schema, human-readable amount handling with runtime decimals conversion, usage flags, logging, partial-failure reporting, and step-by-step execution flow.
Batch bash workflow implementation
contracts/script/batchDepositToNode.sh
Complete bash script: command-line arg parsing, signing setup (--account or -i with temp keystore), parallel per-chain workers that sequentially fetch token decimals, convert amounts, invoke Forge script, and confirm receipts; aggregates results and exits nonzero on failures.

Cerebro CLI terminal lifecycle improvements

Layer / File(s) Summary
Terminal lifecycle and signal handling
cerebro/main.go
Adds SIGINT/SIGTERM/SIGHUP handler with full terminal state restoration (escape modes), configures go-prompt exit-checker for exit input, and reorders session termination logging to restore terminal before final output.
Prompt configuration and exit handling
cerebro/main.go, cerebro/operator.go
Removes OptionShowCompletionAtStart from getStyleOptions; Operator.Execute no longer closes exitCh on exit command, delegating exit handling to go-prompt.
Cerebro documentation update
cerebro/README.md
Documents known macOS scrollback loss issue when triggering completion menu in go-prompt (upstream go-prompt#206) and planned mitigation to switch readline libraries.

SDK channel handling and session key lifecycle examples

Layer / File(s) Summary
SDK channel final-state routing
sdk/go/channel.go
Deposit, Withdraw, Transfer, CloseHomeChannel, and Acknowledge now treat final channel states (state.IsFinal()) as non-existent, routing to channel creation flow.
SDK client clean shutdown
sdk/ts/src/client.ts
Client.close() now awaits rpcClient.close() to properly shut down underlying RPC/WebSocket connections.
Go session key lifecycle example
sdk/go/examples/channel_session_key/lifecycle.go
New end-to-end example: connects to nitronode, ensures YUSD/YELLOW channels open, generates session key, registers versions v1–v4 with varying asset allow-lists, performs deposits/withdrawals via session-key-backed client, and validates expected failures and revocation.
Go app sessions example asset/registry updates
sdk/go/examples/app_sessions/lifecycle.go
Updated to use YUSD/YELLOW assets, detects disabled app registry via GetApps probe, ensures required channels are open before operations, and conditionally runs unregistered-app test.
TypeScript session key lifecycle example
sdk/ts/examples/channel_session_key/lifecycle.ts, sdk/ts/examples/channel_session_key/package.json, sdk/ts/examples/channel_session_key/tsconfig.json
New end-to-end example: WebSocket polyfill for Node <22, channel/key setup, version registration (v1–v4 with changing allow-lists), session-key deposits/withdrawals, checkpoint/polling for state observation, and revocation validation.
TypeScript app sessions example asset/registry updates
sdk/ts/examples/app_sessions/lifecycle.ts, sdk/ts/examples/app_sessions/package.json
Updated to use YUSD/YELLOW assets, adds WebSocket polyfill, detects app registry disabled state, ensures channels open, and conditionally runs unregistered-app test.

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • layer-3/nitrolite#694: Modifies contracts/script/DeployChannelHub.s.sol for library address handling, directly related to the script enhancements and resulting broadcast artifacts in this PR.
  • layer-3/nitrolite#649: Prior changes to the same DeployChannelHub.s.sol script for node address flow, providing context for the library address reuse extension in this PR.

Suggested reviewers

  • ihsraham
  • dimast-x

🐰 Hop, hop! A grand refactor hops this way,
AppSessions scoped, deployments in array,
Batch deposits flow like carrots in a tray,
Session keys bloom—nitrolite's here to stay! 🥬✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the primary change: deploying stress test v1.3.0 artifacts. It is concise, specific, and accurately reflects the main content of the changeset which consists of deployment artifacts, configuration updates, and supporting script/code changes for the stress test environment.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/stress-env-v1-3-0

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.

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

🧹 Nitpick comments (1)
contracts/deployments/11155111/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-51-48.json (1)

5-5: ⚡ Quick win

Normalize commit hash format across deployment artifacts.

Line 5 uses a full SHA while the rest of this Sepolia stress-v1.3.0 artifact set uses the short SHA (df4e110a). Standardizing one format avoids brittle metadata joins/comparisons in release tooling.

Proposed change
-  "commit": "df4e110a38ca3a4b17e46b606cc3233bbb7521c2",
+  "commit": "df4e110a",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@contracts/deployments/11155111/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-51-48.json`
at line 5, Update the "commit" field in the SessionKeyValidator deployment
artifact to use the short SHA form used by the other Sepolia stress-v1.3.0
artifacts (replace "df4e110a38ca3a4b17e46b606cc3233bbb7521c2" with "df4e110a");
specifically edit the JSON key "commit" in the SessionKeyValidator stress-v1_3_0
artifact so the value matches the short-hash format used across the release
metadata.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@contracts/broadcast/DeployChannelHub.s.sol/84532/run-1779195327198.json`:
- Around line 106-107: The first receipt in the JSON has an all-zero blockHash
while its status is 0x1 and blockNumber is populated; replace the placeholder
"0x000...000" value for the receipt's blockHash field with the actual block hash
corresponding to the provided blockNumber so the receipt object (fields
blockHash, blockNumber, status) is consistent and deterministic.

---

Nitpick comments:
In
`@contracts/deployments/11155111/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-51-48.json`:
- Line 5: Update the "commit" field in the SessionKeyValidator deployment
artifact to use the short SHA form used by the other Sepolia stress-v1.3.0
artifacts (replace "df4e110a38ca3a4b17e46b606cc3233bbb7521c2" with "df4e110a");
specifically edit the JSON key "commit" in the SessionKeyValidator stress-v1_3_0
artifact so the value matches the short-hash format used across the release
metadata.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3baf5a64-cbe6-418d-9986-129d37dd2009

📥 Commits

Reviewing files that changed from the base of the PR and between df4e110 and 5374b7a.

📒 Files selected for processing (17)
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-1779194593262.json
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-latest.json
  • contracts/broadcast/DeployChannelHub.s.sol/84532/run-1779195327198.json
  • contracts/broadcast/DeployChannelHub.s.sol/84532/run-latest.json
  • contracts/deployments/11155111/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/ECDSAValidator.sol_ECDSAValidator/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-51-48.json
  • contracts/deployments/84532/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/ECDSAValidator.sol_ECDSAValidator/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-58-32.json
  • nitronode/chart/config/stress-v1/blockchains.yaml

nksazonov and others added 5 commits May 20, 2026 12:46
Resolves the chicken-and-egg failure on app session creation when the
session key authorizes by application_id. The previous implementation
resolved the application_id via a subquery against the app_sessions row,
but during create_app_session that row does not exist yet, so the
application-bound branch never matched and recovery failed with
"no active session key found".

Callers now pass the application_id explicitly: create_app_session reads
it from the signed AppDefinitionV1, and post-create handlers read it
from the loaded AppSessionV1 record. The session-id branch is preserved
for keys bound to specific app sessions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@philanton philanton force-pushed the feat/stress-env-v1-3-0 branch from 5d83a6e to 9110ba0 Compare May 20, 2026 10:34
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.

🧹 Nitpick comments (3)
nitronode/chart/config/stress-v1/blockchains.yaml (1)

4-4: ⚡ Quick win

Use EIP-55 checksummed addresses consistently.

Lines 4 and 9 use lowercase addresses while lines 6 and 11 use mixed-case EIP-55 checksummed addresses. Checksumming provides an integrity check against transcription errors and is an Ethereum best practice.

🔧 Apply EIP-55 checksumming

You can generate checksummed addresses using a tool like eth-checksum or Web3 libraries. For example, using Python:

from eth_utils import to_checksum_address

# Line 4
print(to_checksum_address("0xf74c93a176794337fb43c951cc0f6cef9a6723f6"))

# Line 9
print(to_checksum_address("0xeddf27e378a8b102a98a4b03a3730ef585bfaff5"))

Then update the config with the checksummed versions.

Also applies to: 9-9

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nitronode/chart/config/stress-v1/blockchains.yaml` at line 4, Replace any
lowercase Ethereum addresses in this YAML with their EIP-55 checksummed
equivalents: locate the channel_hub_address entry and the other Ethereum address
entries mentioned in the review (the lowercase addresses on the other lines) and
update their values to the checksummed form (use a library like
eth_utils.to_checksum_address or web3 utilities to generate them) so all
addresses in the file consistently use EIP-55 casing.
nitronode/store/database/interface.go (1)

222-222: ⚡ Quick win

Add a doc comment for GetAppSessionKeyOwner in DatabaseStore.

This changed exported interface method should include a short doc comment for consistency and lintability.

As per coding guidelines: **/*.go: Follow gofmt formatting and add doc comments on all exported names in Go code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nitronode/store/database/interface.go` at line 222, Add a Go doc comment for
the exported interface method GetAppSessionKeyOwner on DatabaseStore: insert a
short comment immediately above the method declaration that begins with the
method name and describes what the method does and what it returns (e.g., that
it looks up and returns the owner ID or an error given a sessionKey,
appSessionId, and applicationId). Ensure the comment follows Go doc style
(starts with "GetAppSessionKeyOwner ...") and is placed directly above the
GetAppSessionKeyOwner(sessionKey, appSessionId, applicationId string) (string,
error) declaration.
nitronode/api/app_session_v1/interface.go (1)

65-65: ⚡ Quick win

Add a doc comment for GetAppSessionKeyOwner in the exported Store interface.

Please add a brief method comment so the changed exported API stays compliant and self-documenting.

As per coding guidelines: **/*.go: Follow gofmt formatting and add doc comments on all exported names in Go code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nitronode/api/app_session_v1/interface.go` at line 65, Add a Go doc comment
for the exported method GetAppSessionKeyOwner on the Store interface: place a
comment line immediately above the GetAppSessionKeyOwner declaration that begins
with "GetAppSessionKeyOwner" and briefly describes what the method does, its
purpose, and what the returned string and error represent (e.g., retrieves the
owner ID or name for the given sessionKey, appSessionId, and applicationId);
ensure the comment follows standard Go doc style and is formatted with gofmt.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@nitronode/api/app_session_v1/interface.go`:
- Line 65: Add a Go doc comment for the exported method GetAppSessionKeyOwner on
the Store interface: place a comment line immediately above the
GetAppSessionKeyOwner declaration that begins with "GetAppSessionKeyOwner" and
briefly describes what the method does, its purpose, and what the returned
string and error represent (e.g., retrieves the owner ID or name for the given
sessionKey, appSessionId, and applicationId); ensure the comment follows
standard Go doc style and is formatted with gofmt.

In `@nitronode/chart/config/stress-v1/blockchains.yaml`:
- Line 4: Replace any lowercase Ethereum addresses in this YAML with their
EIP-55 checksummed equivalents: locate the channel_hub_address entry and the
other Ethereum address entries mentioned in the review (the lowercase addresses
on the other lines) and update their values to the checksummed form (use a
library like eth_utils.to_checksum_address or web3 utilities to generate them)
so all addresses in the file consistently use EIP-55 casing.

In `@nitronode/store/database/interface.go`:
- Line 222: Add a Go doc comment for the exported interface method
GetAppSessionKeyOwner on DatabaseStore: insert a short comment immediately above
the method declaration that begins with the method name and describes what the
method does and what it returns (e.g., that it looks up and returns the owner ID
or an error given a sessionKey, appSessionId, and applicationId). Ensure the
comment follows Go doc style (starts with "GetAppSessionKeyOwner ...") and is
placed directly above the GetAppSessionKeyOwner(sessionKey, appSessionId,
applicationId string) (string, error) declaration.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f53e5d6c-1b1e-49b2-b88a-001e2e0257f8

📥 Commits

Reviewing files that changed from the base of the PR and between 5374b7a and 9110ba0.

📒 Files selected for processing (26)
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-1779194593262.json
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-latest.json
  • contracts/broadcast/DeployChannelHub.s.sol/84532/run-1779195327198.json
  • contracts/broadcast/DeployChannelHub.s.sol/84532/run-latest.json
  • contracts/deployments/11155111/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/ECDSAValidator.sol_ECDSAValidator/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-51-48.json
  • contracts/deployments/84532/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/ECDSAValidator.sol_ECDSAValidator/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-58-32.json
  • nitronode/api/app_session_v1/README.md
  • nitronode/api/app_session_v1/create_app_session.go
  • nitronode/api/app_session_v1/handler.go
  • nitronode/api/app_session_v1/interface.go
  • nitronode/api/app_session_v1/testing.go
  • nitronode/chart/config/stress-v1/blockchains.yaml
  • nitronode/store/database/app_session_key_state.go
  • nitronode/store/database/app_session_key_state_test.go
  • nitronode/store/database/interface.go
  • pkg/blockchain/evm/channel_hub_abi.go
✅ Files skipped from review due to trivial changes (14)
  • contracts/deployments/84532/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/11155111/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-51-48.json
  • contracts/deployments/84532/ECDSAValidator.sol_ECDSAValidator/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/84532/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/11155111/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/84532/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-19T12-55-27.json
  • contracts/deployments/11155111/ECDSAValidator.sol_ECDSAValidator/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/84532/SessionKeyValidator.sol_SessionKeyValidator/stress-v1_3_0-2026-05-19T12-58-32.json
  • contracts/deployments/11155111/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/deployments/11155111/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-19T12-43-13.json
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-1779194593262.json
  • contracts/broadcast/DeployChannelHub.s.sol/84532/run-1779195327198.json

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@contracts/script/batchDepositToNode.sh`:
- Around line 175-184: The loop that checks transaction confirmations uses "cast
receipt ... || echo WARNING" which only logs a warning but still allows ok=$((ok
+ 1)) to run; change the logic so the loop sets a failure flag (e.g.
confirmed_all=true; on any failed "cast receipt" set confirmed_all=false) while
iterating hashes from jq, and after the loop only increment ok (ok=$((ok+1)))
and print the "confirmed: ..." message if confirmed_all is true; if false, print
a failure message and do not increment ok (and consider setting a nonzero
overall error indicator).
- Around line 149-162: The awk expression computing raw_amount in
batchDepositToNode.sh is vulnerable to shell injection via unquoted
$human_amount and loses precision; replace that step by validating/quoting
human_amount and invoking a small Python one-liner or heredoc using
decimal.Decimal to compute raw_amount = int(Decimal(human_amount) * (10 **
int(decimals))) to avoid injection and precision loss (use printf/echo to pass
the value, do not eval it in the shell). Also fix the confirmation logic around
cast receipt: only increment ok and treat the token as successful after cast
receipt confirms; on receipt failure, increment fail and append token to
fail_tokens (variables: human_amount, raw_amount, decimals, fail, fail_tokens,
ok and the cast receipt handling) so unconfirmed transactions are not marked
successful.

In `@contracts/script/DepositToNode.s.sol`:
- Around line 35-45: The run function currently broadcasts transactions without
validating inputs; add pre-broadcast guards: require(hub != address(0),
"hub==0"), require(token != address(0), "token==0"), require(amount > 0,
"amount==0"), and (optionally) require(Address.isContract(hub) &&
Address.isContract(token), "not contract") before vm.startBroadcast(); then move
vm.startBroadcast() below those checks so IERC20(token).forceApprove(hub,
amount) and IChannelHub(hub).depositToNode(token, amount) only run after
validation. Ensure you import/use OpenZeppelin's Address.isContract if you add
the contract-check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a9f5f103-3406-40bf-a61b-46d0c8681527

📥 Commits

Reviewing files that changed from the base of the PR and between 8ab333a and 104c13d.

📒 Files selected for processing (3)
  • contracts/script/DepositToNode.s.sol
  • contracts/script/batchDepositToNode.md
  • contracts/script/batchDepositToNode.sh

Comment thread contracts/script/batchDepositToNode.sh
Comment thread contracts/script/batchDepositToNode.sh Outdated
Comment thread contracts/script/DepositToNode.s.sol
nksazonov and others added 7 commits May 20, 2026 16:14
…er/close paths

Deposit, Withdraw, Transfer, and CloseHomeChannel inspected only
state == nil and state.HomeChannelID == nil to decide whether a new
channel needs to be created. A previously finalized state still has
both fields populated, so subsequent calls reused the closed channel
instead of opening a new one. Include state.IsFinal() in the
channel-absent predicate so reopens after a Finalize work correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lifecycle

app_sessions: rewrite requirements doc, replace WETH/USDC with YELLOW/YUSD,
probe apps.v1 group via GetApps and skip RegisterApp + fail-case Step 9 when
the registry is disabled, and add ensureChannelOpen() so the example only
assumes a minimum off-chain balance instead of a pre-opened channel.

channel_session_key: new lifecycle example that registers a channel session
key, deposits/withdraws via a session-key-backed client, narrows the asset
allow-list across v2/v3, and verifies revocation (v4 with empty assets)
blocks every channel operation. Includes checkpointAndWait() that polls
GetHomeChannel state_version after each Checkpoint so the next state
transition does not race the node's on-chain event ingestion. txSigner
remains the wallet's raw signer; only the channel state signer is replaced
with ChannelSessionKeySignerV1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lifecycle

app_sessions: mirror the Go example changes. Rewrite requirements doc,
replace WETH/USDC with YELLOW/YUSD, probe apps.v1 via getApps() and skip
registerApp + fail-case Step 9 when the registry is disabled, add an
ensureChannelOpen() helper that calls acknowledge() on demand, and polyfill
globalThis.WebSocket from the ws package because Node <22 does not expose
a stable global WebSocket and the SDK dialer uses `new WebSocket(url)`
directly. Add ws + @types/ws as deps.

channel_session_key: new lifecycle example mirroring the Go counterpart.
Registers a channel session key, deposits/withdraws via a session-key-
backed client built with ChannelSessionKeyStateSigner, narrows the asset
allow-list across v2/v3, and verifies revocation (v4 with empty assets)
blocks every channel operation. Includes checkpointAndWait() that polls
getHomeChannel state_version after each checkpoint so the next state
transition does not race the node's on-chain event ingestion. txSigner
remains an EthereumRawSigner over the wallet key; only the state signer
is swapped to the session key.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
go-prompt put the tty into raw mode and emitted bracketed-paste, alt-screen
and mouse-tracking escapes that were never disabled on exit. Restoring the
saved termios via term.Restore + stty sane wasn't enough — subsequent
programs in the same tab inherited broken paste behaviour and an
unresponsive Ctrl-C until the user opened a fresh tab.

Changes:
  - handleExit() now also emits the matching disable sequences for
    bracketed paste, cursor visibility, alt screen and the four mouse
    modes, then wipes the leftover ghost prompt + completion-menu rows
    that go-prompt leaves on the screen during teardown.
  - SIGINT / SIGTERM / SIGHUP handler so abnormal termination (shell
    kill, window close) still restores the terminal.
  - Removed OptionShowCompletionAtStart so the completion box is not
    permanently visible below the prompt.
  - Drove "exit" through go-prompt's ExitChecker (instead of the
    operator closing exitCh during Execute) so go-prompt's own teardown
    runs before main prints the farewell. Eliminates the stray
    "cerebro> " line that used to appear between "Exiting..." and the
    session-ended log.
  - Reordered main: capture farewell, restore terminal, then print —
    so the final log lands on a clean row.

Also documented in cerebro/README.md the remaining upstream go-prompt
scrollback-loss bug (c-bata/go-prompt#206) that is triggered whenever the
completion menu renders on macOS Terminal.app / iTerm2, and the plan to
replace go-prompt with chzyer/readline or peterh/liner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Client.close() only resolved the exit promise; it never invoked
rpcClient.close(), which is what actually closes the underlying
WebSocket. As a result Node processes that finished their work and called
client.close() hung after they were "done" because the live WebSocket
kept the event loop alive. Visible in the channel_session_key example:
the script reached "=== Example Complete ===" but never returned to the
shell.

Awaiting this.rpcClient.close() inside Client.close() lets graceful
shutdown actually terminate the transport so Node can exit naturally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@philanton philanton force-pushed the feat/stress-env-v1-3-0 branch from 6ad48f4 to 2a27193 Compare May 21, 2026 09:11
Comment thread sdk/ts/examples/channel_session_key/lifecycle.ts Fixed
@philanton philanton changed the title YNU-922: feat: deploy sc stress test v1.3.0 YNU-922: deploy stress test v1.3.0 May 21, 2026
Flagged by github-code-quality on PR #774 review. The channel_session_key
lifecycle example imports ChannelSessionKeyStateSigner for the
session-key client and never instantiates ChannelDefaultSigner directly
— createSigners() builds the default channel signer internally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
sdk/go/examples/app_sessions/lifecycle.go (2)

279-279: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Propagate ctx instead of context.Background() for SubmitAppSessionKeyState

Line 279 uses context.Background() for wallet3Client.SubmitAppSessionKeyState, which bypasses the caller’s cancellation/timeouts; pass the existing function ctx there for consistent lifecycle control.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sdk/go/examples/app_sessions/lifecycle.go` at line 279, Call to
wallet3Client.SubmitAppSessionKeyState currently uses context.Background() which
ignores the caller's cancellation/timeouts; replace context.Background() with
the existing function-scoped ctx when invoking SubmitAppSessionKeyState (keep
the same wallet3Client and appSessionKey3State variables) so the operation
respects the caller's context lifecycle.

211-211: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Handle signer.Sign() errors instead of discarding with _ in sdk/go/examples/app_sessions/lifecycle.go

Multiple appSession*Signer.Sign(...) calls ignore the returned error (e.g., at lines 211, 234, 303-304, 334-335, 370-371, 475-476, 503, 528-529, 559). If signing fails, the code continues and later uses sig.String() in client calls, making failures harder to debug.

Suggested fix pattern
- appSession1CreateSession1Sig, _ := appSession1Signer.Sign(session1CreateRequest)
+ appSession1CreateSession1Sig, err := appSession1Signer.Sign(session1CreateRequest)
+ if err != nil {
+   log.Fatalf("failed to sign session1 create request: %v", err)
+ }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sdk/go/examples/app_sessions/lifecycle.go` at line 211, Several calls to
appSessionXSigner.Sign(...) (e.g., appSession1Signer.Sign producing
appSession1CreateSession1Sig) ignore the returned error; change each to capture
the error (sig, err := appSession1Signer.Sign(...)), check err immediately, and
handle it (return the error, log and exit, or propagate) before using
sig.String(); update all similar occurrences (appSession1Signer.Sign,
appSession2Signer.Sign, etc. that assign variables like
appSession1CreateSession1Sig, appSession1ApproveSessionSig,
appSession2CreateSessionSig, etc.) so the code does not proceed when signing
fails.
🧹 Nitpick comments (1)
contracts/script/DeployChannelHub.s.sol (1)

110-120: 💤 Low value

Minor: Inconsistent label padding in console output.

The label strings have inconsistent character lengths which may cause misaligned output:

  • "ChannelEngine (new): " vs "ChannelEngine (existing): "
  • "EscrowDepositEngine (new): " vs "EscrowDepositEngine (existing): "

This doesn't affect functionality but could make logs harder to read.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@contracts/script/DeployChannelHub.s.sol` around lines 110 - 120, The
console.log label strings for ChannelEngine, EscrowDepositEngine, and
EscrowWithdrawalEngine are padded inconsistently (see the logs using
deployChannelEngine, deployEscrowDeposit, deployEscrowWithdrawal and variables
channelEngineAddr, escrowDepositAddr, escrowWithdrawalAddr); update the labels
so both "(new)" and "(existing)" variants have equal length—either by using a
single formatted label per engine and applying a fixed-width pad or by calling a
pad helper (e.g., padEnd) to normalize the label strings before passing them to
console.log—so the three console.log calls produce aligned, consistent output.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cerebro/main.go`:
- Around line 81-84: The code currently ignores errors from term.GetState,
term.Restore and exec.Command("stty", "sane").Run(); update the initialization
and handleExit closure to capture and handle these errors (e.g., return them,
log via a logger, or at minimum print to stderr) instead of assigning to `_` or
discarding Run()'s error: change the initialState retrieval (term.GetState) to
check and handle the error, have handleExit propagate or log the error returned
by term.Restore(int(os.Stdin.Fd()), initialState), and capture and handle the
error from exec.Command("stty", "sane").Run() so any failure during terminal
teardown is surfaced for diagnosis.

In `@contracts/script/batchDepositToNode.md`:
- Around line 93-95: Add explicit fence language identifiers (e.g., ```text) to
every unlabeled fenced code block in contracts/script/batchDepositToNode.md —
specifically the blocks containing "batchDepositToNode-20260520-143000.log", the
"=== Summary ===" sections (both variants shown), and the
"batchDepositToNode.sh" diagram; update the other occurrences mentioned (around
the ranges corresponding to the other examples) to use ```text so Markdown lint
passes and readability is improved.

In `@contracts/script/batchDepositToNode.sh`:
- Around line 89-95: The cast wallet import call is being silenced and its
failure ignored, so update the import step (the cast wallet import invocation
that sets up TMPKS/TMPPW and precedes SIGNING_ARGS and unset PK) to fail fast:
capture the exit status of the import and exit non‑zero with a clear error
message if it fails (or use a conditional/&& so subsequent lines that set
SIGNING_ARGS and unset PK only run on success), ensuring you still reference
TMPKS and TMPPW in the error context so debugging shows which keystore/password
failed.

In `@contracts/script/DepositToNode.s.sol`:
- Around line 9-11: Add a NatSpec comment for the external interface method
IChannelHub.depositToNode: above the interface declaration include a
method-level comment describing its purpose using `@notice`, document parameters
with `@param` token and `@param` amount, and add `@dev` notes that the function is
payable and any important side effects (e.g., token transfer or contract state
changes) so tooling and readers can understand expected behavior.

In `@sdk/go/examples/app_sessions/lifecycle.go`:
- Around line 73-75: Replace the hard-coded private key literals assigned to
wallet1PrivateKey, wallet2PrivateKey and wallet3PrivateKey with
environment-driven inputs: read each key from an environment variable (e.g.,
WALLET1_PRIVATE_KEY, WALLET2_PRIVATE_KEY, WALLET3_PRIVATE_KEY) and fail fast if
any are missing or empty by returning an error or logging and exiting; update
any tests/examples to document the required env vars instead of embedding
secrets.

In `@sdk/go/examples/channel_session_key/lifecycle.go`:
- Line 61: Remove the hardcoded private key assigned to walletPrivateKey in
lifecycle.go and replace it with a secure retrieval mechanism (e.g., read from
an environment variable or use a secure prompt/secret manager). Locate the
walletPrivateKey variable and change its initialization so it loads from
os.Getenv("WALLET_PRIVATE_KEY") or a provided secret accessor and validate that
the value is present, returning an error if missing; ensure no literal secret
remains in the file or repo.

In `@sdk/ts/examples/app_sessions/lifecycle.ts`:
- Around line 107-109: Replace the hard-coded private key literals
(wallet1PrivateKey, wallet2PrivateKey, wallet3PrivateKey) with values loaded
from environment variables or CLI args (e.g., process.env.WALLET1_PRIVATE_KEY
etc.), validate each is present and well-formed at startup, and throw a clear
error (fail fast) if any are missing or invalid so the example won’t run with
embedded secrets.

In `@sdk/ts/examples/channel_session_key/lifecycle.ts`:
- Line 69: Replace the hardcoded walletPrivateKey value with a runtime
environment variable: read the key from process.env (e.g. WALLET_PRIVATE_KEY),
validate it exists (throw or log a clear error if missing), and cast/assign it
to the same walletPrivateKey constant (keeping the Hex type). Update any
documentation/comments to instruct users to set WALLET_PRIVATE_KEY before
running the example; do not leave a plaintext fallback in lifecycle.ts.

---

Outside diff comments:
In `@sdk/go/examples/app_sessions/lifecycle.go`:
- Line 279: Call to wallet3Client.SubmitAppSessionKeyState currently uses
context.Background() which ignores the caller's cancellation/timeouts; replace
context.Background() with the existing function-scoped ctx when invoking
SubmitAppSessionKeyState (keep the same wallet3Client and appSessionKey3State
variables) so the operation respects the caller's context lifecycle.
- Line 211: Several calls to appSessionXSigner.Sign(...) (e.g.,
appSession1Signer.Sign producing appSession1CreateSession1Sig) ignore the
returned error; change each to capture the error (sig, err :=
appSession1Signer.Sign(...)), check err immediately, and handle it (return the
error, log and exit, or propagate) before using sig.String(); update all similar
occurrences (appSession1Signer.Sign, appSession2Signer.Sign, etc. that assign
variables like appSession1CreateSession1Sig, appSession1ApproveSessionSig,
appSession2CreateSessionSig, etc.) so the code does not proceed when signing
fails.

---

Nitpick comments:
In `@contracts/script/DeployChannelHub.s.sol`:
- Around line 110-120: The console.log label strings for ChannelEngine,
EscrowDepositEngine, and EscrowWithdrawalEngine are padded inconsistently (see
the logs using deployChannelEngine, deployEscrowDeposit, deployEscrowWithdrawal
and variables channelEngineAddr, escrowDepositAddr, escrowWithdrawalAddr);
update the labels so both "(new)" and "(existing)" variants have equal
length—either by using a single formatted label per engine and applying a
fixed-width pad or by calling a pad helper (e.g., padEnd) to normalize the label
strings before passing them to console.log—so the three console.log calls
produce aligned, consistent output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75c1b9b4-dd8a-4544-84ef-3dcdc275757c

📥 Commits

Reviewing files that changed from the base of the PR and between 104c13d and 2a27193.

⛔ Files ignored due to path filters (2)
  • sdk/ts/examples/app_sessions/package-lock.json is excluded by !**/package-lock.json
  • sdk/ts/examples/channel_session_key/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (38)
  • cerebro/README.md
  • cerebro/main.go
  • cerebro/operator.go
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-1779278401948.json
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-1779286321195.json
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-latest.json
  • contracts/broadcast/DeployChannelHub.s.sol/84532/run-1779278728832.json
  • contracts/broadcast/DeployChannelHub.s.sol/84532/run-latest.json
  • contracts/deployments/11155111/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-20T12-00-01.json
  • contracts/deployments/11155111/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-20T14-12-01.json
  • contracts/deployments/11155111/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-20T12-00-01.json
  • contracts/deployments/11155111/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-20T12-00-01.json
  • contracts/deployments/84532/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-20T12-05-28.json
  • contracts/deployments/84532/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-20T12-05-28.json
  • contracts/deployments/84532/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-20T12-05-28.json
  • contracts/deployments/84532/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-20T12-05-28.json
  • contracts/script/DeployChannelHub.s.sol
  • contracts/script/DepositToNode.s.sol
  • contracts/script/batchDepositToNode.md
  • contracts/script/batchDepositToNode.sh
  • nitronode/api/app_session_v1/README.md
  • nitronode/api/app_session_v1/create_app_session.go
  • nitronode/api/app_session_v1/handler.go
  • nitronode/api/app_session_v1/interface.go
  • nitronode/api/app_session_v1/testing.go
  • nitronode/chart/config/stress-v1/blockchains.yaml
  • nitronode/store/database/app_session_key_state.go
  • nitronode/store/database/app_session_key_state_test.go
  • nitronode/store/database/interface.go
  • sdk/go/channel.go
  • sdk/go/examples/app_sessions/lifecycle.go
  • sdk/go/examples/channel_session_key/lifecycle.go
  • sdk/ts/examples/app_sessions/lifecycle.ts
  • sdk/ts/examples/app_sessions/package.json
  • sdk/ts/examples/channel_session_key/lifecycle.ts
  • sdk/ts/examples/channel_session_key/package.json
  • sdk/ts/examples/channel_session_key/tsconfig.json
  • sdk/ts/src/client.ts
✅ Files skipped from review due to trivial changes (11)
  • contracts/deployments/84532/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-20T12-05-28.json
  • contracts/deployments/84532/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-20T12-05-28.json
  • contracts/deployments/84532/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-20T12-05-28.json
  • contracts/deployments/11155111/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-20T12-00-01.json
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-1779286321195.json
  • contracts/deployments/11155111/ChannelEngine.sol_ChannelEngine/stress-v1_3_0-2026-05-20T12-00-01.json
  • contracts/deployments/11155111/ChannelHub.sol_ChannelHub/stress-v1_3_0-2026-05-20T14-12-01.json
  • contracts/deployments/84532/EscrowDepositEngine.sol_EscrowDepositEngine/stress-v1_3_0-2026-05-20T12-05-28.json
  • contracts/broadcast/DeployChannelHub.s.sol/84532/run-1779278728832.json
  • contracts/deployments/11155111/EscrowWithdrawalEngine.sol_EscrowWithdrawalEngine/stress-v1_3_0-2026-05-20T12-00-01.json
  • contracts/broadcast/DeployChannelHub.s.sol/11155111/run-1779278401948.json

Comment thread cerebro/main.go Outdated
Comment thread contracts/script/batchDepositToNode.md Outdated
Comment thread contracts/script/batchDepositToNode.sh Outdated
Comment thread contracts/script/DepositToNode.s.sol
Comment thread sdk/go/examples/app_sessions/lifecycle.go Outdated
Comment thread sdk/go/examples/channel_session_key/lifecycle.go Outdated
Comment thread sdk/ts/examples/app_sessions/lifecycle.ts Outdated
Comment thread sdk/ts/examples/channel_session_key/lifecycle.ts Outdated
philanton and others added 3 commits May 21, 2026 12:34
Project Go rule prohibits ignoring errors with `_`. `term.GetState`,
`term.Restore`, and `stty sane` previously swallowed any failure, which
could leave the user with a broken shell state and no clue what went
wrong. Now log warnings on each failure path, and skip Restore when the
initial state was never captured successfully.

Flagged by CodeRabbit on PR #774.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CodeRabbit / Betterleaks flagged the committed private-key literals in
all four lifecycle examples as a secret-leak vector. The keys were also
the wrong default: examples should target the public sandbox endpoint,
not the internal stress-test deployment.

  - sdk/go/examples/app_sessions/lifecycle.go
  - sdk/go/examples/channel_session_key/lifecycle.go
  - sdk/ts/examples/app_sessions/lifecycle.ts
  - sdk/ts/examples/channel_session_key/lifecycle.ts

Each file now uses placeholder hex literals ("0x7d607..." etc.) the
operator must replace before running, and wsURL points at
wss://nitronode-sandbox.yellow.org/v1/ws.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@philanton philanton merged commit 76cc8d2 into main May 21, 2026
16 checks passed
@philanton philanton deleted the feat/stress-env-v1-3-0 branch May 21, 2026 10:01
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