Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
4e8c6222
Commit
4e8c6222
authored
Sep 03, 2023
by
dhanu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(op-service) - refactor log flags
- use app.Writer - remove side effects - move testlog to op-service
parent
911394b0
Changes
95
Show whitespace changes
Inline
Side-by-side
Showing
95 changed files
with
129 additions
and
135 deletions
+129
-135
config.go
endpoint-monitor/config.go
+0
-3
endpoint_monitor.go
endpoint-monitor/endpoint_monitor.go
+1
-1
api_test.go
indexer/api/api_test.go
+1
-1
cli.go
indexer/cmd/indexer/cli.go
+3
-3
config_test.go
indexer/config/config_test.go
+1
-1
setup.go
indexer/e2e_tests/setup.go
+1
-1
l1_etl_test.go
indexer/etl/l1_etl_test.go
+1
-1
batch_submitter.go
op-batcher/batcher/batch_submitter.go
+1
-4
channel_manager_test.go
op-batcher/batcher/channel_manager_test.go
+1
-1
channel_test.go
op-batcher/batcher/channel_test.go
+1
-1
config.go
op-batcher/batcher/config.go
+0
-3
entrypoint.go
op-bootnode/bootnode/entrypoint.go
+1
-1
challenger_test.go
op-challenger/challenger_test.go
+1
-1
main.go
op-challenger/cmd/main.go
+1
-5
agent_test.go
op-challenger/game/fault/agent_test.go
+2
-1
player_test.go
op-challenger/game/fault/player_test.go
+1
-1
responder_test.go
op-challenger/game/fault/responder/responder_test.go
+1
-1
updater_test.go
op-challenger/game/fault/trace/alphabet/updater_test.go
+1
-1
executor_test.go
op-challenger/game/fault/trace/cannon/executor_test.go
+1
-1
provider_test.go
op-challenger/game/fault/trace/cannon/provider_test.go
+1
-1
updater_test.go
op-challenger/game/fault/trace/cannon/updater_test.go
+1
-1
monitor_test.go
op-challenger/game/monitor_test.go
+1
-1
coordinator_test.go
op-challenger/game/scheduler/coordinator_test.go
+1
-1
scheduler_test.go
op-challenger/game/scheduler/scheduler_test.go
+1
-1
blocktime_test.go
op-e2e/actions/blocktime_test.go
+1
-1
l1_miner_test.go
op-e2e/actions/l1_miner_test.go
+1
-1
l1_replica_test.go
op-e2e/actions/l1_replica_test.go
+1
-1
l2_batcher_test.go
op-e2e/actions/l2_batcher_test.go
+1
-1
l2_engine_test.go
op-e2e/actions/l2_engine_test.go
+1
-1
l2_proposer_test.go
op-e2e/actions/l2_proposer_test.go
+1
-1
l2_sequencer_test.go
op-e2e/actions/l2_sequencer_test.go
+1
-1
l2_verifier_test.go
op-e2e/actions/l2_verifier_test.go
+1
-1
reorg_test.go
op-e2e/actions/reorg_test.go
+1
-1
sync_test.go
op-e2e/actions/sync_test.go
+1
-1
system_config_test.go
op-e2e/actions/system_config_test.go
+1
-1
user_test.go
op-e2e/actions/user_test.go
+1
-1
bridge_test.go
op-e2e/bridge_test.go
+1
-1
helper.go
op-e2e/e2eutils/challenger/helper.go
+1
-1
cannon_helper.go
op-e2e/e2eutils/disputegame/cannon_helper.go
+1
-1
helper.go
op-e2e/e2eutils/disputegame/helper.go
+1
-1
op_geth.go
op-e2e/op_geth.go
+1
-1
setup.go
op-e2e/setup.go
+1
-1
system_fpp_test.go
op-e2e/system_fpp_test.go
+1
-1
system_test.go
op-e2e/system_test.go
+1
-1
config.go
op-heartbeat/config.go
+0
-3
service.go
op-heartbeat/service.go
+1
-1
main.go
op-node/cmd/main.go
+1
-5
server_test.go
op-node/node/server_test.go
+1
-1
app_scores_test.go
op-node/p2p/app_scores_test.go
+1
-1
expiry_test.go
op-node/p2p/gating/expiry_test.go
+1
-1
gossip_test.go
op-node/p2p/gossip_test.go
+1
-1
host_test.go
op-node/p2p/host_test.go
+1
-1
peer_monitor_test.go
op-node/p2p/monitor/peer_monitor_test.go
+1
-1
peer_scorer_test.go
op-node/p2p/peer_scorer_test.go
+1
-1
peer_scores_test.go
op-node/p2p/peer_scores_test.go
+1
-1
gc_test.go
op-node/p2p/store/gc_test.go
+1
-1
ip_ban_book_test.go
op-node/p2p/store/ip_ban_book_test.go
+1
-1
peer_ban_book_test.go
op-node/p2p/store/peer_ban_book_test.go
+1
-1
scorebook_test.go
op-node/p2p/store/scorebook_test.go
+1
-1
sync_test.go
op-node/p2p/sync_test.go
+1
-1
attributes_queue_test.go
op-node/rollup/derive/attributes_queue_test.go
+1
-1
batch_queue_test.go
op-node/rollup/derive/batch_queue_test.go
+1
-1
batches_test.go
op-node/rollup/derive/batches_test.go
+1
-1
calldata_source_test.go
op-node/rollup/derive/calldata_source_test.go
+1
-1
channel_bank_test.go
op-node/rollup/derive/channel_bank_test.go
+1
-1
engine_queue_test.go
op-node/rollup/derive/engine_queue_test.go
+1
-1
l1_retrieval_test.go
op-node/rollup/derive/l1_retrieval_test.go
+1
-1
l1_traversal_test.go
op-node/rollup/derive/l1_traversal_test.go
+1
-1
origin_selector_test.go
op-node/rollup/driver/origin_selector_test.go
+1
-1
sequencer_test.go
op-node/rollup/driver/sequencer_test.go
+1
-1
start_test.go
op-node/rollup/sync/start_test.go
+1
-1
receipts_test.go
op-node/sources/receipts_test.go
+1
-1
rollupclient.go
op-node/sources/rollupclient.go
+5
-0
main.go
op-program/client/cmd/main.go
+1
-1
driver_test.go
op-program/client/driver/driver_test.go
+1
-1
client_test.go
op-program/client/l1/client_test.go
+1
-1
engine_backend_test.go
op-program/client/l2/engine_backend_test.go
+1
-1
l2_engine_api_tests.go
op-program/client/l2/engineapi/test/l2_engine_api_tests.go
+1
-1
main.go
op-program/host/cmd/main.go
+1
-5
main_test.go
op-program/host/cmd/main_test.go
+15
-0
host_test.go
op-program/host/host_test.go
+1
-1
prefetcher_test.go
op-program/host/prefetcher/prefetcher_test.go
+1
-1
retry_test.go
op-program/host/prefetcher/retry_test.go
+1
-1
config.go
op-proposer/proposer/config.go
+0
-3
l2_output_submitter.go
op-proposer/proposer/l2_output_submitter.go
+1
-1
cli.go
op-service/log/cli.go
+22
-19
writer_test.go
op-service/log/writer_test.go
+1
-1
LICENSE
op-service/testlog/LICENSE
+0
-0
README.md
op-service/testlog/README.md
+0
-0
capturing.go
op-service/testlog/capturing.go
+0
-0
testlog.go
op-service/testlog/testlog.go
+0
-0
price_bump_test.go
op-service/txmgr/price_bump_test.go
+1
-1
queue_test.go
op-service/txmgr/queue_test.go
+1
-1
txmgr_test.go
op-service/txmgr/txmgr_test.go
+1
-1
commands.go
op-wheel/commands.go
+1
-4
No files found.
endpoint-monitor/config.go
View file @
4e8c6222
...
@@ -65,9 +65,6 @@ func (c Config) Check() error {
...
@@ -65,9 +65,6 @@ func (c Config) Check() error {
if
c
.
CheckDuration
>=
c
.
CheckInterval
{
if
c
.
CheckDuration
>=
c
.
CheckInterval
{
return
fmt
.
Errorf
(
"%s must be less than %s"
,
CheckDurationFlagName
,
CheckIntervalFlagName
)
return
fmt
.
Errorf
(
"%s must be less than %s"
,
CheckDurationFlagName
,
CheckIntervalFlagName
)
}
}
if
err
:=
c
.
LogConfig
.
Check
();
err
!=
nil
{
return
err
}
if
err
:=
c
.
MetricsConfig
.
Check
();
err
!=
nil
{
if
err
:=
c
.
MetricsConfig
.
Check
();
err
!=
nil
{
return
err
return
err
}
}
...
...
endpoint-monitor/endpoint_monitor.go
View file @
4e8c6222
...
@@ -33,7 +33,7 @@ func Main(version string) func(cliCtx *cli.Context) error {
...
@@ -33,7 +33,7 @@ func Main(version string) func(cliCtx *cli.Context) error {
return
fmt
.
Errorf
(
"invalid CLI flags: %w"
,
err
)
return
fmt
.
Errorf
(
"invalid CLI flags: %w"
,
err
)
}
}
l
:=
oplog
.
NewLogger
(
cfg
.
LogConfig
)
l
:=
oplog
.
NewLogger
(
c
liCtx
,
c
fg
.
LogConfig
)
endpointMonitor
:=
NewEndpointMonitor
(
cfg
,
l
)
endpointMonitor
:=
NewEndpointMonitor
(
cfg
,
l
)
l
.
Info
(
fmt
.
Sprintf
(
"starting endpoint monitor with checkInterval=%s checkDuration=%s"
,
cfg
.
CheckInterval
,
cfg
.
CheckDuration
))
l
.
Info
(
fmt
.
Sprintf
(
"starting endpoint monitor with checkInterval=%s checkDuration=%s"
,
cfg
.
CheckInterval
,
cfg
.
CheckDuration
))
...
...
indexer/api/api_test.go
View file @
4e8c6222
...
@@ -10,7 +10,7 @@ import (
...
@@ -10,7 +10,7 @@ import (
"github.com/ethereum-optimism/optimism/indexer/api/routes"
"github.com/ethereum-optimism/optimism/indexer/api/routes"
"github.com/ethereum-optimism/optimism/indexer/config"
"github.com/ethereum-optimism/optimism/indexer/config"
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
...
...
indexer/cmd/indexer/cli.go
View file @
4e8c6222
...
@@ -28,7 +28,7 @@ var (
...
@@ -28,7 +28,7 @@ var (
)
)
func
runIndexer
(
ctx
*
cli
.
Context
)
error
{
func
runIndexer
(
ctx
*
cli
.
Context
)
error
{
log
:=
log
.
NewLogger
(
log
.
ReadCLIConfig
(
ctx
))
.
New
(
"role"
,
"indexer"
)
log
:=
log
.
NewLogger
(
ctx
,
log
.
ReadCLIConfig
(
ctx
))
.
New
(
"role"
,
"indexer"
)
cfg
,
err
:=
config
.
LoadConfig
(
log
,
ctx
.
String
(
ConfigFlag
.
Name
))
cfg
,
err
:=
config
.
LoadConfig
(
log
,
ctx
.
String
(
ConfigFlag
.
Name
))
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"failed to load config"
,
"err"
,
err
)
log
.
Error
(
"failed to load config"
,
"err"
,
err
)
...
@@ -52,7 +52,7 @@ func runIndexer(ctx *cli.Context) error {
...
@@ -52,7 +52,7 @@ func runIndexer(ctx *cli.Context) error {
}
}
func
runApi
(
ctx
*
cli
.
Context
)
error
{
func
runApi
(
ctx
*
cli
.
Context
)
error
{
log
:=
log
.
NewLogger
(
log
.
ReadCLIConfig
(
ctx
))
.
New
(
"role"
,
"api"
)
log
:=
log
.
NewLogger
(
ctx
,
log
.
ReadCLIConfig
(
ctx
))
.
New
(
"role"
,
"api"
)
cfg
,
err
:=
config
.
LoadConfig
(
log
,
ctx
.
String
(
ConfigFlag
.
Name
))
cfg
,
err
:=
config
.
LoadConfig
(
log
,
ctx
.
String
(
ConfigFlag
.
Name
))
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"failed to load config"
,
"err"
,
err
)
log
.
Error
(
"failed to load config"
,
"err"
,
err
)
...
@@ -71,7 +71,7 @@ func runApi(ctx *cli.Context) error {
...
@@ -71,7 +71,7 @@ func runApi(ctx *cli.Context) error {
}
}
func
runMigrations
(
ctx
*
cli
.
Context
)
error
{
func
runMigrations
(
ctx
*
cli
.
Context
)
error
{
log
:=
log
.
NewLogger
(
log
.
ReadCLIConfig
(
ctx
))
.
New
(
"role"
,
"api"
)
log
:=
log
.
NewLogger
(
ctx
,
log
.
ReadCLIConfig
(
ctx
))
.
New
(
"role"
,
"api"
)
cfg
,
err
:=
config
.
LoadConfig
(
log
,
ctx
.
String
(
ConfigFlag
.
Name
))
cfg
,
err
:=
config
.
LoadConfig
(
log
,
ctx
.
String
(
ConfigFlag
.
Name
))
migrationsDir
:=
ctx
.
String
(
MigrationsFlag
.
Name
)
migrationsDir
:=
ctx
.
String
(
MigrationsFlag
.
Name
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
indexer/config/config_test.go
View file @
4e8c6222
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"os"
"os"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
indexer/e2e_tests/setup.go
View file @
4e8c6222
...
@@ -13,7 +13,7 @@ import (
...
@@ -13,7 +13,7 @@ import (
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/indexer/database"
op_e2e
"github.com/ethereum-optimism/optimism/op-e2e"
op_e2e
"github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
indexer/etl/l1_etl_test.go
View file @
4e8c6222
...
@@ -104,7 +104,7 @@ func TestL1ETLConstruction(t *testing.T) {
...
@@ -104,7 +104,7 @@ func TestL1ETLConstruction(t *testing.T) {
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
ts
:=
test
.
construction
()
ts
:=
test
.
construction
()
logger
:=
log
.
NewLogger
(
log
.
DefaultCLIConfig
())
logger
:=
log
.
NewLogger
(
nil
,
log
.
DefaultCLIConfig
())
cfg
:=
Config
{
StartHeight
:
ts
.
start
}
cfg
:=
Config
{
StartHeight
:
ts
.
start
}
etl
,
err
:=
NewL1ETL
(
cfg
,
logger
,
ts
.
db
.
DB
,
etlMetrics
,
ts
.
client
,
ts
.
contracts
)
etl
,
err
:=
NewL1ETL
(
cfg
,
logger
,
ts
.
db
.
DB
,
etlMetrics
,
ts
.
client
,
ts
.
contracts
)
...
...
op-batcher/batcher/batch_submitter.go
View file @
4e8c6222
...
@@ -27,11 +27,8 @@ func Main(version string, cliCtx *cli.Context) error {
...
@@ -27,11 +27,8 @@ func Main(version string, cliCtx *cli.Context) error {
return
err
return
err
}
}
cfg
:=
NewConfig
(
cliCtx
)
cfg
:=
NewConfig
(
cliCtx
)
if
err
:=
cfg
.
Check
();
err
!=
nil
{
return
fmt
.
Errorf
(
"invalid CLI flags: %w"
,
err
)
}
l
:=
oplog
.
NewLogger
(
cfg
.
LogConfig
)
l
:=
oplog
.
NewLogger
(
c
liCtx
,
c
fg
.
LogConfig
)
opservice
.
ValidateEnvVars
(
flags
.
EnvVarPrefix
,
flags
.
Flags
,
l
)
opservice
.
ValidateEnvVars
(
flags
.
EnvVarPrefix
,
flags
.
Flags
,
l
)
m
:=
metrics
.
NewMetrics
(
"default"
)
m
:=
metrics
.
NewMetrics
(
"default"
)
l
.
Info
(
"Initializing Batch Submitter"
)
l
.
Info
(
"Initializing Batch Submitter"
)
...
...
op-batcher/batcher/channel_manager_test.go
View file @
4e8c6222
...
@@ -11,8 +11,8 @@ import (
...
@@ -11,8 +11,8 @@ import (
"github.com/ethereum-optimism/optimism/op-batcher/metrics"
"github.com/ethereum-optimism/optimism/op-batcher/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
derivetest
"github.com/ethereum-optimism/optimism/op-node/rollup/derive/test"
derivetest
"github.com/ethereum-optimism/optimism/op-node/rollup/derive/test"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-batcher/batcher/channel_test.go
View file @
4e8c6222
...
@@ -6,8 +6,8 @@ import (
...
@@ -6,8 +6,8 @@ import (
"github.com/ethereum-optimism/optimism/op-batcher/metrics"
"github.com/ethereum-optimism/optimism/op-batcher/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-batcher/batcher/config.go
View file @
4e8c6222
...
@@ -99,9 +99,6 @@ func (c CLIConfig) Check() error {
...
@@ -99,9 +99,6 @@ func (c CLIConfig) Check() error {
if
err
:=
c
.
RPCConfig
.
Check
();
err
!=
nil
{
if
err
:=
c
.
RPCConfig
.
Check
();
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
c
.
LogConfig
.
Check
();
err
!=
nil
{
return
err
}
if
err
:=
c
.
MetricsConfig
.
Check
();
err
!=
nil
{
if
err
:=
c
.
MetricsConfig
.
Check
();
err
!=
nil
{
return
err
return
err
}
}
...
...
op-bootnode/bootnode/entrypoint.go
View file @
4e8c6222
...
@@ -43,7 +43,7 @@ func (l *l2Chain) PayloadByNumber(_ context.Context, _ uint64) (*eth.ExecutionPa
...
@@ -43,7 +43,7 @@ func (l *l2Chain) PayloadByNumber(_ context.Context, _ uint64) (*eth.ExecutionPa
func
Main
(
cliCtx
*
cli
.
Context
)
error
{
func
Main
(
cliCtx
*
cli
.
Context
)
error
{
log
.
Info
(
"Initializing bootnode"
)
log
.
Info
(
"Initializing bootnode"
)
logCfg
:=
oplog
.
ReadCLIConfig
(
cliCtx
)
logCfg
:=
oplog
.
ReadCLIConfig
(
cliCtx
)
logger
:=
oplog
.
NewLogger
(
logCfg
)
logger
:=
oplog
.
NewLogger
(
cliCtx
,
logCfg
)
m
:=
metrics
.
NewMetrics
(
"default"
)
m
:=
metrics
.
NewMetrics
(
"default"
)
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
...
...
op-challenger/challenger_test.go
View file @
4e8c6222
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-challenger/config"
"github.com/ethereum-optimism/optimism/op-challenger/config"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
...
op-challenger/cmd/main.go
View file @
4e8c6222
...
@@ -2,7 +2,6 @@ package main
...
@@ -2,7 +2,6 @@ package main
import
(
import
(
"context"
"context"
"fmt"
"os"
"os"
op_challenger
"github.com/ethereum-optimism/optimism/op-challenger"
op_challenger
"github.com/ethereum-optimism/optimism/op-challenger"
...
@@ -71,9 +70,6 @@ func run(args []string, action ConfigAction) error {
...
@@ -71,9 +70,6 @@ func run(args []string, action ConfigAction) error {
func
setupLogging
(
ctx
*
cli
.
Context
)
(
log
.
Logger
,
error
)
{
func
setupLogging
(
ctx
*
cli
.
Context
)
(
log
.
Logger
,
error
)
{
logCfg
:=
oplog
.
ReadCLIConfig
(
ctx
)
logCfg
:=
oplog
.
ReadCLIConfig
(
ctx
)
if
err
:=
logCfg
.
Check
();
err
!=
nil
{
logger
:=
oplog
.
NewLogger
(
ctx
,
logCfg
)
return
nil
,
fmt
.
Errorf
(
"log config error: %w"
,
err
)
}
logger
:=
oplog
.
NewLogger
(
logCfg
)
return
logger
,
nil
return
logger
,
nil
}
}
op-challenger/game/fault/agent_test.go
View file @
4e8c6222
...
@@ -10,11 +10,12 @@ import (
...
@@ -10,11 +10,12 @@ import (
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
gameTypes
"github.com/ethereum-optimism/optimism/op-challenger/game/types"
gameTypes
"github.com/ethereum-optimism/optimism/op-challenger/game/types"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
// TestShouldResolve tests the resolution logic.
// TestShouldResolve tests the resolution logic.
...
...
op-challenger/game/fault/player_test.go
View file @
4e8c6222
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
gameTypes
"github.com/ethereum-optimism/optimism/op-challenger/game/types"
gameTypes
"github.com/ethereum-optimism/optimism/op-challenger/game/types"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-challenger/game/fault/responder/responder_test.go
View file @
4e8c6222
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
gameTypes
"github.com/ethereum-optimism/optimism/op-challenger/game/types"
gameTypes
"github.com/ethereum-optimism/optimism/op-challenger/game/types"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
...
...
op-challenger/game/fault/trace/alphabet/updater_test.go
View file @
4e8c6222
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-challenger/game/fault/trace/cannon/executor_test.go
View file @
4e8c6222
...
@@ -12,7 +12,7 @@ import (
...
@@ -12,7 +12,7 @@ import (
"github.com/ethereum-optimism/optimism/op-challenger/config"
"github.com/ethereum-optimism/optimism/op-challenger/config"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-challenger/game/fault/trace/cannon/provider_test.go
View file @
4e8c6222
...
@@ -12,8 +12,8 @@ import (
...
@@ -12,8 +12,8 @@ import (
"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/cannon/mipsevm"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/ioutil"
"github.com/ethereum-optimism/optimism/op-service/ioutil"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-challenger/game/fault/trace/cannon/updater_test.go
View file @
4e8c6222
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
...
...
op-challenger/game/monitor_test.go
View file @
4e8c6222
...
@@ -7,6 +7,7 @@ import (
...
@@ -7,6 +7,7 @@ import (
"testing"
"testing"
"time"
"time"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
ethtypes
"github.com/ethereum/go-ethereum/core/types"
ethtypes
"github.com/ethereum/go-ethereum/core/types"
...
@@ -14,7 +15,6 @@ import (
...
@@ -14,7 +15,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
)
)
...
...
op-challenger/game/scheduler/coordinator_test.go
View file @
4e8c6222
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"github.com/ethereum-optimism/optimism/op-challenger/game/types"
"github.com/ethereum-optimism/optimism/op-challenger/game/types"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-challenger/game/scheduler/scheduler_test.go
View file @
4e8c6222
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-e2e/actions/blocktime_test.go
View file @
4e8c6222
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/params"
...
...
op-e2e/actions/l1_miner_test.go
View file @
4e8c6222
...
@@ -10,7 +10,7 @@ import (
...
@@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
)
)
func
TestL1Miner_BuildBlock
(
gt
*
testing
.
T
)
{
func
TestL1Miner_BuildBlock
(
gt
*
testing
.
T
)
{
...
...
op-e2e/actions/l1_replica_test.go
View file @
4e8c6222
...
@@ -16,8 +16,8 @@ import (
...
@@ -16,8 +16,8 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
var
defaultRollupTestParams
=
&
e2eutils
.
TestParams
{
var
defaultRollupTestParams
=
&
e2eutils
.
TestParams
{
...
...
op-e2e/actions/l2_batcher_test.go
View file @
4e8c6222
...
@@ -16,8 +16,8 @@ import (
...
@@ -16,8 +16,8 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
func
TestBatcher
(
gt
*
testing
.
T
)
{
func
TestBatcher
(
gt
*
testing
.
T
)
{
...
...
op-e2e/actions/l2_engine_test.go
View file @
4e8c6222
...
@@ -21,8 +21,8 @@ import (
...
@@ -21,8 +21,8 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
func
TestL2EngineAPI
(
gt
*
testing
.
T
)
{
func
TestL2EngineAPI
(
gt
*
testing
.
T
)
{
...
...
op-e2e/actions/l2_proposer_test.go
View file @
4e8c6222
...
@@ -10,8 +10,8 @@ import (
...
@@ -10,8 +10,8 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
func
TestProposer
(
gt
*
testing
.
T
)
{
func
TestProposer
(
gt
*
testing
.
T
)
{
...
...
op-e2e/actions/l2_sequencer_test.go
View file @
4e8c6222
...
@@ -13,7 +13,7 @@ import (
...
@@ -13,7 +13,7 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
)
)
func
setupSequencerTest
(
t
Testing
,
sd
*
e2eutils
.
SetupData
,
log
log
.
Logger
)
(
*
L1Miner
,
*
L2Engine
,
*
L2Sequencer
)
{
func
setupSequencerTest
(
t
Testing
,
sd
*
e2eutils
.
SetupData
,
log
log
.
Logger
)
(
*
L1Miner
,
*
L2Engine
,
*
L2Sequencer
)
{
...
...
op-e2e/actions/l2_verifier_test.go
View file @
4e8c6222
...
@@ -10,7 +10,7 @@ import (
...
@@ -10,7 +10,7 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
)
)
func
setupVerifier
(
t
Testing
,
sd
*
e2eutils
.
SetupData
,
log
log
.
Logger
,
l1F
derive
.
L1Fetcher
,
syncCfg
*
sync
.
Config
)
(
*
L2Engine
,
*
L2Verifier
)
{
func
setupVerifier
(
t
Testing
,
sd
*
e2eutils
.
SetupData
,
log
log
.
Logger
,
l1F
derive
.
L1Fetcher
,
syncCfg
*
sync
.
Config
)
(
*
L2Engine
,
*
L2Verifier
)
{
...
...
op-e2e/actions/reorg_test.go
View file @
4e8c6222
...
@@ -17,8 +17,8 @@ import (
...
@@ -17,8 +17,8 @@ import (
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
func
setupReorgTest
(
t
Testing
,
config
*
e2eutils
.
TestParams
)
(
*
e2eutils
.
SetupData
,
*
e2eutils
.
DeployParams
,
*
L1Miner
,
*
L2Sequencer
,
*
L2Engine
,
*
L2Verifier
,
*
L2Engine
,
*
L2Batcher
)
{
func
setupReorgTest
(
t
Testing
,
config
*
e2eutils
.
TestParams
)
(
*
e2eutils
.
SetupData
,
*
e2eutils
.
DeployParams
,
*
L1Miner
,
*
L2Sequencer
,
*
L2Engine
,
*
L2Verifier
,
*
L2Engine
,
*
L2Batcher
)
{
...
...
op-e2e/actions/sync_test.go
View file @
4e8c6222
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
...
op-e2e/actions/system_config_test.go
View file @
4e8c6222
...
@@ -15,8 +15,8 @@ import (
...
@@ -15,8 +15,8 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
// TestBatcherKeyRotation tests that batcher A can operate, then be replaced with batcher B, then ignore old batcher A,
// TestBatcherKeyRotation tests that batcher A can operate, then be replaced with batcher B, then ignore old batcher A,
...
...
op-e2e/actions/user_test.go
View file @
4e8c6222
...
@@ -10,7 +10,7 @@ import (
...
@@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
)
)
type
regolithScheduledTest
struct
{
type
regolithScheduledTest
struct
{
...
...
op-e2e/bridge_test.go
View file @
4e8c6222
...
@@ -10,7 +10,7 @@ import (
...
@@ -10,7 +10,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-e2e/e2eutils/challenger/helper.go
View file @
4e8c6222
...
@@ -16,7 +16,7 @@ import (
...
@@ -16,7 +16,7 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-e2e/e2eutils/disputegame/cannon_helper.go
View file @
4e8c6222
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-e2e/e2eutils/disputegame/helper.go
View file @
4e8c6222
...
@@ -21,7 +21,7 @@ import (
...
@@ -21,7 +21,7 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/transactions"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/transactions"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
...
...
op-e2e/op_geth.go
View file @
4e8c6222
...
@@ -16,8 +16,8 @@ import (
...
@@ -16,8 +16,8 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
...
...
op-e2e/setup.go
View file @
4e8c6222
...
@@ -53,11 +53,11 @@ import (
...
@@ -53,11 +53,11 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
proposermetrics
"github.com/ethereum-optimism/optimism/op-proposer/metrics"
proposermetrics
"github.com/ethereum-optimism/optimism/op-proposer/metrics"
l2os
"github.com/ethereum-optimism/optimism/op-proposer/proposer"
l2os
"github.com/ethereum-optimism/optimism/op-proposer/proposer"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
)
)
...
...
op-e2e/system_fpp_test.go
View file @
4e8c6222
...
@@ -9,10 +9,10 @@ import (
...
@@ -9,10 +9,10 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-program/client/driver"
"github.com/ethereum-optimism/optimism/op-program/client/driver"
opp
"github.com/ethereum-optimism/optimism/op-program/host"
opp
"github.com/ethereum-optimism/optimism/op-program/host"
oppconf
"github.com/ethereum-optimism/optimism/op-program/host/config"
oppconf
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-e2e/system_test.go
View file @
4e8c6222
...
@@ -39,10 +39,10 @@ import (
...
@@ -39,10 +39,10 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
"github.com/ethereum-optimism/optimism/op-service/retry"
"github.com/ethereum-optimism/optimism/op-service/retry"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
func
TestMain
(
m
*
testing
.
M
)
{
func
TestMain
(
m
*
testing
.
M
)
{
...
...
op-heartbeat/config.go
View file @
4e8c6222
...
@@ -28,9 +28,6 @@ func (c Config) Check() error {
...
@@ -28,9 +28,6 @@ func (c Config) Check() error {
if
c
.
HTTPPort
<=
0
{
if
c
.
HTTPPort
<=
0
{
return
errors
.
New
(
"must specify a valid HTTP port"
)
return
errors
.
New
(
"must specify a valid HTTP port"
)
}
}
if
err
:=
c
.
Log
.
Check
();
err
!=
nil
{
return
err
}
if
err
:=
c
.
Metrics
.
Check
();
err
!=
nil
{
if
err
:=
c
.
Metrics
.
Check
();
err
!=
nil
{
return
err
return
err
}
}
...
...
op-heartbeat/service.go
View file @
4e8c6222
...
@@ -37,7 +37,7 @@ func Main(version string) func(ctx *cli.Context) error {
...
@@ -37,7 +37,7 @@ func Main(version string) func(ctx *cli.Context) error {
return
fmt
.
Errorf
(
"invalid CLI flags: %w"
,
err
)
return
fmt
.
Errorf
(
"invalid CLI flags: %w"
,
err
)
}
}
l
:=
oplog
.
NewLogger
(
cfg
.
Log
)
l
:=
oplog
.
NewLogger
(
c
liCtx
,
c
fg
.
Log
)
l
.
Info
(
"starting heartbeat monitor"
,
"version"
,
version
)
l
.
Info
(
"starting heartbeat monitor"
,
"version"
,
version
)
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
...
...
op-node/cmd/main.go
View file @
4e8c6222
...
@@ -83,11 +83,7 @@ func main() {
...
@@ -83,11 +83,7 @@ func main() {
func
RollupNodeMain
(
ctx
*
cli
.
Context
)
error
{
func
RollupNodeMain
(
ctx
*
cli
.
Context
)
error
{
log
.
Info
(
"Initializing Rollup Node"
)
log
.
Info
(
"Initializing Rollup Node"
)
logCfg
:=
oplog
.
ReadCLIConfig
(
ctx
)
logCfg
:=
oplog
.
ReadCLIConfig
(
ctx
)
if
err
:=
logCfg
.
Check
();
err
!=
nil
{
log
:=
oplog
.
NewLogger
(
ctx
,
logCfg
)
log
.
Error
(
"Unable to create the log config"
,
"error"
,
err
)
return
err
}
log
:=
oplog
.
NewLogger
(
logCfg
)
opservice
.
ValidateEnvVars
(
flags
.
EnvVarPrefix
,
flags
.
Flags
,
log
)
opservice
.
ValidateEnvVars
(
flags
.
EnvVarPrefix
,
flags
.
Flags
,
log
)
m
:=
metrics
.
NewMetrics
(
"default"
)
m
:=
metrics
.
NewMetrics
(
"default"
)
...
...
op-node/node/server_test.go
View file @
4e8c6222
...
@@ -18,10 +18,10 @@ import (
...
@@ -18,10 +18,10 @@ import (
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/version"
"github.com/ethereum-optimism/optimism/op-node/version"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
func
TestOutputAtBlock
(
t
*
testing
.
T
)
{
func
TestOutputAtBlock
(
t
*
testing
.
T
)
{
...
...
op-node/p2p/app_scores_test.go
View file @
4e8c6222
...
@@ -7,8 +7,8 @@ import (
...
@@ -7,8 +7,8 @@ import (
"time"
"time"
"github.com/ethereum-optimism/optimism/op-node/p2p/store"
"github.com/ethereum-optimism/optimism/op-node/p2p/store"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-node/p2p/gating/expiry_test.go
View file @
4e8c6222
...
@@ -9,8 +9,8 @@ import (
...
@@ -9,8 +9,8 @@ import (
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/p2p/gating/mocks"
"github.com/ethereum-optimism/optimism/op-node/p2p/gating/mocks"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/testlog"
log
"github.com/ethereum/go-ethereum/log"
log
"github.com/ethereum/go-ethereum/log"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peer"
...
...
op-node/p2p/gossip_test.go
View file @
4e8c6222
...
@@ -16,7 +16,7 @@ import (
...
@@ -16,7 +16,7 @@ import (
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
)
)
func
TestGuardGossipValidator
(
t
*
testing
.
T
)
{
func
TestGuardGossipValidator
(
t
*
testing
.
T
)
{
...
...
op-node/p2p/host_test.go
View file @
4e8c6222
...
@@ -25,9 +25,9 @@ import (
...
@@ -25,9 +25,9 @@ import (
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
func
TestingConfig
(
t
*
testing
.
T
)
*
Config
{
func
TestingConfig
(
t
*
testing
.
T
)
*
Config
{
...
...
op-node/p2p/monitor/peer_monitor_test.go
View file @
4e8c6222
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
"time"
"time"
"github.com/ethereum-optimism/optimism/op-node/p2p/monitor/mocks"
"github.com/ethereum-optimism/optimism/op-node/p2p/monitor/mocks"
"github.com/ethereum-optimism/optimism/op-node/testlog"
clock2
"github.com/ethereum-optimism/optimism/op-service/clock"
clock2
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-node/p2p/peer_scorer_test.go
View file @
4e8c6222
...
@@ -14,7 +14,7 @@ import (
...
@@ -14,7 +14,7 @@ import (
p2pMocks
"github.com/ethereum-optimism/optimism/op-node/p2p/mocks"
p2pMocks
"github.com/ethereum-optimism/optimism/op-node/p2p/mocks"
"github.com/ethereum-optimism/optimism/op-node/p2p/store"
"github.com/ethereum-optimism/optimism/op-node/p2p/store"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
)
)
// PeerScorerTestSuite tests peer parameterization.
// PeerScorerTestSuite tests peer parameterization.
...
...
op-node/p2p/peer_scores_test.go
View file @
4e8c6222
...
@@ -15,8 +15,8 @@ import (
...
@@ -15,8 +15,8 @@ import (
p2pMocks
"github.com/ethereum-optimism/optimism/op-node/p2p/mocks"
p2pMocks
"github.com/ethereum-optimism/optimism/op-node/p2p/mocks"
"github.com/ethereum-optimism/optimism/op-node/p2p/store"
"github.com/ethereum-optimism/optimism/op-node/p2p/store"
testlog
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
testlog
"github.com/ethereum-optimism/optimism/op-service/testlog"
log
"github.com/ethereum/go-ethereum/log"
log
"github.com/ethereum/go-ethereum/log"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync"
"github.com/ipfs/go-datastore/sync"
...
...
op-node/p2p/store/gc_test.go
View file @
4e8c6222
...
@@ -6,8 +6,8 @@ import (
...
@@ -6,8 +6,8 @@ import (
"testing"
"testing"
"time"
"time"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
...
op-node/p2p/store/ip_ban_book_test.go
View file @
4e8c6222
...
@@ -6,8 +6,8 @@ import (
...
@@ -6,8 +6,8 @@ import (
"testing"
"testing"
"time"
"time"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync"
"github.com/ipfs/go-datastore/sync"
...
...
op-node/p2p/store/peer_ban_book_test.go
View file @
4e8c6222
...
@@ -5,8 +5,8 @@ import (
...
@@ -5,8 +5,8 @@ import (
"testing"
"testing"
"time"
"time"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync"
"github.com/ipfs/go-datastore/sync"
...
...
op-node/p2p/store/scorebook_test.go
View file @
4e8c6222
...
@@ -9,8 +9,8 @@ import (
...
@@ -9,8 +9,8 @@ import (
//nolint:all
//nolint:all
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoreds"
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoreds"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
ds
"github.com/ipfs/go-datastore"
ds
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync"
"github.com/ipfs/go-datastore/sync"
...
...
op-node/p2p/sync_test.go
View file @
4e8c6222
...
@@ -19,8 +19,8 @@ import (
...
@@ -19,8 +19,8 @@ import (
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
type
mockPayloadFn
func
(
n
uint64
)
(
*
eth
.
ExecutionPayload
,
error
)
type
mockPayloadFn
func
(
n
uint64
)
(
*
eth
.
ExecutionPayload
,
error
)
...
...
op-node/rollup/derive/attributes_queue_test.go
View file @
4e8c6222
...
@@ -13,9 +13,9 @@ import (
...
@@ -13,9 +13,9 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
// TestAttributesQueue checks that it properly uses the PreparePayloadAttributes function
// TestAttributesQueue checks that it properly uses the PreparePayloadAttributes function
...
...
op-node/rollup/derive/batch_queue_test.go
View file @
4e8c6222
...
@@ -13,9 +13,9 @@ import (
...
@@ -13,9 +13,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
type
fakeBatchQueueInput
struct
{
type
fakeBatchQueueInput
struct
{
...
...
op-node/rollup/derive/batches_test.go
View file @
4e8c6222
...
@@ -7,9 +7,9 @@ import (
...
@@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
...
...
op-node/rollup/derive/calldata_source_test.go
View file @
4e8c6222
...
@@ -15,9 +15,9 @@ import (
...
@@ -15,9 +15,9 @@ import (
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
type
testTx
struct
{
type
testTx
struct
{
...
...
op-node/rollup/derive/channel_bank_test.go
View file @
4e8c6222
...
@@ -10,9 +10,9 @@ import (
...
@@ -10,9 +10,9 @@ import (
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
...
op-node/rollup/derive/engine_queue_test.go
View file @
4e8c6222
...
@@ -17,9 +17,9 @@ import (
...
@@ -17,9 +17,9 @@ import (
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
type
fakeAttributesQueue
struct
{
type
fakeAttributesQueue
struct
{
...
...
op-node/rollup/derive/l1_retrieval_test.go
View file @
4e8c6222
...
@@ -14,9 +14,9 @@ import (
...
@@ -14,9 +14,9 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
type
fakeDataIter
struct
{
type
fakeDataIter
struct
{
...
...
op-node/rollup/derive/l1_traversal_test.go
View file @
4e8c6222
...
@@ -15,9 +15,9 @@ import (
...
@@ -15,9 +15,9 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
// TestL1TraversalNext tests that the `Next` function only returns
// TestL1TraversalNext tests that the `Next` function only returns
...
...
op-node/rollup/driver/origin_selector_test.go
View file @
4e8c6222
...
@@ -5,9 +5,9 @@ import (
...
@@ -5,9 +5,9 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-node/rollup/driver/sequencer_test.go
View file @
4e8c6222
...
@@ -19,9 +19,9 @@ import (
...
@@ -19,9 +19,9 @@ import (
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
var
mockResetErr
=
fmt
.
Errorf
(
"mock reset err: %w"
,
derive
.
ErrReset
)
var
mockResetErr
=
fmt
.
Errorf
(
"mock reset err: %w"
,
derive
.
ErrReset
)
...
...
op-node/rollup/sync/start_test.go
View file @
4e8c6222
...
@@ -7,9 +7,9 @@ import (
...
@@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
)
)
...
...
op-node/sources/receipts_test.go
View file @
4e8c6222
...
@@ -9,9 +9,9 @@ import (
...
@@ -9,9 +9,9 @@ import (
"time"
"time"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
...
...
op-node/sources/rollupclient.go
View file @
4e8c6222
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
...
@@ -58,3 +59,7 @@ func (r *RollupClient) SequencerActive(ctx context.Context) (bool, error) {
...
@@ -58,3 +59,7 @@ func (r *RollupClient) SequencerActive(ctx context.Context) (bool, error) {
err
:=
r
.
rpc
.
CallContext
(
ctx
,
&
result
,
"admin_sequencerActive"
)
err
:=
r
.
rpc
.
CallContext
(
ctx
,
&
result
,
"admin_sequencerActive"
)
return
result
,
err
return
result
,
err
}
}
func
(
r
*
RollupClient
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
log
.
Lvl
)
error
{
return
r
.
rpc
.
CallContext
(
ctx
,
nil
,
"admin_setLogLevel"
,
lvl
)
}
op-program/client/cmd/main.go
View file @
4e8c6222
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
func
main
()
{
func
main
()
{
// Default to a machine parsable but relatively human friendly log format.
// Default to a machine parsable but relatively human friendly log format.
// Don't do anything fancy to detect if color output is supported.
// Don't do anything fancy to detect if color output is supported.
logger
:=
oplog
.
NewLogger
(
oplog
.
CLIConfig
{
logger
:=
oplog
.
NewLogger
(
nil
,
oplog
.
CLIConfig
{
Level
:
"info"
,
Level
:
"info"
,
Format
:
"logfmt"
,
Format
:
"logfmt"
,
Color
:
false
,
Color
:
false
,
...
...
op-program/client/driver/driver_test.go
View file @
4e8c6222
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
...
op-program/client/l1/client_test.go
View file @
4e8c6222
...
@@ -13,10 +13,10 @@ import (
...
@@ -13,10 +13,10 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-program/client/l1/test"
"github.com/ethereum-optimism/optimism/op-program/client/l1/test"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
)
var
_
derive
.
L1Fetcher
=
(
*
OracleL1Client
)(
nil
)
var
_
derive
.
L1Fetcher
=
(
*
OracleL1Client
)(
nil
)
...
...
op-program/client/l2/engine_backend_test.go
View file @
4e8c6222
...
@@ -5,11 +5,11 @@ import (
...
@@ -5,11 +5,11 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi/test"
"github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi/test"
l2test
"github.com/ethereum-optimism/optimism/op-program/client/l2/test"
l2test
"github.com/ethereum-optimism/optimism/op-program/client/l2/test"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/consensus/beacon"
"github.com/ethereum/go-ethereum/consensus/beacon"
...
...
op-program/client/l2/engineapi/test/l2_engine_api_tests.go
View file @
4e8c6222
...
@@ -5,9 +5,9 @@ import (
...
@@ -5,9 +5,9 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/client/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-program/host/cmd/main.go
View file @
4e8c6222
package
main
package
main
import
(
import
(
"fmt"
"os"
"os"
"github.com/ethereum-optimism/optimism/op-program/host"
"github.com/ethereum-optimism/optimism/op-program/host"
...
@@ -75,9 +74,6 @@ func run(args []string, action ConfigAction) error {
...
@@ -75,9 +74,6 @@ func run(args []string, action ConfigAction) error {
func
setupLogging
(
ctx
*
cli
.
Context
)
(
log
.
Logger
,
error
)
{
func
setupLogging
(
ctx
*
cli
.
Context
)
(
log
.
Logger
,
error
)
{
logCfg
:=
oplog
.
ReadCLIConfig
(
ctx
)
logCfg
:=
oplog
.
ReadCLIConfig
(
ctx
)
if
err
:=
logCfg
.
Check
();
err
!=
nil
{
logger
:=
oplog
.
NewLogger
(
ctx
,
logCfg
)
return
nil
,
fmt
.
Errorf
(
"log config error: %w"
,
err
)
}
logger
:=
oplog
.
NewLogger
(
logCfg
)
return
logger
,
nil
return
logger
,
nil
}
}
op-program/host/cmd/main_test.go
View file @
4e8c6222
...
@@ -43,6 +43,21 @@ func TestLogLevel(t *testing.T) {
...
@@ -43,6 +43,21 @@ func TestLogLevel(t *testing.T) {
}
}
}
}
func
TestLogFormat
(
t
*
testing
.
T
)
{
t
.
Run
(
"RejectInvalid"
,
func
(
t
*
testing
.
T
)
{
verifyArgsInvalid
(
t
,
"unrecognized log format: foo"
,
addRequiredArgs
(
"--log.format=foo"
))
})
for
_
,
lvl
:=
range
[]
string
{
"json"
,
"json-pretty"
,
"terminal"
,
"text"
,
"logfmt"
}
{
lvl
:=
lvl
t
.
Run
(
"AcceptValid_"
+
lvl
,
func
(
t
*
testing
.
T
)
{
logger
,
_
,
err
:=
runWithArgs
(
addRequiredArgs
(
"--log.format"
,
lvl
))
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
logger
)
})
}
}
func
TestDefaultCLIOptionsMatchDefaultConfig
(
t
*
testing
.
T
)
{
func
TestDefaultCLIOptionsMatchDefaultConfig
(
t
*
testing
.
T
)
{
cfg
:=
configForArgs
(
t
,
addRequiredArgs
())
cfg
:=
configForArgs
(
t
,
addRequiredArgs
())
rollupCfg
,
err
:=
chaincfg
.
GetRollupConfig
(
"op-goerli"
)
rollupCfg
,
err
:=
chaincfg
.
GetRollupConfig
(
"op-goerli"
)
...
...
op-program/host/host_test.go
View file @
4e8c6222
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
"time"
"time"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/testlog"
preimage
"github.com/ethereum-optimism/optimism/op-preimage"
preimage
"github.com/ethereum-optimism/optimism/op-preimage"
"github.com/ethereum-optimism/optimism/op-program/chainconfig"
"github.com/ethereum-optimism/optimism/op-program/chainconfig"
"github.com/ethereum-optimism/optimism/op-program/client"
"github.com/ethereum-optimism/optimism/op-program/client"
...
@@ -15,6 +14,7 @@ import (
...
@@ -15,6 +14,7 @@ import (
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum-optimism/optimism/op-program/host/kvstore"
"github.com/ethereum-optimism/optimism/op-program/host/kvstore"
"github.com/ethereum-optimism/optimism/op-program/io"
"github.com/ethereum-optimism/optimism/op-program/io"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-program/host/prefetcher/prefetcher_test.go
View file @
4e8c6222
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"math/rand"
"math/rand"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
...
...
op-program/host/prefetcher/retry_test.go
View file @
4e8c6222
...
@@ -5,10 +5,10 @@ import (
...
@@ -5,10 +5,10 @@ import (
"errors"
"errors"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/retry"
"github.com/ethereum-optimism/optimism/op-service/retry"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-proposer/proposer/config.go
View file @
4e8c6222
...
@@ -67,9 +67,6 @@ func (c CLIConfig) Check() error {
...
@@ -67,9 +67,6 @@ func (c CLIConfig) Check() error {
if
err
:=
c
.
RPCConfig
.
Check
();
err
!=
nil
{
if
err
:=
c
.
RPCConfig
.
Check
();
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
c
.
LogConfig
.
Check
();
err
!=
nil
{
return
err
}
if
err
:=
c
.
MetricsConfig
.
Check
();
err
!=
nil
{
if
err
:=
c
.
MetricsConfig
.
Check
();
err
!=
nil
{
return
err
return
err
}
}
...
...
op-proposer/proposer/l2_output_submitter.go
View file @
4e8c6222
...
@@ -43,7 +43,7 @@ func Main(version string, cliCtx *cli.Context) error {
...
@@ -43,7 +43,7 @@ func Main(version string, cliCtx *cli.Context) error {
return
fmt
.
Errorf
(
"invalid CLI flags: %w"
,
err
)
return
fmt
.
Errorf
(
"invalid CLI flags: %w"
,
err
)
}
}
l
:=
oplog
.
NewLogger
(
cfg
.
LogConfig
)
l
:=
oplog
.
NewLogger
(
c
liCtx
,
c
fg
.
LogConfig
)
opservice
.
ValidateEnvVars
(
flags
.
EnvVarPrefix
,
flags
.
Flags
,
l
)
opservice
.
ValidateEnvVars
(
flags
.
EnvVarPrefix
,
flags
.
Flags
,
l
)
m
:=
metrics
.
NewMetrics
(
"default"
)
m
:=
metrics
.
NewMetrics
(
"default"
)
l
.
Info
(
"Initializing L2 Output Submitter"
)
l
.
Info
(
"Initializing L2 Output Submitter"
)
...
...
op-service/log/cli.go
View file @
4e8c6222
...
@@ -2,6 +2,7 @@ package log
...
@@ -2,6 +2,7 @@ package log
import
(
import
(
"fmt"
"fmt"
"io"
"os"
"os"
"strings"
"strings"
...
@@ -25,12 +26,28 @@ func CLIFlags(envPrefix string) []cli.Flag {
...
@@ -25,12 +26,28 @@ func CLIFlags(envPrefix string) []cli.Flag {
Usage
:
"The lowest log level that will be output"
,
Usage
:
"The lowest log level that will be output"
,
Value
:
"info"
,
Value
:
"info"
,
EnvVars
:
opservice
.
PrefixEnvVar
(
envPrefix
,
"LOG_LEVEL"
),
EnvVars
:
opservice
.
PrefixEnvVar
(
envPrefix
,
"LOG_LEVEL"
),
Action
:
func
(
ctx
*
cli
.
Context
,
s
string
)
error
{
level
:=
strings
.
ToLower
(
s
)
_
,
err
:=
log
.
LvlFromString
(
level
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"unrecognized log level: %w"
,
err
)
}
return
nil
},
},
},
&
cli
.
StringFlag
{
&
cli
.
StringFlag
{
Name
:
FormatFlagName
,
Name
:
FormatFlagName
,
Usage
:
"Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty',"
,
Usage
:
"Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty',"
,
Value
:
"text"
,
Value
:
"text"
,
EnvVars
:
opservice
.
PrefixEnvVar
(
envPrefix
,
"LOG_FORMAT"
),
EnvVars
:
opservice
.
PrefixEnvVar
(
envPrefix
,
"LOG_FORMAT"
),
Action
:
func
(
ctx
*
cli
.
Context
,
s
string
)
error
{
switch
s
{
case
"json"
,
"json-pretty"
,
"terminal"
,
"text"
,
"logfmt"
:
return
nil
default
:
return
fmt
.
Errorf
(
"unrecognized log format: %s"
,
s
)
}
},
},
},
&
cli
.
BoolFlag
{
&
cli
.
BoolFlag
{
Name
:
ColorFlagName
,
Name
:
ColorFlagName
,
...
@@ -46,28 +63,14 @@ type CLIConfig struct {
...
@@ -46,28 +63,14 @@ type CLIConfig struct {
Format
string
// Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty'
Format
string
// Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty'
}
}
func
(
cfg
CLIConfig
)
Check
()
error
{
func
NewLogger
(
ctx
*
cli
.
Context
,
cfg
CLIConfig
)
log
.
Logger
{
switch
cfg
.
Format
{
var
wr
io
.
Writer
=
os
.
Stdout
case
"json"
,
"json-pretty"
,
"terminal"
,
"text"
,
"logfmt"
:
if
ctx
!=
nil
&&
ctx
.
App
!=
nil
{
default
:
wr
=
ctx
.
App
.
Writer
return
fmt
.
Errorf
(
"unrecognized log format: %s"
,
cfg
.
Format
)
}
level
:=
strings
.
ToLower
(
cfg
.
Level
)
_
,
err
:=
log
.
LvlFromString
(
level
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"unrecognized log level: %w"
,
err
)
}
}
return
nil
handler
:=
log
.
StreamHandler
(
wr
,
Format
(
cfg
.
Format
,
cfg
.
Color
))
}
func
NewLogger
(
cfg
CLIConfig
)
log
.
Logger
{
handler
:=
log
.
StreamHandler
(
os
.
Stdout
,
Format
(
cfg
.
Format
,
cfg
.
Color
))
handler
=
log
.
SyncHandler
(
handler
)
handler
=
log
.
SyncHandler
(
handler
)
handler
=
log
.
LvlFilterHandler
(
Level
(
cfg
.
Level
),
handler
)
handler
=
log
.
LvlFilterHandler
(
Level
(
cfg
.
Level
),
handler
)
// Set the root handle to what we have configured. Some components like go-ethereum's RPC
// server use log.Root() instead of being able to pass in a log.
log
.
Root
()
.
SetHandler
(
handler
)
logger
:=
log
.
New
()
logger
:=
log
.
New
()
logger
.
SetHandler
(
handler
)
logger
.
SetHandler
(
handler
)
return
logger
return
logger
...
...
op-service/log/writer_test.go
View file @
4e8c6222
...
@@ -4,7 +4,7 @@ import (
...
@@ -4,7 +4,7 @@ import (
"io"
"io"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
...
op-
nod
e/testlog/LICENSE
→
op-
servic
e/testlog/LICENSE
View file @
4e8c6222
File moved
op-
nod
e/testlog/README.md
→
op-
servic
e/testlog/README.md
View file @
4e8c6222
File moved
op-
nod
e/testlog/capturing.go
→
op-
servic
e/testlog/capturing.go
View file @
4e8c6222
File moved
op-
nod
e/testlog/testlog.go
→
op-
servic
e/testlog/testlog.go
View file @
4e8c6222
File moved
op-service/txmgr/price_bump_test.go
View file @
4e8c6222
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"math/big"
"math/big"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
...
op-service/txmgr/queue_test.go
View file @
4e8c6222
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"testing"
"testing"
"time"
"time"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum-optimism/optimism/op-service/txmgr/metrics"
"github.com/ethereum-optimism/optimism/op-service/txmgr/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
...
...
op-service/txmgr/txmgr_test.go
View file @
4e8c6222
...
@@ -11,7 +11,7 @@ import (
...
@@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-
nod
e/testlog"
"github.com/ethereum-optimism/optimism/op-
servic
e/testlog"
"github.com/ethereum-optimism/optimism/op-service/txmgr/metrics"
"github.com/ethereum-optimism/optimism/op-service/txmgr/metrics"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
...
...
op-wheel/commands.go
View file @
4e8c6222
...
@@ -396,10 +396,7 @@ var (
...
@@ -396,10 +396,7 @@ var (
},
oplog
.
CLIFlags
(
envVarPrefix
)
...
),
opmetrics
.
CLIFlags
(
envVarPrefix
)
...
),
},
oplog
.
CLIFlags
(
envVarPrefix
)
...
),
opmetrics
.
CLIFlags
(
envVarPrefix
)
...
),
Action
:
EngineAction
(
func
(
ctx
*
cli
.
Context
,
client
client
.
RPC
)
error
{
Action
:
EngineAction
(
func
(
ctx
*
cli
.
Context
,
client
client
.
RPC
)
error
{
logCfg
:=
oplog
.
ReadCLIConfig
(
ctx
)
logCfg
:=
oplog
.
ReadCLIConfig
(
ctx
)
if
err
:=
logCfg
.
Check
();
err
!=
nil
{
l
:=
oplog
.
NewLogger
(
ctx
,
logCfg
)
return
fmt
.
Errorf
(
"failed to parse log configuration: %w"
,
err
)
}
l
:=
oplog
.
NewLogger
(
logCfg
)
settings
:=
ParseBuildingArgs
(
ctx
)
settings
:=
ParseBuildingArgs
(
ctx
)
// TODO: finalize/safe flag
// TODO: finalize/safe flag
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment