From 8daee6e3dbf3e17b951ffa62b59be25bb8cf1874 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Wed, 10 Jul 2024 16:49:50 -0500 Subject: [PATCH 1/7] Produce a more descriptive error when validation server url is not set to a WS/WSS server --- staker/stateless_block_validator.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/staker/stateless_block_validator.go b/staker/stateless_block_validator.go index 1cf3d7a4c3..61ace07cb5 100644 --- a/staker/stateless_block_validator.go +++ b/staker/stateless_block_validator.go @@ -7,6 +7,7 @@ import ( "context" "errors" "fmt" + "net/url" "testing" "github.com/offchainlabs/nitro/arbstate/daprovider" @@ -428,8 +429,13 @@ func (v *StatelessBlockValidator) Start(ctx_in context.Context) error { return fmt.Errorf("starting execution spawner: %w", err) } } - for _, spawner := range v.execSpawners { + for i, spawner := range v.execSpawners { if err := spawner.Start(ctx_in); err != nil { + if u, parseErr := url.Parse(v.config.ValidationServerConfigs[i].URL); parseErr == nil { + if u.Scheme == "http" || u.Scheme == "https" { + return fmt.Errorf("validation server's url scheme: %s is unsupported, it should either be ws or wss, err: %w", u.Scheme, err) + } + } return err } } From 14ba36cc1c70973bbc7062b9da5e4b5bfc93d5d2 Mon Sep 17 00:00:00 2001 From: Tristan Wilson Date: Thu, 11 Jul 2024 11:34:37 +0200 Subject: [PATCH 2/7] Move TxLookupLimit override into ParseNode Overriding it outside of ParseNode, which is called when reloading the config via LiveConfig, causes a mismatch in TxLookupLimit which is not hot reloadable. --- cmd/nitro/nitro.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/nitro/nitro.go b/cmd/nitro/nitro.go index 572e6d2f06..088cec01fa 100644 --- a/cmd/nitro/nitro.go +++ b/cmd/nitro/nitro.go @@ -369,11 +369,6 @@ func mainImpl() int { return 0 } - if nodeConfig.Execution.Caching.Archive && nodeConfig.Execution.TxLookupLimit != 0 { - log.Info("retaining ability to lookup full transaction history as archive mode is enabled") - nodeConfig.Execution.TxLookupLimit = 0 - } - if err := resourcemanager.Init(&nodeConfig.Node.ResourceMgmt); err != nil { flag.Usage() log.Crit("Failed to start resource management module", "err", err) @@ -914,6 +909,12 @@ func ParseNode(ctx context.Context, args []string) (*NodeConfig, *genericconf.Wa if nodeConfig.Execution.Caching.Archive { nodeConfig.Node.MessagePruner.Enable = false } + + if nodeConfig.Execution.Caching.Archive && nodeConfig.Execution.TxLookupLimit != 0 { + log.Info("retaining ability to lookup full transaction history as archive mode is enabled") + nodeConfig.Execution.TxLookupLimit = 0 + } + err = nodeConfig.Validate() if err != nil { return nil, nil, err From bca0114226d2973fd1ab31d6e3f7b2313b6e6d40 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Thu, 11 Jul 2024 11:26:29 -0500 Subject: [PATCH 3/7] address PR comments --- staker/stateless_block_validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staker/stateless_block_validator.go b/staker/stateless_block_validator.go index 61ace07cb5..e263e1c402 100644 --- a/staker/stateless_block_validator.go +++ b/staker/stateless_block_validator.go @@ -433,7 +433,7 @@ func (v *StatelessBlockValidator) Start(ctx_in context.Context) error { if err := spawner.Start(ctx_in); err != nil { if u, parseErr := url.Parse(v.config.ValidationServerConfigs[i].URL); parseErr == nil { if u.Scheme == "http" || u.Scheme == "https" { - return fmt.Errorf("validation server's url scheme: %s is unsupported, it should either be ws or wss, err: %w", u.Scheme, err) + return fmt.Errorf("validation server's url scheme is unsupported, it should either be ws or wss, url:%s err: %w", v.config.ValidationServerConfigs[i].URL, err) } } return err From 11de4f95a2f715081b0eaad2ed0f8fae45c11fd4 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 11 Jul 2024 15:02:23 -0600 Subject: [PATCH 4/7] Add check for after-next-version label to design approved status --- .github/workflows/merge-checks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-checks.yml b/.github/workflows/merge-checks.yml index 6561c429e2..28b29d5cec 100644 --- a/.github/workflows/merge-checks.yml +++ b/.github/workflows/merge-checks.yml @@ -1,7 +1,7 @@ name: Merge Checks on: - pull_request_target: + pull_request: branches: [ master ] types: [synchronize, opened, reopened, labeled, unlabeled] @@ -17,7 +17,7 @@ jobs: run: | set -x pipefail status_state="pending" - if ${{ contains(github.event.*.labels.*.name, 'design-approved') }}; then + if ${{ contains(github.event.pull_request.labels.*.name, 'design-approved') && !contains(github.event.pull_request.labels.*.name, 'after-next-version') }}; then status_state="success" else resp="$(curl -sSL --fail-with-body \ From 13433ce94961182ac586d86190cb56c90b6132e2 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 11 Jul 2024 15:04:08 -0600 Subject: [PATCH 5/7] Undo change for testing --- .github/workflows/merge-checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-checks.yml b/.github/workflows/merge-checks.yml index 28b29d5cec..c9f7957389 100644 --- a/.github/workflows/merge-checks.yml +++ b/.github/workflows/merge-checks.yml @@ -1,7 +1,7 @@ name: Merge Checks on: - pull_request: + pull_request_target: branches: [ master ] types: [synchronize, opened, reopened, labeled, unlabeled] From 783f12f9877c89421fe57652e61c463a871d32af Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Fri, 12 Jul 2024 16:21:28 -0500 Subject: [PATCH 6/7] address PR comments --- staker/stateless_block_validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staker/stateless_block_validator.go b/staker/stateless_block_validator.go index e263e1c402..ec235c4bf5 100644 --- a/staker/stateless_block_validator.go +++ b/staker/stateless_block_validator.go @@ -432,7 +432,7 @@ func (v *StatelessBlockValidator) Start(ctx_in context.Context) error { for i, spawner := range v.execSpawners { if err := spawner.Start(ctx_in); err != nil { if u, parseErr := url.Parse(v.config.ValidationServerConfigs[i].URL); parseErr == nil { - if u.Scheme == "http" || u.Scheme == "https" { + if u.Scheme != "ws" && u.Scheme != "wss" { return fmt.Errorf("validation server's url scheme is unsupported, it should either be ws or wss, url:%s err: %w", v.config.ValidationServerConfigs[i].URL, err) } } From cbdf31fe9d5e071272a5e4bbdfc05af6cef1c711 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Fri, 12 Jul 2024 15:28:07 -0600 Subject: [PATCH 7/7] Fix disabling P2P --- cmd/nitro-val/nitro_val.go | 3 +++ cmd/nitro/nitro.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cmd/nitro-val/nitro_val.go b/cmd/nitro-val/nitro_val.go index 6f5f546430..1a7d2e6283 100644 --- a/cmd/nitro-val/nitro_val.go +++ b/cmd/nitro-val/nitro_val.go @@ -70,6 +70,9 @@ func mainImpl() int { nodeConfig.WS.Apply(&stackConf) nodeConfig.Auth.Apply(&stackConf) nodeConfig.IPC.Apply(&stackConf) + stackConf.P2P.ListenAddr = "" + stackConf.P2P.NoDial = true + stackConf.P2P.NoDiscovery = true vcsRevision, strippedRevision, vcsTime := confighelpers.GetVersion() stackConf.Version = strippedRevision diff --git a/cmd/nitro/nitro.go b/cmd/nitro/nitro.go index 04bdeb3228..a4ef1b2945 100644 --- a/cmd/nitro/nitro.go +++ b/cmd/nitro/nitro.go @@ -183,6 +183,9 @@ func mainImpl() int { if nodeConfig.WS.ExposeAll { stackConf.WSModules = append(stackConf.WSModules, "personal") } + stackConf.P2P.ListenAddr = "" + stackConf.P2P.NoDial = true + stackConf.P2P.NoDiscovery = true vcsRevision, strippedRevision, vcsTime := confighelpers.GetVersion() stackConf.Version = strippedRevision