Skip to content

chore: fix jwt secret flag - #150

Merged
chatton merged 5 commits into
mainfrom
cian/fix-jwt-secret-flag
Nov 11, 2025
Merged

chatton merged 5 commits into
mainfrom
cian/fix-jwt-secret-flag

Conversation

@chatton

@chatton chatton commented Nov 11, 2025 •

Copy link
Copy Markdown
Collaborator

Overview

Fixes the evm-single type to write the contents of the jwt token as a file instead of passing as a field, pulls in the changes made in #149

cc @randygrok

closes #149

Summary by CodeRabbit

  • Improvements
    • Updated node health check mechanism with new endpoints and improved readiness verification
    • JWT secret now configured via file-based approach
    • Node aggregator and signer flags renamed to align with current naming standards
    • Enhanced readiness checks with TCP connectivity verification and context cancellation support

randygrok and others added 4 commits November 6, 2025 09:15
Update evstack health checks to use the new HTTP /health/ready endpoint
instead of the gRPC /evnode.v1.HealthService/Livez endpoint.

Changes:
- Replace gRPC endpoint with /health/ready HTTP endpoint
- Update health check method from POST to GET
- Continue using RPC port (7331) where HTTP endpoints are served
- Remove unused bytes import
@coderabbitai

coderabbitai Bot commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Three Docker/EVM node configuration files updated: health check endpoints switched from /evnode.v1.HealthService/Livez POST to /health/ready GET requests, JWT secret handling converted to file-based approach, node aggregator and signer flags renamed from rollkit to evnode naming conventions, and TCP readiness checks added.

Changes

Cohort / File(s) Summary
Health check endpoint and method updates
framework/docker/evmsingle_with_reth_test.go, framework/docker/evstack/evmsingle/node.go, framework/docker/evstack/node.go
Replaced POST requests to /evnode.v1.HealthService/Livez with GET requests to /health/ready endpoint; removed JSON body and Content-Type headers from health check requests; updated health check interpretation logic to treat 200 OK as node readiness.
JWT secret file-based handling
framework/docker/evstack/evmsingle/node.go
JWT secret now written to jwt-secret.txt file in home directory; flag changed from --evm.jwt-secret (inline) to --evm.jwt-secret-file (file path reference).
Node aggregator and signer flag updates
framework/docker/evstack/evmsingle/node.go
Renamed node aggregator and signer passphrase flags from rollkit naming conventions to evnode naming.
TCP dial readiness check
framework/docker/evstack/evmsingle/node.go
Added TCP dial connectivity check for node readiness verification; context cancellation now respected in readiness loop.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Straightforward endpoint and HTTP method replacements across multiple files
  • JWT file handling addition is minimal and follows a clear pattern
  • Limited logic complexity; mostly configuration and flag changes
  • TCP dial check is a standard readiness verification pattern

Possibly related PRs

Suggested reviewers

  • mojtaba-esk
  • tty47

Poem

🐰 A health check hops from POST to GET,
Secrets dance in files, no regret,
Flags renamed with care, so fine,
TCP dials check the line,
EVM nodes ready, Docker's delight! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: fix jwt secret flag' accurately reflects the main change in the PR, which replaces JWT secret field-based passing with file-based passing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cian/fix-jwt-secret-flag

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
framework/docker/evstack/evmsingle/node.go (1)

208-238: LGTM! Improved readiness check implementation.

The readiness check has been enhanced with several improvements:

  1. Context cancellation is properly respected (lines 216-220)
  2. TCP dial check before HTTP request reduces spurious errors (lines 222-227)
  3. Health endpoint updated to REST-style /health/ready GET request (lines 211, 228)

These changes make the readiness check more robust and align with the health check updates across the codebase.

Minor note: Line 228 ignores the error from http.NewRequestWithContext with _. While this shouldn't fail with valid parameters, it's technically more defensive to check the error. This is optional and not a blocker.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7defa8b and 5da3b62.

