Skip to content

Conversation

@bragaigor
Copy link
Contributor

@bragaigor bragaigor commented Jan 21, 2026

Introduce continuous mode for JIT Validator. Unlike "Native" mode (which runs logic in-process), this module manages a persistent subprocess (jit) to perform validation. The communication protocol handles the exchange of validation inputs (batches, preimages, WASM binaries) and outputs (new state). This mode is the equivalent of current JIT Validator functionality in Go, where main logic can be found here:

func (machine *JitMachine) prove(

Default mode is set to "Native".

Some functionality like JitLocator is left out on purpose as those will be introduced in a separate PR. This other PR shows a more holistic view of how everything will eventually fit together.

This PR also introduces Validator graceful shutdown mechanism in case it receives certain signals.

Closes NIT-4305

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.49%. Comparing base (efc1cdb) to head (fda3eb1).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4269      +/-   ##
==========================================
- Coverage   33.04%   32.49%   -0.55%     
==========================================
  Files         482      482              
  Lines       57028    57028              
==========================================
- Hits        18843    18533     -310     
- Misses      34778    35252     +474     
+ Partials     3407     3243     -164     

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

❌ 7 Tests Failed:

Tests completed Failed Passed Skipped
4102 7 4095 0
View the top 3 failed tests by shortest run time
TestDataStreaming_CannotReplay
Stack Traces | 0.000s run time
=== RUN   TestDataStreaming_CannotReplay
WARN [01-28|19:32:49.000] Served datastreaming_start               conn=127.0.0.1:34212 reqid=1 duration="137.077µs" err="too much time has elapsed since request was signed"
INFO [01-28|19:32:49.000] rpc response                             method=datastreaming_start logId=1 err="too much time has elapsed since request was signed" result={}   attempt=0 args="[\"0x697a6460\", \"0x5\", \"0xd9\", \"0x400\", \"0xa\", \"0x19984654370bc31b4d6b199f6709726e1ad478de08af2843c8edc5c01d47b53a15b58f2ea36d531b0475721c08e25e8fae2ca9cc2b0cd96d51ec424ff7b2065500\"]" errorData=null
    protocol_test.go:197: goroutine 3356 [running]:
        runtime/debug.Stack()
        	/opt/hostedtoolcache/go/1.25.6/x64/src/runtime/debug/stack.go:26 +0x5e
        github.com/offchainlabs/nitro/util/testhelpers.RequireImpl({0x161f8d0, 0xc001439880}, {0x1606120, 0xc0011bc300}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/util/testhelpers/testhelpers.go:29 +0x9f
        github.com/offchainlabs/nitro/daprovider/data_streaming.TestDataStreaming_CannotReplay(0xc001439880)
        	/home/runner/work/nitro/nitro/daprovider/data_streaming/protocol_test.go:197 +0x145
        testing.tRunner(0xc001439880, 0x14b0a98)
        	/opt/hostedtoolcache/go/1.25.6/x64/src/testing/testing.go:1934 +0xea
        created by testing.(*T).Run in goroutine 1
        	/opt/hostedtoolcache/go/1.25.6/x64/src/testing/testing.go:1997 +0x465
        
    protocol_test.go:197: �[31;1m [] too much time has elapsed since request was signed �[0;0m
--- FAIL: TestDataStreaming_CannotReplay (0.00s)
TestOutOfGasInStorageCacheFlush
Stack Traces | 2.910s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [01-28|19:45:48.873] Transaction pool stopped
INFO [01-28|19:45:48.873] Persisting dirty state                   head=37  root=311e79..52efcb layers=37
INFO [01-28|19:45:48.876] Persisted dirty state to disk            size=182.40KiB  elapsed=2.834ms
INFO [01-28|19:45:48.877] Blockchain stopped
INFO [01-28|19:45:48.877] HTTP server stopped                      endpoint=127.0.0.1:45541
TRACE[01-28|19:45:48.877] P2P networking is spinning down
INFO [01-28|19:45:48.877] Submitted transaction                    hash=0xaa499b11e1e39597277abaca9ac2be596b9ae816ef9d36a1f677bb5a64a652b6 from=0xb386a74Dcab67b66F8AC07B4f08365d37495Dd23 nonce=5    recipient=0x0e78A6AED8468A1Fd8428C4092EBBbe4f4D23e26 value=0
INFO [01-28|19:45:48.878] DataPoster sent transaction              nonce=5    hash=aa499b..a652b6 feeCap=15,337,916,100 tipCap=50,000,000    blobFeeCap=<nil> gas=526,525
INFO [01-28|19:45:48.878] Starting work on payload                 id=0x035ac4a22f342e97
INFO [01-28|19:45:48.878] BatchPoster: batch sent                  sequenceNumber=6   from=17   to=20   prevDelayed=1   currentDelayed=1   totalSegments=6  numBlobs=0
INFO [01-28|19:45:48.879] Submitted transaction                    hash=0xe9fea9184c8b45544157a842b60e55b114d4c821a383c1e79c9cc6d41d29428b from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=1333 recipient=0x9EDAfA0CF95Cf72D3344a6c740E389c6D8F20785 value=1,000,000,000,000,000,000,000,000
INFO [01-28|19:45:48.879] Updated payload                          id=0x035ac4a22f342e97 number=37   hash=490754..271ab8 txs=1   withdrawals=0 gas=511,300    fees=2.5565e-05     root=52e280..534a1b elapsed=1.127ms
INFO [01-28|19:45:48.879] InboxTracker                             sequencerBatchCount=6   messageCount=17   l1Block=36   l1Timestamp=2026-01-28T19:45:48+0000
INFO [01-28|19:45:48.880] Stopping work on payload                 id=0x035ac4a22f342e97 reason=delivery
INFO [01-28|19:45:48.880] Starting work on payload                 id=0x0333fdf99b776c7f
INFO [01-28|19:45:48.881] Imported new potential chain segment     number=37   hash=490754..271ab8 blocks=1  txs=1   mgas=0.511  elapsed=1.756ms      mgasps=291.042  triediffs=193.53KiB  triedirty=0.00B
INFO [01-28|19:45:48.882] Submitted transaction                    hash=0xe3c051bb3e73a8cf3be560d8f759fa78e499cc165d0483bb543a028323f6bf02 from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=23   recipient=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 value=1
INFO [01-28|19:45:48.882] Chain head was updated                   number=37   hash=490754..271ab8 root=52e280..534a1b elapsed="194.091µs"
INFO [01-28|19:45:48.882] Updated payload                          id=0x0333fdf99b776c7f number=1658 hash=a25f4d..db9103 txs=1   withdrawals=0 gas=102,456    fees=0.0102456      root=705b46..a40395 elapsed=1.494ms
--- FAIL: TestOutOfGasInStorageCacheFlush (2.91s)
TestVersion40
Stack Traces | 5.210s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:71 +0x64b
        testing.tRunner(0xc00fa3aa80, 0x3cdb600)
        	/opt/hostedtoolcache/go/1.25.6/x64/src/testing/testing.go:1934 +0xea
        created by testing.(*T).Run in goroutine 1
        	/opt/hostedtoolcache/go/1.25.6/x64/src/testing/testing.go:1997 +0x465
        
    precompile_inclusion_test.go:94: �[31;1m [] execution aborted (timeout = 5s) �[0;0m
INFO [01-28|19:44:30.190] Writing cached state to disk             block=1 hash=847041..a3cf07 root=d45d64..4e7811
INFO [01-28|19:44:30.190] Persisted trie from memory database      nodes=23  flushnodes=0 size=3.61KiB   flushsize=0.00B time="135.342µs" flushtime=0s gcnodes=0 gcsize=0.00B gctime="3.107µs" livenodes=0   livesize=0.00B
INFO [01-28|19:44:30.190] Writing cached state to disk             block=1 hash=847041..a3cf07 root=d45d64..4e7811
INFO [01-28|19:44:30.190] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time="2.084µs"   flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s        livenodes=0   livesize=0.00B
INFO [01-28|19:44:30.190] Writing snapshot state to disk           root=28fb26..40a768
INFO [01-28|19:44:30.190] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time=861ns       flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s        livenodes=0   livesize=0.00B
INFO [01-28|19:44:30.191] Blockchain stopped
INFO [01-28|19:44:30.191] New Key                                  name=Faucet           Address=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A
INFO [01-28|19:44:30.191] New Key                                  name=RollupOwner      Address=0x57Ff0F473737a1c161bfF9efDF016F7991585088
INFO [01-28|19:44:30.191] New Key                                  name=Sequencer        Address=0xb386a74Dcab67b66F8AC07B4f08365d37495Dd23
INFO [01-28|19:44:30.191] New Key                                  name=Validator        Address=0x83FFCFaCE2Fb0E1286686815503608A16EF41e47
INFO [01-28|19:44:30.191] New Key                                  name=User             Address=0x7E23C8862920797d81916d62c274dd9217113e28
--- FAIL: TestVersion40 (5.21s)

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

@bragaigor bragaigor force-pushed the braga/only-validation-cont-mode branch from 85a7be7 to 0f651ac Compare January 22, 2026 01:38
@bragaigor bragaigor marked this pull request as ready for review January 22, 2026 03:02
@bragaigor bragaigor requested a review from eljobe January 22, 2026 03:04
Add test related to server lifecycle and update
complete_machine to kill parent process instead
of waiting for it

Signed-off-by: Igor Braga <[email protected]>
pmikolajczyk41
pmikolajczyk41 previously approved these changes Jan 27, 2026
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 left a comment

Choose a reason for hiding this comment

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

awesome work

Ignoring the test since the workflow this is run does
not have a jit binary available so it's failing with
`No such file or directory`. Support for it will come
in a separate PR

Signed-off-by: Igor Braga <[email protected]>
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.

4 participants