Skip to content

Commit

Permalink
Merge branch 'master' into sepolia_chaininfo_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee authored Feb 4, 2025
2 parents f472ccf + 6ddf703 commit 7de7c96
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bold
3 changes: 1 addition & 2 deletions cmd/nitro/nitro.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ func mainImpl() int {
return 1
}
if nodeConfig.Execution.Sequencer.Enable && !nodeConfig.Execution.Sequencer.Timeboost.Enable && nodeConfig.Node.TransactionStreamer.TrackBlockMetadataFrom != 0 {
log.Error("Sequencer node's track-block-metadata-from should not be set when timeboost is not enabled")
return 1
log.Warn("Sequencer node's track-block-metadata-from is set but timeboost is not enabled")
}

var dataSigner signature.DataSignerFunc
Expand Down
2 changes: 1 addition & 1 deletion go-ethereum
43 changes: 43 additions & 0 deletions system_tests/classic_redirect_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2021-2025, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro/blob/master/LICENSE

package arbtest

import (
"context"
"testing"
"time"

"github.com/ethereum/go-ethereum/rpc"

"github.com/offchainlabs/nitro/util/testhelpers"
)

func TestClassicRedirectURLNotLeaked(t *testing.T) {
t.Parallel()

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

// nitro will expect that listener provides an RPC server.
// However we don't need to provide a real RPC server here, so calls to it will fail
listener, err := testhelpers.FreeTCPPortListener()
Require(t, err)
defer listener.Close()

builder := NewNodeBuilder(ctx).DefaultConfig(t, false)
builder.execConfig.RPC.ClassicRedirect = "http://" + listener.Addr().String()
builder.execConfig.RPC.ClassicRedirectTimeout = time.Second
cleanup := builder.Build(t)
defer cleanup()

l2rpc := builder.L2.Stack.Attach()

var result traceResult
err = l2rpc.CallContext(ctx, &result, "arbtrace_call", callTxArgs{}, []string{"trace"}, rpc.BlockNumberOrHash{})
// checks that it errors and that the error message does not contains the classic redirect URL
expectedErrMsg := "Failed to call fallback API"
if err == nil || err.Error() != expectedErrMsg {
t.Fatalf("Expected error message to be %s, got %v", expectedErrMsg, err)
}
}

0 comments on commit 7de7c96

Please sign in to comment.