Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
d21b735
add draft of debug block
magicxyyz Sep 24, 2025
55880e4
Merge branch 'master' into debug-block
magicxyyz Sep 25, 2025
dc79489
set chain config in debug block
magicxyyz Sep 25, 2025
0fa4d20
cleanup sequencer config
magicxyyz Sep 25, 2025
94f58b2
open arbosstate for writing chain config in debug block
magicxyyz Sep 25, 2025
b7583c5
use chainConfig.ArbitrumChainParams.DebugAddress in debug block
magicxyyz Sep 26, 2025
9664d99
update geth pin
magicxyyz Sep 29, 2025
28a48ba
Merge branch 'master' into debug-block
magicxyyz Sep 29, 2025
0089af3
use build tag to guard debug block injection
magicxyyz Sep 30, 2025
f591e5a
add dangerous config for debugblock, guard impl with build tag
magicxyyz Oct 1, 2025
b6deb16
publish debug tx to trigger next block
magicxyyz Oct 2, 2025
8f96031
update geth pin
magicxyyz Oct 2, 2025
f0d4fd9
Merge branch 'master' into debug-block
magicxyyz Oct 2, 2025
45039a6
fix returning error from stubbed debugblock.ConfigAddOptions
magicxyyz Oct 2, 2025
c55d177
use hardcoded account to trigger debug block
magicxyyz Oct 3, 2025
0e1dd84
add system test for debug block injection
magicxyyz Oct 3, 2025
4352417
expand trigger account comment
magicxyyz Oct 3, 2025
01a3e3c
test that debug block injection doesn't affect prod build
magicxyyz Oct 3, 2025
7c10a57
rename debug block test file
magicxyyz Oct 3, 2025
e737880
fix challenge test build
magicxyyz Oct 6, 2025
967954d
update geth pin
magicxyyz Oct 6, 2025
efdc491
Merge branch 'master' into debug-block
magicxyyz Oct 6, 2025
f1434ef
Merge branch 'master' into debug-block
magicxyyz Oct 7, 2025
3fcbad7
add experimental tooling tests to ci workflow
magicxyyz Oct 7, 2025
6d32415
execute only TestExperimental tests in experimental ci step
magicxyyz Oct 7, 2025
6a4986c
add nitro-node-experimental to Dockerfile
magicxyyz Oct 7, 2025
2668155
Merge branch 'master' into debug-block
magicxyyz Oct 7, 2025
a989d74
copy debugblock package into wasm-bin-builder
magicxyyz Oct 7, 2025
4e34dce
Merge branch 'master' into debug-block
magicxyyz Oct 7, 2025
229410c
Merge branch 'master' into debug-block
magicxyyz Oct 8, 2025
009dbb1
use DebugAddress as pointer
magicxyyz Oct 9, 2025
1d954f8
update geth pin
magicxyyz Oct 9, 2025
1979462
add BenchSequencer
magicxyyz Oct 9, 2025
373946d
add missing newline
magicxyyz Oct 10, 2025
d7d885a
Merge branch 'master' into debug-block
magicxyyz Oct 10, 2025
1dbc550
add bench sequencer system tests
magicxyyz Oct 10, 2025
e53f1a4
Merge branch 'debug-block' into bench-sequencer
magicxyyz Oct 10, 2025
1c6308a
remove unnecessery BenchSequencer.StopAndWait
magicxyyz Oct 13, 2025
ae315ef
remove unused config param from NewBenchSequencer
magicxyyz Oct 22, 2025
547bad7
update geth pin
magicxyyz Oct 22, 2025
15200f6
Merge branch 'master' into debug-block
magicxyyz Nov 5, 2025
64466d8
update geth pin
magicxyyz Nov 5, 2025
faf8fc6
Merge branch 'master' into debug-block
magicxyyz Nov 5, 2025
d46410c
fix debug block test param
magicxyyz Nov 5, 2025
c7ff5df
fix missing chain config overwrite in common_test
magicxyyz Nov 5, 2025
0dcd27f
Merge branch 'debug-block' into bench-sequencer
magicxyyz Nov 5, 2025
fca5848
apply lint format
magicxyyz Nov 5, 2025
e8ddbe5
update debug block tx warning message
magicxyyz Nov 5, 2025
c9a6fa5
add missing copyright comments
magicxyyz Nov 5, 2025
3516227
fix challange test build
magicxyyz Nov 5, 2025
0333e8a
Merge branch 'debug-block' into bench-sequencer
magicxyyz Nov 6, 2025
341aca2
add benchseq rpc returning retry queue length
magicxyyz Nov 7, 2025
67f607a
Merge pull request #3806 from OffchainLabs/bench-sequencer
joshuacolvin0 Nov 7, 2025
ec34f2e
update geth pin
magicxyyz Nov 10, 2025
c2f5f47
Merge branch 'master' into debug-block
magicxyyz Nov 10, 2025
1bf903c
improve debug block accounts prefunding
magicxyyz Nov 11, 2025
6a011ef
fix debug block prefund
magicxyyz Nov 11, 2025
ff84586
update geth pin
magicxyyz Dec 15, 2025
528c9c7
Merge branch 'master' into debug-block
magicxyyz Dec 15, 2025
6caeb5e
Merge branch 'master' into debug-block
magicxyyz Dec 15, 2025
006e790
update pin
KolbyML Feb 4, 2026
1e7bfa0
Merge remote-tracking branch 'origin/master' into debug-block
KolbyML Feb 4, 2026
c840a64
fix conflicts 1
KolbyML Feb 5, 2026
0299c9f
revert broken submodules for git merge
KolbyML Feb 5, 2026
82886ed
Merge remote-tracking branch 'origin/master' into debug-block
KolbyML Feb 5, 2026
47870ac
fix code cov issue
KolbyML Feb 5, 2026
2f6cf8a
Remove benchmark code from debug code
KolbyML Feb 5, 2026
014c5b5
Merge remote-tracking branch 'origin/master' into debug-block
KolbyML Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/_go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ on:
run-pebble-b:
required: false
type: boolean
run-experimental:
required: false,
type: boolean

