Skip to content

Add Rust validation server Docker entrypoint script and image target #4571

Draft
bragaigor wants to merge 2 commits intomasterfrom
braga/rust-val-script
Draft

Add Rust validation server Docker entrypoint script and image target #4571
bragaigor wants to merge 2 commits intomasterfrom
braga/rust-val-script

Conversation

@bragaigor
Copy link
Copy Markdown
Contributor

  • Add scripts/rust-val-entry.sh entrypoint that launches a single Rust validation server alongside the nitro node, replacing the two Go nitro-val processes used by split-val-entry.sh
  • Add nitro-node-rust-validator Docker target for standalone use
  • Add the Rust validator binary, rust-val-entry.sh, and curl to nitro-node-dev for testnode compatibility
  • Build the Rust validation server (make build-validation-server) in the prover-builder Docker stage

Key differences from split-val-entry.sh

  • Single Rust validator process instead of two Go nitro-val processes
  • No legacy machines path needed — MachineLocator auto-discovers all module roots under --root-path
  • Uses http:// URL (axum HTTP JSON-RPC) instead of ws:// (Go rpcclient supports both)
  • Health check via curl (matching CI pattern) instead of netcat

How was it tested?

Tested locally using nitro-testnode:

  1. Built the testnode with local nitro source:
cd nitro-testnode   
./test-node.bash --init-force --dev nitro --validate
  1. Modified nitro-testnode/docker-compose.yaml to use rust-val-entry.sh for the validator service:
validator:  
  entrypoint: /usr/local/bin/rust-val-entry.sh  
 # removed validation_node from depends_on
  1. Restarted the validator service and verified via docker compose logs -f validator:
  • Rust validation server starts and logs Listening on 0.0.0.0:4141
  • Health check passes
  • Nitro node launches and connects to the validator
  1. Also verified standalone image build and run:
docker build . --tag nitro-node-rust-validator --target nitro-node-rust-validator  
docker run --rm --entrypoint /usr/local/bin/rust-val-entry.sh nitro-node-rust-validator

closes NIT-4662

Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.12%. Comparing base (fd2a5b0) to head (68952d9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4571      +/-   ##
==========================================
- Coverage   34.35%   34.12%   -0.23%     
==========================================
  Files         498      498              
  Lines       58977    58977              
==========================================
- Hits        20262    20128     -134     
- Misses      35137    35274     +137     
+ Partials     3578     3575       -3     

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
4626 16 4610 0
View the top 3 failed tests by shortest run time
TestAliasingFlaky
Stack Traces | -0.000s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [03-27|16:51:59.087] Updated payload                          id=0x03966cc62e919714                      number=44 hash=dc221c..0ae37b txs=1  withdrawals=0 gas=21000     fees=0.002089421463 root=aea772..2cbc36 elapsed="294.451µs"
INFO [03-27|16:51:59.088] Stopping work on payload                 id=0x03966cc62e919714                      reason=delivery
INFO [03-27|16:51:59.088] Imported new potential chain segment     number=44 hash=dc221c..0ae37b blocks=1  txs=1  mgas=0.021 elapsed="444.904µs" mgasps=47.201   triediffs=214.99KiB triedirty=0.00B
INFO [03-27|16:51:59.088] Chain head was updated                   number=44 hash=dc221c..0ae37b root=aea772..2cbc36 elapsed="40.552µs"
INFO [03-27|16:51:59.089] Starting work on payload                 id=0x0351db2c21bcf9b8
INFO [03-27|16:51:59.089] Updated payload                          id=0x0351db2c21bcf9b8                      number=45 hash=77fd93..a0eb95 txs=0  withdrawals=0 gas=0         fees=0              root=149098..5090dd elapsed="246.624µs"
INFO [03-27|16:51:59.089] Stopping work on payload                 id=0x0351db2c21bcf9b8                      reason=delivery
INFO [03-27|16:51:59.089] Ethereum protocol stopped
INFO [03-27|16:51:59.089] Imported new potential chain segment     number=45 hash=77fd93..a0eb95 blocks=1  txs=0  mgas=0.000 elapsed="339.014µs" mgasps=0.000    triediffs=218.29KiB triedirty=0.00B
INFO [03-27|16:51:59.089] Transaction pool stopped
INFO [03-27|16:51:59.089] Chain head was updated                   number=45 hash=77fd93..a0eb95 root=149098..5090dd elapsed="25.128µs"
INFO [03-27|16:51:59.089] Persisting dirty state                   head=34 root=70fda7..3756ce layers=34
INFO [03-27|16:51:59.090] Submitted transaction                    hash=0x57e601445b3627d121f392223c7ddaf5b9f69d47135ad2f827a6de00c52de5fa from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=5  recipient=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A value=1,000,000,000,000
INFO [03-27|16:51:59.090] Starting work on payload                 id=0x03c9d2f306da1642
INFO [03-27|16:51:59.090] Persisted dirty state to disk            size=167.01KiB elapsed="958.109µs"
INFO [03-27|16:51:59.091] Blockchain stopped
INFO [03-27|16:51:59.091] Updated payload                          id=0x03c9d2f306da1642                      number=46 hash=f3a2fa..e6d04a txs=1  withdrawals=0 gas=21000     fees=0.002091897704 root=aba433..cfc706 elapsed="403.52µs"
INFO [03-27|16:51:59.091] Stopping work on payload                 id=0x03c9d2f306da1642                      reason=delivery
INFO [03-27|16:51:59.091] Imported new potential chain segment     number=46 hash=f3a2fa..e6d04a blocks=1  txs=1  mgas=0.021 elapsed="447.023µs" mgasps=46.977   triediffs=222.23KiB triedirty=0.00B
INFO [03-27|16:51:59.091] Chain head was updated                   number=46 hash=f3a2fa..e6d04a root=aba433..cfc706 elapsed="24.096µs"
TestPruningDBSizeReduction
Stack Traces | 0.000s run time
=== RUN   TestPruningDBSizeReduction
--- FAIL: TestPruningDBSizeReduction (0.00s)
TestPruningDBSizeReduction
Stack Traces | 0.000s run time
=== RUN   TestPruningDBSizeReduction
--- FAIL: TestPruningDBSizeReduction (0.00s)

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

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.

1 participant