From 365cd0570e52fd03ce85f36dfb2b4a99129c8514 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 23 May 2023 22:50:41 +0530 Subject: [PATCH 01/18] Test that parsing an empty CLI option set results in a default config --- arbnode/batch_poster.go | 1 + arbnode/node.go | 1 + arbnode/simple_redis_lock.go | 2 +- broadcastclient/broadcastclient.go | 2 +- cmd/genericconf/config.go | 2 +- cmd/genericconf/server.go | 6 +++--- cmd/nitro/config_test.go | 19 +++++++++++++++++++ cmd/nitro/nitro.go | 6 ++++++ das/das.go | 1 + go.mod | 3 +++ go.sum | 6 ++++++ util/headerreader/header_reader.go | 1 + util/signature/sign_verify.go | 6 ++---- util/signature/verifier.go | 2 +- 14 files changed, 47 insertions(+), 11 deletions(-) diff --git a/arbnode/batch_poster.go b/arbnode/batch_poster.go index 9a531df479..e992874f92 100644 --- a/arbnode/batch_poster.go +++ b/arbnode/batch_poster.go @@ -133,6 +133,7 @@ var DefaultBatchPosterConfig = BatchPosterConfig{ ExtraBatchGas: 50_000, DataPoster: dataposter.DefaultDataPosterConfig, L1Wallet: DefaultBatchPosterL1WalletConfig, + RedisLock: DefaultRedisLockConfig, } var DefaultBatchPosterL1WalletConfig = genericconf.WalletConfig{ diff --git a/arbnode/node.go b/arbnode/node.go index e05737b718..56d70b1f5b 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -419,6 +419,7 @@ var ConfigDefault = Config{ DelayedSequencer: DefaultDelayedSequencerConfig, BatchPoster: DefaultBatchPosterConfig, ForwardingTargetImpl: "", + Forwarder: execution.DefaultNodeForwarderConfig, TxPreChecker: execution.DefaultTxPreCheckerConfig, BlockValidator: staker.DefaultBlockValidatorConfig, Feed: broadcastclient.FeedConfigDefault, diff --git a/arbnode/simple_redis_lock.go b/arbnode/simple_redis_lock.go index 753bb70671..53c531a53d 100644 --- a/arbnode/simple_redis_lock.go +++ b/arbnode/simple_redis_lock.go @@ -41,7 +41,7 @@ func RedisLockConfigAddOptions(prefix string, f *flag.FlagSet) { f.String(prefix+".my-id", "", "this node's id prefix when acquiring the lock (optional)") f.Duration(prefix+".lockout-duration", DefaultRedisLockConfig.LockoutDuration, "how long lock is held") f.Duration(prefix+".refresh-duration", DefaultRedisLockConfig.RefreshDuration, "how long between consecutive calls to redis") - f.String(prefix+".key", prefix+".simple-lock-key", "key for lock") + f.String(prefix+".key", DefaultRedisLockConfig.Key, "key for lock") f.Bool(prefix+".background-lock", DefaultRedisLockConfig.BackgroundLock, "should node always try grabing lock in background") } diff --git a/broadcastclient/broadcastclient.go b/broadcastclient/broadcastclient.go index fc9b268d10..e4c9f9397b 100644 --- a/broadcastclient/broadcastclient.go +++ b/broadcastclient/broadcastclient.go @@ -95,7 +95,7 @@ var DefaultConfig = Config{ RequireChainId: false, RequireFeedVersion: false, Verifier: signature.DefultFeedVerifierConfig, - URLs: []string{""}, + URLs: []string{}, Timeout: 20 * time.Second, EnableCompression: true, } diff --git a/cmd/genericconf/config.go b/cmd/genericconf/config.go index 88825e9ea9..bdf86ba6c8 100644 --- a/cmd/genericconf/config.go +++ b/cmd/genericconf/config.go @@ -33,7 +33,7 @@ func ConfConfigAddOptions(prefix string, f *flag.FlagSet) { var ConfConfigDefault = ConfConfig{ Dump: false, EnvPrefix: "", - File: nil, + File: []string{}, S3: DefaultS3Config, String: "", ReloadInterval: 0, diff --git a/cmd/genericconf/server.go b/cmd/genericconf/server.go index 17c4a7a872..40252514b1 100644 --- a/cmd/genericconf/server.go +++ b/cmd/genericconf/server.go @@ -26,7 +26,7 @@ var HTTPConfigDefault = HTTPConfig{ Port: 8547, API: append(node.DefaultConfig.HTTPModules, "eth", "arb"), RPCPrefix: node.DefaultConfig.HTTPPathPrefix, - CORSDomain: node.DefaultConfig.HTTPCors, + CORSDomain: []string{}, VHosts: node.DefaultConfig.HTTPVirtualHosts, ServerTimeouts: HTTPServerTimeoutConfigDefault, } @@ -91,7 +91,7 @@ var WSConfigDefault = WSConfig{ Port: 8548, API: append(node.DefaultConfig.WSModules, "eth", "arb"), RPCPrefix: node.DefaultConfig.WSPathPrefix, - Origins: node.DefaultConfig.WSOrigins, + Origins: []string{}, ExposeAll: node.DefaultConfig.WSExposeAll, } @@ -137,7 +137,7 @@ type GraphQLConfig struct { var GraphQLConfigDefault = GraphQLConfig{ Enable: false, - CORSDomain: node.DefaultConfig.GraphQLCors, + CORSDomain: []string{}, VHosts: node.DefaultConfig.GraphQLVirtualHosts, } diff --git a/cmd/nitro/config_test.go b/cmd/nitro/config_test.go index cd3e4bd6a7..3f76d1750e 100644 --- a/cmd/nitro/config_test.go +++ b/cmd/nitro/config_test.go @@ -14,10 +14,29 @@ import ( "testing" "time" + "github.com/offchainlabs/nitro/cmd/util/confighelpers" "github.com/offchainlabs/nitro/util/colors" "github.com/offchainlabs/nitro/util/testhelpers" + + "github.com/r3labs/diff/v3" + flag "github.com/spf13/pflag" ) +func TestEmptyCliConfig(t *testing.T) { + f := flag.NewFlagSet("", flag.ContinueOnError) + NodeConfigAddOptions(f) + k, err := confighelpers.BeginCommonParse(f, []string{}) + Require(t, err) + var emptyCliNodeConfig NodeConfig + err = confighelpers.EndCommonParse(k, &emptyCliNodeConfig) + Require(t, err) + if !reflect.DeepEqual(emptyCliNodeConfig, NodeConfigDefault) { + changelog, err := diff.Diff(emptyCliNodeConfig, NodeConfigDefault) + Require(t, err) + Fail(t, "empty cli config differs from expected default", changelog) + } +} + func TestSeqConfig(t *testing.T) { args := strings.Split("--persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --chain.id 421613 --parent-chain.wallet.pathname /l1keystore --parent-chain.wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642", " ") _, _, _, err := ParseNode(context.Background(), args) diff --git a/cmd/nitro/nitro.go b/cmd/nitro/nitro.go index 334ce969e1..5f88277818 100644 --- a/cmd/nitro/nitro.go +++ b/cmd/nitro/nitro.go @@ -610,16 +610,22 @@ type NodeConfig struct { var NodeConfigDefault = NodeConfig{ Conf: genericconf.ConfConfigDefault, Node: arbnode.ConfigDefault, + Validation: valnode.DefaultValidationConfig, L1: conf.L1ConfigDefault, L2: conf.L2ConfigDefault, LogLevel: int(log.LvlInfo), LogType: "plaintext", + FileLogging: genericconf.DefaultFileLoggingConfig, Persistent: conf.PersistentConfigDefault, HTTP: genericconf.HTTPConfigDefault, WS: genericconf.WSConfigDefault, IPC: genericconf.IPCConfigDefault, + AuthRPC: genericconf.AuthRPCConfigDefault, + GraphQL: genericconf.GraphQLConfigDefault, Metrics: false, MetricsServer: genericconf.MetricsServerConfigDefault, + Init: InitConfigDefault, + Rpc: genericconf.DefaultRpcConfig, } func NodeConfigAddOptions(f *flag.FlagSet) { diff --git a/das/das.go b/das/das.go index a5d5c8d560..9783c12c6e 100644 --- a/das/das.go +++ b/das/das.go @@ -69,6 +69,7 @@ var DefaultDataAvailabilityConfig = DataAvailabilityConfig{ RestfulClientAggregatorConfig: DefaultRestfulClientAggregatorConfig, L1ConnectionAttempts: 15, PanicOnError: false, + IpfsStorageServiceConfig: DefaultIpfsStorageServiceConfig, } func OptionalAddressFromString(s string) (*common.Address, error) { diff --git a/go.mod b/go.mod index 42217858fb..7b42380b81 100644 --- a/go.mod +++ b/go.mod @@ -29,6 +29,7 @@ require ( github.com/multiformats/go-multiaddr v0.8.0 github.com/multiformats/go-multihash v0.2.1 github.com/pkg/errors v0.9.1 + github.com/r3labs/diff/v3 v3.0.1 github.com/spf13/pflag v1.0.5 github.com/wealdtech/go-merkletree v1.0.0 golang.org/x/term v0.5.0 @@ -228,6 +229,8 @@ require ( github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/stretchr/testify v1.8.2 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa // indirect github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect diff --git a/go.sum b/go.sum index 2432bec383..8c0b3c637e 100644 --- a/go.sum +++ b/go.sum @@ -1440,6 +1440,8 @@ github.com/quic-go/quic-go v0.33.0 h1:ItNoTDN/Fm/zBlq769lLJc8ECe9gYaW40veHCCco7y github.com/quic-go/quic-go v0.33.0/go.mod h1:YMuhaAV9/jIu0XclDXwZPAsP/2Kgr5yMYhe9oxhhOFA= github.com/quic-go/webtransport-go v0.5.2 h1:GA6Bl6oZY+g/flt00Pnu0XtivSD8vukOu3lYhJjnGEk= github.com/quic-go/webtransport-go v0.5.2/go.mod h1:OhmmgJIzTTqXK5xvtuX0oBpLV2GkLWNDA+UeTGJXErU= +github.com/r3labs/diff/v3 v3.0.1 h1:CBKqf3XmNRHXKmdU7mZP1w7TV0pDyVCis1AUHtA4Xtg= +github.com/r3labs/diff/v3 v3.0.1/go.mod h1:f1S9bourRbiM66NskseyUdo0fTmEE0qKrikYJX63dgo= github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= @@ -1586,6 +1588,10 @@ github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+ github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= github.com/warpfork/go-testmark v0.9.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index 1f501ed1c8..2fcbd0d5d3 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -78,6 +78,7 @@ func AddOptions(prefix string, f *flag.FlagSet) { f.Bool(prefix+".poll-only", DefaultConfig.PollOnly, "do not attempt to subscribe to header events") f.Bool(prefix+".use-finality-data", DefaultConfig.UseFinalityData, "use l1 data about finalized/safe blocks") f.Duration(prefix+".poll-interval", DefaultConfig.PollInterval, "interval when polling endpoint") + f.Duration(prefix+".subscribe-err-interval", DefaultConfig.SubscribeErrInterval, "interval for subscribe error") f.Duration(prefix+".tx-timeout", DefaultConfig.TxTimeout, "timeout when waiting for a transaction") f.Duration(prefix+".old-header-timeout", DefaultConfig.OldHeaderTimeout, "warns if the latest l1 block is at least this old") } diff --git a/util/signature/sign_verify.go b/util/signature/sign_verify.go index 9a594ccbeb..874c781dcf 100644 --- a/util/signature/sign_verify.go +++ b/util/signature/sign_verify.go @@ -31,12 +31,10 @@ func SignVerifyConfigAddOptions(prefix string, f *flag.FlagSet) { } var DefaultSignVerifyConfig = SignVerifyConfig{ - ECDSA: VerifierConfig{ - AcceptSequencer: true, - }, + ECDSA: DefultFeedVerifierConfig, SymmetricFallback: false, SymmetricSign: false, - Symmetric: TestSimpleHmacConfig, + Symmetric: EmptySimpleHmacConfig, } func NewSignVerify(config *SignVerifyConfig, signerFunc DataSignerFunc, bpValidator contracts.BatchPosterVerifierInterface) (*SignVerify, error) { diff --git a/util/signature/verifier.go b/util/signature/verifier.go index fb0aae9e1e..d1fc71e1d3 100644 --- a/util/signature/verifier.go +++ b/util/signature/verifier.go @@ -37,7 +37,7 @@ var ErrMissingSignature = fmt.Errorf("%w: signature not found", ErrSignatureNotV var ErrSignerNotApproved = fmt.Errorf("%w: signer not approved", ErrSignatureNotVerified) func FeedVerifierConfigAddOptions(prefix string, f *flag.FlagSet) { - f.StringArray(prefix+".allowed-addresses", DefultFeedVerifierConfig.AllowedAddresses, "a list of allowed addresses") + f.StringSlice(prefix+".allowed-addresses", DefultFeedVerifierConfig.AllowedAddresses, "a list of allowed addresses") f.Bool(prefix+".accept-sequencer", DefultFeedVerifierConfig.AcceptSequencer, "accept verified message from sequencer") DangerousFeedVerifierConfigAddOptions(prefix+".dangerous", f) } From 690998e632c413d87fa17fc8488889bdab74c80e Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 23 May 2023 23:08:58 +0530 Subject: [PATCH 02/18] Use update geth for missing config --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index a23dc84cfd..d79f1644a1 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit a23dc84cfd8a00f1a971edf917563a72fdf4304f +Subproject commit d79f1644a1ac5b4adf068771ee080ce5ed6202cb From 30e208b8a80632c12fdec2bd4c1fc68c8d6c0c4f Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 23 May 2023 23:19:52 +0530 Subject: [PATCH 03/18] update gitmodules --- .gitmodules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitmodules b/.gitmodules index e1c15431c1..e5b31b642a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,3 +20,5 @@ [submodule "arbitrator/wasm-testsuite/testsuite"] path = arbitrator/wasm-testsuite/testsuite url = https://github.com/WebAssembly/testsuite.git +[submodule "go-ethereum/"] + branch = missing_bloom_confirm \ No newline at end of file From cec5da143eb408e19b9434680a90d296b11a17df Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 23 May 2023 23:29:37 +0530 Subject: [PATCH 04/18] update gitmodules --- .gitmodules | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index e5b31b642a..15f0570e42 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,7 @@ [submodule "go-ethereum"] path = go-ethereum url = https://github.com/OffchainLabs/go-ethereum.git + branch = missing_bloom_confirm [submodule "fastcache"] path = fastcache url = https://github.com/OffchainLabs/fastcache.git @@ -19,6 +20,4 @@ url = https://github.com/OffchainLabs/blockscout.git [submodule "arbitrator/wasm-testsuite/testsuite"] path = arbitrator/wasm-testsuite/testsuite - url = https://github.com/WebAssembly/testsuite.git -[submodule "go-ethereum/"] - branch = missing_bloom_confirm \ No newline at end of file + url = https://github.com/WebAssembly/testsuite.git \ No newline at end of file From 3a9291b891f641098d4e18351347425b7c5aa3ae Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 23 May 2023 23:46:15 +0530 Subject: [PATCH 05/18] update geth --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index d79f1644a1..a23dc84cfd 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit d79f1644a1ac5b4adf068771ee080ce5ed6202cb +Subproject commit a23dc84cfd8a00f1a971edf917563a72fdf4304f From 4e99ba0282c294b66c5cff2b1ef1398ef0710421 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 23 May 2023 23:47:49 +0530 Subject: [PATCH 06/18] update gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 15f0570e42..4a3ca5ccf4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,4 +20,4 @@ url = https://github.com/OffchainLabs/blockscout.git [submodule "arbitrator/wasm-testsuite/testsuite"] path = arbitrator/wasm-testsuite/testsuite - url = https://github.com/WebAssembly/testsuite.git \ No newline at end of file + url = https://github.com/WebAssembly/testsuite.git From 7934e571c98117b199057b8d8675472e24aac013 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 24 May 2023 00:23:08 +0530 Subject: [PATCH 07/18] update gitmodules --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 4a3ca5ccf4..e1c15431c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,6 @@ [submodule "go-ethereum"] path = go-ethereum url = https://github.com/OffchainLabs/go-ethereum.git - branch = missing_bloom_confirm [submodule "fastcache"] path = fastcache url = https://github.com/OffchainLabs/fastcache.git From 191e99e7bf7c45166607e250f5963afa8b88a610 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 24 May 2023 00:34:47 +0530 Subject: [PATCH 08/18] Fix test --- util/signature/sign_verify.go | 8 ++++++++ util/signature/sign_verify_test.go | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/util/signature/sign_verify.go b/util/signature/sign_verify.go index 874c781dcf..c91f8db864 100644 --- a/util/signature/sign_verify.go +++ b/util/signature/sign_verify.go @@ -36,6 +36,14 @@ var DefaultSignVerifyConfig = SignVerifyConfig{ SymmetricSign: false, Symmetric: EmptySimpleHmacConfig, } +var TestSignVerifyConfig = SignVerifyConfig{ + ECDSA: VerifierConfig{ + AcceptSequencer: true, + }, + SymmetricFallback: false, + SymmetricSign: false, + Symmetric: TestSimpleHmacConfig, +} func NewSignVerify(config *SignVerifyConfig, signerFunc DataSignerFunc, bpValidator contracts.BatchPosterVerifierInterface) (*SignVerify, error) { var fallback *SimpleHmac diff --git a/util/signature/sign_verify_test.go b/util/signature/sign_verify_test.go index 8ecb6e5ccc..916fc03a20 100644 --- a/util/signature/sign_verify_test.go +++ b/util/signature/sign_verify_test.go @@ -17,7 +17,7 @@ func TestSignVerifyModes(t *testing.T) { signingAddr := crypto.PubkeyToAddress(privateKey.PublicKey) dataSigner := DataSignerFromPrivateKey(privateKey) - config := DefaultSignVerifyConfig + config := TestSignVerifyConfig config.SymmetricFallback = false config.SymmetricSign = false config.ECDSA.AcceptSequencer = false @@ -25,14 +25,14 @@ func TestSignVerifyModes(t *testing.T) { signVerifyECDSA, err := NewSignVerify(&config, dataSigner, nil) Require(t, err) - configSymmetric := DefaultSignVerifyConfig + configSymmetric := TestSignVerifyConfig configSymmetric.SymmetricFallback = true configSymmetric.SymmetricSign = true configSymmetric.ECDSA.AcceptSequencer = false signVerifySymmetric, err := NewSignVerify(&configSymmetric, nil, nil) Require(t, err) - configFallback := DefaultSignVerifyConfig + configFallback := TestSignVerifyConfig configFallback.SymmetricFallback = true configFallback.SymmetricSign = false configFallback.ECDSA.AllowedAddresses = []string{signingAddr.Hex()} From ea21852ed74c2949de5884395bede9d5ed708793 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 24 May 2023 00:36:07 +0530 Subject: [PATCH 09/18] update geth --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index a23dc84cfd..d79f1644a1 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit a23dc84cfd8a00f1a971edf917563a72fdf4304f +Subproject commit d79f1644a1ac5b4adf068771ee080ce5ed6202cb From 4919158b56c44c15b3d55d763df582dd601516c5 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 24 May 2023 00:42:47 +0530 Subject: [PATCH 10/18] update geth --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index d79f1644a1..a23dc84cfd 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit d79f1644a1ac5b4adf068771ee080ce5ed6202cb +Subproject commit a23dc84cfd8a00f1a971edf917563a72fdf4304f From 7985fc43059ff37bfeabd40f5b0d24ff0639d7c5 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 24 May 2023 19:54:27 +0530 Subject: [PATCH 11/18] Empty-Commit From da0df13293f7538bef3a5b596ea3319bbb03f852 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 24 May 2023 21:17:23 +0530 Subject: [PATCH 12/18] Changes based on offline discussion --- arbnode/batch_poster.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arbnode/batch_poster.go b/arbnode/batch_poster.go index e992874f92..36edcb3b43 100644 --- a/arbnode/batch_poster.go +++ b/arbnode/batch_poster.go @@ -41,6 +41,7 @@ import ( var ( batchPosterWalletBalance = metrics.NewRegisteredGaugeFloat64("arb/batchposter/wallet/balanceether", nil) batchPosterGasRefunderBalance = metrics.NewRegisteredGaugeFloat64("arb/batchposter/gasrefunder/balanceether", nil) + batchPosterSimpleRedisLockKey = "node.batch-poster.redis-lock.simple-lock-key" ) type batchPosterPosition struct { @@ -180,7 +181,9 @@ func NewBatchPoster(l1Reader *headerreader.HeaderReader, inbox *InboxTracker, st return nil, err } redisLockConfigFetcher := func() *SimpleRedisLockConfig { - return &config().RedisLock + simpleRedisLockConfig := config().RedisLock + simpleRedisLockConfig.Key = batchPosterSimpleRedisLockKey + return &simpleRedisLockConfig } redisLock, err := NewSimpleRedisLock(redisClient, redisLockConfigFetcher, func() bool { return syncMonitor.Synced() }) if err != nil { From 92ccdb0510c35bd859dc842bd42f4d1ededffbad Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 21 Jun 2023 21:21:09 +0530 Subject: [PATCH 13/18] minor fix --- contracts | 2 +- go-ethereum | 2 +- go.mod | 2 -- go.sum | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/contracts b/contracts index f48ce451e4..c667c8972f 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit f48ce451e4bc2dbea9024cdc08fd0eb410fa61b5 +Subproject commit c667c8972fbc25a596d82feaf6b426868f9f0437 diff --git a/go-ethereum b/go-ethereum index a23dc84cfd..afeb7841e1 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit a23dc84cfd8a00f1a971edf917563a72fdf4304f +Subproject commit afeb7841e15ca8517c58412578627708e719415b diff --git a/go.mod b/go.mod index c439943c7b..32b33216d5 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,6 @@ require ( github.com/libp2p/go-libp2p v0.26.4 github.com/multiformats/go-multiaddr v0.8.0 github.com/multiformats/go-multihash v0.2.1 - github.com/pkg/errors v0.9.1 github.com/r3labs/diff/v3 v3.0.1 github.com/spf13/pflag v1.0.5 github.com/wealdtech/go-merkletree v1.0.0 @@ -114,7 +113,6 @@ require ( github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect github.com/ipfs/bbloom v0.0.4 // indirect github.com/ipfs/go-bitfield v1.1.0 // indirect github.com/ipfs/go-block-format v0.1.1 // indirect diff --git a/go.sum b/go.sum index f083e5a986..bdb82b1e4a 100644 --- a/go.sum +++ b/go.sum @@ -599,8 +599,6 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw= -github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e/go.mod h1:j9cQbcqHQujT0oKJ38PylVfqohClLr3CvDC+Qcg+lhU= 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.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= From ff1ea776401e4cf6cd579abc5692a84b87c8eb25 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 29 Sep 2023 18:16:12 +0530 Subject: [PATCH 14/18] minor fix --- arbnode/redislock/redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arbnode/redislock/redis.go b/arbnode/redislock/redis.go index c02476f04a..c8252e059f 100644 --- a/arbnode/redislock/redis.go +++ b/arbnode/redislock/redis.go @@ -42,7 +42,7 @@ func AddConfigOptions(prefix string, f *flag.FlagSet) { f.String(prefix+".my-id", "", "this node's id prefix when acquiring the lock (optional)") f.Duration(prefix+".lockout-duration", DefaultCfg.LockoutDuration, "how long lock is held") f.Duration(prefix+".refresh-duration", DefaultCfg.RefreshDuration, "how long between consecutive calls to redis") - f.String(prefix+".key", prefix+".simple-lock-key", "key for lock") + f.String(prefix+".key", DefaultCfg.Key, "key for lock") f.Bool(prefix+".background-lock", DefaultCfg.BackgroundLock, "should node always try grabing lock in background") } From 0f75e8f652eabfce22cac78bf537ad3dd4f7080f Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 29 Sep 2023 18:19:56 +0530 Subject: [PATCH 15/18] minor fix --- contracts | 2 +- das/das.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts b/contracts index b16bf0b737..ae11e7a864 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit b16bf0b737468382854dac28346fec8b65b55989 +Subproject commit ae11e7a86488e28c706e062ae501bfb7157197c1 diff --git a/das/das.go b/das/das.go index f05bdb7f3f..9133b73ea4 100644 --- a/das/das.go +++ b/das/das.go @@ -69,7 +69,7 @@ var DefaultDataAvailabilityConfig = DataAvailabilityConfig{ RestAggregator: DefaultRestfulClientAggregatorConfig, ParentChainConnectionAttempts: 15, PanicOnError: false, - IpfsStorageServiceConfig: DefaultIpfsStorageServiceConfig, + IpfsStorage: DefaultIpfsStorageServiceConfig, } func OptionalAddressFromString(s string) (*common.Address, error) { From ed37574632a4cea67ddff98f4a20213589d06e36 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 29 Sep 2023 18:20:34 +0530 Subject: [PATCH 16/18] minor fix --- contracts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts b/contracts index ae11e7a864..b16bf0b737 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit ae11e7a86488e28c706e062ae501bfb7157197c1 +Subproject commit b16bf0b737468382854dac28346fec8b65b55989 From 1f549cdb486cfc8f9a46360a07149e754d4beb57 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 29 Sep 2023 18:41:48 +0530 Subject: [PATCH 17/18] minor fix --- arbnode/batch_poster.go | 2 +- arbnode/dataposter/data_poster.go | 30 +++++++++++++++--------------- arbnode/maintenance.go | 1 + arbnode/node.go | 1 + staker/staker.go | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/arbnode/batch_poster.go b/arbnode/batch_poster.go index 073c299319..659d3256e8 100644 --- a/arbnode/batch_poster.go +++ b/arbnode/batch_poster.go @@ -164,7 +164,7 @@ func BatchPosterConfigAddOptions(prefix string, f *pflag.FlagSet) { f.String(prefix+".l1-block-bound", DefaultBatchPosterConfig.L1BlockBound, "only post messages to batches when they're within the max future block/timestamp as of this L1 block tag (\"safe\", \"finalized\", \"latest\", or \"ignore\" to ignore this check)") f.Duration(prefix+".l1-block-bound-bypass", DefaultBatchPosterConfig.L1BlockBoundBypass, "post batches even if not within the layer 1 future bounds if we're within this margin of the max delay") redislock.AddConfigOptions(prefix+".redis-lock", f) - dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f) + dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f, dataposter.DefaultDataPosterConfig) genericconf.WalletConfigAddOptions(prefix+".parent-chain-wallet", f, DefaultBatchPosterConfig.ParentChainWallet.Pathname) } diff --git a/arbnode/dataposter/data_poster.go b/arbnode/dataposter/data_poster.go index 3b563e9658..aa0a710f9d 100644 --- a/arbnode/dataposter/data_poster.go +++ b/arbnode/dataposter/data_poster.go @@ -661,21 +661,21 @@ type DangerousConfig struct { // that flags can be reloaded dynamically. type ConfigFetcher func() *DataPosterConfig -func DataPosterConfigAddOptions(prefix string, f *pflag.FlagSet) { - f.String(prefix+".replacement-times", DefaultDataPosterConfig.ReplacementTimes, "comma-separated list of durations since first posting to attempt a replace-by-fee") - f.Bool(prefix+".wait-for-l1-finality", DefaultDataPosterConfig.WaitForL1Finality, "only treat a transaction as confirmed after L1 finality has been achieved (recommended)") - f.Uint64(prefix+".max-mempool-transactions", DefaultDataPosterConfig.MaxMempoolTransactions, "the maximum number of transactions to have queued in the mempool at once (0 = unlimited)") - f.Int(prefix+".max-queued-transactions", DefaultDataPosterConfig.MaxQueuedTransactions, "the maximum number of unconfirmed transactions to track at once (0 = unlimited)") - f.Float64(prefix+".target-price-gwei", DefaultDataPosterConfig.TargetPriceGwei, "the target price to use for maximum fee cap calculation") - f.Float64(prefix+".urgency-gwei", DefaultDataPosterConfig.UrgencyGwei, "the urgency to use for maximum fee cap calculation") - f.Float64(prefix+".min-fee-cap-gwei", DefaultDataPosterConfig.MinFeeCapGwei, "the minimum fee cap to post transactions at") - f.Float64(prefix+".min-tip-cap-gwei", DefaultDataPosterConfig.MinTipCapGwei, "the minimum tip cap to post transactions at") - f.Float64(prefix+".max-tip-cap-gwei", DefaultDataPosterConfig.MaxTipCapGwei, "the maximum tip cap to post transactions at") - f.Uint64(prefix+".nonce-rbf-soft-confs", DefaultDataPosterConfig.NonceRbfSoftConfs, "the maximum probable reorg depth, used to determine when a transaction will no longer likely need replaced-by-fee") - f.Bool(prefix+".allocate-mempool-balance", DefaultDataPosterConfig.AllocateMempoolBalance, "if true, don't put transactions in the mempool that spend a total greater than the batch poster's balance") - f.Bool(prefix+".use-db-storage", DefaultDataPosterConfig.UseDBStorage, "uses database storage when enabled") - f.Bool(prefix+".use-noop-storage", DefaultDataPosterConfig.UseNoOpStorage, "uses noop storage, it doesn't store anything") - f.Bool(prefix+".legacy-storage-encoding", DefaultDataPosterConfig.LegacyStorageEncoding, "encodes items in a legacy way (as it was before dropping generics)") +func DataPosterConfigAddOptions(prefix string, f *pflag.FlagSet, defaultDataPosterConfig DataPosterConfig) { + f.String(prefix+".replacement-times", defaultDataPosterConfig.ReplacementTimes, "comma-separated list of durations since first posting to attempt a replace-by-fee") + f.Bool(prefix+".wait-for-l1-finality", defaultDataPosterConfig.WaitForL1Finality, "only treat a transaction as confirmed after L1 finality has been achieved (recommended)") + f.Uint64(prefix+".max-mempool-transactions", defaultDataPosterConfig.MaxMempoolTransactions, "the maximum number of transactions to have queued in the mempool at once (0 = unlimited)") + f.Int(prefix+".max-queued-transactions", defaultDataPosterConfig.MaxQueuedTransactions, "the maximum number of unconfirmed transactions to track at once (0 = unlimited)") + f.Float64(prefix+".target-price-gwei", defaultDataPosterConfig.TargetPriceGwei, "the target price to use for maximum fee cap calculation") + f.Float64(prefix+".urgency-gwei", defaultDataPosterConfig.UrgencyGwei, "the urgency to use for maximum fee cap calculation") + f.Float64(prefix+".min-fee-cap-gwei", defaultDataPosterConfig.MinFeeCapGwei, "the minimum fee cap to post transactions at") + f.Float64(prefix+".min-tip-cap-gwei", defaultDataPosterConfig.MinTipCapGwei, "the minimum tip cap to post transactions at") + f.Float64(prefix+".max-tip-cap-gwei", defaultDataPosterConfig.MaxTipCapGwei, "the maximum tip cap to post transactions at") + f.Uint64(prefix+".nonce-rbf-soft-confs", defaultDataPosterConfig.NonceRbfSoftConfs, "the maximum probable reorg depth, used to determine when a transaction will no longer likely need replaced-by-fee") + f.Bool(prefix+".allocate-mempool-balance", defaultDataPosterConfig.AllocateMempoolBalance, "if true, don't put transactions in the mempool that spend a total greater than the batch poster's balance") + f.Bool(prefix+".use-db-storage", defaultDataPosterConfig.UseDBStorage, "uses database storage when enabled") + f.Bool(prefix+".use-noop-storage", defaultDataPosterConfig.UseNoOpStorage, "uses noop storage, it doesn't store anything") + f.Bool(prefix+".legacy-storage-encoding", defaultDataPosterConfig.LegacyStorageEncoding, "encodes items in a legacy way (as it was before dropping generics)") signature.SimpleHmacConfigAddOptions(prefix+".redis-signer", f) addDangerousOptions(prefix+".dangerous", f) diff --git a/arbnode/maintenance.go b/arbnode/maintenance.go index 2b1837a25b..b95e9bd86e 100644 --- a/arbnode/maintenance.go +++ b/arbnode/maintenance.go @@ -76,6 +76,7 @@ func MaintenanceConfigAddOptions(prefix string, f *flag.FlagSet) { var DefaultMaintenanceConfig = MaintenanceConfig{ TimeOfDay: "", + Lock: redislock.DefaultCfg, minutesAfterMidnight: 0, } diff --git a/arbnode/node.go b/arbnode/node.go index fd2c2d9274..efdb8e65d2 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -410,6 +410,7 @@ var ConfigDefault = Config{ Caching: execution.DefaultCachingConfig, TransactionStreamer: DefaultTransactionStreamerConfig, ResourceMgmt: resourcemanager.DefaultConfig, + Maintenance: DefaultMaintenanceConfig, } func ConfigDefaultL1Test() *Config { diff --git a/staker/staker.go b/staker/staker.go index d52d1adc77..4148d0a204 100644 --- a/staker/staker.go +++ b/staker/staker.go @@ -203,7 +203,7 @@ func L1ValidatorConfigAddOptions(prefix string, f *flag.FlagSet) { f.String(prefix+".gas-refunder-address", DefaultL1ValidatorConfig.GasRefunderAddress, "The gas refunder contract address (optional)") f.String(prefix+".redis-url", DefaultL1ValidatorConfig.RedisUrl, "redis url for L1 validator") f.Uint64(prefix+".extra-gas", DefaultL1ValidatorConfig.ExtraGas, "use this much more gas than estimation says is necessary to post transactions") - dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f) + dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f, dataposter.DefaultDataPosterConfigForValidator) redislock.AddConfigOptions(prefix+".redis-lock", f) DangerousConfigAddOptions(prefix+".dangerous", f) genericconf.WalletConfigAddOptions(prefix+".parent-chain-wallet", f, DefaultL1ValidatorConfig.ParentChainWallet.Pathname) From 30f7d2c7d5fd73e082b9886e4fb35f530baeb7bb Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 10 Oct 2023 23:11:11 +0530 Subject: [PATCH 18/18] minor fix --- arbnode/node.go | 3 --- cmd/nitro/nitro.go | 1 + execution/gethexec/node.go | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arbnode/node.go b/arbnode/node.go index f4c33f924f..5d06264b65 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -361,9 +361,6 @@ var ConfigDefault = Config{ DelayedSequencer: DefaultDelayedSequencerConfig, BatchPoster: DefaultBatchPosterConfig, MessagePruner: DefaultMessagePrunerConfig, - ForwardingTarget: "", - Forwarder: execution.DefaultNodeForwarderConfig, - TxPreChecker: execution.DefaultTxPreCheckerConfig, BlockValidator: staker.DefaultBlockValidatorConfig, Feed: broadcastclient.FeedConfigDefault, Staker: staker.DefaultL1ValidatorConfig, diff --git a/cmd/nitro/nitro.go b/cmd/nitro/nitro.go index 60295d3660..285cc3fe86 100644 --- a/cmd/nitro/nitro.go +++ b/cmd/nitro/nitro.go @@ -591,6 +591,7 @@ type NodeConfig struct { var NodeConfigDefault = NodeConfig{ Conf: genericconf.ConfConfigDefault, Node: arbnode.ConfigDefault, + Execution: gethexec.ConfigDefault, Validation: valnode.DefaultValidationConfig, ParentChain: conf.L1ConfigDefault, Chain: conf.L2ConfigDefault, diff --git a/execution/gethexec/node.go b/execution/gethexec/node.go index b29309cdbb..1068dda967 100644 --- a/execution/gethexec/node.go +++ b/execution/gethexec/node.go @@ -91,6 +91,7 @@ var ConfigDefault = Config{ TxLookupLimit: 126_230_400, // 1 year at 4 blocks per second Caching: DefaultCachingConfig, Dangerous: DefaultDangerousConfig, + Forwarder: DefaultNodeForwarderConfig, } func ConfigDefaultNonSequencerTest() *Config {