jobs:
go-tests:
Expand Down Expand Up @@ -317,6 +320,13 @@ jobs:
verbose: false
token: ${{ secrets.CODECOV_TOKEN }}

# --------------------- EXPERIMENTAL MODE --------------------
- name: run experimental tooling tests
if: inputs.run-experimental
run: >-
${{ github.workspace }}/.github/workflows/gotestsum.sh
--tags debugblock --run TestExperimental --timeout 60m --cover

# --------------------- ARCHIVE LOGS FOR ALL MODES ---------------------

- name: Archive detailed run log
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ COPY ./contracts/package.json ./contracts/yarn.lock ./contracts/
COPY ./safe-smart-account ./safe-smart-account
COPY ./solgen/gen.go ./solgen/
COPY ./go-ethereum ./go-ethereum
COPY ./experimental/debugblock ./experimental/debugblock
COPY scripts/remove_reference_types.sh scripts/
COPY --from=brotli-wasm-export / target/
COPY --from=contracts-builder workspace/contracts-local/out/precompiles/ contracts-local/out/precompiles/
Expand Down Expand Up @@ -354,5 +355,11 @@ RUN export DEBIAN_FRONTEND=noninteractive && \

USER user

FROM nitro-node AS nitro-node-experimental
USER root
COPY --from=node-builder /workspace/target/bin/nitro-experimental /usr/local/bin/
ENTRYPOINT [ "/usr/local/bin/nitro-experimental" , "--validation.wasm.allowed-wasm-module-roots", "/home/user/nitro-legacy/machines,/home/user/target/machines"]
USER user

FROM nitro-node AS nitro-node-default
# Just to ensure nitro-node-dist is default
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ all: build build-replay-env test-gen-proofs
@touch .make/all

.PHONY: build
build: $(patsubst %,$(output_root)/bin/%, nitro deploy relay daprovider anytrustserver autonomous-auctioneer bidder-client anytrusttool blobtool el-proxy mockexternalsigner seq-coordinator-invalidate nitro-val seq-coordinator-manager dbconv genesis-generator transaction-filterer)
build: $(patsubst %,$(output_root)/bin/%, nitro deploy relay daprovider anytrustserver autonomous-auctioneer bidder-client anytrusttool blobtool el-proxy mockexternalsigner seq-coordinator-invalidate nitro-val seq-coordinator-manager dbconv genesis-generator transaction-filterer nitro-experimental)
@printf $(done)

