From 23453cb74332712381b418b94f19ff99b146ef54 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Tue, 9 Jan 2024 22:36:23 +0100 Subject: [PATCH 01/25] Update op-geth dependency (v1.13.8) & migrate to slog --- cannon/cmd/log.go | 10 +- cannon/cmd/run.go | 2 +- endpoint-monitor/endpoint_monitor.go | 2 +- go.mod | 21 ++-- go.sum | 42 ++++---- indexer/api/api_test.go | 6 +- indexer/cmd/indexer/cli.go | 6 +- indexer/config/config_test.go | 14 +-- indexer/e2e_tests/setup.go | 16 +-- indexer/etl/l1_etl_test.go | 2 +- op-batcher/batcher/batch_submitter.go | 2 +- op-batcher/batcher/channel_manager_test.go | 18 ++-- op-batcher/batcher/channel_test.go | 8 +- op-batcher/batcher/service.go | 4 +- op-bindings/cmd/main.go | 2 +- op-bootnode/bootnode/entrypoint.go | 2 +- op-chain-ops/cmd/check-canyon/main.go | 7 +- op-chain-ops/cmd/check-deploy-config/main.go | 4 +- op-chain-ops/cmd/check-derivation/main.go | 9 +- .../cmd/op-upgrade-extended-pause/main.go | 4 +- op-chain-ops/cmd/op-upgrade/main.go | 4 +- op-chain-ops/cmd/protocol-version/main.go | 5 +- op-chain-ops/cmd/registry-data/main.go | 4 +- op-chain-ops/genesis/layer_one.go | 3 +- op-chain-ops/state/memory_db.go | 7 +- op-challenger/challenger_test.go | 2 +- op-challenger/cmd/main.go | 2 +- op-challenger/game/fault/agent_test.go | 2 +- op-challenger/game/fault/player_test.go | 24 ++--- .../game/fault/responder/responder_test.go | 2 +- .../game/fault/trace/cannon/executor.go | 4 +- .../game/fault/trace/cannon/executor_test.go | 9 +- .../game/fault/trace/cannon/provider_test.go | 2 +- .../game/fault/trace/outputs/provider_test.go | 2 +- .../fault/trace/outputs/split_adapter_test.go | 2 +- op-challenger/game/monitor_test.go | 2 +- .../game/scheduler/coordinator_test.go | 2 +- .../game/scheduler/scheduler_test.go | 4 +- op-conductor/cmd/main.go | 2 +- op-conductor/conductor/service_test.go | 2 +- op-conductor/consensus/raft_test.go | 2 +- op-conductor/health/monitor_test.go | 2 +- op-e2e/actions/blocktime_test.go | 4 +- op-e2e/actions/dencun_fork_test.go | 4 +- op-e2e/actions/l1_miner_test.go | 2 +- op-e2e/actions/l1_replica_test.go | 4 +- op-e2e/actions/l2_batcher_test.go | 12 +-- op-e2e/actions/l2_engine_test.go | 6 +- op-e2e/actions/l2_proposer_test.go | 2 +- op-e2e/actions/l2_sequencer_test.go | 4 +- op-e2e/actions/l2_verifier_test.go | 2 +- op-e2e/actions/reorg_test.go | 10 +- op-e2e/actions/span_batch_test.go | 14 +-- op-e2e/actions/sync_test.go | 14 +-- op-e2e/actions/system_config_test.go | 6 +- op-e2e/actions/user_test.go | 2 +- op-e2e/bridge_test.go | 2 +- op-e2e/config/init.go | 34 ++++--- op-e2e/e2eutils/challenger/helper.go | 2 +- op-e2e/e2eutils/disputegame/helper.go | 4 +- .../disputegame/output_alphabet_helper.go | 2 +- .../disputegame/output_cannon_helper.go | 2 +- op-e2e/op_geth.go | 2 +- op-e2e/setup.go | 19 ++-- op-e2e/system_fpp_test.go | 6 +- op-e2e/system_test.go | 19 ++-- op-heartbeat/service.go | 2 +- op-node/cmd/main.go | 2 +- op-node/cmd/stateviz/main.go | 7 +- op-node/node/server_test.go | 6 +- op-node/p2p/app_scores_test.go | 2 +- op-node/p2p/gating/expiry_test.go | 2 +- op-node/p2p/gossip_test.go | 8 +- op-node/p2p/host_test.go | 14 +-- op-node/p2p/monitor/peer_monitor_test.go | 2 +- op-node/p2p/peer_scorer_test.go | 2 +- op-node/p2p/peer_scores_test.go | 6 +- op-node/p2p/store/gc_test.go | 2 +- op-node/p2p/store/ip_ban_book_test.go | 2 +- op-node/p2p/store/peer_ban_book_test.go | 2 +- op-node/p2p/store/scorebook_test.go | 8 +- op-node/p2p/sync_test.go | 6 +- .../rollup/derive/attributes_queue_test.go | 2 +- op-node/rollup/derive/batch_queue_test.go | 18 ++-- op-node/rollup/derive/batches_test.go | 39 +++----- op-node/rollup/derive/calldata_source_test.go | 2 +- op-node/rollup/derive/channel_bank_test.go | 8 +- op-node/rollup/derive/engine_queue_test.go | 12 +-- op-node/rollup/derive/l1_retrieval_test.go | 4 +- op-node/rollup/derive/l1_traversal_test.go | 4 +- op-node/rollup/driver/origin_selector_test.go | 12 +-- op-node/rollup/driver/sequencer_test.go | 2 +- op-node/rollup/sync/start_test.go | 5 +- op-node/service.go | 20 ++-- op-program/client/cmd/main.go | 4 +- op-program/client/driver/driver_test.go | 2 +- op-program/client/l1/client_test.go | 2 +- op-program/client/l2/engine.go | 12 ++- op-program/client/l2/engine_backend_test.go | 2 +- .../l2/engineapi/test/l2_engine_api_tests.go | 2 +- op-program/host/cmd/main.go | 2 +- op-program/host/host_test.go | 2 +- op-program/host/prefetcher/prefetcher_test.go | 4 +- op-program/host/prefetcher/retry_test.go | 4 +- op-proposer/proposer/l2_output_submitter.go | 2 +- op-proposer/proposer/service.go | 1 + op-service/client/polling_test.go | 9 +- op-service/dial/active_l2_provider_test.go | 4 +- op-service/log/cli.go | 99 ++++++++++++------- op-service/log/defaults.go | 7 +- op-service/log/dynamic.go | 30 +++--- op-service/log/dynamic_test.go | 47 +++++---- op-service/log/writer.go | 19 ++-- op-service/log/writer_test.go | 40 ++++---- op-service/rpc/api.go | 5 +- op-service/sources/receipts_test.go | 2 +- op-service/sources/rollupclient.go | 4 +- op-service/testlog/capturing.go | 88 ++++++++++++----- op-service/testlog/capturing_test.go | 38 +++++++ op-service/testlog/testlog.go | 84 ++++++++-------- op-service/txmgr/price_bump_test.go | 2 +- op-service/txmgr/queue_test.go | 2 +- op-service/txmgr/txmgr_test.go | 12 +-- op-ufm/cmd/ufm/main.go | 22 ++--- op-wheel/cheat/cheat.go | 7 +- op-wheel/cmd/main.go | 8 +- op-wheel/commands.go | 4 +- proxyd/cmd/proxyd/main.go | 25 ++--- proxyd/integration_tests/util_test.go | 23 ++--- 129 files changed, 680 insertions(+), 590 deletions(-) create mode 100644 op-service/testlog/capturing_test.go diff --git a/cannon/cmd/log.go b/cannon/cmd/log.go index cc829bb2e71e..419d5b837a66 100644 --- a/cannon/cmd/log.go +++ b/cannon/cmd/log.go @@ -4,13 +4,9 @@ import ( "io" "github.com/ethereum/go-ethereum/log" + "golang.org/x/exp/slog" ) -func Logger(w io.Writer, lvl log.Lvl) log.Logger { - h := log.StreamHandler(w, log.LogfmtFormat()) - h = log.SyncHandler(h) - h = log.LvlFilterHandler(lvl, h) - l := log.New() - l.SetHandler(h) - return l +func Logger(w io.Writer, lvl slog.Level) log.Logger { + return log.NewLogger(log.LogfmtHandlerWithLevel(w, lvl)) } diff --git a/cannon/cmd/run.go b/cannon/cmd/run.go index 86234684fd4c..822183ba68ce 100644 --- a/cannon/cmd/run.go +++ b/cannon/cmd/run.go @@ -229,7 +229,7 @@ func Run(ctx *cli.Context) error { return err } - l := Logger(os.Stderr, log.LvlInfo) + l := Logger(os.Stderr, log.LevelInfo) outLog := &mipsevm.LoggingWriter{Name: "program std-out", Log: l} errLog := &mipsevm.LoggingWriter{Name: "program std-err", Log: l} diff --git a/endpoint-monitor/endpoint_monitor.go b/endpoint-monitor/endpoint_monitor.go index 675a287a31f4..b08b8c199e59 100644 --- a/endpoint-monitor/endpoint_monitor.go +++ b/endpoint-monitor/endpoint_monitor.go @@ -36,7 +36,7 @@ func Main(version string) func(cliCtx *cli.Context) error { } l := oplog.NewLogger(oplog.AppOut(cliCtx), cfg.LogConfig) - oplog.SetGlobalLogHandler(l.GetHandler()) + oplog.SetGlobalLogHandler(l.Handler()) endpointMonitor := NewEndpointMonitor(cfg, l) l.Info(fmt.Sprintf("starting endpoint monitor with checkInterval=%s checkDuration=%s", cfg.CheckInterval, cfg.CheckDuration)) diff --git a/go.mod b/go.mod index b7ceb2899ef5..786e6216cc29 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240103191009-655947053753 - github.com/ethereum/go-ethereum v1.13.5 + github.com/ethereum/go-ethereum v1.13.8 github.com/fsnotify/fsnotify v1.7.0 github.com/go-chi/chi/v5 v5.0.11 github.com/go-chi/docgen v1.2.0 @@ -21,7 +21,7 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.5 github.com/hashicorp/raft v1.6.0 github.com/hashicorp/raft-boltdb v0.0.0-20231211162105-6c830fa4535e - github.com/holiman/uint256 v1.2.3 + github.com/holiman/uint256 v1.2.4 github.com/ipfs/go-datastore v0.6.0 github.com/ipfs/go-ds-leveldb v0.5.0 github.com/jackc/pgtype v1.14.1 @@ -42,7 +42,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/urfave/cli/v2 v2.27.1 golang.org/x/crypto v0.18.0 - golang.org/x/exp v0.0.0-20231006140011-7918f672742d + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa golang.org/x/sync v0.6.0 golang.org/x/term v0.16.0 golang.org/x/time v0.5.0 @@ -58,7 +58,7 @@ require ( github.com/armon/go-metrics v0.4.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.7.0 // indirect + github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/boltdb/bolt v1.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/btcsuite/btcd/btcutil v1.1.5 // indirect @@ -74,7 +74,7 @@ require ( github.com/containerd/cgroups v1.1.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80 // indirect + github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect @@ -92,11 +92,10 @@ require ( github.com/flynn/noise v1.0.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect - github.com/gballet/go-verkle v0.0.0-20230607174250-df487255f46b // indirect + github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect - github.com/go-stack/stack v1.8.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.8.1 // indirect @@ -206,11 +205,11 @@ require ( go.uber.org/mock v0.3.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/mod v0.13.0 // indirect - golang.org/x/net v0.17.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.14.0 // indirect + golang.org/x/tools v0.15.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -219,7 +218,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.13.5 => github.com/ethereum-optimism/op-geth v1.101305.2-rc.2 +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.2-rc.2.0.20240115214724-94dd378935ec //replace github.com/ethereum-optimism/superchain-registry/superchain => ../superchain-registry/superchain //replace github.com/ethereum/go-ethereum v1.13.5 => ../go-ethereum diff --git a/go.sum b/go.sum index 8fa814a7732b..d0a4a67cf7ed 100644 --- a/go.sum +++ b/go.sum @@ -42,8 +42,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= +github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= @@ -122,8 +122,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80 h1:DuBDHVjgGMPki7bAyh91+3cF1Vh34sAEdH8JQgbc2R0= -github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80/go.mod h1:gzbVz57IDJgQ9rLQwfSk696JGWof8ftznEL9GoAv3NI= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -170,8 +170,8 @@ github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/ github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101305.2-rc.2 h1:UQVo1JKEjZ80JdrL4meey1KhHmdbT/l6kmc8SzIbp3s= -github.com/ethereum-optimism/op-geth v1.101305.2-rc.2/go.mod h1:HGpRaQiUONEEfsL/hq9/jg8YnR9TCHCPqjmaPoFBhto= +github.com/ethereum-optimism/op-geth v1.101305.2-rc.2.0.20240115214724-94dd378935ec h1:3ThkDGyIkNIDd+AdYb8HNvGO1sefzjiw3ivIz49xNbg= +github.com/ethereum-optimism/op-geth v1.101305.2-rc.2.0.20240115214724-94dd378935ec/go.mod h1:stpeVGYwr0Rz4J0qEmEVC9zBAfKthi34VZ3IalZMrY4= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240103191009-655947053753 h1:DL667cfM6peU8H9Ut/uu9h9Bd4gQCcJrjq+yYsfYwjk= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240103191009-655947053753/go.mod h1:/70H/KqrtKcvWvNGVj6S3rAcLC+kUPr3t2aDmYIS+Xk= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= @@ -194,8 +194,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/gballet/go-verkle v0.0.0-20230607174250-df487255f46b h1:vMT47RYsrftsHSTQhqXwC3BYflo38OLC3Y4LtXtLyU0= -github.com/gballet/go-verkle v0.0.0-20230607174250-df487255f46b/go.mod h1:CDncRYVRSDqwakm282WEkjfaAj1hxU/v5RXxk5nXOiI= +github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= +github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= @@ -227,8 +227,6 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= @@ -340,8 +338,8 @@ github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZ github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= @@ -439,8 +437,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/karalabe/usb v0.0.3-0.20230711191512-61db3e06439c h1:AqsttAyEyIEsNz5WLRwuRwjiT5CMDUfLk6cFJDVPebs= github.com/karalabe/usb v0.0.3-0.20230711191512-61db3e06439c/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -844,8 +840,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -857,8 +853,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -887,8 +883,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -903,7 +899,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -946,7 +941,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211020174200-9d6173849985/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1003,8 +997,8 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/indexer/api/api_test.go b/indexer/api/api_test.go index 39019a5db7bb..e69a22fbfcf4 100644 --- a/indexer/api/api_test.go +++ b/indexer/api/api_test.go @@ -104,7 +104,7 @@ func (mbv *MockBridgeTransfersView) L2BridgeWithdrawalSum(database.WithdrawFilte } func TestHealthz(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) cfg := &Config{ DB: &TestDBConnector{BridgeTransfers: &MockBridgeTransfersView{}}, HTTPServer: apiConfig, @@ -122,7 +122,7 @@ func TestHealthz(t *testing.T) { } func TestL1BridgeDepositsHandler(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) cfg := &Config{ DB: &TestDBConnector{BridgeTransfers: &MockBridgeTransfersView{}}, HTTPServer: apiConfig, @@ -151,7 +151,7 @@ func TestL1BridgeDepositsHandler(t *testing.T) { } func TestL2BridgeWithdrawalsByAddressHandler(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) cfg := &Config{ DB: &TestDBConnector{BridgeTransfers: &MockBridgeTransfersView{}}, HTTPServer: apiConfig, diff --git a/indexer/cmd/indexer/cli.go b/indexer/cmd/indexer/cli.go index 153cae9da4fc..9d0d8ab62e43 100644 --- a/indexer/cmd/indexer/cli.go +++ b/indexer/cmd/indexer/cli.go @@ -34,7 +34,7 @@ var ( func runIndexer(ctx *cli.Context, shutdown context.CancelCauseFunc) (cliapp.Lifecycle, error) { log := oplog.NewLogger(oplog.AppOut(ctx), oplog.ReadCLIConfig(ctx)).New("role", "indexer") - oplog.SetGlobalLogHandler(log.GetHandler()) + oplog.SetGlobalLogHandler(log.Handler()) log.Info("running indexer...") cfg, err := config.LoadConfig(log, ctx.String(ConfigFlag.Name)) @@ -48,7 +48,7 @@ func runIndexer(ctx *cli.Context, shutdown context.CancelCauseFunc) (cliapp.Life func runApi(ctx *cli.Context, _ context.CancelCauseFunc) (cliapp.Lifecycle, error) { log := oplog.NewLogger(oplog.AppOut(ctx), oplog.ReadCLIConfig(ctx)).New("role", "api") - oplog.SetGlobalLogHandler(log.GetHandler()) + oplog.SetGlobalLogHandler(log.Handler()) log.Info("running api...") cfg, err := config.LoadConfig(log, ctx.String(ConfigFlag.Name)) @@ -71,7 +71,7 @@ func runMigrations(ctx *cli.Context) error { ctx.Context = opio.CancelOnInterrupt(ctx.Context) log := oplog.NewLogger(oplog.AppOut(ctx), oplog.ReadCLIConfig(ctx)).New("role", "migrations") - oplog.SetGlobalLogHandler(log.GetHandler()) + oplog.SetGlobalLogHandler(log.Handler()) log.Info("running migrations...") cfg, err := config.LoadConfig(log, ctx.String(ConfigFlag.Name)) diff --git a/indexer/config/config_test.go b/indexer/config/config_test.go index fedfe2189196..0a5e0eaa5b0b 100644 --- a/indexer/config/config_test.go +++ b/indexer/config/config_test.go @@ -12,7 +12,7 @@ import ( ) func TestLoadConfig(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) tmpfile, err := os.CreateTemp("", "test.toml") require.NoError(t, err) defer os.Remove(tmpfile.Name()) @@ -112,7 +112,7 @@ func TestLoadConfigWithoutPreset(t *testing.T) { err = tmpfile.Close() require.NoError(t, err) - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) conf, err := LoadConfig(logger, tmpfile.Name()) require.NoError(t, err) @@ -146,7 +146,7 @@ func TestLoadConfigWithUnknownPreset(t *testing.T) { err = tmpfile.Close() require.NoError(t, err) - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) conf, err := LoadConfig(logger, tmpfile.Name()) require.Error(t, err) @@ -178,7 +178,7 @@ func TestLoadConfigPollingValues(t *testing.T) { err = tmpfile.Close() require.NoError(t, err) - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) conf, err := LoadConfig(logger, tmpfile.Name()) require.NoError(t, err) @@ -224,7 +224,7 @@ func TestLoadedConfigPresetPrecendence(t *testing.T) { err = tmpfile.Close() require.NoError(t, err) - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) conf, err := LoadConfig(logger, tmpfile.Name()) require.NoError(t, err) @@ -265,7 +265,7 @@ func TestLocalDevnet(t *testing.T) { err = tmpfile.Close() require.NoError(t, err) - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) conf, err := LoadConfig(logger, tmpfile.Name()) require.NoError(t, err) @@ -276,7 +276,7 @@ func TestLocalDevnet(t *testing.T) { } func TestThrowsOnUnknownKeys(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) tmpfile, err := os.CreateTemp("", "test.toml") require.NoError(t, err) defer os.Remove(tmpfile.Name()) diff --git a/indexer/e2e_tests/setup.go b/indexer/e2e_tests/setup.go index 3049bb658bf3..2ab5892c8553 100644 --- a/indexer/e2e_tests/setup.go +++ b/indexer/e2e_tests/setup.go @@ -13,15 +13,17 @@ import ( "github.com/ethereum-optimism/optimism/indexer/client" "github.com/ethereum-optimism/optimism/indexer/config" "github.com/ethereum-optimism/optimism/indexer/database" - "github.com/prometheus/client_golang/prometheus" op_e2e "github.com/ethereum-optimism/optimism/op-e2e" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/optimism/op-service/metrics" "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/log" _ "github.com/jackc/pgx/v5/stdlib" + "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" ) @@ -56,7 +58,7 @@ func init() { // Disable the global logger. Ideally we'd like to dump geth // logs per-test but that's possible when running tests in // parallel as the root logger is shared. - log.Root().SetHandler(log.DiscardHandler()) + oplog.SetGlobalLogHandler(log.DiscardHandler()) } // createE2ETestSuite ... Create a new E2E test suite @@ -78,8 +80,7 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite { t.Log("set env 'ENABLE_ROLLUP_LOGS' to show rollup logs") for name := range opCfg.Loggers { t.Logf("discarding logs for %s", name) - noopLog := log.New() - noopLog.SetHandler(log.DiscardHandler()) + noopLog := log.NewLogger(log.DiscardHandler()) opCfg.Loggers[name] = noopLog } } @@ -114,7 +115,7 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite { MetricsServer: config.ServerConfig{Host: "127.0.0.1", Port: 0}, } - indexerLog := testlog.Logger(t, log.LvlInfo).New("role", "indexer") + indexerLog := testlog.Logger(t, log.LevelInfo).New("role", "indexer") ix, err := indexer.NewIndexer(context.Background(), indexerLog, indexerCfg, func(cause error) { if cause != nil { t.Fatalf("indexer shut down with critical error: %v", cause) @@ -127,7 +128,7 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite { }) // API Configuration and Start - apiLog := testlog.Logger(t, log.LvlInfo).New("role", "indexer_api") + apiLog := testlog.Logger(t, log.LevelInfo).New("role", "indexer_api") apiCfg := &api.Config{ DB: &api.TestDBConnector{BridgeTransfers: ix.DB.BridgeTransfers}, // reuse the same DB HTTPServer: config.ServerConfig{Host: "127.0.0.1", Port: 0}, @@ -186,8 +187,7 @@ func setupTestDatabase(t *testing.T) string { Password: "", } - noopLog := log.New() - noopLog.SetHandler(log.DiscardHandler()) + noopLog := log.NewLogger(log.DiscardHandler()) db, err := database.NewDB(context.Background(), noopLog, dbConfig) require.NoError(t, err) defer db.Close() diff --git a/indexer/etl/l1_etl_test.go b/indexer/etl/l1_etl_test.go index 7ae204afe123..e57f16f6fd92 100644 --- a/indexer/etl/l1_etl_test.go +++ b/indexer/etl/l1_etl_test.go @@ -105,7 +105,7 @@ func TestL1ETLConstruction(t *testing.T) { t.Run(test.name, func(t *testing.T) { ts := test.construction() - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) cfg := Config{StartHeight: ts.start} etl, err := NewL1ETL(cfg, logger, ts.db.DB, etlMetrics, ts.client, ts.contracts, func(cause error) { diff --git a/op-batcher/batcher/batch_submitter.go b/op-batcher/batcher/batch_submitter.go index 8590d84b6a3d..a35b9ad1a186 100644 --- a/op-batcher/batcher/batch_submitter.go +++ b/op-batcher/batcher/batch_submitter.go @@ -25,7 +25,7 @@ func Main(version string) cliapp.LifecycleAction { } l := oplog.NewLogger(oplog.AppOut(cliCtx), cfg.LogConfig) - oplog.SetGlobalLogHandler(l.GetHandler()) + oplog.SetGlobalLogHandler(l.Handler()) opservice.ValidateEnvVars(flags.EnvVarPrefix, flags.Flags, l) l.Info("Initializing Batch Submitter") diff --git a/op-batcher/batcher/channel_manager_test.go b/op-batcher/batcher/channel_manager_test.go index 80c70605366b..5f6c8dbd3059 100644 --- a/op-batcher/batcher/channel_manager_test.go +++ b/op-batcher/batcher/channel_manager_test.go @@ -52,7 +52,7 @@ func TestChannelManagerBatchType(t *testing.T) { // ChannelManagerReturnsErrReorg ensures that the channel manager // detects a reorg when it has cached L1 blocks. func ChannelManagerReturnsErrReorg(t *testing.T, batchType uint) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{BatchType: batchType}, &rollup.Config{}) m.Clear() @@ -83,7 +83,7 @@ func ChannelManagerReturnsErrReorg(t *testing.T, batchType uint) { // ChannelManagerReturnsErrReorgWhenDrained ensures that the channel manager // detects a reorg even if it does not have any blocks inside it. func ChannelManagerReturnsErrReorgWhenDrained(t *testing.T, batchType uint) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ MaxFrameSize: 120_000, @@ -116,7 +116,7 @@ func ChannelManager_Clear(t *testing.T, batchType uint) { require := require.New(t) // Create a channel manager - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) rng := rand.New(rand.NewSource(time.Now().UnixNano())) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ // Need to set the channel timeout here so we don't clear pending @@ -196,7 +196,7 @@ func ChannelManager_Clear(t *testing.T, batchType uint) { func ChannelManager_TxResend(t *testing.T, batchType uint) { require := require.New(t) rng := rand.New(rand.NewSource(time.Now().UnixNano())) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ MaxFrameSize: 120_000, @@ -244,7 +244,7 @@ func ChannelManager_TxResend(t *testing.T, batchType uint) { func ChannelManagerCloseBeforeFirstUse(t *testing.T, batchType uint) { require := require.New(t) rng := rand.New(rand.NewSource(time.Now().UnixNano())) - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ MaxFrameSize: 100, @@ -275,7 +275,7 @@ func ChannelManagerCloseBeforeFirstUse(t *testing.T, batchType uint) { // channel frames. func ChannelManagerCloseNoPendingChannel(t *testing.T, batchType uint) { require := require.New(t) - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ MaxFrameSize: 100, @@ -321,7 +321,7 @@ func ChannelManagerClosePendingChannel(t *testing.T, batchType uint) { // The number of batch txs depends on compression of the random data, hence the static test RNG seed. // Example of different RNG seed that creates less than 2 frames: 1698700588902821588 rng := rand.New(rand.NewSource(123)) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ MaxFrameSize: 10_000, @@ -379,7 +379,7 @@ func TestChannelManager_Close_PartiallyPendingChannel(t *testing.T) { // The number of batch txs depends on compression of the random data, hence the static test RNG seed. // Example of different RNG seed that creates less than 2 frames: 1698700588902821588 rng := rand.New(rand.NewSource(123)) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) const framesize = 2200 m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ @@ -441,7 +441,7 @@ func TestChannelManager_Close_PartiallyPendingChannel(t *testing.T) { func ChannelManagerCloseAllTxsFailed(t *testing.T, batchType uint) { require := require.New(t) rng := rand.New(rand.NewSource(time.Now().UnixNano())) - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ MaxFrameSize: 1000, diff --git a/op-batcher/batcher/channel_test.go b/op-batcher/batcher/channel_test.go index 4524a069341c..25b502308284 100644 --- a/op-batcher/batcher/channel_test.go +++ b/op-batcher/batcher/channel_test.go @@ -18,7 +18,7 @@ import ( // correctly identifies when a pending channel is timed out. func TestChannelTimeout(t *testing.T) { // Create a new channel manager with a ChannelTimeout - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ ChannelTimeout: 100, }, &rollup.Config{}) @@ -64,7 +64,7 @@ func TestChannelTimeout(t *testing.T) { // TestChannelNextTxData checks the nextTxData function. func TestChannelNextTxData(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{}, &rollup.Config{}) m.Clear() @@ -108,7 +108,7 @@ func TestChannelNextTxData(t *testing.T) { // TestChannelTxConfirmed checks the [ChannelManager.TxConfirmed] function. func TestChannelTxConfirmed(t *testing.T) { // Create a channel manager - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{ // Need to set the channel timeout here so we don't clear pending // channels on confirmation. This would result in [TxConfirmed] @@ -162,7 +162,7 @@ func TestChannelTxConfirmed(t *testing.T) { // TestChannelTxFailed checks the [ChannelManager.TxFailed] function. func TestChannelTxFailed(t *testing.T) { // Create a channel manager - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) m := NewChannelManager(log, metrics.NoopMetrics, ChannelConfig{}, &rollup.Config{}) m.Clear() diff --git a/op-batcher/batcher/service.go b/op-batcher/batcher/service.go index a28a09079eea..49ea70b3be79 100644 --- a/op-batcher/batcher/service.go +++ b/op-batcher/batcher/service.go @@ -27,9 +27,7 @@ import ( "github.com/ethereum-optimism/optimism/op-service/txmgr" ) -var ( - ErrAlreadyStopped = errors.New("already stopped") -) +var ErrAlreadyStopped = errors.New("already stopped") type BatcherConfig struct { NetworkTimeout time.Duration diff --git a/op-bindings/cmd/main.go b/op-bindings/cmd/main.go index 2916c386b61a..8c14f4fcda1d 100644 --- a/op-bindings/cmd/main.go +++ b/op-bindings/cmd/main.go @@ -72,7 +72,7 @@ func main() { func setupLogger(c *cli.Context) log.Logger { logger := oplog.NewLogger(oplog.AppOut(c), oplog.ReadCLIConfig(c)) - oplog.SetGlobalLogHandler(logger.GetHandler()) + oplog.SetGlobalLogHandler(logger.Handler()) return logger } diff --git a/op-bootnode/bootnode/entrypoint.go b/op-bootnode/bootnode/entrypoint.go index 1b1111242025..aa6df6dafca1 100644 --- a/op-bootnode/bootnode/entrypoint.go +++ b/op-bootnode/bootnode/entrypoint.go @@ -44,7 +44,7 @@ func Main(cliCtx *cli.Context) error { log.Info("Initializing bootnode") logCfg := oplog.ReadCLIConfig(cliCtx) logger := oplog.NewLogger(oplog.AppOut(cliCtx), logCfg) - oplog.SetGlobalLogHandler(logger.GetHandler()) + oplog.SetGlobalLogHandler(logger.Handler()) m := metrics.NewMetrics("default") ctx := context.Background() diff --git a/op-chain-ops/cmd/check-canyon/main.go b/op-chain-ops/cmd/check-canyon/main.go index c6deeb87ced1..deb5270ed639 100644 --- a/op-chain-ops/cmd/check-canyon/main.go +++ b/op-chain-ops/cmd/check-canyon/main.go @@ -12,7 +12,9 @@ import ( "github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-service/client" "github.com/ethereum-optimism/optimism/op-service/eth" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/mattn/go-isatty" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" @@ -206,7 +208,10 @@ func CheckInactivation(f func(Args, bool) error, ctx Args, forkActivated bool, v } func main() { - logger := log.New() + color := isatty.IsTerminal(os.Stderr.Fd()) + handler := log.NewTerminalHandler(os.Stderr, color) + oplog.SetGlobalLogHandler(handler) + logger := log.NewLogger(handler) // Define the flag variables var ( diff --git a/op-chain-ops/cmd/check-deploy-config/main.go b/op-chain-ops/cmd/check-deploy-config/main.go index 68659cfc7bdc..599f91611e01 100644 --- a/op-chain-ops/cmd/check-deploy-config/main.go +++ b/op-chain-ops/cmd/check-deploy-config/main.go @@ -9,11 +9,13 @@ import ( "github.com/urfave/cli/v2" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum/go-ethereum/log" ) func main() { - log.Root().SetHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(isatty.IsTerminal(os.Stderr.Fd())))) + color := isatty.IsTerminal(os.Stderr.Fd()) + oplog.SetGlobalLogHandler(log.NewTerminalHandler(os.Stderr, color)) app := &cli.App{ Name: "check-deploy-config", diff --git a/op-chain-ops/cmd/check-derivation/main.go b/op-chain-ops/cmd/check-derivation/main.go index a848db8a3ca2..499b128f8767 100644 --- a/op-chain-ops/cmd/check-derivation/main.go +++ b/op-chain-ops/cmd/check-derivation/main.go @@ -14,9 +14,11 @@ import ( "github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-service/client" "github.com/ethereum-optimism/optimism/op-service/eth" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/optimism/op-service/retry" "github.com/ethereum-optimism/optimism/op-service/sources" "github.com/ethereum-optimism/optimism/op-service/testutils" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" @@ -28,7 +30,8 @@ import ( ) func main() { - log.Root().SetHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(isatty.IsTerminal(os.Stderr.Fd())))) + color := isatty.IsTerminal(os.Stderr.Fd()) + oplog.SetGlobalLogHandler(log.NewTerminalHandler(os.Stderr, color)) app := cli.NewApp() app.Name = "check-derivation" @@ -157,7 +160,7 @@ func detectL2Reorg(cliCtx *cli.Context) error { return err } - var pollingInterval = cliCtx.Duration("polling-interval") + pollingInterval := cliCtx.Duration("polling-interval") // blockMap maps blockNumber to blockHash blockMap := make(map[uint64]common.Hash) var prevUnsafeHeadNum uint64 @@ -326,7 +329,7 @@ func checkConsolidation(cliCtx *cli.Context) error { if err != nil { return err } - var pollingInterval = cliCtx.Duration("polling-interval") + pollingInterval := cliCtx.Duration("polling-interval") privateKey, err := getPrivateKey(cliCtx) if err != nil { return err diff --git a/op-chain-ops/cmd/op-upgrade-extended-pause/main.go b/op-chain-ops/cmd/op-upgrade-extended-pause/main.go index 4af39cf08361..f3458eb87e2c 100644 --- a/op-chain-ops/cmd/op-upgrade-extended-pause/main.go +++ b/op-chain-ops/cmd/op-upgrade-extended-pause/main.go @@ -14,6 +14,7 @@ import ( "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-chain-ops/safe" "github.com/ethereum-optimism/optimism/op-chain-ops/upgrades" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/superchain-registry/superchain" ) @@ -149,7 +150,8 @@ var deployments = map[uint64]superchain.ImplementationList{ } func main() { - log.Root().SetHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(isatty.IsTerminal(os.Stderr.Fd())))) + color := isatty.IsTerminal(os.Stderr.Fd()) + oplog.SetGlobalLogHandler(log.NewTerminalHandler(os.Stderr, color)) app := &cli.App{ Name: "op-upgrade", diff --git a/op-chain-ops/cmd/op-upgrade/main.go b/op-chain-ops/cmd/op-upgrade/main.go index 7fdf67c8967e..3509a3614832 100644 --- a/op-chain-ops/cmd/op-upgrade/main.go +++ b/op-chain-ops/cmd/op-upgrade/main.go @@ -18,12 +18,14 @@ import ( "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-chain-ops/safe" "github.com/ethereum-optimism/optimism/op-chain-ops/upgrades" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/superchain-registry/superchain" ) func main() { - log.Root().SetHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(isatty.IsTerminal(os.Stderr.Fd())))) + color := isatty.IsTerminal(os.Stderr.Fd()) + oplog.SetGlobalLogHandler(log.NewTerminalHandler(os.Stderr, color)) app := &cli.App{ Name: "op-upgrade", diff --git a/op-chain-ops/cmd/protocol-version/main.go b/op-chain-ops/cmd/protocol-version/main.go index 7c4487437daa..a5bd6b434921 100644 --- a/op-chain-ops/cmd/protocol-version/main.go +++ b/op-chain-ops/cmd/protocol-version/main.go @@ -7,12 +7,14 @@ import ( "github.com/mattn/go-isatty" "github.com/urfave/cli/v2" + "golang.org/x/exp/slog" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" opservice "github.com/ethereum-optimism/optimism/op-service" + oplog "github.com/ethereum-optimism/optimism/op-service/log" ) const EnvPrefix = "OP_CHAIN_OPS_PROTOCOL_VERSION" @@ -51,7 +53,8 @@ var ( ) func main() { - log.Root().SetHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(isatty.IsTerminal(os.Stderr.Fd())))) + color := isatty.IsTerminal(os.Stderr.Fd()) + oplog.SetGlobalLogHandler(log.NewTerminalHandlerWithLevel(os.Stdout, slog.LevelDebug, color)) app := &cli.App{ Name: "protocol-version", diff --git a/op-chain-ops/cmd/registry-data/main.go b/op-chain-ops/cmd/registry-data/main.go index 75fc78dd93c5..1f33d65db8db 100644 --- a/op-chain-ops/cmd/registry-data/main.go +++ b/op-chain-ops/cmd/registry-data/main.go @@ -12,6 +12,7 @@ import ( opservice "github.com/ethereum-optimism/optimism/op-service" "github.com/ethereum-optimism/optimism/op-service/jsonutil" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core" @@ -52,7 +53,8 @@ var ( ) func main() { - log.Root().SetHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(isatty.IsTerminal(os.Stderr.Fd())))) + color := isatty.IsTerminal(os.Stderr.Fd()) + oplog.SetGlobalLogHandler(log.NewTerminalHandler(os.Stderr, color)) app := &cli.App{ Name: "registry-data", diff --git a/op-chain-ops/genesis/layer_one.go b/op-chain-ops/genesis/layer_one.go index 40d1c96f9014..3e931eb84411 100644 --- a/op-chain-ops/genesis/layer_one.go +++ b/op-chain-ops/genesis/layer_one.go @@ -56,7 +56,8 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme SetPrecompileBalances(memDB) if dump != nil { - for address, account := range dump.Accounts { + for _, account := range dump.Accounts { + address := *account.Address name := "" if l1Deployments != nil { if n := l1Deployments.GetName(address); n != "" { diff --git a/op-chain-ops/state/memory_db.go b/op-chain-ops/state/memory_db.go index e7cd375eabe5..2e8c8470f839 100644 --- a/op-chain-ops/state/memory_db.go +++ b/op-chain-ops/state/memory_db.go @@ -16,7 +16,10 @@ import ( var _ vm.StateDB = (*MemoryStateDB)(nil) -var emptyCodeHash = crypto.Keccak256(nil) +var ( + emptyCodeHash = crypto.Keccak256(nil) + zeroAddr = common.Address{} +) // MemoryStateDB implements geth's StateDB interface // but operates on a core.Genesis so that a genesis.json @@ -28,7 +31,7 @@ type MemoryStateDB struct { func NewMemoryStateDB(genesis *core.Genesis) *MemoryStateDB { if genesis == nil { - genesis = core.DeveloperGenesisBlock(15_000_000, common.Address{}) + genesis = core.DeveloperGenesisBlock(15_000_000, &zeroAddr) } return &MemoryStateDB{ diff --git a/op-challenger/challenger_test.go b/op-challenger/challenger_test.go index 2464e0dcf296..666e656e2c0f 100644 --- a/op-challenger/challenger_test.go +++ b/op-challenger/challenger_test.go @@ -12,7 +12,7 @@ import ( func TestMainShouldReturnErrorWhenConfigInvalid(t *testing.T) { cfg := &config.Config{} - app, err := Main(context.Background(), testlog.Logger(t, log.LvlInfo), cfg) + app, err := Main(context.Background(), testlog.Logger(t, log.LevelInfo), cfg) require.ErrorIs(t, err, cfg.Check()) require.Nil(t, app) } diff --git a/op-challenger/cmd/main.go b/op-challenger/cmd/main.go index f8a3f9a13e58..28e01bd8dbf0 100644 --- a/op-challenger/cmd/main.go +++ b/op-challenger/cmd/main.go @@ -64,6 +64,6 @@ func run(ctx context.Context, args []string, action ConfiguredLifecycle) error { func setupLogging(ctx *cli.Context) (log.Logger, error) { logCfg := oplog.ReadCLIConfig(ctx) logger := oplog.NewLogger(oplog.AppOut(ctx), logCfg) - oplog.SetGlobalLogHandler(logger.GetHandler()) + oplog.SetGlobalLogHandler(logger.Handler()) return logger, nil } diff --git a/op-challenger/game/fault/agent_test.go b/op-challenger/game/fault/agent_test.go index 47bcacbcba93..6e767d5b6ded 100644 --- a/op-challenger/game/fault/agent_test.go +++ b/op-challenger/game/fault/agent_test.go @@ -72,7 +72,7 @@ func TestLoadClaimsWhenGameNotResolvable(t *testing.T) { } func setupTestAgent(t *testing.T) (*Agent, *stubClaimLoader, *stubResponder) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) claimLoader := &stubClaimLoader{} depth := types.Depth(4) provider := alphabet.NewTraceProvider(big.NewInt(0), depth) diff --git a/op-challenger/game/fault/player_test.go b/op-challenger/game/fault/player_test.go index b5fb2d97fd37..9072315b4b9d 100644 --- a/op-challenger/game/fault/player_test.go +++ b/op-challenger/game/fault/player_test.go @@ -13,9 +13,7 @@ import ( "github.com/stretchr/testify/require" ) -var ( - mockValidatorError = fmt.Errorf("mock validator error") -) +var mockValidatorError = fmt.Errorf("mock validator error") func TestProgressGame_LogErrorFromAct(t *testing.T) { handler, game, actor := setupProgressGameTest(t) @@ -23,14 +21,14 @@ func TestProgressGame_LogErrorFromAct(t *testing.T) { status := game.ProgressGame(context.Background()) require.Equal(t, types.GameStatusInProgress, status) require.Equal(t, 1, actor.callCount, "should perform next actions") - errLog := handler.FindLog(log.LvlError, "Error when acting on game") + errLog := handler.FindLog(log.LevelError, "Error when acting on game") require.NotNil(t, errLog, "should log error") - require.Equal(t, actor.actErr, errLog.GetContextValue("err")) + require.Equal(t, actor.actErr, errLog.AttrValue("err")) // Should still log game status - msg := handler.FindLog(log.LvlInfo, "Game info") + msg := handler.FindLog(log.LevelInfo, "Game info") require.NotNil(t, msg) - require.Equal(t, uint64(1), msg.GetContextValue("claims")) + require.Equal(t, uint64(1), msg.AttrValue("claims")) } func TestProgressGame_LogGameStatus(t *testing.T) { @@ -64,9 +62,9 @@ func TestProgressGame_LogGameStatus(t *testing.T) { status := game.ProgressGame(context.Background()) require.Equal(t, 1, gameState.callCount, "should perform next actions") require.Equal(t, test.status, status) - errLog := handler.FindLog(log.LvlInfo, test.logMsg) + errLog := handler.FindLog(log.LevelInfo, test.logMsg) require.NotNil(t, errLog, "should log game result") - require.Equal(t, test.status, errLog.GetContextValue("status")) + require.Equal(t, test.status, errLog.AttrValue("status")) }) } } @@ -146,18 +144,14 @@ func (m *mockValidator) Validate(ctx context.Context) error { } func setupProgressGameTest(t *testing.T) (*testlog.CapturingHandler, *GamePlayer, *stubGameState) { - logger := testlog.Logger(t, log.LvlDebug) - handler := &testlog.CapturingHandler{ - Delegate: logger.GetHandler(), - } - logger.SetHandler(handler) + logger, logs := testlog.CaptureLogger(t, log.LevelDebug) gameState := &stubGameState{claimCount: 1} game := &GamePlayer{ act: gameState.Act, loader: gameState, logger: logger, } - return handler, game, gameState + return logs, game, gameState } type stubGameState struct { diff --git a/op-challenger/game/fault/responder/responder_test.go b/op-challenger/game/fault/responder/responder_test.go index 9b278a8e8b5e..04472101a984 100644 --- a/op-challenger/game/fault/responder/responder_test.go +++ b/op-challenger/game/fault/responder/responder_test.go @@ -197,7 +197,7 @@ func TestPerformAction(t *testing.T) { } func newTestFaultResponder(t *testing.T) (*FaultResponder, *mockTxManager, *mockContract) { - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) mockTxMgr := &mockTxManager{} contract := &mockContract{} responder, err := NewFaultResponder(log, mockTxMgr, contract) diff --git a/op-challenger/game/fault/trace/cannon/executor.go b/op-challenger/game/fault/trace/cannon/executor.go index eeb24dd73eab..cafa3b5374c0 100644 --- a/op-challenger/game/fault/trace/cannon/executor.go +++ b/op-challenger/game/fault/trace/cannon/executor.go @@ -130,10 +130,10 @@ func (e *Executor) GenerateProof(ctx context.Context, dir string, i uint64) erro func runCmd(ctx context.Context, l log.Logger, binary string, args ...string) error { cmd := exec.CommandContext(ctx, binary, args...) - stdOut := oplog.NewWriter(l, log.LvlInfo) + stdOut := oplog.NewWriter(l, log.LevelInfo) defer stdOut.Close() // Keep stdErr at info level because cannon uses stderr for progress messages - stdErr := oplog.NewWriter(l, log.LvlInfo) + stdErr := oplog.NewWriter(l, log.LevelInfo) defer stdErr.Close() cmd.Stdout = stdOut cmd.Stderr = stdErr diff --git a/op-challenger/game/fault/trace/cannon/executor_test.go b/op-challenger/game/fault/trace/cannon/executor_test.go index 0e67aa9bcaf4..de81e310e048 100644 --- a/op-challenger/game/fault/trace/cannon/executor_test.go +++ b/op-challenger/game/fault/trace/cannon/executor_test.go @@ -41,7 +41,7 @@ func TestGenerateProof(t *testing.T) { } captureExec := func(t *testing.T, cfg config.Config, proofAt uint64) (string, string, map[string]string) { m := &cannonDurationMetrics{} - executor := NewExecutor(testlog.Logger(t, log.LvlInfo), m, &cfg, inputs) + executor := NewExecutor(testlog.Logger(t, log.LevelInfo), m, &cfg, inputs) executor.selectSnapshot = func(logger log.Logger, dir string, absolutePreState string, i uint64) (string, error) { return input, nil } @@ -135,15 +135,14 @@ func TestRunCmdLogsOutput(t *testing.T) { } ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - logger := testlog.Logger(t, log.LvlInfo) - logs := testlog.Capture(logger) + logger, logs := testlog.CaptureLogger(t, log.LevelInfo) err := runCmd(ctx, logger, bin, "Hello World") require.NoError(t, err) - require.NotNil(t, logs.FindLog(log.LvlInfo, "Hello World")) + require.NotNil(t, logs.FindLog(log.LevelInfo, "Hello World")) } func TestFindStartingSnapshot(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) withSnapshots := func(t *testing.T, files ...string) string { dir := t.TempDir() diff --git a/op-challenger/game/fault/trace/cannon/provider_test.go b/op-challenger/game/fault/trace/cannon/provider_test.go index f6903e29a96a..c0f1024bb93a 100644 --- a/op-challenger/game/fault/trace/cannon/provider_test.go +++ b/op-challenger/game/fault/trace/cannon/provider_test.go @@ -235,7 +235,7 @@ func setupTestData(t *testing.T) (string, string) { func setupWithTestData(t *testing.T, dataDir string, prestate string) (*CannonTraceProvider, *stubGenerator) { generator := &stubGenerator{} return &CannonTraceProvider{ - logger: testlog.Logger(t, log.LvlInfo), + logger: testlog.Logger(t, log.LevelInfo), dir: dataDir, generator: generator, prestate: filepath.Join(dataDir, prestate), diff --git a/op-challenger/game/fault/trace/outputs/provider_test.go b/op-challenger/game/fault/trace/outputs/provider_test.go index 67a8cd8c9d25..5df45431fee0 100644 --- a/op-challenger/game/fault/trace/outputs/provider_test.go +++ b/op-challenger/game/fault/trace/outputs/provider_test.go @@ -121,7 +121,7 @@ func setupWithTestData(t *testing.T, prestateBlock, poststateBlock uint64, custo inputGameDepth = customGameDepth[0] } return &OutputTraceProvider{ - logger: testlog.Logger(t, log.LvlInfo), + logger: testlog.Logger(t, log.LevelInfo), rollupClient: &rollupClient, prestateBlock: prestateBlock, poststateBlock: poststateBlock, diff --git a/op-challenger/game/fault/trace/outputs/split_adapter_test.go b/op-challenger/game/fault/trace/outputs/split_adapter_test.go index fe03035a5067..76bab2383a69 100644 --- a/op-challenger/game/fault/trace/outputs/split_adapter_test.go +++ b/op-challenger/game/fault/trace/outputs/split_adapter_test.go @@ -134,7 +134,7 @@ func setupAdapterTest(t *testing.T, topDepth types.Depth) (split.ProviderCreator prestateProvider := &stubPrestateProvider{ absolutePrestate: prestateOutputRoot, } - topProvider := NewTraceProviderFromInputs(testlog.Logger(t, log.LvlInfo), prestateProvider, rollupClient, topDepth, prestateBlock, poststateBlock) + topProvider := NewTraceProviderFromInputs(testlog.Logger(t, log.LevelInfo), prestateProvider, rollupClient, topDepth, prestateBlock, poststateBlock) adapter := OutputRootSplitAdapter(topProvider, creator.Create) return adapter, creator } diff --git a/op-challenger/game/monitor_test.go b/op-challenger/game/monitor_test.go index eedd3b4bb02b..c9753db15379 100644 --- a/op-challenger/game/monitor_test.go +++ b/op-challenger/game/monitor_test.go @@ -177,7 +177,7 @@ func setupMonitorTest( t *testing.T, allowedGames []common.Address, ) (*gameMonitor, *stubGameSource, *stubScheduler, *mockNewHeadSource) { - logger := testlog.Logger(t, log.LvlDebug) + logger := testlog.Logger(t, log.LevelDebug) source := &stubGameSource{} i := uint64(1) fetchBlockNum := func(ctx context.Context) (uint64, error) { diff --git a/op-challenger/game/scheduler/coordinator_test.go b/op-challenger/game/scheduler/coordinator_test.go index 7f2abaedf8c3..7e4056d19cfd 100644 --- a/op-challenger/game/scheduler/coordinator_test.go +++ b/op-challenger/game/scheduler/coordinator_test.go @@ -332,7 +332,7 @@ func TestDropOldGameStates(t *testing.T) { } func setupCoordinatorTest(t *testing.T, bufferSize int) (*coordinator, <-chan job, chan job, *createdGames, *stubDiskManager) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) workQueue := make(chan job, bufferSize) resultQueue := make(chan job, bufferSize) games := &createdGames{ diff --git a/op-challenger/game/scheduler/scheduler_test.go b/op-challenger/game/scheduler/scheduler_test.go index bd87e41f4b1e..74ed6e5a2b43 100644 --- a/op-challenger/game/scheduler/scheduler_test.go +++ b/op-challenger/game/scheduler/scheduler_test.go @@ -14,7 +14,7 @@ import ( ) func TestSchedulerProcessesGames(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) ctx := context.Background() createPlayer := func(g types.GameMetadata, dir string) (GamePlayer, error) { return &test.StubGamePlayer{}, nil @@ -43,7 +43,7 @@ func TestSchedulerProcessesGames(t *testing.T) { } func TestReturnBusyWhenScheduleQueueFull(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) createPlayer := func(game types.GameMetadata, dir string) (GamePlayer, error) { return &test.StubGamePlayer{}, nil } diff --git a/op-conductor/cmd/main.go b/op-conductor/cmd/main.go index e7b49d9eb29d..508ffe220df0 100644 --- a/op-conductor/cmd/main.go +++ b/op-conductor/cmd/main.go @@ -44,7 +44,7 @@ func main() { func OpConductorMain(ctx *cli.Context, closeApp context.CancelCauseFunc) (cliapp.Lifecycle, error) { logCfg := oplog.ReadCLIConfig(ctx) log := oplog.NewLogger(oplog.AppOut(ctx), logCfg) - oplog.SetGlobalLogHandler(log.GetHandler()) + oplog.SetGlobalLogHandler(log.Handler()) opservice.ValidateEnvVars(flags.EnvVarPrefix, flags.Flags, log) cfg, err := conductor.NewConfig(ctx, log) diff --git a/op-conductor/conductor/service_test.go b/op-conductor/conductor/service_test.go index d2dc98994b82..28686f038f09 100644 --- a/op-conductor/conductor/service_test.go +++ b/op-conductor/conductor/service_test.go @@ -95,7 +95,7 @@ type OpConductorTestSuite struct { func (s *OpConductorTestSuite) SetupSuite() { s.ctx = context.Background() - s.log = testlog.Logger(s.T(), log.LvlDebug) + s.log = testlog.Logger(s.T(), log.LevelDebug) s.cfg = mockConfig(s.T()) s.version = "v0.0.1" s.next = make(chan struct{}, 1) diff --git a/op-conductor/consensus/raft_test.go b/op-conductor/consensus/raft_test.go index 48ac975b0bb4..d9ef7c911cff 100644 --- a/op-conductor/consensus/raft_test.go +++ b/op-conductor/consensus/raft_test.go @@ -16,7 +16,7 @@ import ( ) func TestCommitAndRead(t *testing.T) { - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) serverID := "SequencerA" serverAddr := "127.0.0.1:0" bootstrap := true diff --git a/op-conductor/health/monitor_test.go b/op-conductor/health/monitor_test.go index 8cb96aab3c5c..5997d5a07521 100644 --- a/op-conductor/health/monitor_test.go +++ b/op-conductor/health/monitor_test.go @@ -37,7 +37,7 @@ type HealthMonitorTestSuite struct { } func (s *HealthMonitorTestSuite) SetupSuite() { - s.log = testlog.Logger(s.T(), log.LvlInfo) + s.log = testlog.Logger(s.T(), log.LevelInfo) s.rc = &testutils.MockRollupClient{} s.pc = &p2pMocks.API{} s.interval = 1 diff --git a/op-e2e/actions/blocktime_test.go b/op-e2e/actions/blocktime_test.go index 80bd055b23cf..34499b0093fd 100644 --- a/op-e2e/actions/blocktime_test.go +++ b/op-e2e/actions/blocktime_test.go @@ -51,7 +51,7 @@ func BatchInLastPossibleBlocks(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp.DeployConfig.L2BlockTime = 2 sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) sd, _, miner, sequencer, sequencerEngine, _, _, batcher := setupReorgTestActors(t, dp, sd, log) @@ -163,7 +163,7 @@ func LargeL1Gaps(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp.DeployConfig.MaxSequencerDrift = 32 dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) sd, _, miner, sequencer, sequencerEngine, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) diff --git a/op-e2e/actions/dencun_fork_test.go b/op-e2e/actions/dencun_fork_test.go index 488ab87fc19d..2a44abc359c8 100644 --- a/op-e2e/actions/dencun_fork_test.go +++ b/op-e2e/actions/dencun_fork_test.go @@ -17,7 +17,7 @@ func TestDencunL1Fork(gt *testing.T) { offset := uint64(24) dp.DeployConfig.L1CancunTimeOffset = &offset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) l1Head := miner.l1Chain.CurrentBlock() @@ -60,7 +60,7 @@ func TestDencunL1ForkAtGenesis(gt *testing.T) { offset := uint64(0) dp.DeployConfig.L1CancunTimeOffset = &offset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) l1Head := miner.l1Chain.CurrentBlock() diff --git a/op-e2e/actions/l1_miner_test.go b/op-e2e/actions/l1_miner_test.go index b149cfd778c3..10e4c0c5498c 100644 --- a/op-e2e/actions/l1_miner_test.go +++ b/op-e2e/actions/l1_miner_test.go @@ -17,7 +17,7 @@ func TestL1Miner_BuildBlock(gt *testing.T) { t := NewDefaultTesting(gt) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner := NewL1Miner(t, log, sd.L1Cfg) t.Cleanup(func() { _ = miner.Close() diff --git a/op-e2e/actions/l1_replica_test.go b/op-e2e/actions/l1_replica_test.go index fa12159f7ea6..7e9b65cfac86 100644 --- a/op-e2e/actions/l1_replica_test.go +++ b/op-e2e/actions/l1_replica_test.go @@ -34,7 +34,7 @@ func TestL1Replica_ActL1RPCFail(gt *testing.T) { t := NewDefaultTesting(gt) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) replica := NewL1Replica(t, log, sd.L1Cfg) t.Cleanup(func() { _ = replica.Close() @@ -56,7 +56,7 @@ func TestL1Replica_ActL1Sync(gt *testing.T) { t := NewDefaultTesting(gt) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) genesisBlock := sd.L1Cfg.ToBlock() consensus := beacon.New(ethash.NewFaker()) db := rawdb.NewMemoryDatabase() diff --git a/op-e2e/actions/l2_batcher_test.go b/op-e2e/actions/l2_batcher_test.go index 3c185452ae95..25c510275ee4 100644 --- a/op-e2e/actions/l2_batcher_test.go +++ b/op-e2e/actions/l2_batcher_test.go @@ -61,7 +61,7 @@ func NormalBatcher(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, p) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) @@ -133,7 +133,7 @@ func L2Finalization(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, engine, sequencer := setupSequencerTest(t, sd, log) sequencer.ActL2PipelineFull(t) @@ -240,7 +240,7 @@ func L2FinalizationWithSparseL1(gt *testing.T, deltaTimeOffset *hexutil.Uint64) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, engine, sequencer := setupSequencerTest(t, sd, log) sequencer.ActL2PipelineFull(t) @@ -301,7 +301,7 @@ func GarbageBatch(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset for _, garbageKind := range GarbageKinds { sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) miner, engine, sequencer := setupSequencerTest(t, sd, log) _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) @@ -385,7 +385,7 @@ func ExtendedTimeWithoutL1Batches(gt *testing.T, deltaTimeOffset *hexutil.Uint64 dp := e2eutils.MakeDeployParams(t, p) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) miner, engine, sequencer := setupSequencerTest(t, sd, log) _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) @@ -444,7 +444,7 @@ func BigL2Txs(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, p) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) miner, engine, sequencer := setupSequencerTest(t, sd, log) _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) diff --git a/op-e2e/actions/l2_engine_test.go b/op-e2e/actions/l2_engine_test.go index fc48a49e5262..7397b48879d2 100644 --- a/op-e2e/actions/l2_engine_test.go +++ b/op-e2e/actions/l2_engine_test.go @@ -30,7 +30,7 @@ func TestL2EngineAPI(gt *testing.T) { jwtPath := e2eutils.WriteDefaultJWT(t) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) genesisBlock := sd.L2Cfg.ToBlock() consensus := beacon.New(ethash.NewFaker()) db := rawdb.NewMemoryDatabase() @@ -94,7 +94,7 @@ func TestL2EngineAPIBlockBuilding(gt *testing.T) { jwtPath := e2eutils.WriteDefaultJWT(t) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) genesisBlock := sd.L2Cfg.ToBlock() db := rawdb.NewMemoryDatabase() tdb := trie.NewDatabase(db, &trie.Config{HashDB: hashdb.Defaults}) @@ -188,7 +188,7 @@ func TestL2EngineAPIFail(gt *testing.T) { jwtPath := e2eutils.WriteDefaultJWT(t) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath) // mock an RPC failure engine.ActL2RPCFail(t) diff --git a/op-e2e/actions/l2_proposer_test.go b/op-e2e/actions/l2_proposer_test.go index 1c346f020680..86f18401a0d2 100644 --- a/op-e2e/actions/l2_proposer_test.go +++ b/op-e2e/actions/l2_proposer_test.go @@ -44,7 +44,7 @@ func RunProposerTest(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) rollupSeqCl := sequencer.RollupClient() diff --git a/op-e2e/actions/l2_sequencer_test.go b/op-e2e/actions/l2_sequencer_test.go index 654787cd8268..bd1679e636e4 100644 --- a/op-e2e/actions/l2_sequencer_test.go +++ b/op-e2e/actions/l2_sequencer_test.go @@ -41,7 +41,7 @@ func TestL2Sequencer_SequencerDrift(gt *testing.T) { } dp := e2eutils.MakeDeployParams(t, p) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, engine, sequencer := setupSequencerTest(t, sd, log) miner.ActL1SetFeeRecipient(common.Address{'A'}) @@ -109,7 +109,7 @@ func TestL2Sequencer_SequencerOnlyReorg(gt *testing.T) { t := NewDefaultTesting(gt) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, _, sequencer := setupSequencerTest(t, sd, log) // Sequencer at first only recognizes the genesis as safe. diff --git a/op-e2e/actions/l2_verifier_test.go b/op-e2e/actions/l2_verifier_test.go index 5116b0cc32e7..5eb03380aaf8 100644 --- a/op-e2e/actions/l2_verifier_test.go +++ b/op-e2e/actions/l2_verifier_test.go @@ -38,7 +38,7 @@ func TestL2Verifier_SequenceWindow(gt *testing.T) { } dp := e2eutils.MakeDeployParams(t, p) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, engine, verifier := setupVerifierOnlyTest(t, sd, log) miner.ActL1SetFeeRecipient(common.Address{'A'}) diff --git a/op-e2e/actions/reorg_test.go b/op-e2e/actions/reorg_test.go index 3ebbe7ecffe5..58565cd1d58c 100644 --- a/op-e2e/actions/reorg_test.go +++ b/op-e2e/actions/reorg_test.go @@ -27,7 +27,7 @@ func setupReorgTest(t Testing, config *e2eutils.TestParams, deltaTimeOffset *hex dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) return setupReorgTestActors(t, dp, sd, log) } @@ -384,7 +384,7 @@ func DeepReorg(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { } // Set up alice - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) addresses := e2eutils.CollectAddresses(sd, dp) l2UserEnv := &BasicUserEnv[*L2Bindings]{ EthCl: l2Client, @@ -609,7 +609,7 @@ func RestartOpGeth(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) jwtPath := e2eutils.WriteDefaultJWT(t) // L1 miner := NewL1Miner(t, log, sd.L1Cfg) @@ -700,7 +700,7 @@ func ConflictingL2Blocks(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) sd, _, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) @@ -815,7 +815,7 @@ func SyncAfterReorg(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { } sd, dp, miner, sequencer, seqEngine, verifier, _, batcher := setupReorgTest(t, &testingParams, deltaTimeOffset) l2Client := seqEngine.EthClient() - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) addresses := e2eutils.CollectAddresses(sd, dp) l2UserEnv := &BasicUserEnv[*L2Bindings]{ EthCl: l2Client, diff --git a/op-e2e/actions/span_batch_test.go b/op-e2e/actions/span_batch_test.go index 65312b949652..d983c4cef7d2 100644 --- a/op-e2e/actions/span_batch_test.go +++ b/op-e2e/actions/span_batch_test.go @@ -37,7 +37,7 @@ func TestDropSpanBatchBeforeHardfork(gt *testing.T) { // do not activate Delta hardfork for verifier dp.DeployConfig.L2GenesisDeltaTimeOffset = nil sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) rollupSeqCl := sequencer.RollupClient() @@ -127,7 +127,7 @@ func TestHardforkMiddleOfSpanBatch(gt *testing.T) { deltaOffset := hexutil.Uint64(6) dp.DeployConfig.L2GenesisDeltaTimeOffset = &deltaOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) minerCl := miner.EthClient() @@ -234,7 +234,7 @@ func TestAcceptSingularBatchAfterHardfork(gt *testing.T) { // activate Delta hardfork for verifier. dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) rollupSeqCl := sequencer.RollupClient() @@ -319,7 +319,7 @@ func TestMixOfBatchesAfterHardfork(gt *testing.T) { // Activate Delta hardfork for verifier. dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) verifEngine, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) rollupSeqCl := sequencer.RollupClient() @@ -408,7 +408,7 @@ func TestSpanBatchEmptyChain(gt *testing.T) { // Activate Delta hardfork dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) @@ -474,7 +474,7 @@ func TestSpanBatchLowThroughputChain(gt *testing.T) { // Activate Delta hardfork dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) _, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg), &sync.Config{}) @@ -574,7 +574,7 @@ func TestSpanBatchLowThroughputChain(gt *testing.T) { func TestBatchEquivalence(gt *testing.T) { t := NewDefaultTesting(gt) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) p := &e2eutils.TestParams{ MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) diff --git a/op-e2e/actions/sync_test.go b/op-e2e/actions/sync_test.go index 62d706912b1c..572bb0aeedf1 100644 --- a/op-e2e/actions/sync_test.go +++ b/op-e2e/actions/sync_test.go @@ -53,7 +53,7 @@ func DerivationWithFlakyL1RPC(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) // mute all the temporary derivation errors that we forcefully create + log := testlog.Logger(t, log.LevelError) // mute all the temporary derivation errors that we forcefully create _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) rng := rand.New(rand.NewSource(1234)) @@ -93,7 +93,7 @@ func FinalizeWhileSyncing(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlError) // mute all the temporary derivation errors that we forcefully create + log := testlog.Logger(t, log.LevelError) // mute all the temporary derivation errors that we forcefully create _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) sequencer.ActL2PipelineFull(t) @@ -137,7 +137,7 @@ func TestUnsafeSync(gt *testing.T) { t := NewDefaultTesting(gt) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) sd, _, _, sequencer, seqEng, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) @@ -168,7 +168,7 @@ func TestELSync(gt *testing.T) { t := NewDefaultTesting(gt) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) miner, seqEng, sequencer := setupSequencerTest(t, sd, log) // Enable engine P2P sync @@ -211,7 +211,7 @@ func TestInvalidPayloadInSpanBatch(gt *testing.T) { dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs dp.DeployConfig.L2BlockTime = 2 sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) _, _, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) l2Cl := seqEng.EthClient() rng := rand.New(rand.NewSource(1234)) @@ -334,7 +334,7 @@ func TestSpanBatchAtomicity_Consolidation(gt *testing.T) { dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs dp.DeployConfig.L2BlockTime = 2 sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) _, _, miner, sequencer, seqEng, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) seqEngCl, err := sources.NewEngineClient(seqEng.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) require.NoError(t, err) @@ -393,7 +393,7 @@ func TestSpanBatchAtomicity_ForceAdvance(gt *testing.T) { dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs dp.DeployConfig.L2BlockTime = 2 sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) targetHeadNumber := uint64(6) // L1 block time / L2 block time diff --git a/op-e2e/actions/system_config_test.go b/op-e2e/actions/system_config_test.go index d46e45373140..b09c2fdb182b 100644 --- a/op-e2e/actions/system_config_test.go +++ b/op-e2e/actions/system_config_test.go @@ -55,7 +55,7 @@ func BatcherKeyRotation(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp.DeployConfig.L2BlockTime = 2 dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner.ActL1SetFeeRecipient(common.Address{'A'}) sequencer.ActL2PipelineFull(t) @@ -233,7 +233,7 @@ func GPOParamsChange(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) batcher := NewL2Batcher(log, sd.RollupCfg, &BatcherCfg{ MinL1TxSize: 0, @@ -363,7 +363,7 @@ func GasLimitChange(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) batcher := NewL2Batcher(log, sd.RollupCfg, &BatcherCfg{ MinL1TxSize: 0, diff --git a/op-e2e/actions/user_test.go b/op-e2e/actions/user_test.go index d3ce8898524c..06bc294ad812 100644 --- a/op-e2e/actions/user_test.go +++ b/op-e2e/actions/user_test.go @@ -60,7 +60,7 @@ func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) { dp.DeployConfig.L2GenesisRegolithTimeOffset = test.regolithTime dp.DeployConfig.L2GenesisDeltaTimeOffset = test.deltaTime sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) require.Equal(t, dp.Secrets.Addresses().Batcher, dp.DeployConfig.BatchSenderAddress) require.Equal(t, dp.Secrets.Addresses().Proposer, dp.DeployConfig.L2OutputOracleProposer) diff --git a/op-e2e/bridge_test.go b/op-e2e/bridge_test.go index 4b04beae75b3..d3092d1a6e48 100644 --- a/op-e2e/bridge_test.go +++ b/op-e2e/bridge_test.go @@ -31,7 +31,7 @@ func TestERC20BridgeDeposits(t *testing.T) { require.Nil(t, err, "Error starting up system") defer sys.Close() - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) l1Client := sys.Clients["l1"] diff --git a/op-e2e/config/init.go b/op-e2e/config/init.go index 6f60d1a5d81f..b5b8581850ae 100644 --- a/op-e2e/config/init.go +++ b/op-e2e/config/init.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/log" + "golang.org/x/exp/slog" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-e2e/external" @@ -63,26 +64,29 @@ func init() { flag.StringVar(&l1DeploymentsPath, "l1-deployments", defaultL1DeploymentsPath, "") flag.StringVar(&deployConfigPath, "deploy-config", defaultDeployConfigPath, "") flag.StringVar(&externalL2, "externalL2", "", "Enable tests with external L2") - flag.IntVar(&EthNodeVerbosity, "ethLogVerbosity", int(log.LvlInfo), "The level of verbosity to use for the eth node logs") + flag.IntVar(&EthNodeVerbosity, "ethLogVerbosity", int(log.LevelInfo), "The level of verbosity to use for the eth node logs") testing.Init() // Register test flags before parsing flag.Parse() // Setup global logger - lvl := log.Lvl(EthNodeVerbosity) - if lvl < log.LvlCrit { - log.Root().SetHandler(log.DiscardHandler()) - } else if lvl > log.LvlTrace { // clip to trace level - lvl = log.LvlTrace + lvl := slog.Level(EthNodeVerbosity) + var handler slog.Handler + if lvl > log.LevelCrit { + handler = log.DiscardHandler() + } else { + if lvl < log.LevelTrace { // clip to trace level + lvl = log.LevelTrace + } + // We cannot attach a testlog logger, + // because the global logger is shared between different independent parallel tests. + // Tests that write to a testlogger of another finished test fail. + handler = oplog.NewLogHandler(os.Stdout, oplog.CLIConfig{ + Level: lvl, + Color: false, // some CI logs do not handle colors well + Format: oplog.FormatTerminal, + }) } - // We cannot attach a testlog logger, - // because the global logger is shared between different independent parallel tests. - // Tests that write to a testlogger of another finished test fail. - h := oplog.NewLogHandler(os.Stdout, oplog.CLIConfig{ - Level: lvl, - Color: false, // some CI logs do not handle colors well - Format: oplog.FormatTerminal, - }) - oplog.SetGlobalLogHandler(h) + oplog.SetGlobalLogHandler(handler) if err := allExist(l1AllocsPath, l1DeploymentsPath, deployConfigPath); err != nil { return diff --git a/op-e2e/e2eutils/challenger/helper.go b/op-e2e/e2eutils/challenger/helper.go index 60a1483ee58a..6ca8c5b4f965 100644 --- a/op-e2e/e2eutils/challenger/helper.go +++ b/op-e2e/e2eutils/challenger/helper.go @@ -110,7 +110,7 @@ func WithAlphabet(rollupEndpoint string) Option { } func NewChallenger(t *testing.T, ctx context.Context, l1Endpoint string, name string, options ...Option) *Helper { - log := testlog.Logger(t, log.LvlDebug).New("role", name) + log := testlog.Logger(t, log.LevelDebug).New("role", name) log.Info("Creating challenger", "l1", l1Endpoint) cfg := NewChallengerConfig(t, l1Endpoint, options...) chl, err := challenger.Main(ctx, log, cfg) diff --git a/op-e2e/e2eutils/disputegame/helper.go b/op-e2e/e2eutils/disputegame/helper.go index 2f9acd9f3947..3b22afb5b930 100644 --- a/op-e2e/e2eutils/disputegame/helper.go +++ b/op-e2e/e2eutils/disputegame/helper.go @@ -112,7 +112,7 @@ func (h *FactoryHelper) StartOutputCannonGameWithCorrectRoot(ctx context.Context } func (h *FactoryHelper) StartOutputCannonGame(ctx context.Context, l2Node string, l2BlockNumber uint64, rootClaim common.Hash) *OutputCannonGameHelper { - logger := testlog.Logger(h.t, log.LvlInfo).New("role", "OutputCannonGameHelper") + logger := testlog.Logger(h.t, log.LevelInfo).New("role", "OutputCannonGameHelper") rollupClient := h.system.RollupClient(l2Node) extraData := h.createBisectionGameExtraData(l2Node, l2BlockNumber) @@ -164,7 +164,7 @@ func (h *FactoryHelper) StartOutputAlphabetGameWithCorrectRoot(ctx context.Conte } func (h *FactoryHelper) StartOutputAlphabetGame(ctx context.Context, l2Node string, l2BlockNumber uint64, rootClaim common.Hash) *OutputAlphabetGameHelper { - logger := testlog.Logger(h.t, log.LvlInfo).New("role", "OutputAlphabetGameHelper") + logger := testlog.Logger(h.t, log.LevelInfo).New("role", "OutputAlphabetGameHelper") rollupClient := h.system.RollupClient(l2Node) extraData := h.createBisectionGameExtraData(l2Node, l2BlockNumber) diff --git a/op-e2e/e2eutils/disputegame/output_alphabet_helper.go b/op-e2e/e2eutils/disputegame/output_alphabet_helper.go index 871c4e69349d..a57299a821ed 100644 --- a/op-e2e/e2eutils/disputegame/output_alphabet_helper.go +++ b/op-e2e/e2eutils/disputegame/output_alphabet_helper.go @@ -36,7 +36,7 @@ func (g *OutputAlphabetGameHelper) StartChallenger( } func (g *OutputAlphabetGameHelper) CreateHonestActor(ctx context.Context, l2Node string) *OutputHonestHelper { - logger := testlog.Logger(g.t, log.LvlInfo).New("role", "HonestHelper", "game", g.addr) + logger := testlog.Logger(g.t, log.LevelInfo).New("role", "HonestHelper", "game", g.addr) caller := batching.NewMultiCaller(g.system.NodeClient("l1").Client(), batching.DefaultBatchSize) contract, err := contracts.NewFaultDisputeGameContract(g.addr, caller) g.require.NoError(err, "Failed to create game contact") diff --git a/op-e2e/e2eutils/disputegame/output_cannon_helper.go b/op-e2e/e2eutils/disputegame/output_cannon_helper.go index 7060872f4dd8..fdf654a2a63c 100644 --- a/op-e2e/e2eutils/disputegame/output_cannon_helper.go +++ b/op-e2e/e2eutils/disputegame/output_cannon_helper.go @@ -47,7 +47,7 @@ func (g *OutputCannonGameHelper) CreateHonestActor(ctx context.Context, l2Node s opts = append(opts, options...) cfg := challenger.NewChallengerConfig(g.t, g.system.NodeEndpoint("l1"), opts...) - logger := testlog.Logger(g.t, log.LvlInfo).New("role", "HonestHelper", "game", g.addr) + logger := testlog.Logger(g.t, log.LevelInfo).New("role", "HonestHelper", "game", g.addr) l2Client := g.system.NodeClient(l2Node) caller := batching.NewMultiCaller(g.system.NodeClient("l1").Client(), batching.DefaultBatchSize) contract, err := contracts.NewFaultDisputeGameContract(g.addr, caller) diff --git a/op-e2e/op_geth.go b/op-e2e/op_geth.go index 4e73f7d2499d..b07482ab7ad5 100644 --- a/op-e2e/op_geth.go +++ b/op-e2e/op_geth.go @@ -51,7 +51,7 @@ type OpGeth struct { } func NewOpGeth(t *testing.T, ctx context.Context, cfg *SystemConfig) (*OpGeth, error) { - logger := testlog.Logger(t, log.LvlCrit) + logger := testlog.Logger(t, log.LevelCrit) l1Genesis, err := genesis.BuildL1DeveloperGenesis(cfg.DeployConfig, config.L1Allocs, config.L1Deployments, true) require.Nil(t, err) diff --git a/op-e2e/setup.go b/op-e2e/setup.go index a440940e8851..31c4710a4c8b 100644 --- a/op-e2e/setup.go +++ b/op-e2e/setup.go @@ -146,10 +146,10 @@ func DefaultSystemConfig(t *testing.T) SystemConfig { }, }, Loggers: map[string]log.Logger{ - "verifier": testlog.Logger(t, log.LvlInfo).New("role", "verifier"), - "sequencer": testlog.Logger(t, log.LvlInfo).New("role", "sequencer"), - "batcher": testlog.Logger(t, log.LvlInfo).New("role", "batcher"), - "proposer": testlog.Logger(t, log.LvlCrit).New("role", "proposer"), + "verifier": testlog.Logger(t, log.LevelInfo).New("role", "verifier"), + "sequencer": testlog.Logger(t, log.LevelInfo).New("role", "sequencer"), + "batcher": testlog.Logger(t, log.LevelInfo).New("role", "batcher"), + "proposer": testlog.Logger(t, log.LevelCrit).New("role", "proposer"), }, GethOptions: map[string][]geth.GethOption{}, P2PTopology: nil, // no P2P connectivity by default @@ -302,7 +302,7 @@ func (sys *System) RollupClient(name string) *sources.RollupClient { if ok { return client } - logger := testlog.Logger(sys.t, log.LvlInfo).New("rollupClient", name) + logger := testlog.Logger(sys.t, log.LevelInfo).New("rollupClient", name) endpoint := sys.RollupEndpoint(name) client, err := dial.DialRollupClientWithTimeout(context.Background(), 30*time.Second, logger, endpoint) require.NoErrorf(sys.t, err, "Failed to dial rollup client %v", name) @@ -504,7 +504,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste sys.RollupConfig = &defaultConfig // Create a fake Beacon node to hold on to blobs created by the L1 miner, and to serve them to L2 - bcn := fakebeacon.NewBeacon(testlog.Logger(t, log.LvlInfo).New("role", "l1_cl"), + bcn := fakebeacon.NewBeacon(testlog.Logger(t, log.LevelInfo).New("role", "l1_cl"), path.Join(cfg.BlobsPath, "l1_cl"), l1Genesis.Timestamp, cfg.DeployConfig.L1BlockTime) t.Cleanup(func() { _ = bcn.Close() @@ -641,8 +641,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste } // Don't log state snapshots in test output - snapLog := log.New() - snapLog.SetHandler(log.DiscardHandler()) + snapLog := log.NewLogger(log.DiscardHandler()) // Rollup nodes @@ -735,7 +734,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste TxMgrConfig: newTxMgrConfig(sys.EthInstances["l1"].WSEndpoint(), cfg.Secrets.Proposer), AllowNonFinalized: cfg.NonFinalizedProposals, LogConfig: oplog.CLIConfig{ - Level: log.LvlInfo, + Level: log.LevelInfo, Format: oplog.FormatText, }, } @@ -772,7 +771,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste PollInterval: 50 * time.Millisecond, TxMgrConfig: newTxMgrConfig(sys.EthInstances["l1"].WSEndpoint(), cfg.Secrets.Batcher), LogConfig: oplog.CLIConfig{ - Level: log.LvlInfo, + Level: log.LevelInfo, Format: oplog.FormatText, }, Stopped: sys.Cfg.DisableBatcher, // Batch submitter may be enabled later diff --git a/op-e2e/system_fpp_test.go b/op-e2e/system_fpp_test.go index 20bee732fa96..e7e65c21624c 100644 --- a/op-e2e/system_fpp_test.go +++ b/op-e2e/system_fpp_test.go @@ -85,7 +85,7 @@ func testVerifyL2OutputRootEmptyBlock(t *testing.T, detached bool, spanBatchActi require.Nil(t, err, "Error starting up system") defer sys.Close() - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) l1Client := sys.Clients["l1"] @@ -190,7 +190,7 @@ func testVerifyL2OutputRoot(t *testing.T, detached bool, spanBatchActivated bool require.Nil(t, err, "Error starting up system") defer sys.Close() - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) l1Client := sys.Clients["l1"] @@ -283,7 +283,7 @@ func testFaultProofProgramScenario(t *testing.T, ctx context.Context, sys *Syste // Check the FPP confirms the expected output t.Log("Running fault proof in fetching mode") - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) err := opp.FaultProofProgram(ctx, log, fppConfig) require.NoError(t, err) diff --git a/op-e2e/system_test.go b/op-e2e/system_test.go index 5faa0dd685ef..198762e27870 100644 --- a/op-e2e/system_test.go +++ b/op-e2e/system_test.go @@ -222,7 +222,7 @@ func TestSystemE2E(t *testing.T) { } func runE2ESystemTest(t *testing.T, sys *System) { - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) l1Client := sys.Clients["l1"] @@ -305,7 +305,7 @@ func TestConfirmationDepth(t *testing.T) { require.Nil(t, err, "Error starting up system") defer sys.Close() - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) l1Client := sys.Clients["l1"] @@ -363,7 +363,7 @@ func TestPendingGasLimit(t *testing.T) { require.Nil(t, err, "Error starting up system") defer sys.Close() - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) l2Verif := sys.Clients["verifier"] @@ -628,8 +628,8 @@ func TestSystemP2PAltSync(t *testing.T) { }, L1EpochPollInterval: time.Second * 4, } - cfg.Loggers["alice"] = testlog.Logger(t, log.LvlInfo).New("role", "alice") - cfg.Loggers["bob"] = testlog.Logger(t, log.LvlInfo).New("role", "bob") + cfg.Loggers["alice"] = testlog.Logger(t, log.LevelInfo).New("role", "alice") + cfg.Loggers["bob"] = testlog.Logger(t, log.LevelInfo).New("role", "bob") // connect the nodes cfg.P2PTopology = map[string][]string{ @@ -672,9 +672,8 @@ func TestSystemP2PAltSync(t *testing.T) { time.Sleep(time.Second * 10) // set up our syncer node, connect it to alice/bob - cfg.Loggers["syncer"] = testlog.Logger(t, log.LvlInfo).New("role", "syncer") - snapLog := log.New() - snapLog.SetHandler(log.DiscardHandler()) + cfg.Loggers["syncer"] = testlog.Logger(t, log.LevelInfo).New("role", "syncer") + snapLog := log.NewLogger(log.DiscardHandler()) // Create a peer, and hook up alice and bob h, err := sys.newMockNetPeer() @@ -768,8 +767,8 @@ func TestSystemDenseTopology(t *testing.T) { }, L1EpochPollInterval: time.Second * 4, } - cfg.Loggers["verifier2"] = testlog.Logger(t, log.LvlInfo).New("role", "verifier") - cfg.Loggers["verifier3"] = testlog.Logger(t, log.LvlInfo).New("role", "verifier") + cfg.Loggers["verifier2"] = testlog.Logger(t, log.LevelInfo).New("role", "verifier") + cfg.Loggers["verifier3"] = testlog.Logger(t, log.LevelInfo).New("role", "verifier") // connect the nodes cfg.P2PTopology = map[string][]string{ diff --git a/op-heartbeat/service.go b/op-heartbeat/service.go index 801d61feedd2..55305fde591a 100644 --- a/op-heartbeat/service.go +++ b/op-heartbeat/service.go @@ -39,7 +39,7 @@ func Main(version string) func(ctx *cli.Context) error { } l := oplog.NewLogger(oplog.AppOut(cliCtx), cfg.Log) - oplog.SetGlobalLogHandler(l.GetHandler()) + oplog.SetGlobalLogHandler(l.Handler()) l.Info("starting heartbeat monitor", "version", version) srv, err := Start(cliCtx.Context, l, cfg, version) diff --git a/op-node/cmd/main.go b/op-node/cmd/main.go index 40bfb76f6a1b..f0e0122ac95f 100644 --- a/op-node/cmd/main.go +++ b/op-node/cmd/main.go @@ -74,7 +74,7 @@ func main() { func RollupNodeMain(ctx *cli.Context, closeApp context.CancelCauseFunc) (cliapp.Lifecycle, error) { logCfg := oplog.ReadCLIConfig(ctx) log := oplog.NewLogger(oplog.AppOut(ctx), logCfg) - oplog.SetGlobalLogHandler(log.GetHandler()) + oplog.SetGlobalLogHandler(log.Handler()) opservice.ValidateEnvVars(flags.EnvVarPrefix, flags.Flags, log) opservice.WarnOnDeprecatedFlags(ctx, flags.DeprecatedFlags, log) m := metrics.NewMetrics("default") diff --git a/op-node/cmd/stateviz/main.go b/op-node/cmd/stateviz/main.go index 8479984361bd..a1c0cddc0dc8 100644 --- a/op-node/cmd/stateviz/main.go +++ b/op-node/cmd/stateviz/main.go @@ -20,7 +20,9 @@ import ( "github.com/ethereum-optimism/optimism/op-service/eth" ophttp "github.com/ethereum-optimism/optimism/op-service/httputil" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum/go-ethereum/log" + "golang.org/x/exp/slog" ) var ( @@ -94,9 +96,8 @@ var embeddedAssets embed.FS func main() { flag.Parse() - log.Root().SetHandler( - log.LvlFilterHandler(log.LvlDebug, log.StreamHandler(os.Stdout, log.TerminalFormat(true))), - ) + oplog.SetGlobalLogHandler( + log.NewTerminalHandlerWithLevel(os.Stdout, slog.LevelDebug, true)) if *snapshot == "" { log.Crit("missing required -snapshot flag") diff --git a/op-node/node/server_test.go b/op-node/node/server_test.go index 51d34c11f625..70a1cdbd2a9c 100644 --- a/op-node/node/server_test.go +++ b/op-node/node/server_test.go @@ -23,7 +23,7 @@ import ( ) func TestOutputAtBlock(t *testing.T) { - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) // Test data for Merkle Patricia Trie: proof the eth2 deposit contract account contents (mainnet). headerTestData := ` @@ -124,7 +124,7 @@ func TestOutputAtBlock(t *testing.T) { } func TestVersion(t *testing.T) { - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) l2Client := &testutils.MockL2Client{} drClient := &mockDriverClient{} rpcCfg := &RPCConfig{ @@ -166,7 +166,7 @@ func randomSyncStatus(rng *rand.Rand) *eth.SyncStatus { } func TestSyncStatus(t *testing.T) { - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) l2Client := &testutils.MockL2Client{} drClient := &mockDriverClient{} rng := rand.New(rand.NewSource(1234)) diff --git a/op-node/p2p/app_scores_test.go b/op-node/p2p/app_scores_test.go index 720b0c4babf5..337d8244c5ae 100644 --- a/op-node/p2p/app_scores_test.go +++ b/op-node/p2p/app_scores_test.go @@ -63,7 +63,7 @@ func (a *appScoreTestData) WaitForNextScoreBookUpdate(t *testing.T) stubScoreBoo func setupPeerApplicationScorerTest(t *testing.T, params *ApplicationScoreParams) (*appScoreTestData, *peerApplicationScorer) { data := &appScoreTestData{ ctx: context.Background(), - logger: testlog.Logger(t, log.LvlInfo), + logger: testlog.Logger(t, log.LevelInfo), clock: clock.NewDeterministicClock(time.UnixMilli(1000)), peers: []peer.ID{}, scorebook: &stubScoreBook{ diff --git a/op-node/p2p/gating/expiry_test.go b/op-node/p2p/gating/expiry_test.go index b64085fe64fc..453e1d3fe2cb 100644 --- a/op-node/p2p/gating/expiry_test.go +++ b/op-node/p2p/gating/expiry_test.go @@ -20,7 +20,7 @@ import ( func expiryTestSetup(t *testing.T) (*clock.DeterministicClock, *mocks.ExpiryStore, *mocks.BlockingConnectionGater, *ExpiryConnectionGater) { mockGater := mocks.NewBlockingConnectionGater(t) - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) cl := clock.NewDeterministicClock(time.Now()) mockExpiryStore := mocks.NewExpiryStore(t) gater := AddBanExpiry(mockGater, mockExpiryStore, log, cl, metrics.NoopMetrics) diff --git a/op-node/p2p/gossip_test.go b/op-node/p2p/gossip_test.go index 0f47787d84ab..40caf87ecafe 100644 --- a/op-node/p2p/gossip_test.go +++ b/op-node/p2p/gossip_test.go @@ -30,7 +30,7 @@ import ( ) func TestGuardGossipValidator(t *testing.T) { - logger := testlog.Logger(t, log.LvlCrit) + logger := testlog.Logger(t, log.LevelCrit) val := guardGossipValidator(logger, func(ctx context.Context, id peer.ID, message *pubsub.Message) pubsub.ValidationResult { if id == "mallory" { panic("mallory was here") @@ -56,7 +56,7 @@ func TestCombinePeers(t *testing.T) { } func TestVerifyBlockSignature(t *testing.T) { - logger := testlog.Logger(t, log.LvlCrit) + logger := testlog.Logger(t, log.LevelCrit) cfg := &rollup.Config{ L2ChainID: big.NewInt(100), } @@ -130,8 +130,8 @@ func TestBlockValidator(t *testing.T) { runCfg := &testutils.MockRuntimeConfig{P2PSeqAddress: crypto.PubkeyToAddress(secrets.SequencerP2P.PublicKey)} signer := &PreparedSigner{Signer: NewLocalSigner(secrets.SequencerP2P)} - // valFnV1 := BuildBlocksValidator(testlog.Logger(t, log.LvlCrit), rollupCfg, runCfg, eth.BlockV1) - valFnV2 := BuildBlocksValidator(testlog.Logger(t, log.LvlCrit), cfg, runCfg, eth.BlockV2) + // valFnV1 := BuildBlocksValidator(testlog.Logger(t, log.LevelCrit), rollupCfg, runCfg, eth.BlockV1) + valFnV2 := BuildBlocksValidator(testlog.Logger(t, log.LevelCrit), cfg, runCfg, eth.BlockV2) // Params Set 2: Call the validation function peerID := peer.ID("foo") diff --git a/op-node/p2p/host_test.go b/op-node/p2p/host_test.go index b6fcd6404953..9c1289cb8cc7 100644 --- a/op-node/p2p/host_test.go +++ b/op-node/p2p/host_test.go @@ -61,10 +61,10 @@ func TestingConfig(t *testing.T) *Config { func TestP2PSimple(t *testing.T) { confA := TestingConfig(t) confB := TestingConfig(t) - hostA, err := confA.Host(testlog.Logger(t, log.LvlError).New("host", "A"), nil, metrics.NoopMetrics) + hostA, err := confA.Host(testlog.Logger(t, log.LevelError).New("host", "A"), nil, metrics.NoopMetrics) require.NoError(t, err, "failed to launch host A") defer hostA.Close() - hostB, err := confB.Host(testlog.Logger(t, log.LvlError).New("host", "B"), nil, metrics.NoopMetrics) + hostB, err := confB.Host(testlog.Logger(t, log.LevelError).New("host", "B"), nil, metrics.NoopMetrics) require.NoError(t, err, "failed to launch host B") defer hostB.Close() err = hostA.Connect(context.Background(), peer.AddrInfo{ID: hostB.ID(), Addrs: hostB.Addrs()}) @@ -119,7 +119,7 @@ func TestP2PFull(t *testing.T) { runCfgA := &testutils.MockRuntimeConfig{P2PSeqAddress: common.Address{0x42}} runCfgB := &testutils.MockRuntimeConfig{P2PSeqAddress: common.Address{0x42}} - logA := testlog.Logger(t, log.LvlError).New("host", "A") + logA := testlog.Logger(t, log.LevelError).New("host", "A") nodeA, err := NewNodeP2P(context.Background(), &rollup.Config{}, logA, &confA, &mockGossipIn{}, nil, runCfgA, metrics.NoopMetrics, false) require.NoError(t, err) defer nodeA.Close() @@ -148,7 +148,7 @@ func TestP2PFull(t *testing.T) { require.NoError(t, err) confB.StaticPeers = append(confB.StaticPeers, altAddrB) - logB := testlog.Logger(t, log.LvlError).New("host", "B") + logB := testlog.Logger(t, log.LevelError).New("host", "B") nodeB, err := NewNodeP2P(context.Background(), &rollup.Config{}, logB, &confB, &mockGossipIn{}, nil, runCfgB, metrics.NoopMetrics, false) require.NoError(t, err) @@ -231,9 +231,9 @@ func TestDiscovery(t *testing.T) { pC, _, err := crypto.GenerateSecp256k1Key(rand.Reader) require.NoError(t, err, "failed to generate new p2p priv key") - logA := testlog.Logger(t, log.LvlError).New("host", "A") - logB := testlog.Logger(t, log.LvlError).New("host", "B") - logC := testlog.Logger(t, log.LvlError).New("host", "C") + logA := testlog.Logger(t, log.LevelError).New("host", "A") + logB := testlog.Logger(t, log.LevelError).New("host", "B") + logC := testlog.Logger(t, log.LevelError).New("host", "C") discDBA, err := enode.OpenDB("") // "" = memory db require.NoError(t, err) diff --git a/op-node/p2p/monitor/peer_monitor_test.go b/op-node/p2p/monitor/peer_monitor_test.go index 6e18ac43f9c4..815e0531497c 100644 --- a/op-node/p2p/monitor/peer_monitor_test.go +++ b/op-node/p2p/monitor/peer_monitor_test.go @@ -18,7 +18,7 @@ import ( const testBanDuration = 2 * time.Hour func peerMonitorSetup(t *testing.T) (*PeerMonitor, *clock2.DeterministicClock, *mocks.PeerManager) { - l := testlog.Logger(t, log.LvlInfo) + l := testlog.Logger(t, log.LevelInfo) clock := clock2.NewDeterministicClock(time.UnixMilli(10000)) manager := mocks.NewPeerManager(t) monitor := NewPeerMonitor(context.Background(), l, clock, manager, -100, testBanDuration) diff --git a/op-node/p2p/peer_scorer_test.go b/op-node/p2p/peer_scorer_test.go index 9750c8cc57ff..d0bc6fe73e6f 100644 --- a/op-node/p2p/peer_scorer_test.go +++ b/op-node/p2p/peer_scorer_test.go @@ -30,7 +30,7 @@ type PeerScorerTestSuite struct { func (testSuite *PeerScorerTestSuite) SetupTest() { testSuite.mockStore = &p2pMocks.Peerstore{} testSuite.mockMetricer = &p2pMocks.ScoreMetrics{} - testSuite.logger = testlog.Logger(testSuite.T(), log.LvlError) + testSuite.logger = testlog.Logger(testSuite.T(), log.LevelError) } // TestPeerScorer runs the PeerScorerTestSuite. diff --git a/op-node/p2p/peer_scores_test.go b/op-node/p2p/peer_scores_test.go index 4590b3466dc5..f7f8da6d5d27 100644 --- a/op-node/p2p/peer_scores_test.go +++ b/op-node/p2p/peer_scores_test.go @@ -46,7 +46,7 @@ type PeerScoresTestSuite struct { func (testSuite *PeerScoresTestSuite) SetupTest() { testSuite.mockStore = &p2pMocks.Peerstore{} testSuite.mockMetricer = &p2pMocks.ScoreMetrics{} - testSuite.logger = testlog.Logger(testSuite.T(), log.LvlError) + testSuite.logger = testlog.Logger(testSuite.T(), log.LevelError) } // TestPeerScores runs the PeerScoresTestSuite. @@ -71,7 +71,7 @@ func (c *customPeerstoreNetwork) Close() error { // getNetHosts generates a slice of hosts using the [libp2p/go-libp2p] library. func getNetHosts(testSuite *PeerScoresTestSuite, ctx context.Context, n int) []host.Host { var out []host.Host - log := testlog.Logger(testSuite.T(), log.LvlError) + log := testlog.Logger(testSuite.T(), log.LevelError) for i := 0; i < n; i++ { swarm := tswarm.GenSwarm(testSuite.T()) eps, err := store.NewExtendedPeerstore(ctx, log, clock.SystemClock, swarm.Peerstore(), sync.MutexWrap(ds.NewMapDatastore()), 1*time.Hour) @@ -99,7 +99,7 @@ func (d *discriminatingAppScorer) ApplicationScore(id peer.ID) float64 { func newGossipSubs(testSuite *PeerScoresTestSuite, ctx context.Context, hosts []host.Host) []*pubsub.PubSub { var psubs []*pubsub.PubSub - logger := testlog.Logger(testSuite.T(), log.LvlCrit) + logger := testlog.Logger(testSuite.T(), log.LevelCrit) // For each host, create a default gossipsub router. for _, h := range hosts { diff --git a/op-node/p2p/store/gc_test.go b/op-node/p2p/store/gc_test.go index 68d8023b1bd5..650b5bb3cb4b 100644 --- a/op-node/p2p/store/gc_test.go +++ b/op-node/p2p/store/gc_test.go @@ -20,7 +20,7 @@ func TestScheduleGcPeriodically(t *testing.T) { // Wait for the gc background process to complete after cancelling the context bgTasks.Wait() }() - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) clock := clock.NewDeterministicClock(time.UnixMilli(5000)) called := make(chan struct{}, 10) diff --git a/op-node/p2p/store/ip_ban_book_test.go b/op-node/p2p/store/ip_ban_book_test.go index 34bf37618258..24d3574e0c93 100644 --- a/op-node/p2p/store/ip_ban_book_test.go +++ b/op-node/p2p/store/ip_ban_book_test.go @@ -35,7 +35,7 @@ func TestRoundTripIPBan(t *testing.T) { func createMemoryIPBanBook(t *testing.T) *ipBanBook { store := sync.MutexWrap(ds.NewMapDatastore()) - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) c := clock.NewDeterministicClock(time.UnixMilli(100)) book, err := newIPBanBook(context.Background(), logger, c, store) require.NoError(t, err) diff --git a/op-node/p2p/store/peer_ban_book_test.go b/op-node/p2p/store/peer_ban_book_test.go index a9d0ce6c28b2..580dea3a3e8e 100644 --- a/op-node/p2p/store/peer_ban_book_test.go +++ b/op-node/p2p/store/peer_ban_book_test.go @@ -33,7 +33,7 @@ func TestRoundTripPeerBan(t *testing.T) { func createMemoryPeerBanBook(t *testing.T) *peerBanBook { store := sync.MutexWrap(ds.NewMapDatastore()) - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) c := clock.NewDeterministicClock(time.UnixMilli(100)) book, err := newPeerBanBook(context.Background(), logger, c, store) require.NoError(t, err) diff --git a/op-node/p2p/store/scorebook_test.go b/op-node/p2p/store/scorebook_test.go index 2ff398df9edf..29fa7a2fe303 100644 --- a/op-node/p2p/store/scorebook_test.go +++ b/op-node/p2p/store/scorebook_test.go @@ -165,7 +165,7 @@ func TestCloseCompletes(t *testing.T) { func TestPrune(t *testing.T) { ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) store := sync.MutexWrap(ds.NewMapDatastore()) clock := clock.NewDeterministicClock(time.UnixMilli(1000)) book, err := newScoreBook(ctx, logger, clock, store, 24*time.Hour) @@ -220,7 +220,7 @@ func TestPrune(t *testing.T) { func TestPruneMultipleBatches(t *testing.T) { ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) clock := clock.NewDeterministicClock(time.UnixMilli(1000)) book, err := newScoreBook(ctx, logger, clock, sync.MutexWrap(ds.NewMapDatastore()), 24*time.Hour) require.NoError(t, err) @@ -250,7 +250,7 @@ func TestPruneMultipleBatches(t *testing.T) { func TestIgnoreOutdatedScores(t *testing.T) { ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) clock := clock.NewDeterministicClock(time.UnixMilli(1000)) retentionPeriod := 24 * time.Hour book, err := newScoreBook(ctx, logger, clock, sync.MutexWrap(ds.NewMapDatastore()), retentionPeriod) @@ -289,7 +289,7 @@ func createMemoryStore(t *testing.T) ExtendedPeerstore { func createPeerstoreWithBacking(t *testing.T, store *sync.MutexDatastore) ExtendedPeerstore { ps, err := pstoreds.NewPeerstore(context.Background(), store, pstoreds.DefaultOpts()) require.NoError(t, err, "Failed to create peerstore") - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) c := clock.NewDeterministicClock(time.UnixMilli(100)) eps, err := NewExtendedPeerstore(context.Background(), logger, c, ps, store, 24*time.Hour) require.NoError(t, err) diff --git a/op-node/p2p/sync_test.go b/op-node/p2p/sync_test.go index 4144629e41cb..153e6fdb5ddc 100644 --- a/op-node/p2p/sync_test.go +++ b/op-node/p2p/sync_test.go @@ -100,7 +100,7 @@ func setupSyncTestData(length uint64) (*rollup.Config, *syncTestData) { func TestSinglePeerSync(t *testing.T) { t.Parallel() // Takes a while, but can run in parallel - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) cfg, payloads := setupSyncTestData(25) @@ -160,7 +160,7 @@ func TestSinglePeerSync(t *testing.T) { func TestMultiPeerSync(t *testing.T) { t.Parallel() // Takes a while, but can run in parallel - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) cfg, payloads := setupSyncTestData(100) @@ -291,7 +291,7 @@ func TestMultiPeerSync(t *testing.T) { func TestNetworkNotifyAddPeerAndRemovePeer(t *testing.T) { t.Parallel() - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) cfg, _ := setupSyncTestData(25) diff --git a/op-node/rollup/derive/attributes_queue_test.go b/op-node/rollup/derive/attributes_queue_test.go index 702ff1296942..c9f23080d4fc 100644 --- a/op-node/rollup/derive/attributes_queue_test.go +++ b/op-node/rollup/derive/attributes_queue_test.go @@ -79,7 +79,7 @@ func TestAttributesQueue(t *testing.T) { } attrBuilder := NewFetchingAttributesBuilder(cfg, l1Fetcher, l2Fetcher) - aq := NewAttributesQueue(testlog.Logger(t, log.LvlError), cfg, attrBuilder, nil) + aq := NewAttributesQueue(testlog.Logger(t, log.LevelError), cfg, attrBuilder, nil) actual, err := aq.createNextAttributes(context.Background(), &batch, safeHead) diff --git a/op-node/rollup/derive/batch_queue_test.go b/op-node/rollup/derive/batch_queue_test.go index 9fa76de706f4..cee4a45f3deb 100644 --- a/op-node/rollup/derive/batch_queue_test.go +++ b/op-node/rollup/derive/batch_queue_test.go @@ -165,7 +165,7 @@ func TestBatchQueue(t *testing.T) { // when the safehead's origin is ahead of the pipeline's origin (as is after a reset). // This issue was fixed in https://github.com/ethereum-optimism/optimism/pull/3694 func BatchQueueNewOrigin(t *testing.T, batchType int) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) l1 := L1Chain([]uint64{10, 15, 20, 25}) safeHead := eth.L2BlockRef{ Hash: mockHash(10, 2), @@ -225,7 +225,7 @@ func BatchQueueNewOrigin(t *testing.T, batchType int) { // BatchQueueEager adds a bunch of contiguous batches and asserts that // enough calls to `NextBatch` return all of those batches. func BatchQueueEager(t *testing.T, batchType int) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) l1 := L1Chain([]uint64{10, 20, 30}) chainId := big.NewInt(1234) safeHead := eth.L2BlockRef{ @@ -303,7 +303,7 @@ func BatchQueueEager(t *testing.T, batchType int) { // BatchQueueInvalidInternalAdvance asserts that we do not miss an epoch when generating batches. // This is a regression test for CLI-3378. func BatchQueueInvalidInternalAdvance(t *testing.T, batchType int) { - log := testlog.Logger(t, log.LvlTrace) + log := testlog.Logger(t, log.LevelTrace) l1 := L1Chain([]uint64{10, 15, 20, 25, 30}) chainId := big.NewInt(1234) safeHead := eth.L2BlockRef{ @@ -422,7 +422,7 @@ func BatchQueueInvalidInternalAdvance(t *testing.T, batchType int) { } func BatchQueueMissing(t *testing.T, batchType int) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) l1 := L1Chain([]uint64{10, 15, 20, 25}) chainId := big.NewInt(1234) safeHead := eth.L2BlockRef{ @@ -539,7 +539,7 @@ func BatchQueueMissing(t *testing.T, batchType int) { // BatchQueueAdvancedEpoch tests that batch queue derives consecutive valid batches with advancing epochs. // Batch queue's l1blocks list should be updated along epochs. func BatchQueueAdvancedEpoch(t *testing.T, batchType int) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) l1 := L1Chain([]uint64{0, 6, 12, 18, 24}) // L1 block time: 6s chainId := big.NewInt(1234) safeHead := eth.L2BlockRef{ @@ -626,7 +626,7 @@ func BatchQueueAdvancedEpoch(t *testing.T, batchType int) { // BatchQueueShuffle tests batch queue can reorder shuffled valid batches func BatchQueueShuffle(t *testing.T, batchType int) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) l1 := L1Chain([]uint64{0, 6, 12, 18, 24}) // L1 block time: 6s chainId := big.NewInt(1234) safeHead := eth.L2BlockRef{ @@ -724,7 +724,7 @@ func BatchQueueShuffle(t *testing.T, batchType int) { } func TestBatchQueueOverlappingSpanBatch(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) l1 := L1Chain([]uint64{10, 20, 30}) chainId := big.NewInt(1234) safeHead := eth.L2BlockRef{ @@ -829,7 +829,7 @@ func TestBatchQueueOverlappingSpanBatch(t *testing.T) { } func TestBatchQueueComplex(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) l1 := L1Chain([]uint64{0, 6, 12, 18, 24}) // L1 block time: 6s chainId := big.NewInt(1234) safeHead := eth.L2BlockRef{ @@ -947,7 +947,7 @@ func TestBatchQueueComplex(t *testing.T) { } func TestBatchQueueResetSpan(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) chainId := big.NewInt(1234) l1 := L1Chain([]uint64{0, 4, 8}) safeHead := eth.L2BlockRef{ diff --git a/op-node/rollup/derive/batches_test.go b/op-node/rollup/derive/batches_test.go index e47205235169..b9bc6db0afdd 100644 --- a/op-node/rollup/derive/batches_test.go +++ b/op-node/rollup/derive/batches_test.go @@ -1,12 +1,10 @@ package derive import ( - "bytes" "context" "errors" "math/big" "math/rand" - "strings" "testing" "github.com/stretchr/testify/require" @@ -32,18 +30,10 @@ type ValidBatchTestCase struct { DeltaTime *uint64 } -type TestLogHandler struct { - handler log.Handler - logs *bytes.Buffer -} - -func (th *TestLogHandler) Log(r *log.Record) error { - th.logs.WriteString(r.Msg + "\n") - return th.handler.Log(r) -} - -var HashA = common.Hash{0x0a} -var HashB = common.Hash{0x0b} +var ( + HashA = common.Hash{0x0a} + HashB = common.Hash{0x0b} +) func TestValidBatch(t *testing.T) { defaultConf := rollup.Config{ @@ -1502,12 +1492,7 @@ func TestValidBatch(t *testing.T) { } // Log level can be increased for debugging purposes - logger := testlog.Logger(t, log.LvlError) - - // Create a test log handler to check expected logs - var logBuf bytes.Buffer - handler := TestLogHandler{handler: logger.GetHandler(), logs: &logBuf} - logger.SetHandler(&handler) + logger, logs := testlog.CaptureLogger(t, log.LevelDebug) l2Client := testutils.MockL2Client{} var nilErr error @@ -1540,19 +1525,19 @@ func TestValidBatch(t *testing.T) { } validity := CheckBatch(ctx, &rcfg, logger, testCase.L1Blocks, testCase.L2SafeHead, &testCase.Batch, &l2Client) require.Equal(t, testCase.Expected, validity, "batch check must return expected validity level") - if testCase.ExpectedLog != "" { + if expLog := testCase.ExpectedLog; expLog != "" { // Check if ExpectedLog is contained in the log buffer - if !strings.Contains(logBuf.String(), testCase.ExpectedLog) { - t.Errorf("Expected log message was not found in the buffer: %s", testCase.ExpectedLog) + if _, ok := logs.FindLogContaining(expLog); !ok { + t.Errorf("Expected log message was not logged: %q", expLog) } } - if testCase.NotExpectedLog != "" { + if notExpLog := testCase.NotExpectedLog; notExpLog != "" { // Check if NotExpectedLog is contained in the log buffer - if strings.Contains(logBuf.String(), testCase.NotExpectedLog) { - t.Errorf("Not expected log message was found in the buffer: %s", testCase.NotExpectedLog) + if rec, ok := logs.FindLogContaining(notExpLog); ok { + t.Errorf("Unexpected log message containing %q was logged: %q", notExpLog, rec.Message) } } - logBuf.Reset() + logs.Clear() } // Run singular batch test cases diff --git a/op-node/rollup/derive/calldata_source_test.go b/op-node/rollup/derive/calldata_source_test.go index 213052b36e16..fe9cfc0c3095 100644 --- a/op-node/rollup/derive/calldata_source_test.go +++ b/op-node/rollup/derive/calldata_source_test.go @@ -121,7 +121,7 @@ func TestDataFromEVMTransactions(t *testing.T) { } } - out := DataFromEVMTransactions(DataSourceConfig{cfg.L1Signer(), cfg.BatchInboxAddress}, batcherAddr, txs, testlog.Logger(t, log.LvlCrit)) + out := DataFromEVMTransactions(DataSourceConfig{cfg.L1Signer(), cfg.BatchInboxAddress}, batcherAddr, txs, testlog.Logger(t, log.LevelCrit)) require.ElementsMatch(t, expectedData, out) } diff --git a/op-node/rollup/derive/channel_bank_test.go b/op-node/rollup/derive/channel_bank_test.go index 495ce4426bb8..a4485834ece6 100644 --- a/op-node/rollup/derive/channel_bank_test.go +++ b/op-node/rollup/derive/channel_bank_test.go @@ -102,7 +102,7 @@ func TestChannelBankSimple(t *testing.T) { cfg := &rollup.Config{ChannelTimeout: 10} - cb := NewChannelBank(testlog.Logger(t, log.LvlCrit), cfg, input, nil, metrics.NoopMetrics) + cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, nil, metrics.NoopMetrics) // Load the first frame out, err := cb.NextData(context.Background()) @@ -146,7 +146,7 @@ func TestChannelBankInterleavedPreCanyon(t *testing.T) { cfg := &rollup.Config{ChannelTimeout: 10, CanyonTime: nil} - cb := NewChannelBank(testlog.Logger(t, log.LvlCrit), cfg, input, nil, metrics.NoopMetrics) + cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, nil, metrics.NoopMetrics) // Load a:0 out, err := cb.NextData(context.Background()) @@ -211,7 +211,7 @@ func TestChannelBankInterleaved(t *testing.T) { ct := uint64(0) cfg := &rollup.Config{ChannelTimeout: 10, CanyonTime: &ct} - cb := NewChannelBank(testlog.Logger(t, log.LvlCrit), cfg, input, nil, metrics.NoopMetrics) + cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, nil, metrics.NoopMetrics) // Load a:0 out, err := cb.NextData(context.Background()) @@ -271,7 +271,7 @@ func TestChannelBankDuplicates(t *testing.T) { cfg := &rollup.Config{ChannelTimeout: 10} - cb := NewChannelBank(testlog.Logger(t, log.LvlCrit), cfg, input, nil, metrics.NoopMetrics) + cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, nil, metrics.NoopMetrics) // Load the first frame out, err := cb.NextData(context.Background()) diff --git a/op-node/rollup/derive/engine_queue_test.go b/op-node/rollup/derive/engine_queue_test.go index c8f84b841654..219a3f48b441 100644 --- a/op-node/rollup/derive/engine_queue_test.go +++ b/op-node/rollup/derive/engine_queue_test.go @@ -42,7 +42,7 @@ func (f *fakeAttributesQueue) NextAttributes(_ context.Context, safeHead eth.L2B var _ NextAttributesProvider = (*fakeAttributesQueue)(nil) func TestEngineQueue_Finalize(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) rng := rand.New(rand.NewSource(1234)) @@ -277,7 +277,7 @@ func TestEngineQueue_Finalize(t *testing.T) { } func TestEngineQueue_ResetWhenUnsafeOriginNotCanonical(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) rng := rand.New(rand.NewSource(1234)) @@ -517,7 +517,7 @@ func TestEngineQueue_ResetWhenUnsafeOriginNotCanonical(t *testing.T) { } func TestVerifyNewL1Origin(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) rng := rand.New(rand.NewSource(1234)) @@ -848,7 +848,7 @@ func TestVerifyNewL1Origin(t *testing.T) { } func TestBlockBuildingRace(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) eng := &testutils.MockEngine{} rng := rand.New(rand.NewSource(1234)) @@ -1011,7 +1011,7 @@ func TestBlockBuildingRace(t *testing.T) { } func TestResetLoop(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) eng := &testutils.MockEngine{} l1F := &testutils.MockL1Source{} @@ -1118,7 +1118,7 @@ func TestResetLoop(t *testing.T) { } func TestEngineQueue_StepPopOlderUnsafe(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) eng := &testutils.MockEngine{} l1F := &testutils.MockL1Source{} diff --git a/op-node/rollup/derive/l1_retrieval_test.go b/op-node/rollup/derive/l1_retrieval_test.go index 33538ad9296a..8851957b43a1 100644 --- a/op-node/rollup/derive/l1_retrieval_test.go +++ b/op-node/rollup/derive/l1_retrieval_test.go @@ -92,7 +92,7 @@ func TestL1RetrievalReset(t *testing.T) { dataSrc.ExpectOpenData(a, &fakeDataIter{}, l1Cfg.BatcherAddr) defer dataSrc.AssertExpectations(t) - l1r := NewL1Retrieval(testlog.Logger(t, log.LvlError), dataSrc, nil) + l1r := NewL1Retrieval(testlog.Logger(t, log.LevelError), dataSrc, nil) // We assert that it opens up the correct data on a reset _ = l1r.Reset(context.Background(), a, l1Cfg) @@ -149,7 +149,7 @@ func TestL1RetrievalNextData(t *testing.T) { dataSrc := &MockDataSource{} dataSrc.ExpectOpenData(test.prevBlock, &fakeDataIter{data: test.datas, errs: test.datasErrs}, test.sysCfg.BatcherAddr) - ret := NewL1Retrieval(testlog.Logger(t, log.LvlCrit), dataSrc, l1t) + ret := NewL1Retrieval(testlog.Logger(t, log.LevelCrit), dataSrc, l1t) // If prevErr != nil we forced an error while getting data from the previous stage if test.openErr != nil { diff --git a/op-node/rollup/derive/l1_traversal_test.go b/op-node/rollup/derive/l1_traversal_test.go index 544b10e58cf8..1826562c789a 100644 --- a/op-node/rollup/derive/l1_traversal_test.go +++ b/op-node/rollup/derive/l1_traversal_test.go @@ -36,7 +36,7 @@ func TestL1TraversalNext(t *testing.T) { Genesis: rollup.Genesis{SystemConfig: l1Cfg}, L1SystemConfigAddress: sysCfgAddr, } - tr := NewL1Traversal(testlog.Logger(t, log.LvlError), cfg, nil) + tr := NewL1Traversal(testlog.Logger(t, log.LevelError), cfg, nil) _ = tr.Reset(context.Background(), a, l1Cfg) @@ -132,7 +132,7 @@ func TestL1TraversalAdvance(t *testing.T) { Genesis: rollup.Genesis{SystemConfig: test.initialL1Cfg}, L1SystemConfigAddress: sysCfgAddr, } - tr := NewL1Traversal(testlog.Logger(t, log.LvlError), cfg, src) + tr := NewL1Traversal(testlog.Logger(t, log.LevelError), cfg, src) // Load up the initial state with a reset _ = tr.Reset(context.Background(), test.startBlock, test.initialL1Cfg) diff --git a/op-node/rollup/driver/origin_selector_test.go b/op-node/rollup/driver/origin_selector_test.go index a4728d04d5db..1ddfb8840ee8 100644 --- a/op-node/rollup/driver/origin_selector_test.go +++ b/op-node/rollup/driver/origin_selector_test.go @@ -21,7 +21,7 @@ import ( // is no conf depth to stop the origin selection so block `b` should // be the next L1 origin func TestOriginSelectorAdvances(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) cfg := &rollup.Config{ MaxSequencerDrift: 500, BlockTime: 2, @@ -62,7 +62,7 @@ func TestOriginSelectorAdvances(t *testing.T) { // but it should select block `a` because the L2 block time must be ahead // of the the timestamp of it's L1 origin. func TestOriginSelectorRespectsOriginTiming(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) cfg := &rollup.Config{ MaxSequencerDrift: 500, BlockTime: 2, @@ -102,7 +102,7 @@ func TestOriginSelectorRespectsOriginTiming(t *testing.T) { // as the origin, however block `b` is the L1 Head & the sequencer // needs to wait until that block is confirmed enough before advancing. func TestOriginSelectorRespectsConfDepth(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) cfg := &rollup.Config{ MaxSequencerDrift: 500, BlockTime: 2, @@ -145,7 +145,7 @@ func TestOriginSelectorRespectsConfDepth(t *testing.T) { // This is because 29 (next L2 time) > 20 (origin) + 8 (seq drift) => invalid block. // We maintain confirmation distance, even though we would shift to the next origin if we could. func TestOriginSelectorStrictConfDepth(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) cfg := &rollup.Config{ MaxSequencerDrift: 8, BlockTime: 2, @@ -183,7 +183,7 @@ func TestOriginSelectorStrictConfDepth(t *testing.T) { // drift, the origin should remain on block `a` because the next origin's // time is greater than the next L2 time. func TestOriginSelectorSeqDriftRespectsNextOriginTime(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) cfg := &rollup.Config{ MaxSequencerDrift: 8, BlockTime: 2, @@ -225,7 +225,7 @@ func TestOriginSelectorSeqDriftRespectsNextOriginTime(t *testing.T) { // Due to a conf depth of 2, block `b` is not immediately visible, // and the origin selection should fail until it is visible, by waiting for block `c`. func TestOriginSelectorHandlesLateL1Blocks(t *testing.T) { - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) cfg := &rollup.Config{ MaxSequencerDrift: 8, BlockTime: 2, diff --git a/op-node/rollup/driver/sequencer_test.go b/op-node/rollup/driver/sequencer_test.go index e8026619f53c..01870e33b562 100644 --- a/op-node/rollup/driver/sequencer_test.go +++ b/op-node/rollup/driver/sequencer_test.go @@ -173,7 +173,7 @@ func TestSequencerChaosMonkey(t *testing.T) { l1Time := uint64(100000) // mute errors. We expect a lot of the mocked errors to cause error-logs. We check chain health at the end of the test. - log := testlog.Logger(t, log.LvlCrit) + log := testlog.Logger(t, log.LevelCrit) cfg := &rollup.Config{ Genesis: rollup.Genesis{ diff --git a/op-node/rollup/sync/start_test.go b/op-node/rollup/sync/start_test.go index 1881b7b61e45..6f0113b16f17 100644 --- a/op-node/rollup/sync/start_test.go +++ b/op-node/rollup/sync/start_test.go @@ -23,7 +23,7 @@ var _ L2Chain = (*testutils.FakeChainSource)(nil) // - Both heads are at the tip of their respective chains func (c *syncStartTestCase) generateFakeL2(t *testing.T) (*testutils.FakeChainSource, rollup.Genesis) { t.Helper() - log := testlog.Logger(t, log.LvlError) + log := testlog.Logger(t, log.LevelError) chain := testutils.NewFakeChainSource([]string{c.L1, c.NewL1}, []string{c.L2}, int(c.GenesisL1Num), log) chain.SetL2Head(len(c.L2) - 1) genesis := testutils.FakeGenesis(c.GenesisL1, c.GenesisL2, int(c.GenesisL1Num)) @@ -74,8 +74,7 @@ func (c *syncStartTestCase) Run(t *testing.T) { Genesis: genesis, SeqWindowSize: c.SeqWindowSize, } - lgr := log.New() - lgr.SetHandler(log.DiscardHandler()) + lgr := log.NewLogger(log.DiscardHandler()) result, err := FindL2Heads(context.Background(), cfg, chain, chain, lgr, &Config{}) if c.ExpectedErr != nil { require.ErrorIs(t, err, c.ExpectedErr, "expected error") diff --git a/op-node/service.go b/op-node/service.go index 9ac37a3b8a4c..a07d4dafb482 100644 --- a/op-node/service.go +++ b/op-node/service.go @@ -222,18 +222,16 @@ func applyOverrides(ctx *cli.Context, rollupConfig *rollup.Config) { func NewSnapshotLogger(ctx *cli.Context) (log.Logger, error) { snapshotFile := ctx.String(flags.SnapshotLog.Name) - handler := log.DiscardHandler() - if snapshotFile != "" { - var err error - handler, err = log.FileHandler(snapshotFile, log.JSONFormat()) - if err != nil { - return nil, err - } - handler = log.SyncHandler(handler) + if snapshotFile == "" { + return log.NewLogger(log.DiscardHandler()), nil + } + + sf, err := os.OpenFile(snapshotFile, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644) + if err != nil { + return nil, err } - logger := log.New() - logger.SetHandler(handler) - return logger, nil + handler := log.JSONHandler(sf) + return log.NewLogger(handler), nil } func NewSyncConfig(ctx *cli.Context, log log.Logger) (*sync.Config, error) { diff --git a/op-program/client/cmd/main.go b/op-program/client/cmd/main.go index 822c48556b6e..d075083e5aa1 100644 --- a/op-program/client/cmd/main.go +++ b/op-program/client/cmd/main.go @@ -13,10 +13,10 @@ func main() { // Default to a machine parsable but relatively human friendly log format. // Don't do anything fancy to detect if color output is supported. logger := oplog.NewLogger(os.Stdout, oplog.CLIConfig{ - Level: log.LvlInfo, + Level: log.LevelInfo, Format: oplog.FormatLogFmt, Color: false, }) - oplog.SetGlobalLogHandler(logger.GetHandler()) + oplog.SetGlobalLogHandler(logger.Handler()) client.Main(logger) } diff --git a/op-program/client/driver/driver_test.go b/op-program/client/driver/driver_test.go index 3262ab7ed986..bc9e8bb3b9b3 100644 --- a/op-program/client/driver/driver_test.go +++ b/op-program/client/driver/driver_test.go @@ -107,7 +107,7 @@ func createDriver(t *testing.T, derivationResult error) *Driver { func createDriverWithNextBlock(t *testing.T, derivationResult error, nextBlockNum uint64) *Driver { derivation := &stubDerivation{nextErr: derivationResult, nextBlockNum: nextBlockNum} return &Driver{ - logger: testlog.Logger(t, log.LvlDebug), + logger: testlog.Logger(t, log.LevelDebug), pipeline: derivation, targetBlockNum: 1_000_000, } diff --git a/op-program/client/l1/client_test.go b/op-program/client/l1/client_test.go index 8333b4a70590..4e03f92baa94 100644 --- a/op-program/client/l1/client_test.go +++ b/op-program/client/l1/client_test.go @@ -164,7 +164,7 @@ func TestL1BlockRefByNumber(t *testing.T) { func newClient(t *testing.T) (*OracleL1Client, *test.StubOracle) { stub := test.NewStubOracle(t) stub.Blocks[head.Hash()] = head - client := NewOracleL1Client(testlog.Logger(t, log.LvlDebug), stub, head.Hash()) + client := NewOracleL1Client(testlog.Logger(t, log.LevelDebug), stub, head.Hash()) return client, stub } diff --git a/op-program/client/l2/engine.go b/op-program/client/l2/engine.go index 30ea72a321cd..f40a1012546f 100644 --- a/op-program/client/l2/engine.go +++ b/op-program/client/l2/engine.go @@ -15,9 +15,7 @@ import ( "github.com/ethereum/go-ethereum/log" ) -var ( - ErrNotFound = errors.New("not found") -) +var ErrNotFound = errors.New("not found") type OracleEngine struct { api *engineapi.L2EngineAPI @@ -43,7 +41,13 @@ func (o *OracleEngine) L2OutputRoot(l2ClaimBlockNum uint64) (eth.Bytes32, error) if err != nil { return eth.Bytes32{}, fmt.Errorf("failed to open L2 state db at block %s: %w", outBlock.Hash(), err) } - withdrawalsTrie, err := stateDB.Database().OpenStorageTrie(outBlock.Root, predeploys.L2ToL1MessagePasserAddr, stateDB.GetStorageRoot(predeploys.L2ToL1MessagePasserAddr)) + storageRoot := stateDB.GetStorageRoot(predeploys.L2ToL1MessagePasserAddr) + storageTrie, err := stateDB.Database().OpenTrie(storageRoot) + if err != nil { + return eth.Bytes32{}, fmt.Errorf("opening storage trie: %w", err) + } + // TODO(Seb) confirm + withdrawalsTrie, err := stateDB.Database().OpenStorageTrie(outBlock.Root, predeploys.L2ToL1MessagePasserAddr, storageRoot, storageTrie) if err != nil { return eth.Bytes32{}, fmt.Errorf("withdrawals trie unavailable at block %v: %w", outBlock.Hash(), err) } diff --git a/op-program/client/l2/engine_backend_test.go b/op-program/client/l2/engine_backend_test.go index 861e68068625..531f42d03e27 100644 --- a/op-program/client/l2/engine_backend_test.go +++ b/op-program/client/l2/engine_backend_test.go @@ -199,7 +199,7 @@ func setupOracleBackedChain(t *testing.T, blockCount int) ([]*types.Block, *Orac } func setupOracleBackedChainWithLowerHead(t *testing.T, blockCount int, headBlockNumber int) ([]*types.Block, *OracleBackedL2Chain) { - logger := testlog.Logger(t, log.LvlDebug) + logger := testlog.Logger(t, log.LevelDebug) chainCfg, blocks, oracle := setupOracle(t, blockCount, headBlockNumber) head := blocks[headBlockNumber].Hash() stubOutput := eth.OutputV0{BlockHash: head} diff --git a/op-program/client/l2/engineapi/test/l2_engine_api_tests.go b/op-program/client/l2/engineapi/test/l2_engine_api_tests.go index 232f002e8fe9..743aeb5892bc 100644 --- a/op-program/client/l2/engineapi/test/l2_engine_api_tests.go +++ b/op-program/client/l2/engineapi/test/l2_engine_api_tests.go @@ -313,7 +313,7 @@ type testHelper struct { } func newTestHelper(t *testing.T, createBackend func(t *testing.T) engineapi.EngineBackend) *testHelper { - logger := testlog.Logger(t, log.LvlDebug) + logger := testlog.Logger(t, log.LevelDebug) ctx := context.Background() backend := createBackend(t) api := engineapi.NewL2EngineAPI(logger, backend) diff --git a/op-program/host/cmd/main.go b/op-program/host/cmd/main.go index 19d0f188730b..75dc1383983e 100644 --- a/op-program/host/cmd/main.go +++ b/op-program/host/cmd/main.go @@ -64,6 +64,6 @@ func run(args []string, action ConfigAction) error { func setupLogging(ctx *cli.Context) (log.Logger, error) { logCfg := oplog.ReadCLIConfig(ctx) logger := oplog.NewLogger(oplog.AppOut(ctx), logCfg) - oplog.SetGlobalLogHandler(logger.GetHandler()) + oplog.SetGlobalLogHandler(logger.Handler()) return logger, nil } diff --git a/op-program/host/host_test.go b/op-program/host/host_test.go index b3fd3d83396e..c46ebe781190 100644 --- a/op-program/host/host_test.go +++ b/op-program/host/host_test.go @@ -35,7 +35,7 @@ func TestServerMode(t *testing.T) { hintServer, hintClient, err := io.CreateBidirectionalChannel() require.NoError(t, err) defer hintClient.Close() - logger := testlog.Logger(t, log.LvlTrace) + logger := testlog.Logger(t, log.LevelTrace) result := make(chan error) go func() { result <- PreimageServer(context.Background(), logger, cfg, preimageServer, hintServer) diff --git a/op-program/host/prefetcher/prefetcher_test.go b/op-program/host/prefetcher/prefetcher_test.go index 802638437da2..ac8e52bdf268 100644 --- a/op-program/host/prefetcher/prefetcher_test.go +++ b/op-program/host/prefetcher/prefetcher_test.go @@ -314,7 +314,7 @@ func TestRetryWhenNotAvailableAfterPrefetching(t *testing.T) { _, l1Source, l2Cl, kv := createPrefetcher(t) putsToIgnore := 2 kv = &unreliableKvStore{KV: kv, putsToIgnore: putsToIgnore} - prefetcher := NewPrefetcher(testlog.Logger(t, log.LvlInfo), l1Source, l2Cl, kv) + prefetcher := NewPrefetcher(testlog.Logger(t, log.LevelInfo), l1Source, l2Cl, kv) // Expect one call for each ignored put, plus one more request for when the put succeeds for i := 0; i < putsToIgnore+1; i++ { @@ -356,7 +356,7 @@ func (m *l2Client) ExpectOutputByRoot(root common.Hash, output eth.Output, err e } func createPrefetcher(t *testing.T) (*Prefetcher, *testutils.MockL1Source, *l2Client, kvstore.KV) { - logger := testlog.Logger(t, log.LvlDebug) + logger := testlog.Logger(t, log.LevelDebug) kv := kvstore.NewMemKV() l1Source := new(testutils.MockL1Source) diff --git a/op-program/host/prefetcher/retry_test.go b/op-program/host/prefetcher/retry_test.go index c6d46d027a48..93dc92df0a58 100644 --- a/op-program/host/prefetcher/retry_test.go +++ b/op-program/host/prefetcher/retry_test.go @@ -103,7 +103,7 @@ func TestRetryingL1Source(t *testing.T) { } func createL1Source(t *testing.T) (*RetryingL1Source, *testutils.MockL1Source) { - logger := testlog.Logger(t, log.LvlDebug) + logger := testlog.Logger(t, log.LevelDebug) mock := &testutils.MockL1Source{} source := NewRetryingL1Source(logger, mock) // Avoid sleeping in tests by using a fixed retry strategy with no delay @@ -216,7 +216,7 @@ func TestRetryingL2Source(t *testing.T) { } func createL2Source(t *testing.T) (*RetryingL2Source, *MockL2Source) { - logger := testlog.Logger(t, log.LvlDebug) + logger := testlog.Logger(t, log.LevelDebug) mock := &MockL2Source{} source := NewRetryingL2Source(logger, mock) // Avoid sleeping in tests by using a fixed retry strategy with no delay diff --git a/op-proposer/proposer/l2_output_submitter.go b/op-proposer/proposer/l2_output_submitter.go index e435e47d0b0d..a98e96e63031 100644 --- a/op-proposer/proposer/l2_output_submitter.go +++ b/op-proposer/proposer/l2_output_submitter.go @@ -25,7 +25,7 @@ func Main(version string) cliapp.LifecycleAction { } l := oplog.NewLogger(oplog.AppOut(cliCtx), cfg.LogConfig) - oplog.SetGlobalLogHandler(l.GetHandler()) + oplog.SetGlobalLogHandler(l.Handler()) opservice.ValidateEnvVars(flags.EnvVarPrefix, flags.Flags, l) l.Info("Initializing L2Output Submitter") diff --git a/op-proposer/proposer/service.go b/op-proposer/proposer/service.go index 6796d7fb8cee..ab023f9c160a 100644 --- a/op-proposer/proposer/service.go +++ b/op-proposer/proposer/service.go @@ -19,6 +19,7 @@ import ( "github.com/ethereum-optimism/optimism/op-service/oppprof" oprpc "github.com/ethereum-optimism/optimism/op-service/rpc" "github.com/ethereum-optimism/optimism/op-service/txmgr" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/log" diff --git a/op-service/client/polling_test.go b/op-service/client/polling_test.go index a0210d911a48..721cd326ca49 100644 --- a/op-service/client/polling_test.go +++ b/op-service/client/polling_test.go @@ -73,8 +73,7 @@ func (m *MockRPC) popResult() { } func TestPollingClientSubscribeUnsubscribe(t *testing.T) { - lgr := log.New() - lgr.SetHandler(log.DiscardHandler()) + lgr := log.NewLogger(log.DiscardHandler()) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -134,8 +133,7 @@ func TestPollingClientSubscribeUnsubscribe(t *testing.T) { } func TestPollingClientErrorRecovery(t *testing.T) { - lgr := log.New() - lgr.SetHandler(log.DiscardHandler()) + lgr := log.NewLogger(log.DiscardHandler()) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -165,8 +163,7 @@ func TestPollingClientErrorRecovery(t *testing.T) { } func TestPollingClientClose(t *testing.T) { - lgr := log.New() - lgr.SetHandler(log.DiscardHandler()) + lgr := log.NewLogger(log.DiscardHandler()) ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/op-service/dial/active_l2_provider_test.go b/op-service/dial/active_l2_provider_test.go index 5790c3dbd71c..e9b532cc10bd 100644 --- a/op-service/dial/active_l2_provider_test.go +++ b/op-service/dial/active_l2_provider_test.go @@ -67,7 +67,7 @@ func (et *endpointProviderTest) newActiveL2RollupProvider(checkDuration time.Dur rollupUrls, checkDuration, 1*time.Minute, - testlog.Logger(et.t, log.LvlDebug), + testlog.Logger(et.t, log.LevelDebug), mockRollupDialer, ) } @@ -116,7 +116,7 @@ func (et *endpointProviderTest) newActiveL2EndpointProvider(checkDuration time.D rollupUrls, checkDuration, 1*time.Minute, - testlog.Logger(et.t, log.LvlDebug), + testlog.Logger(et.t, log.LevelDebug), mockEthDialer, mockRollupDialer, ) diff --git a/op-service/log/cli.go b/op-service/log/cli.go index 983f7228dbfc..131ea2faf5eb 100644 --- a/op-service/log/cli.go +++ b/op-service/log/cli.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/urfave/cli/v2" + "golang.org/x/exp/slog" "golang.org/x/term" "github.com/ethereum/go-ethereum/log" @@ -29,7 +30,7 @@ func CLIFlags(envPrefix string) []cli.Flag { &cli.GenericFlag{ Name: LevelFlagName, Usage: "The lowest log level that will be output", - Value: NewLvlFlagValue(log.LvlInfo), + Value: NewLevelFlagValue(log.LevelInfo), EnvVars: opservice.PrefixEnvVar(envPrefix, "LOG_LEVEL"), }, &cli.GenericFlag{ @@ -46,38 +47,61 @@ func CLIFlags(envPrefix string) []cli.Flag { } } -// LvlFlagValue is a value type for cli.GenericFlag to parse and validate log-level values. +// LevelFlagValue is a value type for cli.GenericFlag to parse and validate log-level values. // Log level: trace, debug, info, warn, error, crit. Capitals are accepted too. -type LvlFlagValue log.Lvl +type LevelFlagValue slog.Level -func NewLvlFlagValue(lvl log.Lvl) *LvlFlagValue { - return (*LvlFlagValue)(&lvl) +func NewLevelFlagValue(lvl slog.Level) *LevelFlagValue { + return (*LevelFlagValue)(&lvl) } -func (fv *LvlFlagValue) Set(value string) error { +func (fv *LevelFlagValue) Set(value string) error { value = strings.ToLower(value) // ignore case - lvl, err := log.LvlFromString(value) + lvl, err := LevelFromString(value) if err != nil { return err } - *fv = LvlFlagValue(lvl) + *fv = LevelFlagValue(lvl) return nil } -func (fv LvlFlagValue) String() string { - return log.Lvl(fv).String() +func (fv LevelFlagValue) String() string { + return slog.Level(fv).String() } -func (fv LvlFlagValue) LogLvl() log.Lvl { - return log.Lvl(fv) +func (fv LevelFlagValue) Level() slog.Level { + return slog.Level(fv).Level() } -func (fv *LvlFlagValue) Clone() any { +func (fv *LevelFlagValue) Clone() any { cpy := *fv return &cpy } -var _ cliapp.CloneableGeneric = (*LvlFlagValue)(nil) +// LvlFromString returns the appropriate Lvl from a string name. +// Useful for parsing command line args and configuration files. +// It also converts strings to lowercase. +func LevelFromString(lvlString string) (slog.Level, error) { + lvlString = strings.ToLower(lvlString) // ignore case + switch lvlString { + case "trace", "trce": + return log.LevelTrace, nil + case "debug", "dbug": + return log.LevelDebug, nil + case "info": + return log.LevelInfo, nil + case "warn": + return log.LevelWarn, nil + case "error", "eror": + return log.LevelError, nil + case "crit": + return log.LevelCrit, nil + default: + return log.LevelDebug, fmt.Errorf("unknown level: %v", lvlString) + } +} + +var _ cliapp.CloneableGeneric = (*LevelFlagValue)(nil) // FormatType defines a type of log format. // Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty' @@ -91,25 +115,30 @@ const ( FormatJSONPretty FormatType = "json-pretty" ) -// Formatter turns a format type and color into a structured Format object -func (ft FormatType) Formatter(color bool) log.Format { +// FormatHandler returns the correct slog handler factory for the provided format. +func FormatHandler(ft FormatType, color bool) func(io.Writer) slog.Handler { + termColorHandler := func(w io.Writer) slog.Handler { + return log.NewTerminalHandler(w, color) + } switch ft { case FormatJSON: - return log.JSONFormat() + return log.JSONHandler case FormatJSONPretty: - return log.JSONFormatEx(true, true) + // TODO(Seb): Neither slog nor geth/log seem to provide separate (non)pretty JSON loggers. + // So just reusing the same in both cases for backwards compatibility. + return log.JSONHandler case FormatText: if term.IsTerminal(int(os.Stdout.Fd())) { - return log.TerminalFormat(color) + return termColorHandler } else { - return log.LogfmtFormat() + return log.LogfmtHandler } case FormatTerminal: - return log.TerminalFormat(color) + return termColorHandler case FormatLogFmt: - return log.LogfmtFormat() + return log.LogfmtHandler default: - panic(fmt.Errorf("failed to create `log.Format` for format-type=%q and color=%v", ft, color)) + panic(fmt.Errorf("failed to create slog.Handler factory for format-type=%q and color=%v", ft, color)) } } @@ -150,7 +179,7 @@ func (fv *FormatFlagValue) Clone() any { var _ cliapp.CloneableGeneric = (*FormatFlagValue)(nil) type CLIConfig struct { - Level log.Lvl + Level slog.Level Color bool Format FormatType } @@ -165,20 +194,16 @@ func AppOut(ctx *cli.Context) io.Writer { } // NewLogHandler creates a new configured handler, compatible as LvlSetter for log-level changes during runtime. -func NewLogHandler(wr io.Writer, cfg CLIConfig) log.Handler { - handler := log.StreamHandler(wr, cfg.Format.Formatter(cfg.Color)) - handler = log.SyncHandler(handler) - handler = NewDynamicLogHandler(cfg.Level, handler) - return handler +func NewLogHandler(wr io.Writer, cfg CLIConfig) slog.Handler { + handler := FormatHandler(cfg.Format, cfg.Color)(wr) + return NewDynamicLogHandler(cfg.Level, handler) } // NewLogger creates a new configured logger. // The log handler of the logger is a LvlSetter, i.e. the log level can be changed as needed. func NewLogger(wr io.Writer, cfg CLIConfig) log.Logger { - handler := NewLogHandler(wr, cfg) - logger := log.New() - logger.SetHandler(handler) - return logger + h := NewLogHandler(wr, cfg) + return log.NewLogger(h) } // SetGlobalLogHandler sets the log handles as the handler of the global default logger. @@ -186,15 +211,15 @@ func NewLogger(wr io.Writer, cfg CLIConfig) log.Logger { // as it does makes it difficult to distinguish different services in the same process, e.g. during tests. // Geth and other components may use the global logger however, // and it is thus recommended to set the global log handler to catch these logs. -func SetGlobalLogHandler(h log.Handler) { - log.Root().SetHandler(h) +func SetGlobalLogHandler(h slog.Handler) { + log.SetDefault(log.NewLogger(h)) } // DefaultCLIConfig creates a default log configuration. // Color defaults to true if terminal is detected. func DefaultCLIConfig() CLIConfig { return CLIConfig{ - Level: log.LvlInfo, + Level: log.LevelInfo, Format: FormatText, Color: term.IsTerminal(int(os.Stdout.Fd())), } @@ -202,7 +227,7 @@ func DefaultCLIConfig() CLIConfig { func ReadCLIConfig(ctx *cli.Context) CLIConfig { cfg := DefaultCLIConfig() - cfg.Level = ctx.Generic(LevelFlagName).(*LvlFlagValue).LogLvl() + cfg.Level = ctx.Generic(LevelFlagName).(*LevelFlagValue).Level() cfg.Format = ctx.Generic(FormatFlagName).(*FormatFlagValue).FormatType() if ctx.IsSet(ColorFlagName) { cfg.Color = ctx.Bool(ColorFlagName) diff --git a/op-service/log/defaults.go b/op-service/log/defaults.go index a57408be81db..d7997e8040a3 100644 --- a/op-service/log/defaults.go +++ b/op-service/log/defaults.go @@ -7,10 +7,5 @@ import ( ) func SetupDefaults() { - log.Root().SetHandler( - log.LvlFilterHandler( - log.LvlInfo, - log.StreamHandler(os.Stdout, log.LogfmtFormat()), - ), - ) + SetGlobalLogHandler(log.LogfmtHandlerWithLevel(os.Stdout, log.LevelInfo)) } diff --git a/op-service/log/dynamic.go b/op-service/log/dynamic.go index 901279aba094..a3a03be483ef 100644 --- a/op-service/log/dynamic.go +++ b/op-service/log/dynamic.go @@ -1,31 +1,39 @@ package log -import "github.com/ethereum/go-ethereum/log" +import ( + "context" + + "golang.org/x/exp/slog" +) type LvlSetter interface { - SetLogLevel(lvl log.Lvl) + SetLogLevel(lvl slog.Level) } // DynamicLogHandler allow runtime-configuration of the log handler. type DynamicLogHandler struct { - log.Handler // embedded, to expose any extra methods the underlying handler might provide - maxLvl log.Lvl + slog.Handler // embedded, to expose any extra methods the underlying handler might provide + minLvl slog.Level } -func NewDynamicLogHandler(lvl log.Lvl, h log.Handler) *DynamicLogHandler { +func NewDynamicLogHandler(lvl slog.Level, h slog.Handler) *DynamicLogHandler { return &DynamicLogHandler{ Handler: h, - maxLvl: lvl, + minLvl: lvl, } } -func (d *DynamicLogHandler) SetLogLevel(lvl log.Lvl) { - d.maxLvl = lvl +func (d *DynamicLogHandler) SetLogLevel(lvl slog.Level) { + d.minLvl = lvl } -func (d *DynamicLogHandler) Log(r *log.Record) error { - if r.Lvl > d.maxLvl { // lower log level values are more critical +func (d *DynamicLogHandler) Handle(ctx context.Context, r slog.Record) error { + if r.Level < d.minLvl { // higher log level values are more critical return nil } - return d.Handler.Log(r) // process the log + return d.Handler.Handle(ctx, r) // process the log +} + +func (d *DynamicLogHandler) Enabled(ctx context.Context, lvl slog.Level) bool { + return (lvl >= d.minLvl) && d.Handler.Enabled(ctx, lvl) } diff --git a/op-service/log/dynamic_test.go b/op-service/log/dynamic_test.go index 45fd3def95df..e5f61ee45e31 100644 --- a/op-service/log/dynamic_test.go +++ b/op-service/log/dynamic_test.go @@ -1,44 +1,57 @@ package log import ( + "context" "testing" "github.com/stretchr/testify/require" + "golang.org/x/exp/slog" "github.com/ethereum/go-ethereum/log" ) func TestDynamicLogHandler_SetLogLevel(t *testing.T) { - var records []*log.Record - h := log.FuncHandler(func(r *log.Record) error { - records = append(records, r) - return nil - }) - d := NewDynamicLogHandler(log.LvlInfo, h) - logger := log.New() - logger.SetHandler(d) + h := new(testRecorder) + d := NewDynamicLogHandler(log.LevelInfo, h) + logger := log.NewLogger(d) logger.Info("hello world") // y logger.Error("error!") // y logger.Debug("debugging") // n // increase log level - logger.GetHandler().(LvlSetter).SetLogLevel(log.LvlDebug) + d.SetLogLevel(log.LevelDebug) logger.Info("hello again") // y logger.Debug("can see debug now") // y logger.Trace("but no trace") // n // and decrease log level - logger.GetHandler().(LvlSetter).SetLogLevel(log.LvlWarn) + d.SetLogLevel(log.LevelWarn) logger.Warn("visible warning") // y logger.Info("info should be hidden now") // n logger.Error("another error") // y - require.Len(t, records, 2+2+2) - require.Equal(t, records[0].Msg, "hello world") - require.Equal(t, records[1].Msg, "error!") - require.Equal(t, records[2].Msg, "hello again") - require.Equal(t, records[3].Msg, "can see debug now") - require.Equal(t, records[4].Msg, "visible warning") - require.Equal(t, records[5].Msg, "another error") + require.Len(t, h.records, 2+2+2) + require.Equal(t, h.records[0].Message, "hello world") + require.Equal(t, h.records[1].Message, "error!") + require.Equal(t, h.records[2].Message, "hello again") + require.Equal(t, h.records[3].Message, "can see debug now") + require.Equal(t, h.records[4].Message, "visible warning") + require.Equal(t, h.records[5].Message, "another error") } + +type testRecorder struct { + records []slog.Record +} + +func (r testRecorder) Enabled(context.Context, slog.Level) bool { + return true +} + +func (r *testRecorder) Handle(_ context.Context, rec slog.Record) error { + r.records = append(r.records, rec) + return nil +} + +func (r *testRecorder) WithAttrs([]slog.Attr) slog.Handler { return r } +func (r *testRecorder) WithGroup(string) slog.Handler { return r } diff --git a/op-service/log/writer.go b/op-service/log/writer.go index 77c787249142..aaf7fffbeaac 100644 --- a/op-service/log/writer.go +++ b/op-service/log/writer.go @@ -4,28 +4,29 @@ import ( "sync" "github.com/ethereum/go-ethereum/log" + "golang.org/x/exp/slog" ) type Writer struct { - log func(str string, ctx ...interface{}) + log func(str string, ctx ...any) lock sync.Mutex pending []byte } -func NewWriter(l log.Logger, lvl log.Lvl) *Writer { - var logMethod func(str string, ctx ...interface{}) +func NewWriter(l log.Logger, lvl slog.Level) *Writer { + var logMethod func(str string, ctx ...any) switch lvl { - case log.LvlTrace: + case log.LevelTrace: logMethod = l.Trace - case log.LvlDebug: + case log.LevelDebug: logMethod = l.Debug - case log.LvlInfo: + case log.LevelInfo: logMethod = l.Info - case log.LvlWarn: + case log.LevelWarn: logMethod = l.Warn - case log.LvlError: + case log.LevelError: logMethod = l.Error - case log.LvlCrit: + case log.LevelCrit: logMethod = l.Crit default: // Cast lvl to int to avoid trying to convert it to a string which will fail for unknown types diff --git a/op-service/log/writer_test.go b/op-service/log/writer_test.go index 4a4c000bd5b3..df04cdf03223 100644 --- a/op-service/log/writer_test.go +++ b/op-service/log/writer_test.go @@ -1,63 +1,64 @@ -package log +package log_test import ( "io" "testing" + . "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/optimism/op-service/testlog" "github.com/ethereum/go-ethereum/log" "github.com/stretchr/testify/require" + "golang.org/x/exp/slog" ) var _ io.Writer = (*Writer)(nil) func TestLogWriter(t *testing.T) { - setup := func(t *testing.T, lvl log.Lvl) (*Writer, *testlog.CapturingHandler) { - logger := testlog.Logger(t, lvl) - logs := testlog.Capture(logger) + setup := func(t *testing.T, lvl slog.Level) (*Writer, *testlog.CapturingHandler) { + logger, logs := testlog.CaptureLogger(t, lvl) writer := NewWriter(logger, lvl) return writer, logs } t.Run("LogSingleLine", func(t *testing.T) { - writer, logs := setup(t, log.LvlInfo) + writer, logs := setup(t, log.LevelInfo) line := []byte("Test line\n") count, err := writer.Write(line) require.NoError(t, err) require.Equal(t, len(line), count) - require.NotNil(t, logs.FindLog(log.LvlInfo, "Test line")) + require.NotNil(t, logs.FindLog(log.LevelInfo, "Test line")) }) t.Run("LogMultipleLines", func(t *testing.T) { - writer, logs := setup(t, log.LvlInfo) + writer, logs := setup(t, log.LevelInfo) line := []byte("Line 1\nLine 2\n") count, err := writer.Write(line) require.NoError(t, err) require.Equal(t, len(line), count) - require.NotNil(t, logs.FindLog(log.LvlInfo, "Line 1")) - require.NotNil(t, logs.FindLog(log.LvlInfo, "Line 2")) + require.NotNil(t, logs.FindLog(log.LevelInfo, "Line 1")) + require.NotNil(t, logs.FindLog(log.LevelInfo, "Line 2")) }) t.Run("LogLineAcrossMultipleCalls", func(t *testing.T) { - writer, logs := setup(t, log.LvlInfo) + writer, logs := setup(t, log.LevelInfo) line := []byte("First line\nSplit ") count, err := writer.Write(line) require.NoError(t, err) require.Equal(t, len(line), count) - require.NotNil(t, logs.FindLog(log.LvlInfo, "First line")) + require.NotNil(t, logs.FindLog(log.LevelInfo, "First line")) line = []byte("Line\nLast Line\n") count, err = writer.Write(line) require.NoError(t, err) require.Equal(t, len(line), count) - require.NotNil(t, logs.FindLog(log.LvlInfo, "Split Line")) - require.NotNil(t, logs.FindLog(log.LvlInfo, "Last Line")) + require.NotNil(t, logs.FindLog(log.LevelInfo, "Split Line")) + require.NotNil(t, logs.FindLog(log.LevelInfo, "Last Line")) }) - // Can't test LvlCrit or it will call os.Exit - for _, lvl := range []log.Lvl{log.LvlTrace, log.LvlDebug, log.LvlInfo, log.LvlWarn, log.LvlError} { + // Can't test LevelCrit or it will call os.Exit + for _, lvl := range []slog.Level{log.LevelTrace, log.LevelDebug, log.LevelInfo, log.LevelWarn, log.LevelError} { lvl := lvl - t.Run("LogLvl_"+lvl.String(), func(t *testing.T) { + t.Run("LogLevel_"+lvl.String(), func(t *testing.T) { writer, logs := setup(t, lvl) line := []byte("Log line\n") count, err := writer.Write(line) @@ -68,14 +69,13 @@ func TestLogWriter(t *testing.T) { } t.Run("UseErrorForUnknownLevels", func(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) - logs := testlog.Capture(logger) + logger, logs := testlog.CaptureLogger(t, log.LevelInfo) writer := NewWriter(logger, 60027) line := []byte("Log line\n") count, err := writer.Write(line) require.NoError(t, err) require.Equal(t, len(line), count) - require.NotNil(t, logs.FindLog(log.LvlError, "Unknown log level. Using Error")) - require.NotNil(t, logs.FindLog(log.LvlError, "Log line")) + require.NotNil(t, logs.FindLog(log.LevelError, "Unknown log level. Using Error")) + require.NotNil(t, logs.FindLog(log.LevelError, "Log line")) }) } diff --git a/op-service/rpc/api.go b/op-service/rpc/api.go index 6ed8229d92dd..1bea71ad5799 100644 --- a/op-service/rpc/api.go +++ b/op-service/rpc/api.go @@ -33,13 +33,12 @@ func (n *CommonAdminAPI) SetLogLevel(ctx context.Context, lvlStr string) error { recordDur := n.M.RecordRPCServerRequest("admin_setLogLevel") defer recordDur() - h := n.log.GetHandler() - - lvl, err := log.LvlFromString(lvlStr) + lvl, err := oplog.LevelFromString(lvlStr) if err != nil { return err } + h := n.log.Handler() // We set the log level, and do not wrap the handler with an additional filter handler, // as the underlying handler would otherwise also still filter with the previous log level. lvlSetter, ok := h.(oplog.LvlSetter) diff --git a/op-service/sources/receipts_test.go b/op-service/sources/receipts_test.go index 8fe32d6402bb..5e6203e5d0ff 100644 --- a/op-service/sources/receipts_test.go +++ b/op-service/sources/receipts_test.go @@ -163,7 +163,7 @@ func (tc *ReceiptsTestCase) Run(t *testing.T) { if tc.staticMethod { // if static, instantly reset, for fast clock-independent testing testCfg.MethodResetDuration = 0 } - logger := testlog.Logger(t, log.LvlError) + logger := testlog.Logger(t, log.LevelError) ethCl, err := NewEthClient(client.NewBaseRPCClient(cl), logger, nil, testCfg) require.NoError(t, err) defer ethCl.Close() diff --git a/op-service/sources/rollupclient.go b/op-service/sources/rollupclient.go index d5d1d8e830a7..01b5a8c20153 100644 --- a/op-service/sources/rollupclient.go +++ b/op-service/sources/rollupclient.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/log" + "golang.org/x/exp/slog" "github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-service/client" @@ -64,7 +64,7 @@ func (r *RollupClient) PostUnsafePayload(ctx context.Context, payload *eth.Execu return r.rpc.CallContext(ctx, nil, "admin_postUnsafePayload", payload) } -func (r *RollupClient) SetLogLevel(ctx context.Context, lvl log.Lvl) error { +func (r *RollupClient) SetLogLevel(ctx context.Context, lvl slog.Level) error { return r.rpc.CallContext(ctx, nil, "admin_setLogLevel", lvl.String()) } diff --git a/op-service/testlog/capturing.go b/op-service/testlog/capturing.go index 5b87e30f445b..1e93b09df59d 100644 --- a/op-service/testlog/capturing.go +++ b/op-service/testlog/capturing.go @@ -1,56 +1,92 @@ package testlog import ( + "context" + "strings" + "github.com/ethereum/go-ethereum/log" + + "golang.org/x/exp/slog" ) // CapturingHandler provides a log handler that captures all log records and optionally forwards them to a delegate. // Note that it is not thread safe. type CapturingHandler struct { - Delegate log.Handler - Logs []*log.Record + handler slog.Handler + Logs *[]*slog.Record // shared among derived CapturingHandlers } -func Capture(l log.Logger) *CapturingHandler { - handler := &CapturingHandler{ - Delegate: l.GetHandler(), - } - l.SetHandler(handler) - return handler +func CaptureLogger(t Testing, level slog.Level) (_ log.Logger, ch *CapturingHandler) { + return LoggerWithHandlerMod(t, level, func(h slog.Handler) slog.Handler { + ch = &CapturingHandler{handler: h, Logs: new([]*slog.Record)} + return ch + }), ch +} + +func (c *CapturingHandler) Enabled(context.Context, slog.Level) bool { + // We want to capture all logs, even if the underlying handler only logs + // above a certain level. + return true } -func (c *CapturingHandler) Log(r *log.Record) error { - c.Logs = append(c.Logs, r) - if c.Delegate != nil { - return c.Delegate.Log(r) +func (c *CapturingHandler) Handle(ctx context.Context, r slog.Record) error { + *c.Logs = append(*c.Logs, &r) + if c.handler != nil && c.handler.Enabled(ctx, r.Level) { + return c.handler.Handle(ctx, r) } return nil } +func (c *CapturingHandler) WithAttrs(attrs []slog.Attr) slog.Handler { + // Note: additional attributes won't be visible for captured logs + return &CapturingHandler{ + handler: c.handler.WithAttrs(attrs), + Logs: c.Logs, + } +} + +func (c *CapturingHandler) WithGroup(name string) slog.Handler { + return &CapturingHandler{ + handler: c.handler.WithGroup(name), + Logs: c.Logs, + } +} + func (c *CapturingHandler) Clear() { - c.Logs = nil + *c.Logs = (*c.Logs)[:0] // reuse slice } -func (c *CapturingHandler) FindLog(lvl log.Lvl, msg string) *HelperRecord { - for _, record := range c.Logs { - if record.Lvl == lvl && record.Msg == msg { - return &HelperRecord{record} +func (c *CapturingHandler) FindLog(lvl slog.Level, msg string) HelperRecord { + for _, record := range *c.Logs { + if record.Level == lvl && record.Message == msg { + return HelperRecord{record} } } - return nil + return HelperRecord{} +} + +func (c *CapturingHandler) FindLogContaining(msg string) (*HelperRecord, bool) { + for _, record := range *c.Logs { + if strings.Contains(record.Message, msg) { + return &HelperRecord{record}, true + } + } + return nil, false } type HelperRecord struct { - *log.Record + *slog.Record } -func (h *HelperRecord) GetContextValue(name string) any { - for i := 0; i < len(h.Ctx); i += 2 { - if h.Ctx[i] == name { - return h.Ctx[i+1] +func (h HelperRecord) AttrValue(name string) (v any) { + h.Attrs(func(a slog.Attr) bool { + if a.Key == name { + v = a.Value.Any() + return false } - } - return nil + return true // try next + }) + return } -var _ log.Handler = (*CapturingHandler)(nil) +var _ slog.Handler = (*CapturingHandler)(nil) diff --git a/op-service/testlog/capturing_test.go b/op-service/testlog/capturing_test.go new file mode 100644 index 000000000000..a22d2efaae56 --- /dev/null +++ b/op-service/testlog/capturing_test.go @@ -0,0 +1,38 @@ +package testlog_test + +import ( + "testing" + + "github.com/ethereum-optimism/optimism/op-service/testlog" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" +) + +func TestCaptureLogger(t *testing.T) { + lgr, logs := testlog.CaptureLogger(t, log.LevelInfo) + msg := "foo bar" + lgr.Info(msg, "a", 1) + rec, ok := logs.FindLogContaining("foo") + require.True(t, ok) + require.Equal(t, msg, rec.Message) + require.EqualValues(t, 1, rec.AttrValue("a")) + + lgr.Debug("bug") + _, ok = logs.FindLogContaining("bug") + require.True(t, ok, "should capture all logs, not only above level") + + msgClear := "clear" + lgr.Error(msgClear) + require.NotNil(t, logs.FindLog(log.LevelError, msgClear)) + logs.Clear() + _, ok = logs.FindLogContaining(msgClear) + require.False(t, ok) + + lgrb := lgr.New("b", 2) + msgOp := "optimistic" + lgrb.Info(msgOp, "c", 3) + recOp, ok := logs.FindLogContaining(msgOp) + require.True(t, ok, "should still capture logs from derived logger") + require.EqualValues(t, 3, recOp.AttrValue("c")) + // Note: "b" attributes won't be visible on captured record +} diff --git a/op-service/testlog/testlog.go b/op-service/testlog/testlog.go index d3e3c8b04447..17e7f5e4b2dd 100644 --- a/op-service/testlog/testlog.go +++ b/op-service/testlog/testlog.go @@ -18,6 +18,9 @@ package testlog import ( + "bufio" + "bytes" + "context" "os" "runtime" "strconv" @@ -25,6 +28,7 @@ import ( "sync" "github.com/ethereum/go-ethereum/log" + "golang.org/x/exp/slog" ) var useColorInTestLog bool = true @@ -42,52 +46,32 @@ type Testing interface { Helper() } -// Handler returns a log handler which logs to the unit test log of t. -func Handler(t Testing, level log.Lvl, format log.Format) log.Handler { - return log.LvlFilterHandler(level, &handler{t, format}) -} - -type handler struct { - t Testing - fmt log.Format -} - -func (h *handler) Log(r *log.Record) error { - h.t.Logf("%s", h.fmt.Format(r)) - return nil -} - // logger implements log.Logger such that all output goes to the unit test log via // t.Logf(). All methods in between logger.Trace, logger.Debug, etc. are marked as test // helpers, so the file and line number in unit test output correspond to the call site // which emitted the log message. type logger struct { - t Testing - l log.Logger - mu *sync.Mutex - h *bufHandler + t Testing + l log.Logger + mu *sync.Mutex + buf *bytes.Buffer } -type bufHandler struct { - buf []*log.Record - fmt log.Format +// Logger returns a logger which logs to the unit test log of t. +func Logger(t Testing, level slog.Level) log.Logger { + return LoggerWithHandlerMod(t, level, func(h slog.Handler) slog.Handler { return h }) } -func (h *bufHandler) Log(r *log.Record) error { - h.buf = append(h.buf, r) - return nil +func LoggerWithHandlerMod(t Testing, level slog.Level, handlerMod func(slog.Handler) slog.Handler) log.Logger { + l := &logger{t: t, mu: new(sync.Mutex), buf: new(bytes.Buffer)} + var handler slog.Handler = log.NewTerminalHandlerWithLevel(l.buf, level, useColorInTestLog) + handler = handlerMod(handler) + l.l = log.NewLogger(handler) + return l } -// Logger returns a logger which logs to the unit test log of t. -func Logger(t Testing, level log.Lvl) log.Logger { - l := &logger{ - t: t, - l: log.New(), - mu: new(sync.Mutex), - h: &bufHandler{fmt: log.TerminalFormat(useColorInTestLog)}, - } - l.l.SetHandler(log.LvlFilterHandler(level, l.h)) - return l +func (l *logger) Handler() slog.Handler { + return l.l.Handler() } func (l *logger) Trace(msg string, ctx ...any) { @@ -138,16 +122,28 @@ func (l *logger) Crit(msg string, ctx ...any) { l.flush() } +func (l *logger) Log(level slog.Level, msg string, ctx ...any) { + l.t.Helper() + l.mu.Lock() + defer l.mu.Unlock() + l.l.Log(level, msg, ctx...) + l.flush() +} + +func (l *logger) Write(level slog.Level, msg string, ctx ...any) { + l.Log(level, msg, ctx...) +} + func (l *logger) New(ctx ...any) log.Logger { - return &logger{l.t, l.l.New(ctx...), l.mu, l.h} + return &logger{l.t, l.l.New(ctx...), l.mu, l.buf} } -func (l *logger) GetHandler() log.Handler { - return l.l.GetHandler() +func (l *logger) With(ctx ...any) log.Logger { + return l.New(ctx...) } -func (l *logger) SetHandler(h log.Handler) { - l.l.SetHandler(h) +func (l *logger) Enabled(ctx context.Context, level slog.Level) bool { + return l.l.Enabled(ctx, level) } // flush writes all buffered messages and clears the buffer. @@ -160,10 +156,12 @@ func (l *logger) flush() { if decorationLen <= padLength { padding = padLength - decorationLen } - for _, r := range l.h.buf { - l.t.Logf("%*s%s", padding, "", l.h.fmt.Format(r)) + + scanner := bufio.NewScanner(l.buf) + for scanner.Scan() { + l.t.Logf("%*s%s", padding, "", scanner.Text()) } - l.h.buf = nil + l.buf.Reset() } // The Go testing lib uses the runtime package to get info about the calling site, and then decorates the line. diff --git a/op-service/txmgr/price_bump_test.go b/op-service/txmgr/price_bump_test.go index a78641f09a7d..7cd6299dd7ac 100644 --- a/op-service/txmgr/price_bump_test.go +++ b/op-service/txmgr/price_bump_test.go @@ -24,7 +24,7 @@ type priceBumpTest struct { func (tc *priceBumpTest) run(t *testing.T) { prevFC := calcGasFeeCap(big.NewInt(tc.prevBasefee), big.NewInt(tc.prevGasTip)) - lgr := testlog.Logger(t, log.LvlCrit) + lgr := testlog.Logger(t, log.LevelCrit) tip, fc := updateFees(big.NewInt(tc.prevGasTip), prevFC, big.NewInt(tc.newGasTip), big.NewInt(tc.newBasefee), tc.isBlobTx, lgr) diff --git a/op-service/txmgr/queue_test.go b/op-service/txmgr/queue_test.go index db953fc5173a..507b2b103fc8 100644 --- a/op-service/txmgr/queue_test.go +++ b/op-service/txmgr/queue_test.go @@ -176,7 +176,7 @@ func TestQueue_Send(t *testing.T) { name: "TEST", cfg: conf, backend: backend, - l: testlog.Logger(t, log.LvlCrit), + l: testlog.Logger(t, log.LevelCrit), metr: &metrics.NoopTxMetrics{}, } diff --git a/op-service/txmgr/txmgr_test.go b/op-service/txmgr/txmgr_test.go index 7232f1584fcb..1a4555f76080 100644 --- a/op-service/txmgr/txmgr_test.go +++ b/op-service/txmgr/txmgr_test.go @@ -60,7 +60,7 @@ func newTestHarnessWithConfig(t *testing.T, cfg Config) *testHarness { name: "TEST", cfg: cfg, backend: cfg.Backend, - l: testlog.Logger(t, log.LvlCrit), + l: testlog.Logger(t, log.LevelCrit), metr: &metrics.NoopTxMetrics{}, } @@ -827,7 +827,7 @@ func TestWaitMinedMultipleConfs(t *testing.T) { func TestManagerErrsOnZeroCLIConfs(t *testing.T) { t.Parallel() - _, err := NewSimpleTxManager("TEST", testlog.Logger(t, log.LvlCrit), &metrics.NoopTxMetrics{}, CLIConfig{}) + _, err := NewSimpleTxManager("TEST", testlog.Logger(t, log.LevelCrit), &metrics.NoopTxMetrics{}, CLIConfig{}) require.Error(t, err) } @@ -836,7 +836,7 @@ func TestManagerErrsOnZeroCLIConfs(t *testing.T) { func TestManagerErrsOnZeroConfs(t *testing.T) { t.Parallel() - _, err := NewSimpleTxManagerFromConfig("TEST", testlog.Logger(t, log.LvlCrit), &metrics.NoopTxMetrics{}, Config{}) + _, err := NewSimpleTxManagerFromConfig("TEST", testlog.Logger(t, log.LevelCrit), &metrics.NoopTxMetrics{}, Config{}) require.Error(t, err) } @@ -939,7 +939,7 @@ func TestWaitMinedReturnsReceiptAfterFailure(t *testing.T) { }, name: "TEST", backend: &borkedBackend, - l: testlog.Logger(t, log.LvlCrit), + l: testlog.Logger(t, log.LevelCrit), metr: &metrics.NoopTxMetrics{}, } @@ -977,7 +977,7 @@ func doGasPriceIncrease(t *testing.T, txTipCap, txFeeCap, newTip, newBaseFee int }, name: "TEST", backend: &borkedBackend, - l: testlog.Logger(t, log.LvlCrit), + l: testlog.Logger(t, log.LevelCrit), metr: &metrics.NoopTxMetrics{}, } @@ -1118,7 +1118,7 @@ func testIncreaseGasPriceLimit(t *testing.T, lt gasPriceLimitTest) { }, name: "TEST", backend: &borkedBackend, - l: testlog.Logger(t, log.LvlCrit), + l: testlog.Logger(t, log.LevelCrit), metr: &metrics.NoopTxMetrics{}, } lastGoodTx := types.NewTx(&types.DynamicFeeTx{ diff --git a/op-ufm/cmd/ufm/main.go b/op-ufm/cmd/ufm/main.go index ca2cac4d2c39..a475f7dbb040 100644 --- a/op-ufm/cmd/ufm/main.go +++ b/op-ufm/cmd/ufm/main.go @@ -8,8 +8,10 @@ import ( "os/signal" "syscall" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/optimism/op-ufm/pkg/config" "github.com/ethereum-optimism/optimism/op-ufm/pkg/service" + "golang.org/x/exp/slog" "github.com/ethereum/go-ethereum/log" ) @@ -21,12 +23,8 @@ var ( ) func main() { - log.Root().SetHandler( - log.LvlFilterHandler( - log.LvlInfo, - log.StreamHandler(os.Stdout, log.JSONFormat()), - ), - ) + oplog.SetGlobalLogHandler(slog.NewJSONHandler( + os.Stdout, &slog.HandlerOptions{Level: slog.LevelInfo})) log.Info("initializing", "version", GitVersion, @@ -60,20 +58,16 @@ func initConfig(cfgFile string) *config.Config { } // update log level from config - logLevel, err := log.LvlFromString(cfg.LogLevel) + logLevel, err := oplog.LevelFromString(cfg.LogLevel) if err != nil { - logLevel = log.LvlInfo + logLevel = log.LevelInfo if cfg.LogLevel != "" { log.Warn("invalid server.log_level", "log_level", cfg.LogLevel) } } - log.Root().SetHandler( - log.LvlFilterHandler( - logLevel, - log.StreamHandler(os.Stdout, log.JSONFormat()), - ), - ) + oplog.SetGlobalLogHandler(slog.NewJSONHandler( + os.Stdout, &slog.HandlerOptions{Level: logLevel})) // readable parsed config jsonCfg, _ := json.MarshalIndent(cfg, "", " ") diff --git a/op-wheel/cheat/cheat.go b/op-wheel/cheat/cheat.go index debffacc1182..cd1ba3f29d73 100644 --- a/op-wheel/cheat/cheat.go +++ b/op-wheel/cheat/cheat.go @@ -81,7 +81,12 @@ func (ch *Cheater) Close() error { func openStorageTrie(s *state.StateDB, addr common.Address) (state.Trie, error) { stateRoot := s.IntermediateRoot(true) storageRoot := s.GetStorageRoot(addr) - return s.Database().OpenStorageTrie(stateRoot, addr, storageRoot) + storageTrie, err := s.Database().OpenTrie(storageRoot) + if err != nil { + return nil, fmt.Errorf("opening storage trie: %w", err) + } + // TODO(Seb) confirm + return s.Database().OpenStorageTrie(stateRoot, addr, storageRoot, storageTrie) } type HeadFn func(header *types.Header, headState *state.StateDB) error diff --git a/op-wheel/cmd/main.go b/op-wheel/cmd/main.go index 29c726cddb21..03d29c72c055 100644 --- a/op-wheel/cmd/main.go +++ b/op-wheel/cmd/main.go @@ -27,12 +27,8 @@ func main() { app.Description = "Optimism Wheel is a CLI tool to direct the engine one way or the other with DB cheats and Engine API routines." app.Flags = []cli.Flag{wheel.GlobalGethLogLvlFlag} app.Before = func(c *cli.Context) error { - log.Root().SetHandler( - log.LvlFilterHandler( - c.Generic(wheel.GlobalGethLogLvlFlag.Name).(*oplog.LvlFlagValue).LogLvl(), - log.StreamHandler(os.Stdout, log.TerminalFormat(true)), - ), - ) + lvl := c.Generic(wheel.GlobalGethLogLvlFlag.Name).(*oplog.LevelFlagValue).Level() + oplog.SetGlobalLogHandler(log.NewTerminalHandlerWithLevel(os.Stdout, lvl, true)) return nil } app.Action = cli.ActionFunc(func(c *cli.Context) error { diff --git a/op-wheel/commands.go b/op-wheel/commands.go index b356c8711dab..554b979c9ffb 100644 --- a/op-wheel/commands.go +++ b/op-wheel/commands.go @@ -39,7 +39,7 @@ var ( Name: "geth-log-level", Usage: "Set the global geth logging level", EnvVars: prefixEnvVars("GETH_LOG_LEVEL"), - Value: oplog.NewLvlFlagValue(log.LvlError), + Value: oplog.NewLevelFlagValue(log.LevelError), } DataDirFlag = &cli.StringFlag{ Name: "data-dir", @@ -407,7 +407,7 @@ var ( Action: EngineAction(func(ctx *cli.Context, client client.RPC) error { logCfg := oplog.ReadCLIConfig(ctx) l := oplog.NewLogger(oplog.AppOut(ctx), logCfg) - oplog.SetGlobalLogHandler(l.GetHandler()) + oplog.SetGlobalLogHandler(l.Handler()) settings := ParseBuildingArgs(ctx) // TODO: finalize/safe flag diff --git a/proxyd/cmd/proxyd/main.go b/proxyd/cmd/proxyd/main.go index 10a1518cdb6f..13c31d875c17 100644 --- a/proxyd/cmd/proxyd/main.go +++ b/proxyd/cmd/proxyd/main.go @@ -9,9 +9,12 @@ import ( "strconv" "syscall" - "github.com/BurntSushi/toml" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/optimism/proxyd" + + "github.com/BurntSushi/toml" "github.com/ethereum/go-ethereum/log" + "golang.org/x/exp/slog" ) var ( @@ -23,12 +26,8 @@ var ( func main() { // Set up logger with a default INFO level in case we fail to parse flags. // Otherwise the final critical log won't show what the parsing error was. - log.Root().SetHandler( - log.LvlFilterHandler( - log.LvlInfo, - log.StreamHandler(os.Stdout, log.JSONFormat()), - ), - ) + slog.SetDefault(slog.New(slog.NewJSONHandler( + os.Stdout, &slog.HandlerOptions{Level: slog.LevelInfo}))) log.Info("starting proxyd", "version", GitVersion, "commit", GitCommit, "date", GitDate) @@ -42,19 +41,15 @@ func main() { } // update log level from config - logLevel, err := log.LvlFromString(config.Server.LogLevel) + logLevel, err := oplog.LevelFromString(config.Server.LogLevel) if err != nil { - logLevel = log.LvlInfo + logLevel = log.LevelInfo if config.Server.LogLevel != "" { log.Warn("invalid server.log_level set: " + config.Server.LogLevel) } } - log.Root().SetHandler( - log.LvlFilterHandler( - logLevel, - log.StreamHandler(os.Stdout, log.JSONFormat()), - ), - ) + oplog.SetGlobalLogHandler(slog.NewJSONHandler( + os.Stdout, &slog.HandlerOptions{Level: logLevel})) if config.Server.EnablePprof { log.Info("starting pprof", "addr", "0.0.0.0", "port", "6060") diff --git a/proxyd/integration_tests/util_test.go b/proxyd/integration_tests/util_test.go index db52d2f43bc6..745cb3ab911a 100644 --- a/proxyd/integration_tests/util_test.go +++ b/proxyd/integration_tests/util_test.go @@ -10,13 +10,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/log" - - "github.com/gorilla/websocket" + "github.com/ethereum-optimism/optimism/proxyd" "github.com/BurntSushi/toml" - "github.com/ethereum-optimism/optimism/proxyd" + "github.com/ethereum/go-ethereum/log" + "github.com/gorilla/websocket" "github.com/stretchr/testify/require" + "golang.org/x/exp/slog" ) type ProxydHTTPClient struct { @@ -129,8 +129,10 @@ type WSMessage struct { Body []byte } -type ProxydWSClientOnMessage func(msgType int, data []byte) -type ProxydWSClientOnClose func(err error) +type ( + ProxydWSClientOnMessage func(msgType int, data []byte) + ProxydWSClientOnClose func(err error) +) func NewProxydWSClient( url string, @@ -183,11 +185,6 @@ func (h *ProxydWSClient) WriteControlMessage(msgType int, msg []byte) error { } func InitLogger() { - log.Root().SetHandler( - log.LvlFilterHandler(log.LvlDebug, - log.StreamHandler( - os.Stdout, - log.TerminalFormat(false), - )), - ) + slog.SetDefault(slog.New( + log.NewTerminalHandlerWithLevel(os.Stdout, slog.LevelDebug, false))) } From 644e9b3a79c98252315fa2df311a82e7ed60b087 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Fri, 26 Jan 2024 16:10:19 +0100 Subject: [PATCH 02/25] op-e2e: format system_test.go --- op-e2e/system_test.go | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/op-e2e/system_test.go b/op-e2e/system_test.go index 198762e27870..73ffcb32aabd 100644 --- a/op-e2e/system_test.go +++ b/op-e2e/system_test.go @@ -178,7 +178,7 @@ func TestSystemE2EDencunAtGenesisWithBlobs(t *testing.T) { InitParallel(t) cfg := DefaultSystemConfig(t) - //cancun is on from genesis: + // cancun is on from genesis: genesisActivation := uint64(0) cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation // i.e. turn cancun on at genesis time + 0 @@ -471,7 +471,7 @@ func TestMissingBatchE2E(t *testing.T) { func L1InfoFromState(ctx context.Context, contract *bindings.L1Block, l2Number *big.Int) (*derive.L1BlockInfo, error) { var err error - var out = &derive.L1BlockInfo{} + out := &derive.L1BlockInfo{} opts := bind.CallOpts{ BlockNumber: l2Number, Context: ctx, @@ -932,7 +932,6 @@ func TestL1InfoContract(t *testing.T) { checkInfoList("On sequencer with state", l1InfosFromSequencerState) checkInfoList("On verifier with tx", l1InfosFromVerifierTransactions) checkInfoList("On verifier with state", l1InfosFromVerifierState) - } // calcGasFees determines the actual cost of the transaction given a specific base fee @@ -1227,11 +1226,11 @@ func StopStartBatcher(t *testing.T, deltaTimeOffset *hexutil.Uint64) { cfg := DefaultSystemConfig(t) cfg.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset sys, err := cfg.Start(t) - require.Nil(t, err, "Error starting up system") + require.NoError(t, err, "Error starting up system") defer sys.Close() rollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["verifier"].HTTPEndpoint()) - require.Nil(t, err) + require.NoError(t, err) rollupClient := sources.NewRollupClient(client.NewBaseRPCClient(rollupRPCClient)) l2Seq := sys.Clients["sequencer"] @@ -1239,7 +1238,7 @@ func StopStartBatcher(t *testing.T, deltaTimeOffset *hexutil.Uint64) { // retrieve the initial sync status seqStatus, err := rollupClient.SyncStatus(context.Background()) - require.Nil(t, err) + require.NoError(t, err) nonce := uint64(0) sendTx := func() *types.Receipt { @@ -1258,24 +1257,24 @@ func StopStartBatcher(t *testing.T, deltaTimeOffset *hexutil.Uint64) { // wait until the block the tx was first included in shows up in the safe chain on the verifier safeBlockInclusionDuration := time.Duration(6*cfg.DeployConfig.L1BlockTime) * time.Second _, err = geth.WaitForBlock(receipt.BlockNumber, l2Verif, safeBlockInclusionDuration) - require.Nil(t, err, "Waiting for block on verifier") + require.NoError(t, err, "Waiting for block on verifier") require.NoError(t, wait.ForProcessingFullBatch(context.Background(), rollupClient)) // ensure the safe chain advances newSeqStatus, err := rollupClient.SyncStatus(context.Background()) - require.Nil(t, err) + require.NoError(t, err) require.Greater(t, newSeqStatus.SafeL2.Number, seqStatus.SafeL2.Number, "Safe chain did not advance") // stop the batch submission err = sys.BatchSubmitter.Driver().StopBatchSubmitting(context.Background()) - require.Nil(t, err) + require.NoError(t, err) // wait for any old safe blocks being submitted / derived time.Sleep(safeBlockInclusionDuration) // get the initial sync status seqStatus, err = rollupClient.SyncStatus(context.Background()) - require.Nil(t, err) + require.NoError(t, err) // send another tx sendTx() @@ -1283,12 +1282,12 @@ func StopStartBatcher(t *testing.T, deltaTimeOffset *hexutil.Uint64) { // ensure that the safe chain does not advance while the batcher is stopped newSeqStatus, err = rollupClient.SyncStatus(context.Background()) - require.Nil(t, err) + require.NoError(t, err) require.Equal(t, newSeqStatus.SafeL2.Number, seqStatus.SafeL2.Number, "Safe chain advanced while batcher was stopped") // start the batch submission err = sys.BatchSubmitter.Driver().StartBatchSubmitting() - require.Nil(t, err) + require.NoError(t, err) time.Sleep(safeBlockInclusionDuration) // send a third tx @@ -1296,12 +1295,12 @@ func StopStartBatcher(t *testing.T, deltaTimeOffset *hexutil.Uint64) { // wait until the block the tx was first included in shows up in the safe chain on the verifier _, err = geth.WaitForBlock(receipt.BlockNumber, l2Verif, safeBlockInclusionDuration) - require.Nil(t, err, "Waiting for block on verifier") + require.NoError(t, err, "Waiting for block on verifier") require.NoError(t, wait.ForProcessingFullBatch(context.Background(), rollupClient)) // ensure that the safe chain advances after restarting the batcher newSeqStatus, err = rollupClient.SyncStatus(context.Background()) - require.Nil(t, err) + require.NoError(t, err) require.Greater(t, newSeqStatus.SafeL2.Number, seqStatus.SafeL2.Number, "Safe chain did not advance after batcher was restarted") } From 7bfacaf38afd48a02893f31ae94c70dfdb2ab84c Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Fri, 26 Jan 2024 16:10:56 +0100 Subject: [PATCH 03/25] op-chain-ops/genesis: Ignore nil addresses in BuildL1DeveloperGenesis --- op-chain-ops/genesis/layer_one.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/op-chain-ops/genesis/layer_one.go b/op-chain-ops/genesis/layer_one.go index 3e931eb84411..818d46721125 100644 --- a/op-chain-ops/genesis/layer_one.go +++ b/op-chain-ops/genesis/layer_one.go @@ -57,6 +57,13 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme if dump != nil { for _, account := range dump.Accounts { + // TODO(Seb) confirm this is what we want here + // Changes in https://github.com/ethereum/go-ethereum/pull/28504 + // now also add accounts to the Dump with "pre()" as key + // if the address itself is nil. + if account.Address == nil { + continue + } address := *account.Address name := "" if l1Deployments != nil { From df1c39f17f0b96e9e11a56a6f4f3089787d42387 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Fri, 26 Jan 2024 16:11:31 +0100 Subject: [PATCH 04/25] go: Update to latest op-geth commit fb90ca39bc5c4f45e99ef320abfab85eeb56c561 --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 786e6216cc29..8bf79e6a815c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 - github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240103191009-655947053753 + github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240123193359-a5fc767e225a github.com/ethereum/go-ethereum v1.13.8 github.com/fsnotify/fsnotify v1.7.0 github.com/go-chi/chi/v5 v5.0.11 @@ -218,7 +218,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.2-rc.2.0.20240115214724-94dd378935ec +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.3-rc.2.0.20240126145839-fb90ca39bc5c //replace github.com/ethereum-optimism/superchain-registry/superchain => ../superchain-registry/superchain //replace github.com/ethereum/go-ethereum v1.13.5 => ../go-ethereum diff --git a/go.sum b/go.sum index d0a4a67cf7ed..605db3b3f358 100644 --- a/go.sum +++ b/go.sum @@ -170,10 +170,10 @@ github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/ github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101305.2-rc.2.0.20240115214724-94dd378935ec h1:3ThkDGyIkNIDd+AdYb8HNvGO1sefzjiw3ivIz49xNbg= -github.com/ethereum-optimism/op-geth v1.101305.2-rc.2.0.20240115214724-94dd378935ec/go.mod h1:stpeVGYwr0Rz4J0qEmEVC9zBAfKthi34VZ3IalZMrY4= -github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240103191009-655947053753 h1:DL667cfM6peU8H9Ut/uu9h9Bd4gQCcJrjq+yYsfYwjk= -github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240103191009-655947053753/go.mod h1:/70H/KqrtKcvWvNGVj6S3rAcLC+kUPr3t2aDmYIS+Xk= +github.com/ethereum-optimism/op-geth v1.101305.3-rc.2.0.20240126145839-fb90ca39bc5c h1:PaQ2bSkHH3sdEjWy7Pyc7khMmYJTVla12RLzE50eWN0= +github.com/ethereum-optimism/op-geth v1.101305.3-rc.2.0.20240126145839-fb90ca39bc5c/go.mod h1:ZvO85ziQ3Jr+0+Qy2m0djC0lUzNjageTrvo79kiORnc= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240123193359-a5fc767e225a h1:mWIRpGyrAlWHUznUHKgAJUafkNGfO7VmeLjilhVhB80= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240123193359-a5fc767e225a/go.mod h1:/70H/KqrtKcvWvNGVj6S3rAcLC+kUPr3t2aDmYIS+Xk= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= From 2ab681d5b27c612ebd27e6f4e6ba54ecfd655e00 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Tue, 30 Jan 2024 22:33:40 +0100 Subject: [PATCH 05/25] update latest op-geth dependency --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 2cfa8968b533..8992c41b4f49 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 - github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240123193359-a5fc767e225a + github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee github.com/ethereum/go-ethereum v1.13.8 github.com/fsnotify/fsnotify v1.7.0 github.com/go-chi/chi/v5 v5.0.11 @@ -218,7 +218,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.3-rc.2.0.20240126145839-fb90ca39bc5c +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 //replace github.com/ethereum-optimism/superchain-registry/superchain => ../superchain-registry/superchain //replace github.com/ethereum/go-ethereum v1.13.5 => ../go-ethereum diff --git a/go.sum b/go.sum index 5dc8a61598bc..9250841a060b 100644 --- a/go.sum +++ b/go.sum @@ -170,10 +170,10 @@ github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/ github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101305.3-rc.2.0.20240126145839-fb90ca39bc5c h1:PaQ2bSkHH3sdEjWy7Pyc7khMmYJTVla12RLzE50eWN0= -github.com/ethereum-optimism/op-geth v1.101305.3-rc.2.0.20240126145839-fb90ca39bc5c/go.mod h1:ZvO85ziQ3Jr+0+Qy2m0djC0lUzNjageTrvo79kiORnc= -github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240123193359-a5fc767e225a h1:mWIRpGyrAlWHUznUHKgAJUafkNGfO7VmeLjilhVhB80= -github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240123193359-a5fc767e225a/go.mod h1:/70H/KqrtKcvWvNGVj6S3rAcLC+kUPr3t2aDmYIS+Xk= +github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 h1:ozL8bQyJR9pPsLgOc8b8a4rO9C+sBQg1TuVb+Xh4ZLs= +github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7/go.mod h1:N8CFANZjM+QlTjW3sadEK/hhkLfrZcRYbKJouOL5otg= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee h1:1a7ZvkuPhLJ6uAAsAAfaD7K0wYr45l9eH3TdIMpYl+M= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= From 26eeb8f29145a5fb74003acfe232a374d67a654b Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Tue, 30 Jan 2024 22:39:31 +0100 Subject: [PATCH 06/25] op-program,op-wheel: Use new StateDB.OpenStorageTrie --- op-program/client/l2/engine.go | 7 +------ op-wheel/cheat/cheat.go | 17 +++-------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/op-program/client/l2/engine.go b/op-program/client/l2/engine.go index 9b85d5f0a305..c8cbe13a8eec 100644 --- a/op-program/client/l2/engine.go +++ b/op-program/client/l2/engine.go @@ -41,13 +41,8 @@ func (o *OracleEngine) L2OutputRoot(l2ClaimBlockNum uint64) (eth.Bytes32, error) if err != nil { return eth.Bytes32{}, fmt.Errorf("failed to open L2 state db at block %s: %w", outBlock.Hash(), err) } - storageRoot := stateDB.GetStorageRoot(predeploys.L2ToL1MessagePasserAddr) - storageTrie, err := stateDB.Database().OpenTrie(storageRoot) - if err != nil { - return eth.Bytes32{}, fmt.Errorf("opening storage trie: %w", err) - } // TODO(Seb) confirm - withdrawalsTrie, err := stateDB.Database().OpenStorageTrie(outBlock.Root, predeploys.L2ToL1MessagePasserAddr, storageRoot, storageTrie) + withdrawalsTrie, err := stateDB.OpenStorageTrie(predeploys.L2ToL1MessagePasserAddr) if err != nil { return eth.Bytes32{}, fmt.Errorf("withdrawals trie unavailable at block %v: %w", outBlock.Hash(), err) } diff --git a/op-wheel/cheat/cheat.go b/op-wheel/cheat/cheat.go index cd1ba3f29d73..d06da2b09656 100644 --- a/op-wheel/cheat/cheat.go +++ b/op-wheel/cheat/cheat.go @@ -78,17 +78,6 @@ func (ch *Cheater) Close() error { return ch.DB.Close() } -func openStorageTrie(s *state.StateDB, addr common.Address) (state.Trie, error) { - stateRoot := s.IntermediateRoot(true) - storageRoot := s.GetStorageRoot(addr) - storageTrie, err := s.Database().OpenTrie(storageRoot) - if err != nil { - return nil, fmt.Errorf("opening storage trie: %w", err) - } - // TODO(Seb) confirm - return s.Database().OpenStorageTrie(stateRoot, addr, storageRoot, storageTrie) -} - type HeadFn func(header *types.Header, headState *state.StateDB) error // RunAndClose runs the given function on the head-state, and then persists any changes (if not ReadOnly), @@ -203,7 +192,7 @@ func StorageGet(address common.Address, key common.Hash, w io.Writer) HeadFn { // to another account (maybe even in a different database!). func StorageReadAll(address common.Address, w io.Writer) HeadFn { return func(_ *types.Header, headState *state.StateDB) error { - storage, err := openStorageTrie(headState, address) + storage, err := headState.OpenStorageTrie(address) if err != nil { return fmt.Errorf("failed to open storage trie of addr %s: %w", address, err) } @@ -240,14 +229,14 @@ func dbValueToHash(enc []byte) common.Hash { // Each difference is expressed with 1 character + or - to indicate the change from a to b, followed by key = value. func StorageDiff(out io.Writer, addressA, addressB common.Address) HeadFn { return func(_ *types.Header, headState *state.StateDB) error { - aStorage, err := openStorageTrie(headState, addressA) + aStorage, err := headState.OpenStorageTrie(addressA) if err != nil { return fmt.Errorf("failed to open storage trie of addr A %s: %w", addressA, err) } if aStorage == nil { return fmt.Errorf("no storage trie in state for account A %s", addressA) } - bStorage, err := openStorageTrie(headState, addressB) + bStorage, err := headState.OpenStorageTrie(addressB) if err != nil { return fmt.Errorf("failed to open storage trie of addr B %s: %w", addressB, err) } From 0a06a06ac647bc076a1c3c14528972d7580c6294 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Tue, 30 Jan 2024 22:59:02 +0100 Subject: [PATCH 07/25] all: fix more slog stuff after merging --- op-chain-ops/cmd/op-version-check/main.go | 5 ++++- .../game/fault/preimages/direct_test.go | 2 +- .../game/fault/preimages/large_test.go | 2 +- op-challenger/game/keccak/challenger_test.go | 20 +++++++++---------- .../game/keccak/fetcher/fetcher_test.go | 2 +- op-challenger/game/keccak/scheduler_test.go | 2 +- op-challenger/game/keccak/verifier_test.go | 2 +- op-challenger/sender/sender_test.go | 2 +- op-e2e/actions/dencun_fork_test.go | 10 +++++----- op-e2e/actions/ecotone_fork_test.go | 4 ++-- op-e2e/actions/eip4844_test.go | 4 ++-- .../disputegame/output_cannon_helper.go | 2 +- op-e2e/eip4844_test.go | 2 +- op-e2e/l1_beacon_client_test.go | 2 +- op-e2e/sequencer_failover_setup.go | 12 +++++------ op-node/p2p/gossip_test.go | 4 ++-- .../rollup/derive/engine_consolidate_test.go | 4 ++-- op-program/verify/verify.go | 2 +- 18 files changed, 43 insertions(+), 40 deletions(-) diff --git a/op-chain-ops/cmd/op-version-check/main.go b/op-chain-ops/cmd/op-version-check/main.go index 202084df3dac..085bc434a3f0 100644 --- a/op-chain-ops/cmd/op-version-check/main.go +++ b/op-chain-ops/cmd/op-version-check/main.go @@ -14,6 +14,8 @@ import ( "github.com/ethereum-optimism/optimism/op-chain-ops/upgrades" "github.com/ethereum-optimism/optimism/op-service/jsonutil" + oplog "github.com/ethereum-optimism/optimism/op-service/log" + "github.com/ethereum-optimism/superchain-registry/superchain" ) @@ -29,7 +31,8 @@ type ChainVersionCheck struct { } func main() { - log.Root().SetHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(isatty.IsTerminal(os.Stderr.Fd())))) + color := isatty.IsTerminal(os.Stderr.Fd()) + oplog.SetGlobalLogHandler(log.NewTerminalHandler(os.Stderr, color)) app := &cli.App{ Name: "op-version-check", diff --git a/op-challenger/game/fault/preimages/direct_test.go b/op-challenger/game/fault/preimages/direct_test.go index fb215996582a..473334237fc7 100644 --- a/op-challenger/game/fault/preimages/direct_test.go +++ b/op-challenger/game/fault/preimages/direct_test.go @@ -54,7 +54,7 @@ func TestDirectPreimageUploader_UploadPreimage(t *testing.T) { } func newTestDirectPreimageUploader(t *testing.T) (*DirectPreimageUploader, *mockTxSender, *mockPreimageGameContract) { - logger := testlog.Logger(t, log.LvlError) + logger := testlog.Logger(t, log.LevelError) txMgr := &mockTxSender{} contract := &mockPreimageGameContract{} return NewDirectPreimageUploader(logger, txMgr, contract), txMgr, contract diff --git a/op-challenger/game/fault/preimages/large_test.go b/op-challenger/game/fault/preimages/large_test.go index 811ddb79d8f4..d7b9d4f12062 100644 --- a/op-challenger/game/fault/preimages/large_test.go +++ b/op-challenger/game/fault/preimages/large_test.go @@ -283,7 +283,7 @@ func TestLargePreimageUploader_UploadPreimage_Succeeds(t *testing.T) { } func newTestLargePreimageUploader(t *testing.T) (*LargePreimageUploader, *clock.AdvancingClock, *mockTxSender, *mockPreimageOracleContract) { - logger := testlog.Logger(t, log.LvlError) + logger := testlog.Logger(t, log.LevelError) cl := clock.NewAdvancingClock(time.Second) cl.Start() txSender := &mockTxSender{} diff --git a/op-challenger/game/keccak/challenger_test.go b/op-challenger/game/keccak/challenger_test.go index 03a41cc39e1a..147974da503d 100644 --- a/op-challenger/game/keccak/challenger_test.go +++ b/op-challenger/game/keccak/challenger_test.go @@ -39,7 +39,7 @@ func TestChallenge(t *testing.T) { }, } - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) t.Run("SendChallenges", func(t *testing.T) { verifier, sender, oracle, challenger := setupChallengerTest(logger) @@ -66,7 +66,7 @@ func TestChallenge(t *testing.T) { }) t.Run("LogErrorWhenCreateTxFails", func(t *testing.T) { - logs := testlog.Capture(logger) + logger, logs := testlog.CaptureLogger(t, log.LevelInfo) verifier, _, oracle, challenger := setupChallengerTest(logger) verifier.challenges[preimages[1].LargePreimageIdent] = keccakTypes.Challenge{StateMatrix: []byte{0x01}} @@ -74,12 +74,12 @@ func TestChallenge(t *testing.T) { err := challenger.Challenge(context.Background(), common.Hash{0xaa}, oracle, preimages) require.NoError(t, err) - errLog := logs.FindLog(log.LvlError, "Failed to create challenge transaction") - require.ErrorIs(t, errLog.GetContextValue("err").(error), oracle.err) + errLog := logs.FindLog(log.LevelError, "Failed to create challenge transaction") + require.ErrorIs(t, errLog.AttrValue("err").(error), oracle.err) }) t.Run("LogErrorWhenVerifierFails", func(t *testing.T) { - logs := testlog.Capture(logger) + logger, logs := testlog.CaptureLogger(t, log.LevelInfo) verifier, _, oracle, challenger := setupChallengerTest(logger) verifier.challenges[preimages[1].LargePreimageIdent] = keccakTypes.Challenge{StateMatrix: []byte{0x01}} @@ -87,22 +87,22 @@ func TestChallenge(t *testing.T) { err := challenger.Challenge(context.Background(), common.Hash{0xaa}, oracle, preimages) require.NoError(t, err) - errLog := logs.FindLog(log.LvlError, "Failed to verify large preimage") - require.ErrorIs(t, errLog.GetContextValue("err").(error), verifier.err) + errLog := logs.FindLog(log.LevelError, "Failed to verify large preimage") + require.ErrorIs(t, errLog.AttrValue("err").(error), verifier.err) }) t.Run("DoNotLogErrValid", func(t *testing.T) { - logs := testlog.Capture(logger) + logger, logs := testlog.CaptureLogger(t, log.LevelInfo) _, _, oracle, challenger := setupChallengerTest(logger) // All preimages are valid err := challenger.Challenge(context.Background(), common.Hash{0xaa}, oracle, preimages) require.NoError(t, err) - errLog := logs.FindLog(log.LvlError, "Failed to verify large preimage") + errLog := logs.FindLog(log.LevelError, "Failed to verify large preimage") require.Nil(t, errLog) - dbgLog := logs.FindLog(log.LvlDebug, "Preimage is valid") + dbgLog := logs.FindLog(log.LevelDebug, "Preimage is valid") require.NotNil(t, dbgLog) }) } diff --git a/op-challenger/game/keccak/fetcher/fetcher_test.go b/op-challenger/game/keccak/fetcher/fetcher_test.go index 6d79cf9f7afd..b46a77ae33da 100644 --- a/op-challenger/game/keccak/fetcher/fetcher_test.go +++ b/op-challenger/game/keccak/fetcher/fetcher_test.go @@ -174,7 +174,7 @@ func setupFetcherTest(t *testing.T) (*InputFetcher, *stubOracle, *stubL1Source) txs: make(map[uint64]types.Transactions), rcptStatus: make(map[common.Hash]uint64), } - fetcher := NewPreimageFetcher(testlog.Logger(t, log.LvlTrace), l1Source) + fetcher := NewPreimageFetcher(testlog.Logger(t, log.LevelTrace), l1Source) return fetcher, oracle, l1Source } diff --git a/op-challenger/game/keccak/scheduler_test.go b/op-challenger/game/keccak/scheduler_test.go index 48b6c89b5c34..d911702d7609 100644 --- a/op-challenger/game/keccak/scheduler_test.go +++ b/op-challenger/game/keccak/scheduler_test.go @@ -18,7 +18,7 @@ import ( func TestScheduleNextCheck(t *testing.T) { ctx := context.Background() - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) preimage1 := keccakTypes.LargePreimageMetaData{ // Incomplete so won't be verified LargePreimageIdent: keccakTypes.LargePreimageIdent{ Claimant: common.Address{0xab}, diff --git a/op-challenger/game/keccak/verifier_test.go b/op-challenger/game/keccak/verifier_test.go index c999a995af39..cf5be8ba4d2b 100644 --- a/op-challenger/game/keccak/verifier_test.go +++ b/op-challenger/game/keccak/verifier_test.go @@ -19,7 +19,7 @@ import ( ) func TestVerify(t *testing.T) { - logger := testlog.Logger(t, log.LvlInfo) + logger := testlog.Logger(t, log.LevelInfo) tests := []struct { name string inputs func() []keccakTypes.InputData diff --git a/op-challenger/sender/sender_test.go b/op-challenger/sender/sender_test.go index c5c853b08116..f271cd26607b 100644 --- a/op-challenger/sender/sender_test.go +++ b/op-challenger/sender/sender_test.go @@ -20,7 +20,7 @@ func TestSendAndWait(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() txMgr := &stubTxMgr{sending: make(map[byte]chan *types.Receipt)} - sender := NewTxSender(ctx, testlog.Logger(t, log.LvlInfo), txMgr, 5) + sender := NewTxSender(ctx, testlog.Logger(t, log.LevelInfo), txMgr, 5) tx := func(i byte) txmgr.TxCandidate { return txmgr.TxCandidate{TxData: []byte{i}} diff --git a/op-e2e/actions/dencun_fork_test.go b/op-e2e/actions/dencun_fork_test.go index 2bdb7306c14f..5e0f1706cb31 100644 --- a/op-e2e/actions/dencun_fork_test.go +++ b/op-e2e/actions/dencun_fork_test.go @@ -130,7 +130,7 @@ func TestDencunL2ForkAfterGenesis(gt *testing.T) { dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) // start op-nodes @@ -167,7 +167,7 @@ func TestDencunL2ForkAtGenesis(gt *testing.T) { dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) // start op-nodes @@ -209,7 +209,7 @@ func TestDencunBlobTxRPC(gt *testing.T) { dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) engine := newEngine(t, sd, log) cl := engine.EthClient() tx := aliceSimpleBlobTx(t, dp) @@ -228,7 +228,7 @@ func TestDencunBlobTxInTxPool(gt *testing.T) { dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) engine := newEngine(t, sd, log) tx := aliceSimpleBlobTx(t, dp) errs := engine.eth.TxPool().Add([]*types.Transaction{tx}, true, true) @@ -246,7 +246,7 @@ func TestDencunBlobTxInclusion(gt *testing.T) { dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) _, engine, sequencer := setupSequencerTest(t, sd, log) sequencer.ActL2PipelineFull(t) diff --git a/op-e2e/actions/ecotone_fork_test.go b/op-e2e/actions/ecotone_fork_test.go index 268ba73f51df..4cadbdafce08 100644 --- a/op-e2e/actions/ecotone_fork_test.go +++ b/op-e2e/actions/ecotone_fork_test.go @@ -55,7 +55,7 @@ func TestEcotoneNetworkUpgradeTransactions(gt *testing.T) { require.NoError(t, dp.DeployConfig.Check(), "must have valid config") sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) _, _, miner, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) ethCl := engine.EthClient() @@ -242,7 +242,7 @@ func TestEcotoneBeforeL1(gt *testing.T) { dp.DeployConfig.L2GenesisEcotoneTimeOffset = &offset sd := e2eutils.Setup(t, dp, defaultAlloc) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) _, _, _, sequencer, engine, verifier, _, _ := setupReorgTestActors(t, dp, sd, log) // start op-nodes diff --git a/op-e2e/actions/eip4844_test.go b/op-e2e/actions/eip4844_test.go index cc97025d806a..7257b741e5a4 100644 --- a/op-e2e/actions/eip4844_test.go +++ b/op-e2e/actions/eip4844_test.go @@ -45,7 +45,7 @@ func setupBatcher(t Testing, log log.Logger, sd *e2eutils.SetupData, dp *e2eutil func TestEIP4844DataAvailability(gt *testing.T) { t := NewDefaultTesting(gt) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) sd, dp, miner, sequencer, seqEngine, verifier, _ := setupEIP4844Test(t, log) batcher := setupBatcher(t, log, sd, dp, miner, sequencer, seqEngine, batcherFlags.BlobsType) @@ -84,7 +84,7 @@ func TestEIP4844DataAvailability(gt *testing.T) { func TestEIP4844DataAvailabilitySwitch(gt *testing.T) { t := NewDefaultTesting(gt) - log := testlog.Logger(t, log.LvlDebug) + log := testlog.Logger(t, log.LevelDebug) sd, dp, miner, sequencer, seqEngine, verifier, _ := setupEIP4844Test(t, log) oldBatcher := setupBatcher(t, log, sd, dp, miner, sequencer, seqEngine, batcherFlags.CalldataType) diff --git a/op-e2e/e2eutils/disputegame/output_cannon_helper.go b/op-e2e/e2eutils/disputegame/output_cannon_helper.go index a65dbcb9fcae..f698e23d33cf 100644 --- a/op-e2e/e2eutils/disputegame/output_cannon_helper.go +++ b/op-e2e/e2eutils/disputegame/output_cannon_helper.go @@ -171,7 +171,7 @@ func (g *OutputCannonGameHelper) createCannonTraceProvider(ctx context.Context, splitDepth := g.SplitDepth(ctx) g.require.EqualValues(outputRootClaim.Depth(), splitDepth+1, "outputRootClaim must be the root of an execution game") - logger := testlog.Logger(g.t, log.LvlInfo).New("role", "CannonTraceProvider", "game", g.addr) + logger := testlog.Logger(g.t, log.LevelInfo).New("role", "CannonTraceProvider", "game", g.addr) opt := g.defaultChallengerOptions(l2Node) opt = append(opt, options...) cfg := challenger.NewChallengerConfig(g.t, g.system.NodeEndpoint("l1"), opt...) diff --git a/op-e2e/eip4844_test.go b/op-e2e/eip4844_test.go index 673946abd89a..6f2bfc717568 100644 --- a/op-e2e/eip4844_test.go +++ b/op-e2e/eip4844_test.go @@ -37,7 +37,7 @@ func TestSystem4844E2E(t *testing.T) { require.Nil(t, err, "Error starting up system") defer sys.Close() - log := testlog.Logger(t, log.LvlInfo) + log := testlog.Logger(t, log.LevelInfo) log.Info("genesis", "l2", sys.RollupConfig.Genesis.L2, "l1", sys.RollupConfig.Genesis.L1, "l2_time", sys.RollupConfig.Genesis.L2Time) l1Client := sys.Clients["l1"] diff --git a/op-e2e/l1_beacon_client_test.go b/op-e2e/l1_beacon_client_test.go index 729c21b63c75..928f0532db39 100644 --- a/op-e2e/l1_beacon_client_test.go +++ b/op-e2e/l1_beacon_client_test.go @@ -13,7 +13,7 @@ import ( ) func TestGetVersion(t *testing.T) { - l := testlog.Logger(t, log.LvlInfo) + l := testlog.Logger(t, log.LevelInfo) beaconApi := fakebeacon.NewBeacon(l, t.TempDir(), uint64(0), uint64(0)) t.Cleanup(func() { diff --git a/op-e2e/sequencer_failover_setup.go b/op-e2e/sequencer_failover_setup.go index 8ee112154596..2be9c52a213f 100644 --- a/op-e2e/sequencer_failover_setup.go +++ b/op-e2e/sequencer_failover_setup.go @@ -177,7 +177,7 @@ func setupConductor( RollupCfg: rollupCfg, RPCEnableProxy: true, LogConfig: oplog.CLIConfig{ - Level: log.LvlInfo, + Level: log.LevelInfo, Color: false, }, RPC: oprpc.CLIConfig{ @@ -187,7 +187,7 @@ func setupConductor( } ctx := context.Background() - service, err := con.New(ctx, &cfg, testlog.Logger(t, log.LvlInfo), "0.0.1") + service, err := con.New(ctx, &cfg, testlog.Logger(t, log.LevelInfo), "0.0.1") require.NoError(t, err) err = service.Start(ctx) require.NoError(t, err) @@ -234,7 +234,7 @@ func setupBatcher(t *testing.T, sys *System, conductors map[string]*conductor) { PollInterval: 1 * time.Second, TxMgrConfig: newTxMgrConfig(sys.EthInstances["l1"].WSEndpoint(), sys.Cfg.Secrets.Batcher), LogConfig: oplog.CLIConfig{ - Level: log.LvlDebug, + Level: log.LevelDebug, Format: oplog.FormatText, }, Stopped: false, @@ -258,9 +258,9 @@ func sequencerFailoverSystemConfig(t *testing.T, ports map[string]int) SystemCon cfg.Nodes[Sequencer3Name] = sequencerCfg(ports[Sequencer3Name]) delete(cfg.Loggers, "sequencer") - cfg.Loggers[Sequencer1Name] = testlog.Logger(t, log.LvlInfo).New("role", Sequencer1Name) - cfg.Loggers[Sequencer2Name] = testlog.Logger(t, log.LvlInfo).New("role", Sequencer2Name) - cfg.Loggers[Sequencer3Name] = testlog.Logger(t, log.LvlInfo).New("role", Sequencer3Name) + cfg.Loggers[Sequencer1Name] = testlog.Logger(t, log.LevelInfo).New("role", Sequencer1Name) + cfg.Loggers[Sequencer2Name] = testlog.Logger(t, log.LevelInfo).New("role", Sequencer2Name) + cfg.Loggers[Sequencer3Name] = testlog.Logger(t, log.LevelInfo).New("role", Sequencer3Name) cfg.P2PTopology = map[string][]string{ Sequencer1Name: {Sequencer2Name, Sequencer3Name}, diff --git a/op-node/p2p/gossip_test.go b/op-node/p2p/gossip_test.go index dea324d80296..0833f270e40b 100644 --- a/op-node/p2p/gossip_test.go +++ b/op-node/p2p/gossip_test.go @@ -153,8 +153,8 @@ func TestBlockValidator(t *testing.T) { // Params Set 2: Call the validation function peerID := peer.ID("foo") - v2Validator := BuildBlocksValidator(testlog.Logger(t, log.LvlCrit), cfg, runCfg, eth.BlockV2) - v3Validator := BuildBlocksValidator(testlog.Logger(t, log.LvlCrit), cfg, runCfg, eth.BlockV3) + v2Validator := BuildBlocksValidator(testlog.Logger(t, log.LevelCrit), cfg, runCfg, eth.BlockV2) + v3Validator := BuildBlocksValidator(testlog.Logger(t, log.LevelCrit), cfg, runCfg, eth.BlockV3) zero, one := uint64(0), uint64(1) beaconHash := common.HexToHash("0x1234") diff --git a/op-node/rollup/derive/engine_consolidate_test.go b/op-node/rollup/derive/engine_consolidate_test.go index 43e4c07ac428..f67c331d36f7 100644 --- a/op-node/rollup/derive/engine_consolidate_test.go +++ b/op-node/rollup/derive/engine_consolidate_test.go @@ -195,7 +195,7 @@ func TestAttributesMatch(t *testing.T) { } for _, test := range tests { - err := AttributesMatchBlock(rollupCfg, test.args.attrs, test.args.parentHash, test.args.envelope, testlog.Logger(t, log.LvlInfo)) + err := AttributesMatchBlock(rollupCfg, test.args.attrs, test.args.parentHash, test.args.envelope, testlog.Logger(t, log.LevelInfo)) if test.shouldMatch { require.NoError(t, err) } else { @@ -366,7 +366,7 @@ func TestGetMissingTxnHashes(t *testing.T) { for _, test := range tests { missingSafeHashes, missingUnsafeHashes, err := getMissingTxnHashes( - testlog.Logger(t, log.LvlError), + testlog.Logger(t, log.LevelError), test.safeTransactions, test.unsafeTransactions, ) diff --git a/op-program/verify/verify.go b/op-program/verify/verify.go index 76fb6e54eb66..2f9ebdb7b510 100644 --- a/op-program/verify/verify.go +++ b/op-program/verify/verify.go @@ -114,7 +114,7 @@ func Run(l1RpcUrl string, l1RpcKind string, l2RpcUrl string, l2OracleAddr common fmt.Printf("Configuration: %s\n", argsStr) logger := oplog.DefaultCLIConfig() - logger.Level = log.LvlDebug + logger.Level = log.LevelDebug rollupCfg, err := rollup.LoadOPStackRollupConfig(chainCfg.ChainID.Uint64()) if err != nil { return fmt.Errorf("failed to load rollup config: %w", err) From 152d1e0a458d78c104c09674c22384f484b94bf2 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Wed, 31 Jan 2024 14:15:33 +0100 Subject: [PATCH 08/25] proxyd: update geth 1.13.8 & migrate to slog --- op-service/log/cli.go | 2 +- proxyd/cmd/proxyd/main.go | 33 +++++++++++++++++++++++++++++---- proxyd/go.mod | 15 ++++++++------- proxyd/go.sum | 34 ++++++++++++++++++---------------- 4 files changed, 56 insertions(+), 28 deletions(-) diff --git a/op-service/log/cli.go b/op-service/log/cli.go index 131ea2faf5eb..68157b403efb 100644 --- a/op-service/log/cli.go +++ b/op-service/log/cli.go @@ -78,7 +78,7 @@ func (fv *LevelFlagValue) Clone() any { return &cpy } -// LvlFromString returns the appropriate Lvl from a string name. +// LevelFromString returns the appropriate Level from a string name. // Useful for parsing command line args and configuration files. // It also converts strings to lowercase. func LevelFromString(lvlString string) (slog.Level, error) { diff --git a/proxyd/cmd/proxyd/main.go b/proxyd/cmd/proxyd/main.go index 13c31d875c17..a62e6fbdf708 100644 --- a/proxyd/cmd/proxyd/main.go +++ b/proxyd/cmd/proxyd/main.go @@ -1,15 +1,16 @@ package main import ( + "fmt" "net" "net/http" "net/http/pprof" "os" "os/signal" "strconv" + "strings" "syscall" - oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/optimism/proxyd" "github.com/BurntSushi/toml" @@ -41,15 +42,15 @@ func main() { } // update log level from config - logLevel, err := oplog.LevelFromString(config.Server.LogLevel) + logLevel, err := LevelFromString(config.Server.LogLevel) if err != nil { logLevel = log.LevelInfo if config.Server.LogLevel != "" { log.Warn("invalid server.log_level set: " + config.Server.LogLevel) } } - oplog.SetGlobalLogHandler(slog.NewJSONHandler( - os.Stdout, &slog.HandlerOptions{Level: logLevel})) + slog.SetDefault(slog.New(slog.NewJSONHandler( + os.Stdout, &slog.HandlerOptions{Level: logLevel}))) if config.Server.EnablePprof { log.Info("starting pprof", "addr", "0.0.0.0", "port", "6060") @@ -74,6 +75,30 @@ func main() { shutdown() } +// LevelFromString returns the appropriate Level from a string name. +// Useful for parsing command line args and configuration files. +// It also converts strings to lowercase. +// Note: copied from op-service/log to avoid monorepo dependency +func LevelFromString(lvlString string) (slog.Level, error) { + lvlString = strings.ToLower(lvlString) // ignore case + switch lvlString { + case "trace", "trce": + return log.LevelTrace, nil + case "debug", "dbug": + return log.LevelDebug, nil + case "info": + return log.LevelInfo, nil + case "warn": + return log.LevelWarn, nil + case "error", "eror": + return log.LevelError, nil + case "crit": + return log.LevelCrit, nil + default: + return log.LevelDebug, fmt.Errorf("unknown level: %v", lvlString) + } +} + func StartPProf(hostname string, port int) *http.Server { mux := http.NewServeMux() diff --git a/proxyd/go.mod b/proxyd/go.mod index e37defca0b07..9bd499bcef7d 100644 --- a/proxyd/go.mod +++ b/proxyd/go.mod @@ -6,7 +6,7 @@ require ( github.com/BurntSushi/toml v1.3.2 github.com/alicebob/miniredis v2.5.0+incompatible github.com/emirpasic/gods v1.18.1 - github.com/ethereum/go-ethereum v1.13.5 + github.com/ethereum/go-ethereum v1.13.8 github.com/go-redsync/redsync/v4 v4.10.0 github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb github.com/gorilla/mux v1.8.0 @@ -19,7 +19,8 @@ require ( github.com/stretchr/testify v1.8.4 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/xaionaro-go/weightedshuffle v0.0.0-20211213010739-6a74fbc7d24a - golang.org/x/sync v0.4.0 + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa + golang.org/x/sync v0.5.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -39,22 +40,23 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect + github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set/v2 v2.3.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect + github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect github.com/getsentry/sentry-go v0.25.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-stack/stack v1.8.1 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/gomodule/redigo v1.8.9 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.3 // indirect + github.com/holiman/uint256 v1.2.4 // indirect github.com/klauspost/compress v1.17.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -75,11 +77,10 @@ require ( github.com/yuin/gopher-lua v1.1.0 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/mod v0.13.0 // indirect + golang.org/x/mod v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.14.0 // indirect + golang.org/x/tools v0.15.0 // indirect google.golang.org/protobuf v1.31.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/proxyd/go.sum b/proxyd/go.sum index e9cac7ef70f2..c93d2323ab26 100644 --- a/proxyd/go.sum +++ b/proxyd/go.sum @@ -42,6 +42,8 @@ github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/Yj github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -60,12 +62,14 @@ github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.5 h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk= -github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= +github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= +github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= +github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/getsentry/sentry-go v0.25.0 h1:q6Eo+hS+yoJlTO3uu/azhQadsD8V+jQn2D8VvX1eOyI= github.com/getsentry/sentry-go v0.25.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -81,8 +85,6 @@ github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F4 github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-redsync/redsync/v4 v4.10.0 h1:hTeAak4C73mNBQSTq6KCKDFaiIlfC+z5yTTl8fCJuBs= github.com/go-redsync/redsync/v4 v4.10.0/go.mod h1:ZfayzutkgeBmEmBlUR3j+rF6kN44UUGtEdfzhBFZTPc= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -120,8 +122,8 @@ github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iP github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -211,12 +213,12 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -224,14 +226,14 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -258,8 +260,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From e7fd9162b84c6e81bf1413c34145dc840680f111 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Thu, 1 Feb 2024 22:54:04 +0100 Subject: [PATCH 09/25] op-ufm: update monorepo dependency to prev commit --- op-ufm/go.mod | 60 +++++----- op-ufm/go.sum | 310 +++++++++++--------------------------------------- 2 files changed, 99 insertions(+), 271 deletions(-) diff --git a/op-ufm/go.mod b/op-ufm/go.mod index a911d50aa744..99ffd301017b 100644 --- a/op-ufm/go.mod +++ b/op-ufm/go.mod @@ -2,17 +2,18 @@ module github.com/ethereum-optimism/optimism/op-ufm go 1.21 -toolchain go1.21.3 +toolchain go1.21.6 require ( cloud.google.com/go/kms v1.12.1 github.com/BurntSushi/toml v1.3.2 - github.com/ethereum-optimism/optimism v1.2.0 - github.com/ethereum/go-ethereum v1.13.5 + github.com/ethereum-optimism/optimism v1.5.0-rc.3.0.20240131131533-152d1e0a458d + github.com/ethereum/go-ethereum v1.13.8 github.com/gorilla/mux v1.8.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.17.0 + github.com/prometheus/client_golang v1.18.0 github.com/rs/cors v1.9.0 + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa ) require ( @@ -23,47 +24,49 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.7.0 // indirect + github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cockroachdb/pebble v0.0.0-20231018212520-f6cde3fc2fa4 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-stack/stack v1.8.1 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/s2a-go v0.1.4 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.3 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/holiman/uint256 v1.2.4 // indirect + github.com/klauspost/compress v1.17.2 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.4.3 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect @@ -72,19 +75,19 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect - github.com/urfave/cli/v2 v2.25.7 // indirect + github.com/urfave/cli/v2 v2.27.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/crypto v0.18.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/term v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.13.0 // indirect + golang.org/x/tools v0.16.1 // indirect google.golang.org/api v0.132.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect @@ -92,5 +95,10 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/grpc v1.56.3 // indirect google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) + +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 + +replace github.com/ethereum-optimism/optimism => ../. diff --git a/op-ufm/go.sum b/op-ufm/go.sum index 95dc0ef62b5e..7a9864821c63 100644 --- a/op-ufm/go.sum +++ b/op-ufm/go.sum @@ -10,36 +10,28 @@ cloud.google.com/go/iam v1.1.0 h1:67gSqaPukx7O8WLLHMa0PNs3EBGd2eE4d+psbO/CO94= cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= cloud.google.com/go/kms v1.12.1 h1:xZmZuwy2cwzsocmKDOPu4BL7umg8QXagQx6fKVmf45U= cloud.google.com/go/kms v1.12.1/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/btcsuite/btcd v0.23.3 h1:4KH/JKy9WiCd+iUS9Mu0Zp7Dnj17TGdKrg9xc/FGj24= +github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= +github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd v0.24.0 h1:gL3uHE/IaFj6fcZSu03SvqPMSx7s/dPzfpG/atRwWdo= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= +github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -54,31 +46,26 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= -github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v0.0.0-20231018212520-f6cde3fc2fa4 h1:PuHFhOUMnD62r80dN+Ik5qco2drekgsUSVdcHsvllec= +github.com/cockroachdb/pebble v0.0.0-20231018212520-f6cde3fc2fa4/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -91,65 +78,41 @@ github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5il github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/ethereum-optimism/optimism v1.2.0 h1:wlVqKHj6+HCMrXRskLM7b45zcdqSHCsVk0Kmg+ViCS8= -github.com/ethereum-optimism/optimism v1.2.0/go.mod h1:y1J1a0BkbJ5MTImx1Ayk2syTXZEoFucRAsBpdzbn0Qk= +github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 h1:ozL8bQyJR9pPsLgOc8b8a4rO9C+sBQg1TuVb+Xh4ZLs= +github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7/go.mod h1:N8CFANZjM+QlTjW3sadEK/hhkLfrZcRYbKJouOL5otg= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee h1:1a7ZvkuPhLJ6uAAsAAfaD7K0wYr45l9eH3TdIMpYl+M= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.5 h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk= -github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ= github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= +github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= +github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -176,7 +139,6 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -184,105 +146,59 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/go-bexpr v0.1.11 h1:6DqdA/KBjurGby9yTY0bmkathya0lfwF2SeuubCI7dY= github.com/hashicorp/go-bexpr v0.1.11/go.mod h1:f03lAo0duBlDIUMGCuad8oLcgejw4m7U+N8T+6Kz1AE= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= @@ -290,22 +206,12 @@ github.com/mitchellh/pointerstructure v1.2.1/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8oh github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -315,62 +221,43 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= -github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -389,175 +276,121 @@ github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+F github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= -github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho= +github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= +golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -569,19 +402,16 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 h1:Au6te5hbKUV8pIYWHqOUZ1pva5qK/rwbIhoXEUB9Lu8= google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130 h1:XVeBY8d/FaK4848myy41HBqnDwvxeV3zMZhwN1TvAMU= google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:mPBs5jNgx2GuQGvFwUvVKqtn6HsUw9nP64BedgvqEsQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -589,7 +419,6 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= @@ -607,16 +436,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -627,9 +449,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From c573ac3b472bfdd1ed4f07786cfc26f31df8cc76 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Thu, 1 Feb 2024 22:59:09 +0100 Subject: [PATCH 10/25] testlog: Return pointer with FindLog --- op-service/testlog/capturing.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/op-service/testlog/capturing.go b/op-service/testlog/capturing.go index 1e93b09df59d..c695e51ce84d 100644 --- a/op-service/testlog/capturing.go +++ b/op-service/testlog/capturing.go @@ -56,13 +56,13 @@ func (c *CapturingHandler) Clear() { *c.Logs = (*c.Logs)[:0] // reuse slice } -func (c *CapturingHandler) FindLog(lvl slog.Level, msg string) HelperRecord { +func (c *CapturingHandler) FindLog(lvl slog.Level, msg string) *HelperRecord { for _, record := range *c.Logs { if record.Level == lvl && record.Message == msg { - return HelperRecord{record} + return &HelperRecord{record} } } - return HelperRecord{} + return nil } func (c *CapturingHandler) FindLogContaining(msg string) (*HelperRecord, bool) { From 9f4acb63183c97ded35538f96b5c1fe74645bdf4 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Thu, 1 Feb 2024 23:49:40 +0100 Subject: [PATCH 11/25] genesis: Parse addresses from dump string keys in BuildL1DeveloperGenesis --- op-chain-ops/genesis/layer_one.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/op-chain-ops/genesis/layer_one.go b/op-chain-ops/genesis/layer_one.go index f4a3cd825461..fd277802fbc2 100644 --- a/op-chain-ops/genesis/layer_one.go +++ b/op-chain-ops/genesis/layer_one.go @@ -57,15 +57,16 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme SetPrecompileBalances(memDB) if dump != nil { - for _, account := range dump.Accounts { - // TODO(Seb) confirm this is what we want here - // Changes in https://github.com/ethereum/go-ethereum/pull/28504 - // now also add accounts to the Dump with "pre()" as key - // if the address itself is nil. - if account.Address == nil { + for addrstr, account := range dump.Accounts { + if !common.IsHexAddress(addrstr) { + // TODO(Seb) confirm this is what we want here + // Changes in https://github.com/ethereum/go-ethereum/pull/28504 + // now also add accounts to the Dump with "pre()" as key + // if the address itself is nil. + // So this might be a pre-image key, in which case we skip. continue } - address := *account.Address + address := common.HexToAddress(addrstr) name := "" if l1Deployments != nil { if n := l1Deployments.GetName(address); n != "" { From 9e0aed20bc3a70d4acb20546061ca5a0cd8ad6d4 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Thu, 1 Feb 2024 23:57:37 +0100 Subject: [PATCH 12/25] op-ufm: go mod tidy --- op-ufm/go.mod | 2 +- op-ufm/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/op-ufm/go.mod b/op-ufm/go.mod index 99ffd301017b..625e5404b5bd 100644 --- a/op-ufm/go.mod +++ b/op-ufm/go.mod @@ -39,7 +39,7 @@ require ( github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee // indirect + github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140 // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect diff --git a/op-ufm/go.sum b/op-ufm/go.sum index 7a9864821c63..56ab3cc46474 100644 --- a/op-ufm/go.sum +++ b/op-ufm/go.sum @@ -86,8 +86,8 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 h1:ozL8bQyJR9pPsLgOc8b8a4rO9C+sBQg1TuVb+Xh4ZLs= github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7/go.mod h1:N8CFANZjM+QlTjW3sadEK/hhkLfrZcRYbKJouOL5otg= -github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee h1:1a7ZvkuPhLJ6uAAsAAfaD7K0wYr45l9eH3TdIMpYl+M= -github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240129235549-0a582d7654ee/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140 h1:F2Q+Gj4+W67CKZpVR+MEDL+EiIpgbx6VtwtdsPR4mbQ= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ= From 1390c59985051815c27ea602850bb17b5a2a72ac Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Fri, 2 Feb 2024 00:13:19 +0100 Subject: [PATCH 13/25] update to latest op-geth --- go.mod | 2 +- go.sum | 4 ++-- op-ufm/go.mod | 2 +- op-ufm/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 90022636d28b..e6355b0fced5 100644 --- a/go.mod +++ b/go.mod @@ -218,7 +218,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1 //replace github.com/ethereum-optimism/superchain-registry/superchain => ../superchain-registry/superchain //replace github.com/ethereum/go-ethereum v1.13.5 => ../go-ethereum diff --git a/go.sum b/go.sum index 7a018a18de81..fca84bf1077a 100644 --- a/go.sum +++ b/go.sum @@ -170,8 +170,8 @@ github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/ github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 h1:ozL8bQyJR9pPsLgOc8b8a4rO9C+sBQg1TuVb+Xh4ZLs= -github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7/go.mod h1:N8CFANZjM+QlTjW3sadEK/hhkLfrZcRYbKJouOL5otg= +github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1 h1:gHm/dEh/WQSG7LmtP/urCmPsaM+YSfS2ZCXRvTWD1os= +github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1/go.mod h1:ztegoX+28Fc+7JbR3AEukmpWYyg5psoxF3Ax+BTkYi0= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140 h1:F2Q+Gj4+W67CKZpVR+MEDL+EiIpgbx6VtwtdsPR4mbQ= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= diff --git a/op-ufm/go.mod b/op-ufm/go.mod index 625e5404b5bd..28e8cd0952ea 100644 --- a/op-ufm/go.mod +++ b/op-ufm/go.mod @@ -99,6 +99,6 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1 replace github.com/ethereum-optimism/optimism => ../. diff --git a/op-ufm/go.sum b/op-ufm/go.sum index 56ab3cc46474..af518ef3c285 100644 --- a/op-ufm/go.sum +++ b/op-ufm/go.sum @@ -84,8 +84,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7 h1:ozL8bQyJR9pPsLgOc8b8a4rO9C+sBQg1TuVb+Xh4ZLs= -github.com/ethereum-optimism/op-geth v1.101305.3-rc.4.0.20240130212401-74b44a0658b7/go.mod h1:N8CFANZjM+QlTjW3sadEK/hhkLfrZcRYbKJouOL5otg= +github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1 h1:gHm/dEh/WQSG7LmtP/urCmPsaM+YSfS2ZCXRvTWD1os= +github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1/go.mod h1:ztegoX+28Fc+7JbR3AEukmpWYyg5psoxF3Ax+BTkYi0= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140 h1:F2Q+Gj4+W67CKZpVR+MEDL+EiIpgbx6VtwtdsPR4mbQ= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= From 7641c2d5b41fd0b820aacb5e3cc25e42c6b87780 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Fri, 2 Feb 2024 22:30:28 +0100 Subject: [PATCH 14/25] genesis: Update ForgeDump.UnmarshalJSON to latest geth types --- op-chain-ops/genesis/config.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/op-chain-ops/genesis/config.go b/op-chain-ops/genesis/config.go index 86032a9e27f6..f27f192baa75 100644 --- a/op-chain-ops/genesis/config.go +++ b/op-chain-ops/genesis/config.go @@ -766,17 +766,17 @@ func (d *ForgeDump) UnmarshalJSON(b []byte) error { } d.Root = dump.Root - d.Accounts = make(map[common.Address]gstate.DumpAccount) + d.Accounts = make(map[string]gstate.DumpAccount) for addr, acc := range dump.Accounts { - d.Accounts[addr] = gstate.DumpAccount{ - Balance: acc.Balance, - Nonce: (uint64)(acc.Nonce), - Root: acc.Root, - CodeHash: acc.CodeHash, - Code: acc.Code, - Storage: acc.Storage, - Address: acc.Address, - SecureKey: acc.SecureKey, + d.Accounts[addr.String()] = gstate.DumpAccount{ + Balance: acc.Balance, + Nonce: (uint64)(acc.Nonce), + Root: acc.Root, + CodeHash: acc.CodeHash, + Code: acc.Code, + Storage: acc.Storage, + Address: acc.Address, + AddressHash: acc.SecureKey, } } return nil From 830ff301e264f0fbb3bd30a1310219ebd5ce7501 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Sat, 3 Feb 2024 21:46:58 +0100 Subject: [PATCH 15/25] eth: Use hexutils.U256 instead of uint256.Int as type in ExecutionPayload This fixes JSON mashaling. --- op-node/rollup/derive/engine_queue_test.go | 4 ++-- op-program/client/l2/engineapi/l2_engine_api.go | 8 +++----- op-service/eth/ssz_test.go | 9 ++++----- op-service/eth/types.go | 6 +++--- op-service/sources/types.go | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/op-node/rollup/derive/engine_queue_test.go b/op-node/rollup/derive/engine_queue_test.go index a83838f54100..51278e670093 100644 --- a/op-node/rollup/derive/engine_queue_test.go +++ b/op-node/rollup/derive/engine_queue_test.go @@ -975,7 +975,7 @@ func TestBlockBuildingRace(t *testing.T) { GasUsed: 0, Timestamp: eth.Uint64Quantity(refA1.Time), ExtraData: nil, - BaseFeePerGas: *uint256.NewInt(7), + BaseFeePerGas: eth.Uint256Quantity(*uint256.NewInt(7)), BlockHash: refA1.Hash, Transactions: []eth.Data{ a1InfoTx, @@ -1184,7 +1184,7 @@ func TestEngineQueue_StepPopOlderUnsafe(t *testing.T) { GasUsed: 0, Timestamp: eth.Uint64Quantity(refA1.Time), ExtraData: nil, - BaseFeePerGas: *uint256.NewInt(7), + BaseFeePerGas: eth.Uint256Quantity(*uint256.NewInt(7)), BlockHash: refA1.Hash, Transactions: []eth.Data{}, }} diff --git a/op-program/client/l2/engineapi/l2_engine_api.go b/op-program/client/l2/engineapi/l2_engine_api.go index 184494a84b8f..76e15b195f34 100644 --- a/op-program/client/l2/engineapi/l2_engine_api.go +++ b/op-program/client/l2/engineapi/l2_engine_api.go @@ -19,6 +19,7 @@ import ( "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" + "github.com/holiman/uint256" ) type EngineBackend interface { @@ -113,9 +114,7 @@ func (ea *L2EngineAPI) PendingIndices(from common.Address) uint64 { return ea.pendingIndices[from] } -var ( - ErrNotBuildingBlock = errors.New("not currently building a block, cannot include tx from queue") -) +var ErrNotBuildingBlock = errors.New("not currently building a block, cannot include tx from queue") func (ea *L2EngineAPI) IncludeTx(tx *types.Transaction, from common.Address) error { if ea.blockProcessor == nil { @@ -462,14 +461,13 @@ func (ea *L2EngineAPI) newPayload(ctx context.Context, payload *eth.ExecutionPay GasUsed: uint64(payload.GasUsed), Timestamp: uint64(payload.Timestamp), ExtraData: payload.ExtraData, - BaseFeePerGas: payload.BaseFeePerGas.ToBig(), + BaseFeePerGas: (*uint256.Int)(&payload.BaseFeePerGas).ToBig(), BlockHash: payload.BlockHash, Transactions: txs, Withdrawals: toGethWithdrawals(payload), ExcessBlobGas: (*uint64)(payload.ExcessBlobGas), BlobGasUsed: (*uint64)(payload.BlobGasUsed), }, hashes, root) - if err != nil { log.Debug("Invalid NewPayload params", "params", payload, "error", err) return ð.PayloadStatusV1{Status: eth.ExecutionInvalidBlockHash}, nil diff --git a/op-service/eth/ssz_test.go b/op-service/eth/ssz_test.go index c9f22976408a..fdaded1c19e6 100644 --- a/op-service/eth/ssz_test.go +++ b/op-service/eth/ssz_test.go @@ -67,7 +67,7 @@ func FuzzExecutionPayloadMarshalUnmarshalV1(f *testing.F) { extraData = extraData[:32] } payload.ExtraData = extraData - payload.BaseFeePerGas.SetBytes(data[:32]) + (*uint256.Int)(&payload.BaseFeePerGas).SetBytes(data[:32]) payload.BlockHash = *(*common.Hash)(data[:32]) payload.Transactions = make([]Data, txs) for i := 0; i < int(txs); i++ { @@ -124,7 +124,7 @@ func FuzzExecutionPayloadMarshalUnmarshalV2(f *testing.F) { extraData = extraData[:32] } payload.ExtraData = extraData - payload.BaseFeePerGas.SetBytes(data[:32]) + (*uint256.Int)(&payload.BaseFeePerGas).SetBytes(data[:32]) payload.BlockHash = *(*common.Hash)(data[:32]) payload.Transactions = make([]Data, txs) for i := 0; i < int(txs); i++ { @@ -196,7 +196,7 @@ func FuzzExecutionPayloadMarshalUnmarshalV3(f *testing.F) { extraData = extraData[:32] } payload.ExtraData = extraData - payload.BaseFeePerGas.SetBytes(data[:32]) + (*uint256.Int)(&payload.BaseFeePerGas).SetBytes(data[:32]) payload.BlockHash = *(*common.Hash)(data[:32]) payload.Transactions = make([]Data, txs) for i := 0; i < int(txs); i++ { @@ -319,7 +319,6 @@ func TestOPB04(t *testing.T) { require.Error(t, err) require.Equal(t, ErrExtraDataTooLarge, err) } - } func createPayloadWithWithdrawals(w *types.Withdrawals) *ExecutionPayload { @@ -335,7 +334,7 @@ func createPayloadWithWithdrawals(w *types.Withdrawals) *ExecutionPayload { GasUsed: Uint64Quantity(444), Timestamp: Uint64Quantity(555), ExtraData: common.FromHex("6666"), - BaseFeePerGas: *uint256.NewInt(777), + BaseFeePerGas: Uint256Quantity(*uint256.NewInt(777)), BlockHash: common.HexToHash("0x888"), Withdrawals: w, Transactions: []Data{common.FromHex("9999")}, diff --git a/op-service/eth/types.go b/op-service/eth/types.go index bb7e4c6cdd14..f7e69ddac8d2 100644 --- a/op-service/eth/types.go +++ b/op-service/eth/types.go @@ -148,7 +148,7 @@ func (b BytesMax32) String() string { return hexutil.Encode(b) } -type Uint256Quantity = uint256.Int +type Uint256Quantity = hexutil.U256 type Data = hexutil.Bytes @@ -230,7 +230,7 @@ func (envelope *ExecutionPayloadEnvelope) CheckBlockHash() (actual common.Hash, Extra: payload.ExtraData, MixDigest: common.Hash(payload.PrevRandao), Nonce: types.BlockNonce{}, // zeroed, proof-of-work legacy - BaseFee: payload.BaseFeePerGas.ToBig(), + BaseFee: (*uint256.Int)(&payload.BaseFeePerGas).ToBig(), ParentBeaconRoot: envelope.ParentBeaconBlockRoot, } @@ -269,7 +269,7 @@ func BlockAsPayload(bl *types.Block, canyonForkTime *uint64) (*ExecutionPayload, GasUsed: Uint64Quantity(bl.GasUsed()), Timestamp: Uint64Quantity(bl.Time()), ExtraData: bl.Extra(), - BaseFeePerGas: *baseFee, + BaseFeePerGas: Uint256Quantity(*baseFee), BlockHash: bl.Hash(), Transactions: opaqueTxs, ExcessBlobGas: (*Uint64Quantity)(bl.ExcessBlobGas()), diff --git a/op-service/sources/types.go b/op-service/sources/types.go index 97f121fa4e4c..afb994bd7cc3 100644 --- a/op-service/sources/types.go +++ b/op-service/sources/types.go @@ -303,7 +303,7 @@ func (block *RPCBlock) ExecutionPayloadEnvelope(trustCache bool) (*eth.Execution GasUsed: block.GasUsed, Timestamp: block.Time, ExtraData: eth.BytesMax32(block.Extra), - BaseFeePerGas: baseFee, + BaseFeePerGas: eth.Uint256Quantity(baseFee), BlockHash: block.Hash, Transactions: opaqueTxs, Withdrawals: block.Withdrawals, From 9b2e3e545fde1933656f7e052d90525e51cec39e Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Sun, 4 Feb 2024 19:24:07 +0100 Subject: [PATCH 16/25] op-e2e: fix usage of legacy geth levels --- op-e2e/config/init.go | 15 +++++++++++++-- op-e2e/external_geth/main_test.go | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/op-e2e/config/init.go b/op-e2e/config/init.go index b5b8581850ae..de01c689a0e9 100644 --- a/op-e2e/config/init.go +++ b/op-e2e/config/init.go @@ -21,6 +21,17 @@ import ( oplog "github.com/ethereum-optimism/optimism/op-service/log" ) +// legacy geth log levels - the geth command line --verbosity flag wasn't +// migrated to use slog's numerical levels. +const ( + LegacyLevelCrit = iota + LegacyLevelError + LegacyLevelWarn + LegacyLevelInfo + LegacyLevelDebug + LegacyLevelTrace +) + var ( // All of the following variables are set in the init function // and read from JSON files on disk that are generated by the @@ -40,7 +51,7 @@ var ( // ExternalL2TestParms is additional metadata for executing external L2 // tests. ExternalL2TestParms external.TestParms - // EthNodeVerbosity is the level of verbosity to output + // EthNodeVerbosity is the (legacy geth) level of verbosity to output EthNodeVerbosity int ) @@ -64,7 +75,7 @@ func init() { flag.StringVar(&l1DeploymentsPath, "l1-deployments", defaultL1DeploymentsPath, "") flag.StringVar(&deployConfigPath, "deploy-config", defaultDeployConfigPath, "") flag.StringVar(&externalL2, "externalL2", "", "Enable tests with external L2") - flag.IntVar(&EthNodeVerbosity, "ethLogVerbosity", int(log.LevelInfo), "The level of verbosity to use for the eth node logs") + flag.IntVar(&EthNodeVerbosity, "ethLogVerbosity", LegacyLevelInfo, "The (legacy geth) level of verbosity to use for the eth node logs") testing.Init() // Register test flags before parsing flag.Parse() diff --git a/op-e2e/external_geth/main_test.go b/op-e2e/external_geth/main_test.go index b1f09b580672..85f4218f90b1 100644 --- a/op-e2e/external_geth/main_test.go +++ b/op-e2e/external_geth/main_test.go @@ -33,7 +33,7 @@ func TestShim(t *testing.T) { require.NoError(t, err) require.FileExists(t, "op-geth") - config.EthNodeVerbosity = 4 + config.EthNodeVerbosity = config.LegacyLevelDebug ec := (&e2e.ExternalRunner{ Name: "TestShim", From 305dcca8a47242e365b13421f875270d791e6a74 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Sun, 4 Feb 2024 19:53:15 +0100 Subject: [PATCH 17/25] go: update latest op-geth dependency --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e6355b0fced5..1b5a81ee54dd 100644 --- a/go.mod +++ b/go.mod @@ -218,7 +218,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1 +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.4-0.20240204185102-a814f9a2865a //replace github.com/ethereum-optimism/superchain-registry/superchain => ../superchain-registry/superchain //replace github.com/ethereum/go-ethereum v1.13.5 => ../go-ethereum diff --git a/go.sum b/go.sum index fca84bf1077a..a911d24538ea 100644 --- a/go.sum +++ b/go.sum @@ -170,8 +170,8 @@ github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/ github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1 h1:gHm/dEh/WQSG7LmtP/urCmPsaM+YSfS2ZCXRvTWD1os= -github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1/go.mod h1:ztegoX+28Fc+7JbR3AEukmpWYyg5psoxF3Ax+BTkYi0= +github.com/ethereum-optimism/op-geth v1.101305.4-0.20240204185102-a814f9a2865a h1:8UWxxfXwxtvSiqHqCc1jyJeRlyB8OXR1e2eyI3rQfsg= +github.com/ethereum-optimism/op-geth v1.101305.4-0.20240204185102-a814f9a2865a/go.mod h1:ztegoX+28Fc+7JbR3AEukmpWYyg5psoxF3Ax+BTkYi0= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140 h1:F2Q+Gj4+W67CKZpVR+MEDL+EiIpgbx6VtwtdsPR4mbQ= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= From 3f406b2eb7236fefb1c1abcbc05ac3d14ba31b32 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Sun, 4 Feb 2024 19:57:14 +0100 Subject: [PATCH 18/25] check-ecotone: adapt to field type change --- op-chain-ops/cmd/check-ecotone/main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/op-chain-ops/cmd/check-ecotone/main.go b/op-chain-ops/cmd/check-ecotone/main.go index 1b88bb13be2d..447ae30a365d 100644 --- a/op-chain-ops/cmd/check-ecotone/main.go +++ b/op-chain-ops/cmd/check-ecotone/main.go @@ -335,8 +335,10 @@ func execTx(ctx context.Context, to *common.Address, data []byte, expectRevert b if err != nil { return fmt.Errorf("failed to get chainID: %w", err) } - tx := types.NewTx(&types.DynamicFeeTx{ChainID: chainID, Nonce: nonce, - GasTipCap: tip, GasFeeCap: maxFee, Gas: 500000, To: to, Data: data}) + tx := types.NewTx(&types.DynamicFeeTx{ + ChainID: chainID, Nonce: nonce, + GasTipCap: tip, GasFeeCap: maxFee, Gas: 500000, To: to, Data: data, + }) signer := types.NewCancunSigner(chainID) signedTx, err := types.SignTx(tx, signer, env.key) if err != nil { @@ -657,8 +659,9 @@ func checkL1Fees(ctx context.Context, env *actionEnv) error { return fmt.Errorf("failed to retrieve matching L1 block %s: %w", headRef, err) } gasTip := big.NewInt(2 * params.GWei) + baseFee := (*uint256.Int)(&payload.ExecutionPayload.BaseFeePerGas).ToBig() gasMaxFee := new(big.Int).Add( - new(big.Int).Mul(big.NewInt(2), payload.ExecutionPayload.BaseFeePerGas.ToBig()), gasTip) + new(big.Int).Mul(big.NewInt(2), baseFee), gasTip) to := common.Address{1, 2, 3, 5} txData := &types.DynamicFeeTx{ ChainID: rollupCfg.L2ChainID, From b9651ee5e78d135f21a41a6a4b91a21330203510 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Sun, 4 Feb 2024 20:29:25 +0100 Subject: [PATCH 19/25] Resolve remaining TODOs --- op-chain-ops/genesis/config.go | 18 +++++++++--------- op-chain-ops/genesis/layer_one.go | 10 +++++----- op-program/client/l2/engine.go | 1 - op-service/log/cli.go | 17 ++++++----------- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/op-chain-ops/genesis/config.go b/op-chain-ops/genesis/config.go index f27f192baa75..761a983063b4 100644 --- a/op-chain-ops/genesis/config.go +++ b/op-chain-ops/genesis/config.go @@ -747,14 +747,14 @@ type ForgeDump gstate.Dump func (d *ForgeDump) UnmarshalJSON(b []byte) error { type forgeDumpAccount struct { - Balance string `json:"balance"` - Nonce hexutil.Uint64 `json:"nonce"` - Root hexutil.Bytes `json:"root"` - CodeHash hexutil.Bytes `json:"codeHash"` - Code hexutil.Bytes `json:"code,omitempty"` - Storage map[common.Hash]string `json:"storage,omitempty"` - Address *common.Address `json:"address,omitempty"` - SecureKey hexutil.Bytes `json:"key,omitempty"` + Balance string `json:"balance"` + Nonce hexutil.Uint64 `json:"nonce"` + Root hexutil.Bytes `json:"root"` + CodeHash hexutil.Bytes `json:"codeHash"` + Code hexutil.Bytes `json:"code,omitempty"` + Storage map[common.Hash]string `json:"storage,omitempty"` + Address *common.Address `json:"address,omitempty"` + AddressHash hexutil.Bytes `json:"key,omitempty"` } type forgeDump struct { Root string `json:"root"` @@ -776,7 +776,7 @@ func (d *ForgeDump) UnmarshalJSON(b []byte) error { Code: acc.Code, Storage: acc.Storage, Address: acc.Address, - AddressHash: acc.SecureKey, + AddressHash: acc.AddressHash, } } return nil diff --git a/op-chain-ops/genesis/layer_one.go b/op-chain-ops/genesis/layer_one.go index c43ad86aa87a..f697fdbc0a4d 100644 --- a/op-chain-ops/genesis/layer_one.go +++ b/op-chain-ops/genesis/layer_one.go @@ -58,11 +58,11 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme if dump != nil { for addrstr, account := range dump.Accounts { if !common.IsHexAddress(addrstr) { - // TODO(Seb) confirm this is what we want here - // Changes in https://github.com/ethereum/go-ethereum/pull/28504 - // now also add accounts to the Dump with "pre()" as key - // if the address itself is nil. - // So this might be a pre-image key, in which case we skip. + // Changes in https://github.com/ethereum/go-ethereum/pull/28504 + // add accounts to the Dump with "pre()" as key + // if the address itself is nil. + // So depending on how `dump` was created, this might be a + // pre-image key, which we skip. continue } address := common.HexToAddress(addrstr) diff --git a/op-program/client/l2/engine.go b/op-program/client/l2/engine.go index c8cbe13a8eec..40ab10654e34 100644 --- a/op-program/client/l2/engine.go +++ b/op-program/client/l2/engine.go @@ -41,7 +41,6 @@ func (o *OracleEngine) L2OutputRoot(l2ClaimBlockNum uint64) (eth.Bytes32, error) if err != nil { return eth.Bytes32{}, fmt.Errorf("failed to open L2 state db at block %s: %w", outBlock.Hash(), err) } - // TODO(Seb) confirm withdrawalsTrie, err := stateDB.OpenStorageTrie(predeploys.L2ToL1MessagePasserAddr) if err != nil { return eth.Bytes32{}, fmt.Errorf("withdrawals trie unavailable at block %v: %w", outBlock.Hash(), err) diff --git a/op-service/log/cli.go b/op-service/log/cli.go index 68157b403efb..8570f7a0b060 100644 --- a/op-service/log/cli.go +++ b/op-service/log/cli.go @@ -104,15 +104,14 @@ func LevelFromString(lvlString string) (slog.Level, error) { var _ cliapp.CloneableGeneric = (*LevelFlagValue)(nil) // FormatType defines a type of log format. -// Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty' +// Supported formats: 'text', 'terminal', 'logfmt', 'json' type FormatType string const ( - FormatText FormatType = "text" - FormatTerminal FormatType = "terminal" - FormatLogFmt FormatType = "logfmt" - FormatJSON FormatType = "json" - FormatJSONPretty FormatType = "json-pretty" + FormatText FormatType = "text" + FormatTerminal FormatType = "terminal" + FormatLogFmt FormatType = "logfmt" + FormatJSON FormatType = "json" ) // FormatHandler returns the correct slog handler factory for the provided format. @@ -123,10 +122,6 @@ func FormatHandler(ft FormatType, color bool) func(io.Writer) slog.Handler { switch ft { case FormatJSON: return log.JSONHandler - case FormatJSONPretty: - // TODO(Seb): Neither slog nor geth/log seem to provide separate (non)pretty JSON loggers. - // So just reusing the same in both cases for backwards compatibility. - return log.JSONHandler case FormatText: if term.IsTerminal(int(os.Stdout.Fd())) { return termColorHandler @@ -155,7 +150,7 @@ func NewFormatFlagValue(fmtType FormatType) *FormatFlagValue { func (fv *FormatFlagValue) Set(value string) error { switch FormatType(value) { - case FormatText, FormatTerminal, FormatLogFmt, FormatJSON, FormatJSONPretty: + case FormatText, FormatTerminal, FormatLogFmt, FormatJSON: *fv = FormatFlagValue(value) return nil default: From 2232db1740341fbfa901c9d3a46d8422386d7896 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Sun, 4 Feb 2024 20:58:05 +0100 Subject: [PATCH 20/25] op-program: remove json-pretty formatting option from test --- op-program/host/cmd/main_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/op-program/host/cmd/main_test.go b/op-program/host/cmd/main_test.go index 38cf29e6a4b6..928158c7cd01 100644 --- a/op-program/host/cmd/main_test.go +++ b/op-program/host/cmd/main_test.go @@ -9,7 +9,9 @@ import ( "github.com/ethereum-optimism/optimism/op-node/chaincfg" "github.com/ethereum-optimism/optimism/op-program/chainconfig" "github.com/ethereum-optimism/optimism/op-program/host/config" + oplog "github.com/ethereum-optimism/optimism/op-service/log" "github.com/ethereum-optimism/optimism/op-service/sources" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/log" @@ -48,7 +50,12 @@ func TestLogFormat(t *testing.T) { verifyArgsInvalid(t, `unrecognized log-format: "foo"`, addRequiredArgs("--log.format=foo")) }) - for _, lvl := range []string{"json", "json-pretty", "terminal", "text", "logfmt"} { + for _, lvl := range []string{ + oplog.FormatJSON.String(), + oplog.FormatTerminal.String(), + oplog.FormatText.String(), + oplog.FormatLogFmt.String(), + } { lvl := lvl t.Run("AcceptValid_"+lvl, func(t *testing.T) { logger, _, err := runWithArgs(addRequiredArgs("--log.format", lvl)) From f935883faf7a1fd913a285e1b08107cd2af3e511 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Mon, 5 Feb 2024 23:49:00 +0100 Subject: [PATCH 21/25] go: update to latest op-geth v1.101308.0-rc.1 --- go.mod | 2 +- go.sum | 4 ++-- op-ufm/go.mod | 2 +- op-ufm/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1b5a81ee54dd..6f70e8b7fb02 100644 --- a/go.mod +++ b/go.mod @@ -218,7 +218,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.4-0.20240204185102-a814f9a2865a +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101308.0-rc.1 //replace github.com/ethereum-optimism/superchain-registry/superchain => ../superchain-registry/superchain //replace github.com/ethereum/go-ethereum v1.13.5 => ../go-ethereum diff --git a/go.sum b/go.sum index a911d24538ea..f7807d044da7 100644 --- a/go.sum +++ b/go.sum @@ -170,8 +170,8 @@ github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/ github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101305.4-0.20240204185102-a814f9a2865a h1:8UWxxfXwxtvSiqHqCc1jyJeRlyB8OXR1e2eyI3rQfsg= -github.com/ethereum-optimism/op-geth v1.101305.4-0.20240204185102-a814f9a2865a/go.mod h1:ztegoX+28Fc+7JbR3AEukmpWYyg5psoxF3Ax+BTkYi0= +github.com/ethereum-optimism/op-geth v1.101308.0-rc.1 h1:cRlgrl7EQ2eh5IyKXgb4QglTJC5iphi/JC9MuWQzNTo= +github.com/ethereum-optimism/op-geth v1.101308.0-rc.1/go.mod h1:ztegoX+28Fc+7JbR3AEukmpWYyg5psoxF3Ax+BTkYi0= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140 h1:F2Q+Gj4+W67CKZpVR+MEDL+EiIpgbx6VtwtdsPR4mbQ= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= diff --git a/op-ufm/go.mod b/op-ufm/go.mod index 28e8cd0952ea..03a7c34c54c9 100644 --- a/op-ufm/go.mod +++ b/op-ufm/go.mod @@ -99,6 +99,6 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1 +replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101308.0-rc.1 replace github.com/ethereum-optimism/optimism => ../. diff --git a/op-ufm/go.sum b/op-ufm/go.sum index af518ef3c285..0dea5ae2141e 100644 --- a/op-ufm/go.sum +++ b/op-ufm/go.sum @@ -84,8 +84,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1 h1:gHm/dEh/WQSG7LmtP/urCmPsaM+YSfS2ZCXRvTWD1os= -github.com/ethereum-optimism/op-geth v1.101305.4-0.20240201230840-425e757c51a1/go.mod h1:ztegoX+28Fc+7JbR3AEukmpWYyg5psoxF3Ax+BTkYi0= +github.com/ethereum-optimism/op-geth v1.101308.0-rc.1 h1:cRlgrl7EQ2eh5IyKXgb4QglTJC5iphi/JC9MuWQzNTo= +github.com/ethereum-optimism/op-geth v1.101308.0-rc.1/go.mod h1:ztegoX+28Fc+7JbR3AEukmpWYyg5psoxF3Ax+BTkYi0= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140 h1:F2Q+Gj4+W67CKZpVR+MEDL+EiIpgbx6VtwtdsPR4mbQ= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240131175747-1300b1825140/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= From 37e2678bc3c7922bab7805dacb4bce0177be6a53 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Mon, 5 Feb 2024 23:51:35 +0100 Subject: [PATCH 22/25] op-dispute-mon: Fix logger setup --- op-dispute-mon/cmd/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-dispute-mon/cmd/main.go b/op-dispute-mon/cmd/main.go index e1208df5ba60..4b2c1f46bd17 100644 --- a/op-dispute-mon/cmd/main.go +++ b/op-dispute-mon/cmd/main.go @@ -64,6 +64,6 @@ func run(ctx context.Context, args []string, action ConfiguredLifecycle) error { func setupLogging(ctx *cli.Context) (log.Logger, error) { logCfg := oplog.ReadCLIConfig(ctx) logger := oplog.NewLogger(oplog.AppOut(ctx), logCfg) - oplog.SetGlobalLogHandler(logger.GetHandler()) + oplog.SetGlobalLogHandler(logger.Handler()) return logger, nil } From b30bab60fa34e72d66b7d91ba61d4dfa83478995 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Tue, 6 Feb 2024 00:08:45 +0100 Subject: [PATCH 23/25] log: improve LevelFromString docs --- op-service/log/cli.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/op-service/log/cli.go b/op-service/log/cli.go index 8570f7a0b060..084e02710887 100644 --- a/op-service/log/cli.go +++ b/op-service/log/cli.go @@ -81,6 +81,8 @@ func (fv *LevelFlagValue) Clone() any { // LevelFromString returns the appropriate Level from a string name. // Useful for parsing command line args and configuration files. // It also converts strings to lowercase. +// If the string is unknown, LevelDebug is returned as a default, together with +// a non-nil error. func LevelFromString(lvlString string) (slog.Level, error) { lvlString = strings.ToLower(lvlString) // ignore case switch lvlString { From 55d1e889c48e8e1cd649ab06c939ba9a391912a2 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Tue, 6 Feb 2024 19:55:30 +0100 Subject: [PATCH 24/25] op-e2e/config: treat EthNodeVerbosity as legacy log level --- op-e2e/config/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-e2e/config/init.go b/op-e2e/config/init.go index de01c689a0e9..dd68e28c2d8f 100644 --- a/op-e2e/config/init.go +++ b/op-e2e/config/init.go @@ -80,7 +80,7 @@ func init() { flag.Parse() // Setup global logger - lvl := slog.Level(EthNodeVerbosity) + lvl := log.FromLegacyLevel(EthNodeVerbosity) var handler slog.Handler if lvl > log.LevelCrit { handler = log.DiscardHandler() From a38ad8ecf2cb45ee8c5f3a41fa51e9aa30a409a0 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Tue, 6 Feb 2024 20:14:56 +0100 Subject: [PATCH 25/25] all: fix order of imports --- cannon/cmd/log.go | 3 ++- op-e2e/config/init.go | 3 ++- op-service/log/writer.go | 3 ++- op-service/log/writer_test.go | 8 +++++--- op-service/sources/rollupclient.go | 3 ++- op-service/testlog/capturing.go | 4 ++-- op-service/testlog/testlog.go | 3 ++- op-ufm/cmd/ufm/main.go | 7 ++++--- proxyd/cmd/proxyd/main.go | 7 ++++--- proxyd/integration_tests/util_test.go | 7 ++++--- 10 files changed, 29 insertions(+), 19 deletions(-) diff --git a/cannon/cmd/log.go b/cannon/cmd/log.go index 419d5b837a66..04e168b9ecfb 100644 --- a/cannon/cmd/log.go +++ b/cannon/cmd/log.go @@ -3,8 +3,9 @@ package cmd import ( "io" - "github.com/ethereum/go-ethereum/log" "golang.org/x/exp/slog" + + "github.com/ethereum/go-ethereum/log" ) func Logger(w io.Writer, lvl slog.Level) log.Logger { diff --git a/op-e2e/config/init.go b/op-e2e/config/init.go index dd68e28c2d8f..e2098904ff9e 100644 --- a/op-e2e/config/init.go +++ b/op-e2e/config/init.go @@ -10,10 +10,11 @@ import ( "testing" "time" + "golang.org/x/exp/slog" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/log" - "golang.org/x/exp/slog" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-e2e/external" diff --git a/op-service/log/writer.go b/op-service/log/writer.go index aaf7fffbeaac..0a1731383068 100644 --- a/op-service/log/writer.go +++ b/op-service/log/writer.go @@ -3,8 +3,9 @@ package log import ( "sync" - "github.com/ethereum/go-ethereum/log" "golang.org/x/exp/slog" + + "github.com/ethereum/go-ethereum/log" ) type Writer struct { diff --git a/op-service/log/writer_test.go b/op-service/log/writer_test.go index df04cdf03223..105be28b8c58 100644 --- a/op-service/log/writer_test.go +++ b/op-service/log/writer_test.go @@ -4,11 +4,13 @@ import ( "io" "testing" - . "github.com/ethereum-optimism/optimism/op-service/log" - "github.com/ethereum-optimism/optimism/op-service/testlog" - "github.com/ethereum/go-ethereum/log" "github.com/stretchr/testify/require" "golang.org/x/exp/slog" + + "github.com/ethereum/go-ethereum/log" + + . "github.com/ethereum-optimism/optimism/op-service/log" + "github.com/ethereum-optimism/optimism/op-service/testlog" ) var _ io.Writer = (*Writer)(nil) diff --git a/op-service/sources/rollupclient.go b/op-service/sources/rollupclient.go index 36bbf4babac1..dd72f1a348b3 100644 --- a/op-service/sources/rollupclient.go +++ b/op-service/sources/rollupclient.go @@ -3,9 +3,10 @@ package sources import ( "context" + "golang.org/x/exp/slog" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "golang.org/x/exp/slog" "github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-service/client" diff --git a/op-service/testlog/capturing.go b/op-service/testlog/capturing.go index c695e51ce84d..b468360ca6a7 100644 --- a/op-service/testlog/capturing.go +++ b/op-service/testlog/capturing.go @@ -4,9 +4,9 @@ import ( "context" "strings" - "github.com/ethereum/go-ethereum/log" - "golang.org/x/exp/slog" + + "github.com/ethereum/go-ethereum/log" ) // CapturingHandler provides a log handler that captures all log records and optionally forwards them to a delegate. diff --git a/op-service/testlog/testlog.go b/op-service/testlog/testlog.go index 17e7f5e4b2dd..0ff544225599 100644 --- a/op-service/testlog/testlog.go +++ b/op-service/testlog/testlog.go @@ -27,8 +27,9 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/log" "golang.org/x/exp/slog" + + "github.com/ethereum/go-ethereum/log" ) var useColorInTestLog bool = true diff --git a/op-ufm/cmd/ufm/main.go b/op-ufm/cmd/ufm/main.go index a475f7dbb040..f4f753a40c85 100644 --- a/op-ufm/cmd/ufm/main.go +++ b/op-ufm/cmd/ufm/main.go @@ -8,12 +8,13 @@ import ( "os/signal" "syscall" - oplog "github.com/ethereum-optimism/optimism/op-service/log" - "github.com/ethereum-optimism/optimism/op-ufm/pkg/config" - "github.com/ethereum-optimism/optimism/op-ufm/pkg/service" "golang.org/x/exp/slog" "github.com/ethereum/go-ethereum/log" + + oplog "github.com/ethereum-optimism/optimism/op-service/log" + "github.com/ethereum-optimism/optimism/op-ufm/pkg/config" + "github.com/ethereum-optimism/optimism/op-ufm/pkg/service" ) var ( diff --git a/proxyd/cmd/proxyd/main.go b/proxyd/cmd/proxyd/main.go index a62e6fbdf708..36e076726e96 100644 --- a/proxyd/cmd/proxyd/main.go +++ b/proxyd/cmd/proxyd/main.go @@ -11,11 +11,12 @@ import ( "strings" "syscall" - "github.com/ethereum-optimism/optimism/proxyd" - "github.com/BurntSushi/toml" - "github.com/ethereum/go-ethereum/log" "golang.org/x/exp/slog" + + "github.com/ethereum/go-ethereum/log" + + "github.com/ethereum-optimism/optimism/proxyd" ) var ( diff --git a/proxyd/integration_tests/util_test.go b/proxyd/integration_tests/util_test.go index 745cb3ab911a..e2b1eb646006 100644 --- a/proxyd/integration_tests/util_test.go +++ b/proxyd/integration_tests/util_test.go @@ -10,13 +10,14 @@ import ( "testing" "time" - "github.com/ethereum-optimism/optimism/proxyd" - "github.com/BurntSushi/toml" - "github.com/ethereum/go-ethereum/log" "github.com/gorilla/websocket" "github.com/stretchr/testify/require" "golang.org/x/exp/slog" + + "github.com/ethereum/go-ethereum/log" + + "github.com/ethereum-optimism/optimism/proxyd" ) type ProxydHTTPClient struct {