📒 Files selected for processing (3)
  • framework/docker/evmsingle_with_reth_test.go (1 hunks)
  • framework/docker/evstack/evmsingle/node.go (5 hunks)
  • framework/docker/evstack/node.go (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: chatton
Repo: celestiaorg/tastora PR: 106
File: framework/docker/dataavailability/node.go:259-268
Timestamp: 2025-08-27T08:29:14.500Z
Learning: The user chatton prefers to keep existing logic unchanged during refactors, even when there are potential improvements, to maintain focus on the structural changes and avoid introducing bugs during code movement.
📚 Learning: 2025-08-27T08:24:51.731Z
Learnt from: chatton
Repo: celestiaorg/tastora PR: 106
File: framework/docker/dataavailability/config.go:3-7
Timestamp: 2025-08-27T08:24:51.731Z
Learning: The tastora codebase consistently uses `github.com/moby/moby/client` for Docker client imports throughout all framework/docker packages. Do not suggest changing this to `github.com/docker/docker/client` as it would break type compatibility.

Applied to files:

  • framework/docker/evmsingle_with_reth_test.go
🧬 Code graph analysis (3)
framework/docker/evmsingle_with_reth_test.go (1)
framework/types/network.go (1)
  • Ports (50-63)
framework/docker/evstack/node.go (3)
framework/docker/evstack/evmsingle/node.go (1)
  • Node (21-32)
framework/docker/evstack/reth/node.go (1)
  • Node (23-31)
framework/docker/dataavailability/node.go (1)
  • Node (61-77)
framework/docker/evstack/evmsingle/node.go (1)
framework/docker/evstack/node.go (1)
  • Node (40-55)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test
  • GitHub Check: Analyze (go)
🔇 Additional comments (7)
framework/docker/evmsingle_with_reth_test.go (1)

191-193: LGTM! Health check endpoint updated correctly.

The migration from the gRPC-style /evnode.v1.HealthService/Livez POST endpoint to the simpler REST /health/ready GET endpoint is clean and consistent with the changes across other files in this PR.

framework/docker/evstack/node.go (1)

260-260: LGTM! Consistent health check migration.

The health endpoint has been successfully updated to use /health/ready with a GET request, and the comment accurately reflects the new ready-check behavior. This aligns well with the changes in the test file and the broader PR objectives.

Also applies to: 282-284

framework/docker/evstack/evmsingle/node.go (5)

8-8: Good addition of path import.

The path package is appropriate for constructing Unix paths in Docker containers, as used in line 164 for the JWT secret file path.


129-130: LGTM! Flag renaming from rollkit to evnode.

The aggregator and signer flags have been correctly updated to use the evnode prefix, consistent with the broader namespace migration mentioned in the PR objectives.


156-160: LGTM! JWT secret file writing implemented correctly.

The JWT secret is now properly written to a file as per the PR objectives. The error handling is correct, and the file-based approach is more secure than passing secrets directly as command-line arguments.

Note: The JWT secret file is placed in the home directory root while the passphrase file (line 124) is in the config/ subdirectory. This organizational difference is acceptable but could be standardized in future refactoring if desired.


164-164: LGTM! JWT secret flag correctly updated.

The flag has been properly changed from --evm.jwt-secret to --evm.jwt-secret-file, with the file path correctly constructed using path.Join(n.HomeDir(), "jwt-secret.txt"), matching where the file was written on line 158.


175-175: LGTM! Consistent flag renaming in start command.

The evnode flags in the start command match the naming used in the init command (lines 129-130), ensuring consistency across the node lifecycle.

@mojtaba-esk mojtaba-esk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@chatton
chatton merged commit ef34bd5 into main Nov 11, 2025
6 checks passed
@chatton
chatton deleted the cian/fix-jwt-secret-flag branch November 11, 2025 10:35
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.

3 participants