Skip to content

Nitro validation client connects to the Rust validation server#4450

Merged
eljobe merged 16 commits intomasterfrom
pmikolajczyk/nit-4594
Mar 6, 2026
Merged

Nitro validation client connects to the Rust validation server#4450
eljobe merged 16 commits intomasterfrom
pmikolajczyk/nit-4594

Conversation

@pmikolajczyk41
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 commented Mar 3, 2026

Since the Nitro validation client uses JSON RPC communication, we actually have to abandon nice HTTP path-based routing in favor of a single root dispatcher, that inspects the method field in the JSON RPC envelope.

This PR makes necessary changes and adds a system test, where we create a validation client object (Nitro native component) connected to a running Rust validation service and ensure that the two communicate properly.

Next steps:

  • add a system test for validating a block using the Rust validation server
  • consider migrating from axum to a simpler jsonrpsee (dedicated for JSON RPC) server backend; this is not critical, because axum works well and has nice integrations (e.g. for tracing), but we actually don't need all its capabilities

closes NIT-4594

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.70%. Comparing base (b9b3864) to head (8445d14).
⚠️ Report is 64 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4450      +/-   ##
==========================================
+ Coverage   32.72%   34.70%   +1.98%     
==========================================
  Files         493      493              
  Lines       58290    58290              
==========================================
+ Hits        19076    20231    +1155     
+ Misses      35868    34475    -1393     
- Partials     3346     3584     +238     

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

❌ 11 Tests Failed:

Tests completed Failed Passed Skipped
4301 11 4290 0
View the top 3 failed tests by shortest run time
TestNitroNodeVersionAlerter
Stack Traces | 1.870s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [03-04|10:00:05.140] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time=862ns        flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s         livenodes=0   livesize=0.00B
INFO [03-04|10:00:05.140] Blockchain stopped
INFO [03-04|10:00:05.147] Starting work on payload                 id=0x032dee08a7d8221a
INFO [03-04|10:00:05.151] Submitted contract creation              hash=0xcb3b145beaa11bc4d864d5b1a402f8072db7623ef91f7c215a283f82a62d892a from=0x57Ff0F473737a1c161bfF9efDF016F7991585088 nonce=18 contract=0x548c9E48e32748F36CD0265E6e6359e20c2432FA value=0
INFO [03-04|10:00:05.151] Deploying admin logic contracts
�[90mhostio-test: len 13.80K vs 50.42K�[0;0m
INFO [03-04|10:00:05.155] Submitted transaction                    hash=0x60e0b638226cd50c2dce60dd90b7b9de9abb3ae104bc2d3c6e428302ea318e8f from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=9  recipient=0x3a0a61C11D96F5B8c1492bEaA5bDAedefFff15E8 value=0
INFO [03-04|10:00:05.159] Updated payload                          id=0x032dee08a7d8221a number=21 hash=cb6ab5..ba9e5c txs=1  withdrawals=0 gas=5,156,618  fees=5.156618e-06  root=7b3195..ccc9ce elapsed=11.340ms
INFO [03-04|10:00:05.163] Stopping work on payload                 id=0x032dee08a7d8221a reason=delivery
INFO [03-04|10:00:05.164] InboxTracker                             sequencerBatchCount=2 messageCount=2  l1Block=28 l1Timestamp=2026-03-04T10:00:03+0000
INFO [03-04|10:00:05.165] Imported new potential chain segment     number=21 hash=cb6ab5..ba9e5c blocks=1  txs=1  mgas=5.157  elapsed=4.880ms     mgasps=1056.582 triediffs=75.96KiB  triedirty=0.00B
INFO [03-04|10:00:05.166] Chain head was updated                   number=21 hash=cb6ab5..ba9e5c root=7b3195..ccc9ce elapsed="421.103µs"
INFO [03-04|10:00:05.168] Starting work on payload                 id=0x03685135851881ee
INFO [03-04|10:00:05.169] Updated payload                          id=0x03685135851881ee number=22 hash=99e461..b43bfc txs=0  withdrawals=0 gas=0          fees=0             root=8f1877..883585 elapsed="342.187µs"
INFO [03-04|10:00:05.169] Stopping work on payload                 id=0x03685135851881ee reason=delivery
INFO [03-04|10:00:05.170] Imported new potential chain segment     number=22 hash=99e461..b43bfc blocks=1  txs=0  mgas=0.000  elapsed="830.346µs" mgasps=0.000    triediffs=78.74KiB  triedirty=0.00B
INFO [03-04|10:00:05.170] Chain head was updated                   number=22 hash=99e461..b43bfc root=8f1877..883585 elapsed="38.381µs"
INFO [03-04|10:00:05.171] Log index head rendering in progress     firstblock=0 lastblock=1  processed=2  remaining=0 elapsed=3.851s
INFO [03-04|10:00:05.171] Log index head rendering finished        firstblock=0 lastblock=1  processed=2  elapsed=3.851s
--- FAIL: TestNitroNodeVersionAlerter (1.87s)
TestNitroNodeVersionAlerter
Stack Traces | 7.710s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [03-04|10:01:29.142] Stopping work on payload                 id=0x03fb77675f1966fc reason=delivery
INFO [03-04|10:01:29.142] Persisted dirty state to disk            size=4.49KiB   elapsed="322.655µs"
INFO [03-04|10:01:29.143] Blockchain stopped
INFO [03-04|10:01:29.143] Imported new potential chain segment     number=63 hash=d99dd1..e6e87b blocks=1  txs=1  mgas=0.021  elapsed=2.781ms     mgasps=7.549    triediffs=285.83KiB triedirty=0.00B
INFO [03-04|10:01:29.144] Chain head was updated                   number=63 hash=d99dd1..e6e87b root=515988..305dc6 elapsed="73.959µs"
INFO [03-04|10:01:29.146] Submitted transaction                    hash=0xef69e4f939ee449ba831a8a32a4608bb0e8e1f15ab99935e946bd671a4650b9c from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=19 recipient=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A value=1
INFO [03-04|10:01:29.147] Deploying seq inbox bufferable
INFO [03-04|10:01:29.149] Starting work on payload                 id=0x03680371f0e5a477
INFO [03-04|10:01:29.150] Starting work on payload                 id=0x0391243673f54575
INFO [03-04|10:01:29.151] Updated payload                          id=0x03680371f0e5a477 number=59 hash=6411c5..5a1474 txs=1  withdrawals=0 gas=21000      fees=0.002098579089 root=888d2d..e9883a elapsed=1.066ms
INFO [03-04|10:01:29.151] Updated payload                          id=0x0391243673f54575 number=64 hash=d51ec8..f96844 txs=0  withdrawals=0 gas=0          fees=0              root=6275ce..a18263 elapsed="597.91µs"
INFO [03-04|10:01:29.151] Stopping work on payload                 id=0x0391243673f54575 reason=delivery
INFO [03-04|10:01:29.152] Stopping work on payload                 id=0x03680371f0e5a477 reason=delivery
INFO [03-04|10:01:29.153] Submitted transaction                    hash=0x33ead7ecd1a17203e1b93625e621715c665a832720fabb164491fd064902b2cb from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=24 recipient=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A value=1,000,000,000,000
INFO [03-04|10:01:29.153] Imported new potential chain segment     number=64 hash=d51ec8..f96844 blocks=1  txs=0  mgas=0.000  elapsed=1.945ms     mgasps=0.000    triediffs=289.26KiB triedirty=0.00B
INFO [03-04|10:01:29.153] Chain head was updated                   number=64 hash=d51ec8..f96844 root=6275ce..a18263 elapsed="67.797µs"
INFO [03-04|10:01:29.153] Imported new potential chain segment     number=59 hash=6411c5..5a1474 blocks=1  txs=1  mgas=0.021  elapsed=2.581ms     mgasps=8.136    triediffs=294.14KiB triedirty=0.00B
INFO [03-04|10:01:29.154] Chain head was updated                   number=59 hash=6411c5..5a1474 root=888d2d..e9883a elapsed="189.485µs"
WARN [03-04|10:01:29.155] Getting file info                        dir= error="stat : no such file or directory"
--- FAIL: TestNitroNodeVersionAlerter (7.71s)
TestSequencerPriceAdjustsFrom25Gwei
Stack Traces | 8.010s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [03-04|10:00:15.652] Chain head was updated                   number=36 hash=9d26c2..2507ef root=427ab7..691fb3 elapsed="110.275µs"
INFO [03-04|10:00:15.660] Submitted transaction                    hash=0xf9c87d70bfa5a8485701e4c0e62faa71e2969f92d62b3af5a070cfe676196a1b from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=45 recipient=0x0C709F340F0BB2e361229e345B7e26999d0969Ab value=1
INFO [03-04|10:00:15.661] Submitted transaction                    hash=0xdd61f54a55166415244b19cfba314d94f859de852ba61d8bd7f37a3656308197 from=0xb386a74Dcab67b66F8AC07B4f08365d37495Dd23 nonce=16 recipient=0x8cf63Fc7416c20702562D8FB090FC4B9Ce2A4c67 value=0
INFO [03-04|10:00:15.661] DataPoster sent transaction              nonce=16 hash=dd61f5..308197 feeCap=2,846,692,140  tipCap=50,000,000    blobFeeCap=<nil> gas=161,860
INFO [03-04|10:00:15.661] BatchPoster: batch sent                  sequenceNumber=17 from=29 to=33 prevDelayed=1 currentDelayed=1 totalSegments=7  numBlobs=0
INFO [03-04|10:00:15.662] Starting work on payload                 id=0x030f12ec0d449059
INFO [03-04|10:00:15.663] Updated payload                          id=0x030f12ec0d449059 number=51 hash=2ed960..8a4a22 txs=1  withdrawals=0 gas=149,506    fees=7.4753e-06     root=29a003..0c04b5 elapsed=1.066ms
INFO [03-04|10:00:15.663] Stopping work on payload                 id=0x030f12ec0d449059 reason=delivery
INFO [03-04|10:00:15.665] Imported new potential chain segment     number=51 hash=2ed960..8a4a22 blocks=1  txs=1  mgas=0.150  elapsed=1.911ms     mgasps=78.233   triediffs=277.96KiB triedirty=0.00B
INFO [03-04|10:00:15.665] Chain head was updated                   number=51 hash=2ed960..8a4a22 root=29a003..0c04b5 elapsed="97.311µs"
INFO [03-04|10:00:15.671] Submitted transaction                    hash=0x1154d8400138eff3385eaf18f622d093d65bfc2d1acabc2bef49769334d476ce from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=46 recipient=0x0C709F340F0BB2e361229e345B7e26999d0969Ab value=1
INFO [03-04|10:00:15.681] Submitted transaction                    hash=0xd6cb1ad2fca24f61f8bdf8aacf09f69939110c3fda894c710c1a550425374c54 from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=9  recipient=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 value=1
INFO [03-04|10:00:15.687] Submitted transaction                    hash=0x2149f2d9b1ecb02092c28bb8c387332de9eaf1dccf62cd95b233fada0aab541c from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=5  recipient=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A value=1
INFO [03-04|10:00:15.691] Starting work on payload                 id=0x03ce45f292638490
INFO [03-04|10:00:15.692] Updated payload                          id=0x03ce45f292638490 number=40 hash=63855d..9bc0ce txs=1  withdrawals=0 gas=21000      fees=0.002082054089 root=bc4165..fe2aa3 elapsed="962.93µs"
INFO [03-04|10:00:15.693] Stopping work on payload                 id=0x03ce45f292638490 reason=delivery
INFO [03-04|10:00:15.694] Submitted transaction                    hash=0xc7f4f5e193ef9a67449c8481d8f0546eeb85aedd7ab78db9e9b44eda6b46378f from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=47 recipient=0x0C709F340F0BB2e361229e345B7e26999d0969Ab value=1
INFO [03-04|10:00:15.697] Imported new potential chain segment     number=40 hash=63855d..9bc0ce blocks=1  txs=1  mgas=0.021  elapsed=1.371ms     mgasps=15.309   triediffs=195.75KiB triedirty=0.00B
INFO [03-04|10:00:15.697] Chain head was updated                   number=40 hash=63855d..9bc0ce root=bc4165..fe2aa3 elapsed="66.794µs"
--- FAIL: TestSequencerPriceAdjustsFrom25Gwei (8.01s)

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

@pmikolajczyk41 pmikolajczyk41 marked this pull request as ready for review March 3, 2026 10:53
Copy link
Contributor

@bragaigor bragaigor left a comment

Choose a reason for hiding this comment

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

LGTM overall, just a few minor comments

@bragaigor bragaigor assigned pmikolajczyk41 and unassigned bragaigor Mar 3, 2026
Copy link
Contributor

@bragaigor bragaigor left a comment

Choose a reason for hiding this comment

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

LGTM

@bragaigor bragaigor assigned eljobe and unassigned bragaigor Mar 3, 2026
Copy link
Member

@eljobe eljobe left a comment

Choose a reason for hiding this comment

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

Nice. Very clear PR description that made it easier to review the code. Thanks.

@eljobe eljobe enabled auto-merge March 6, 2026 10:11
@eljobe eljobe added this pull request to the merge queue Mar 6, 2026
Merged via the queue into master with commit a0d9c4f Mar 6, 2026
27 checks passed
@eljobe eljobe deleted the pmikolajczyk/nit-4594 branch March 6, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants