Skip to content

Enable execution only mode in nitro#4386

Open
bragaigor wants to merge 14 commits intomasterfrom
braga/consensus-exec-diff-proc
Open

Enable execution only mode in nitro#4386
bragaigor wants to merge 14 commits intomasterfrom
braga/consensus-exec-diff-proc

Conversation

@bragaigor
Copy link
Copy Markdown
Contributor

Enable execution only mode in nitro as well as consensus only mode

closes NIT-4241
relates to NIT-4202

pulls in OffchainLabs/nitro-testnode#177

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 14, 2026

❌ 9 Tests Failed:

Tests completed Failed Passed Skipped
4593 9 4584 0
View the top 3 failed tests by shortest run time
TestAliasingFlaky
Stack Traces | -0.000s run time
=== RUN   TestAliasingFlaky
=== PAUSE TestAliasingFlaky
=== CONT  TestAliasingFlaky
    common_test.go:768: BuildL1 deployConfig: DeployBold=true, DeployReferenceDAContracts=false
INFO [03-25|19:02:34.760] Starting peer-to-peer node               instance=test-stack-name/linux-amd64/go1.25.8
WARN [03-25|19:02:34.760] P2P server will be useless, neither dialing nor listening
INFO [03-25|19:02:34.762] Submitted contract creation              hash=0x399184f9977f0f6ea1e1f807698efdd88b4fcbb85106214486ecbfdf28b60683 from=0x57Ff0F473737a1c161bfF9efDF016F7991585088 nonce=0  contract=0xA46C59ce2FCaF445F96f66F0411e06A94D34BF45 value=0
INFO [03-25|19:02:34.762] New local node record                    seq=1,774,465,354,761 id=69444a579f333a90                        ip=127.0.0.1 udp=0 tcp=0
WARN [03-25|19:02:34.762] Served eth_getTransactionReceipt         reqid=7 duration="37.416µs" err="transaction indexing is in progress" errdata="\"transaction indexing is in progress\""
INFO [03-25|19:02:34.762] Started P2P networking                   self=enode://ee4125600e142a83a9ff934cfda5905c58d93e322f9ca6515276dc44cd186b431a49b8d6dd5f71af5847b0ab4a763de3cf7fba85b6a35a348d83bda67be1d19d@127.0.0.1:0
INFO [03-25|19:02:34.762] Started log indexer
WARN [03-25|19:02:34.762] Getting file info                        dir= error="stat : no such file or directory"
TestBatchPosterL1SurplusMatchesBatchGasFlaky
Stack Traces | 0.560s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2076bd2]

goroutine 66 [running]:
testing.tRunner.func1.2({0x37d7fc0, 0x61dd9b0})
	/opt/hostedtoolcache/go/1.25.8/x64/src/testing/testing.go:1872 +0x237
testing.tRunner.func1()
	/opt/hostedtoolcache/go/1.25.8/x64/src/testing/testing.go:1875 +0x35b
panic({0x37d7fc0?, 0x61dd9b0?})
	/opt/hostedtoolcache/go/1.25.8/x64/src/runtime/panic.go:783 +0x132
github.com/offchainlabs/nitro/arbnode.(*InboxTracker).GetBatchCount(0x187d900?)
	/home/runner/work/nitro/nitro/arbnode/inbox_tracker.go:210 +0x12
github.com/offchainlabs/nitro/arbnode.(*InboxTracker).FindInboxBatchContainingMessage(0x0, 0x7)
	/home/runner/work/nitro/nitro/arbnode/inbox_tracker.go:225 +0x2f
github.com/offchainlabs/nitro/system_tests.TestBatchPosterL1SurplusMatchesBatchGasFlaky(0xc0005ae1c0)
	/home/runner/work/nitro/nitro/system_tests/batch_poster_test.go:838 +0x725
testing.tRunner(0xc0005ae1c0, 0x41a7988)
	/opt/hostedtoolcache/go/1.25.8/x64/src/testing/testing.go:1934 +0xea
created by testing.(*T).Run in goroutine 1
	/opt/hostedtoolcache/go/1.25.8/x64/src/testing/testing.go:1997 +0x465
TestRedisProduceComplex/one_producer,_all_consumers_are_active
Stack Traces | 1.230s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
�[36mDEBUG�[0m[03-25|21:10:11.121] consumer: xdel                           �[36mcid�[0m=93c58899-b80f-44d4-aece-85fde39d9839 �[36mmessageId�[0m=1774473009964-9
�[36mDEBUG�[0m[03-25|21:10:11.131] trimming                                 �[36mxTrimMinID�[0m=1774473009964-7 �[36mtrimmed�[0m=1 �[36mtrim-err�[0m=<nil>
�[36mDEBUG�[0m[03-25|21:10:11.131] consumer: xdel                           �[36mcid�[0m=3a3b0765-399b-46d0-9e0f-6348777a1143 �[36mmessageId�[0m=1774473009964-7
�[36mDEBUG�[0m[03-25|21:10:11.140] checkResponses                           �[36mresponded�[0m=46 �[36merrored�[0m=0 �[36mchecked�[0m=54
�[36mDEBUG�[0m[03-25|21:10:11.149] redis producer: check responses starting
�[36mDEBUG�[0m[03-25|21:10:11.156] checkResponses                           �[36mresponded�[0m=8  �[36merrored�[0m=0 �[36mchecked�[0m=8
�[31mERROR�[0m[03-25|21:10:11.157] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[03-25|21:10:11.157] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[03-25|21:10:11.158] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[03-25|21:10:11.158] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[03-25|21:10:11.158] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[03-25|21:10:11.161] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[36mDEBUG�[0m[03-25|21:10:11.161] redis producer: check responses starting
�[36mDEBUG�[0m[03-25|21:10:11.161] checkResponses                           �[36mresponded�[0m=0  �[36merrored�[0m=0 �[36mchecked�[0m=0
�[31mERROR�[0m[03-25|21:10:11.161] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[03-25|21:10:11.163] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[03-25|21:10:11.163] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
�[31mERROR�[0m[03-25|21:10:11.163] Error from XpendingExt in getting PEL for auto claim �[31merr�[0m="context canceled" �[31mpendingLen�[0m=0
    pubsub_test.go:408: mergeMaps() unexpected error: duplicate key: 1774473009947-5
--- FAIL: TestRedisProduceComplex/one_producer,_all_consumers_are_active (1.23s)

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

@bragaigor bragaigor force-pushed the braga/consensus-exec-diff-proc branch from be02672 to b2f5213 Compare February 18, 2026 19:14
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 1.80723% with 163 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.28%. Comparing base (c3dfde2) to head (e26368d).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4386      +/-   ##
==========================================
- Coverage   34.55%   34.28%   -0.27%     
==========================================
  Files         497      497              
  Lines       58985    59016      +31     
==========================================
- Hits        20381    20233     -148     
- Misses      34998    35214     +216     
+ Partials     3606     3569      -37     

Conversily enable consensus only mode in nitro

Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
@bragaigor bragaigor marked this pull request as ready for review March 12, 2026 14:01
@diegoximenes diegoximenes requested a review from Copilot March 12, 2026 16:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables running Nitro in “execution-only” or “consensus-only” mode (splitting normally co-located components) and adds configuration/validation to support RPC-based separation.

Changes:

  • Add execution/consensus enablement gating in cmd/nitro/nitro.go to allow running only one component in-process.
  • Tighten config validation for RPC-mode requirements and add --chain.genesis-block-num.
  • Bump nitro-testnode submodule and document the change in the changelog.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
nitro-testnode Updates testnode submodule revision to pick up supporting changes.
execution_consensus/init.go Allows consensus node to be absent (nil) when starting/stopping nodes.
cmd/nitro/nitro.go Introduces execution/consensus-only gating; adjusts initialization paths accordingly.
cmd/nitro/config/config.go Adds RPC-mode validation rules for mutually exclusive execution vs consensus.
cmd/conf/chain.go Adds genesis-block-num field/flag to L2 chain config.
changelog/bragaigor-nit-4241.md Documents the new mode(s) and new chain config flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
pmikolajczyk41
pmikolajczyk41 previously approved these changes Mar 13, 2026
Copy link
Copy Markdown
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.

couldn't spot any obvious problems

}

if execNode != nil {
if executionNodeEnabled && execNode != nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shouldn't/aren't these two checks redundant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

who are we if we don't have redundancy xD jokes apart you're right, I'll remove executionNodeEnabled

Copy link
Copy Markdown
Contributor

@diegoximenes diegoximenes left a comment

Choose a reason for hiding this comment

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

Not to do in this PR.
But at some point we can have less code blocks gated by if executionNode { for example, and have a single one.
This is decreasing code readability a lot.

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

But at some point we can have less code blocks gated by if executionNode { for example, and have a single one.
This is decreasing code readability a lot.

agreed and created ticket for it

Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
@bragaigor bragaigor assigned diegoximenes and unassigned bragaigor Mar 25, 2026
consensusNodeEnabled = nodeConfig.Node.RPCServer.Enable
} else {
// same process: no RPC communication
// TODO: There should be a validation that in this scenario no RPC URL is set.
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.

Missing TODO

if consensusNodeEnabled {
var chainConfig *params.ChainConfig
// TODO: First try to get chainConfig from consensusParsedInitMsg (needs https://github.com/OffchainLabs/nitro/pull/4395)
chainConfig, err = chaininfo.GetChainConfig(new(big.Int).SetUint64(nodeConfig.Chain.ID), nodeConfig.Chain.Name, nil, nodeConfig.Chain.InfoFiles, nodeConfig.Chain.InfoJson)
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.

There is this code block before:

chainInfo, err := chaininfo.ProcessChainInfo(nodeConfig.Chain.ID, nodeConfig.Chain.Name, nodeConfig.Chain.InfoFiles, nodeConfig.Chain.InfoJson)
	if err != nil {
		log.Error("error processing l2 chain info", "err", err)
		return 1
	}

This chainInfo is only retrieved in order to read the inner chain config.
Change this code block to use chaininfo.GetChainConfig, and remove this chaininfo.GetChainConfig from inside this if.

defer valNode.Stop()
}
}
if err == nil {
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.

Don't need to change this line

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