.PHONY: build-node-deps
Expand Down Expand Up @@ -249,6 +249,11 @@ test-go-redis: test-go-deps
.github/workflows/gotestsum.sh --timeout 120m --run TestRedis --nolog -- --test_redis=redis://localhost:6379/0
@printf $(done)

.PHONY: test-go-experimental
test-go-experimental: test-go-deps
.github/workflows/gotestsum.sh --timeout 120m --run TestExperimental --tags debugblock --nolog
@printf $(done)

.PHONY: test-gen-proofs
test-gen-proofs: \
$(arbitrator_test_wasms) \
Expand Down Expand Up @@ -361,6 +366,10 @@ $(output_root)/bin/dbconv: $(DEP_PREDICATE) build-node-deps
$(output_root)/bin/transaction-filterer: $(DEP_PREDICATE) build-node-deps
go build $(GOLANG_PARAMS) -o $@ "$(CURDIR)/cmd/transaction-filterer"

# nitro built with experimental tooling enabled
$(output_root)/bin/nitro-experimental: $(DEP_PREDICATE) build-node-deps
go build $(GOLANG_PARAMS) --tags debugblock -o $@ "$(CURDIR)/cmd/nitro"

# recompile wasm, but don't change timestamp unless files differ
$(replay_wasm): $(DEP_PREDICATE) $(go_source) .make/solgen
mkdir -p `dirname $(replay_wasm)`
Expand Down
5 changes: 5 additions & 0 deletions arbos/block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/offchainlabs/nitro/arbos/arbostypes"
"github.com/offchainlabs/nitro/arbos/l2pricing"
"github.com/offchainlabs/nitro/arbos/util"
"github.com/offchainlabs/nitro/experimental/debugblock"
"github.com/offchainlabs/nitro/util/arbmath"
)

Expand Down Expand Up @@ -247,6 +248,10 @@ func ProduceBlockAdvanced(

firstTx := types.NewTx(startTx)

if chainConfig.DebugMode() && header.Number.Uint64() == chainConfig.ArbitrumChainParams.DebugBlock {
debugblock.DebugBlockStateUpdate(statedb, expectedBalanceDelta, chainConfig)
}

for {
// repeatedly process the next tx, doing redeems created along the way in FIFO order

Expand Down
3 changes: 3 additions & 0 deletions cmd/nitro/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ func openInitializeExecutionDB(ctx context.Context, stack *node.Node, config *No
if err := dbutil.UnfinishedConversionCheck(chainDB); err != nil {
return nil, nil, fmt.Errorf("l2chaindata unfinished database conversion check error: %w", err)
}
if config.Execution.Dangerous.DebugBlock.OverwriteChainConfig {
config.Execution.Dangerous.DebugBlock.Apply(chainConfig)
}
wasmDB, err := stack.OpenDatabaseWithOptions("wasm", node.DatabaseOptions{Cache: config.Execution.Caching.DatabaseCache, Handles: config.Persistent.Handles, MetricsNamespace: "wasm/", PebbleExtraOptions: persistentConfig.Pebble.ExtraOptions("wasm"), NoFreezer: true})
if err != nil {
return nil, nil, err
Expand Down
26 changes: 25 additions & 1 deletion execution/gethexec/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/offchainlabs/nitro/consensus/consensusrpcclient"
"github.com/offchainlabs/nitro/execution"
executionrpcserver "github.com/offchainlabs/nitro/execution/rpcserver"
"github.com/offchainlabs/nitro/experimental/debugblock"
"github.com/offchainlabs/nitro/solgen/go/precompilesgen"
"github.com/offchainlabs/nitro/util"
"github.com/offchainlabs/nitro/util/arbmath"
Expand Down Expand Up @@ -139,6 +140,7 @@ type Config struct {
RPCServer rpcserver.Config `koanf:"rpc-server"`
ConsensusRPCClient rpcclient.ClientConfig `koanf:"consensus-rpc-client" reload:"hot"`
AddressFilter addressfilter.Config `koanf:"address-filter" reload:"hot"`
Dangerous DangerousConfig `koanf:"dangerous"`

forwardingTarget string
}
Expand Down Expand Up @@ -173,6 +175,9 @@ func (c *Config) Validate() error {
if err := c.AddressFilter.Validate(); err != nil {
return fmt.Errorf("error validating addressfilter config: %w", err)
}
if err := c.Dangerous.Validate(); err != nil {
return err
}
return nil
}

Expand All @@ -197,6 +202,7 @@ func ConfigAddOptions(prefix string, f *pflag.FlagSet) {
rpcserver.ConfigAddOptions(prefix+".rpc-server", "execution", f)
rpcclient.RPCClientAddOptions(prefix+".consensus-rpc-client", f, &ConfigDefault.ConsensusRPCClient)
addressfilter.ConfigAddOptions(prefix+".address-filter", f)
DangerousConfigAddOptions(prefix+".dangerous", f)
}

type LiveTracingConfig struct {
Expand All @@ -214,6 +220,25 @@ func LiveTracingConfigAddOptions(prefix string, f *pflag.FlagSet) {
f.String(prefix+".json-config", DefaultLiveTracingConfig.JSONConfig, "(experimental) Tracer configuration in JSON format")
}

type DangerousConfig struct {
DebugBlock debugblock.Config `koanf:"debug-block"`
}

var DefaultDangerousConfig = DangerousConfig{
DebugBlock: debugblock.ConfigDefault,
}

func DangerousConfigAddOptions(prefix string, f *pflag.FlagSet) {
debugblock.ConfigAddOptions(prefix+".debug-block", f)
}

func (c *DangerousConfig) Validate() error {
if err := c.DebugBlock.Validate(); err != nil {
return err
}
return nil
}

var ConfigDefault = Config{
RPC: arbitrum.DefaultConfig,
TxIndexer: DefaultTxIndexerConfig,
Expand Down Expand Up @@ -446,7 +471,6 @@ func CreateExecutionNode(
Authenticated: config.RPCServer.Authenticated,
})
}

stack.RegisterAPIs(apis)

return execNode, nil
Expand Down
33 changes: 25 additions & 8 deletions execution/gethexec/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/offchainlabs/nitro/arbutil"
"github.com/offchainlabs/nitro/execution"
"github.com/offchainlabs/nitro/execution/gethexec/eventfilter"
"github.com/offchainlabs/nitro/experimental/debugblock"
"github.com/offchainlabs/nitro/timeboost"
"github.com/offchainlabs/nitro/util/arbmath"
"github.com/offchainlabs/nitro/util/containers"
Expand Down Expand Up @@ -82,13 +83,13 @@ type SequencerConfig struct {
ExpectedSurplusHardThreshold string `koanf:"expected-surplus-hard-threshold" reload:"hot"`
EnableProfiling bool `koanf:"enable-profiling" reload:"hot"`
Timeboost TimeboostConfig `koanf:"timeboost"`
Dangerous DangerousConfig `koanf:"dangerous"`
Dangerous SequencerDangerousConfig `koanf:"dangerous"`
EventFilter eventfilter.EventFilterConfig `koanf:"event-filter"`
expectedSurplusSoftThreshold int
expectedSurplusHardThreshold int
}

type DangerousConfig struct {
type SequencerDangerousConfig struct {
DisableSeqInboxMaxDataSizeCheck bool `koanf:"disable-seq-inbox-max-data-size-check"`
DisableBlobBaseFeeCheck bool `koanf:"disable-blob-base-fee-check"`
}
Expand Down Expand Up @@ -215,11 +216,11 @@ var DefaultSequencerConfig = SequencerConfig{
ExpectedSurplusHardThreshold: "default",
EnableProfiling: false,
Timeboost: DefaultTimeboostConfig,
Dangerous: DefaultDangerousConfig,
Dangerous: DefaultSequencerDangerousConfig,
EventFilter: eventfilter.DefaultEventFilterConfig,
}

var DefaultDangerousConfig = DangerousConfig{
var DefaultSequencerDangerousConfig = SequencerDangerousConfig{
DisableSeqInboxMaxDataSizeCheck: false,
}

Expand All @@ -233,7 +234,7 @@ func SequencerConfigAddOptions(prefix string, f *pflag.FlagSet) {
AddOptionsForSequencerForwarderConfig(prefix+".forwarder", f)
TimeboostAddOptions(prefix+".timeboost", f)

DangerousAddOptions(prefix+".dangerous", f)
SequencerDangerousAddOptions(prefix+".dangerous", f)
EventFilterAddOptions(prefix+".event-filter", f)
f.Int(prefix+".queue-size", DefaultSequencerConfig.QueueSize, "size of the pending tx queue")
f.Duration(prefix+".queue-timeout", DefaultSequencerConfig.QueueTimeout, "maximum amount of time transaction can wait in queue")
Expand All @@ -260,9 +261,9 @@ func TimeboostAddOptions(prefix string, f *pflag.FlagSet) {
f.Uint64(prefix+".queue-timeout-in-blocks", DefaultTimeboostConfig.QueueTimeoutInBlocks, "maximum amount of time (measured in blocks) that Express Lane transactions can wait in the sequencer's queue")
}

func DangerousAddOptions(prefix string, f *pflag.FlagSet) {
f.Bool(prefix+".disable-seq-inbox-max-data-size-check", DefaultDangerousConfig.DisableSeqInboxMaxDataSizeCheck, "DANGEROUS! disables nitro checks on sequencer MaxTxDataSize against the sequencer inbox MaxDataSize")
f.Bool(prefix+".disable-blob-base-fee-check", DefaultDangerousConfig.DisableBlobBaseFeeCheck, "DANGEROUS! disables nitro checks on sequencer for blob base fee")
func SequencerDangerousAddOptions(prefix string, f *pflag.FlagSet) {
f.Bool(prefix+".disable-seq-inbox-max-data-size-check", DefaultSequencerDangerousConfig.DisableSeqInboxMaxDataSizeCheck, "DANGEROUS! disables nitro checks on sequencer MaxTxDataSize against the sequencer inbox MaxDataSize")
f.Bool(prefix+".disable-blob-base-fee-check", DefaultSequencerDangerousConfig.DisableBlobBaseFeeCheck, "DANGEROUS! disables nitro checks on sequencer for blob base fee")
}

func EventFilterAddOptions(prefix string, f *pflag.FlagSet) {
Expand Down Expand Up @@ -1265,6 +1266,22 @@ func (s *Sequencer) createBlock(ctx context.Context) (returnValue bool) {

var startOfReadingFromTxQueue time.Time

if s.execEngine.bc.Config().DebugMode() {
chainConfig := s.execEngine.bc.Config()
if lastBlock.Number.Uint64()+1 == chainConfig.ArbitrumChainParams.DebugBlock {
// publish transaction to trigger next block
tx := debugblock.PrepareDebugTransaction(chainConfig, lastBlock)
if tx != nil {
go func() {
if err := s.PublishTransaction(ctx, tx, nil); err != nil {
log.Error("debug block: failed to publish tx", "err", err)
} else {
log.Warn("published dangerous debug block tx", "txHash", tx.Hash())
}
}()
}
}
}
for {
if len(queueItems) == 1 {
startOfReadingFromTxQueue = time.Now()
Expand Down
19 changes: 19 additions & 0 deletions experimental/debugblock/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2025, Offchain Labs, Inc.
// For license information, see https://github.com/offchainlabs/nitro/blob/master/LICENSE.md

// DANGER! this file is included in all builds
// DANGER! do not place any of the experimental logic and features here

package debugblock

type Config struct {
OverwriteChainConfig bool `koanf:"overwrite-chain-config"`
DebugAddress string `koanf:"debug-address"`
DebugBlockNum uint64 `koanf:"debug-blocknum"`
}

var ConfigDefault = Config{
OverwriteChainConfig: false,
DebugAddress: "",
DebugBlockNum: 0,
}
Loading
Loading