diff --git a/cmd/nitro-val/nitro_val.go b/cmd/nitro-val/nitro_val.go index 1a7d2e6283..3ff859c302 100644 --- a/cmd/nitro-val/nitro_val.go +++ b/cmd/nitro-val/nitro_val.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "math" _ "net/http/pprof" // #nosec G108 "os" "os/signal" @@ -66,6 +67,8 @@ func mainImpl() int { } stackConf := DefaultValidationNodeStackConfig stackConf.DataDir = "" // ephemeral + stackConf.HTTPBodyLimit = math.MaxInt + stackConf.WSReadLimit = math.MaxInt64 nodeConfig.HTTP.Apply(&stackConf) nodeConfig.WS.Apply(&stackConf) nodeConfig.Auth.Apply(&stackConf) diff --git a/go-ethereum b/go-ethereum index 48de2030c7..a1fc200e5b 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 48de2030c7a6fa8689bc0a0212ebca2a0c73e3ad +Subproject commit a1fc200e5b85a7737a9834ec28fb768fb7bde7bd diff --git a/scripts/split-val-entry.sh b/scripts/split-val-entry.sh index 8e1be0f6cc..6b3358e878 100755 --- a/scripts/split-val-entry.sh +++ b/scripts/split-val-entry.sh @@ -16,4 +16,4 @@ for port in 52000 52001; do done done echo launching nitro-node -/usr/local/bin/nitro --validation.wasm.allowed-wasm-module-roots /home/user/nitro-legacy/machines,/home/user/target/machines --node.block-validator.validation-server-configs-list='[{"jwtsecret":"/tmp/nitro-val.jwt","url":"http://127.0.0.10:52000"}, {"jwtsecret":"/tmp/nitro-val.jwt","url":"http://127.0.0.10:52001"}]' "$@" +/usr/local/bin/nitro --validation.wasm.allowed-wasm-module-roots /home/user/nitro-legacy/machines,/home/user/target/machines --node.block-validator.validation-server-configs-list='[{"jwtsecret":"/tmp/nitro-val.jwt","url":"ws://127.0.0.10:52000"}, {"jwtsecret":"/tmp/nitro-val.jwt","url":"ws://127.0.0.10:52001"}]' "$@" diff --git a/staker/block_validator.go b/staker/block_validator.go index fc9f21cf42..df465cc31f 100644 --- a/staker/block_validator.go +++ b/staker/block_validator.go @@ -8,6 +8,7 @@ import ( "encoding/json" "errors" "fmt" + "net/url" "regexp" "runtime" "sync" @@ -140,6 +141,16 @@ func (c *BlockValidatorConfig) Validate() error { if err := c.ValidationServerConfigs[i].Validate(); err != nil { return fmt.Errorf("failed to validate one of the block-validator validation-server-configs. url: %s, err: %w", c.ValidationServerConfigs[i].URL, err) } + serverUrl := c.ValidationServerConfigs[i].URL + if len(serverUrl) > 0 && serverUrl != "self" && serverUrl != "self-auth" { + u, err := url.Parse(serverUrl) + if err != nil { + return fmt.Errorf("failed parsing validation server's url:%s err: %w", serverUrl, err) + } + 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", serverUrl) + } + } } return nil } diff --git a/staker/stateless_block_validator.go b/staker/stateless_block_validator.go index c8842aedc4..e8232264fe 100644 --- a/staker/stateless_block_validator.go +++ b/staker/stateless_block_validator.go @@ -7,7 +7,6 @@ import ( "context" "errors" "fmt" - "net/url" "runtime" "testing" @@ -488,13 +487,8 @@ func (v *StatelessBlockValidator) Start(ctx_in context.Context) error { return fmt.Errorf("starting execution spawner: %w", err) } } - for i, spawner := range v.execSpawners { + for _, 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 != "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) - } - } return err } } diff --git a/validator/client/validation_client.go b/validator/client/validation_client.go index d6743b109e..05d947db3d 100644 --- a/validator/client/validation_client.go +++ b/validator/client/validation_client.go @@ -24,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/rpc" ) type ValidationClient struct { @@ -68,14 +69,20 @@ func (c *ValidationClient) Start(ctx context.Context) error { } var stylusArchs []string if err := c.client.CallContext(ctx, &stylusArchs, server_api.Namespace+"_stylusArchs"); err != nil { - return err - } - if len(stylusArchs) == 0 { - return fmt.Errorf("could not read stylus archs from validation server") - } - for _, stylusArch := range stylusArchs { - if stylusArch != "wavm" && stylusArch != runtime.GOARCH && stylusArch != "mock" { - return fmt.Errorf("unsupported stylus architecture: %v", stylusArch) + var rpcError rpc.Error + ok := errors.As(err, &rpcError) + if !ok || rpcError.ErrorCode() != -32601 { + return fmt.Errorf("could not read stylus arch from server: %w", err) + } + stylusArchs = []string{"pre-stylus"} // validation does not support stylus + } else { + if len(stylusArchs) == 0 { + return fmt.Errorf("could not read stylus archs from validation server") + } + for _, stylusArch := range stylusArchs { + if stylusArch != "wavm" && stylusArch != runtime.GOARCH && stylusArch != "mock" { + return fmt.Errorf("unsupported stylus architecture: %v", stylusArch) + } } } var moduleRoots []common.Hash diff --git a/validator/server_jit/machine_loader.go b/validator/server_jit/machine_loader.go index b2bdb65322..cfa475370c 100644 --- a/validator/server_jit/machine_loader.go +++ b/validator/server_jit/machine_loader.go @@ -27,16 +27,13 @@ var DefaultJitMachineConfig = JitMachineConfig{ func getJitPath() (string, error) { var jitBinary string executable, err := os.Executable() - println("executable: ", executable) if err == nil { if strings.Contains(filepath.Base(executable), "test") || strings.Contains(filepath.Dir(executable), "system_tests") { _, thisfile, _, _ := runtime.Caller(0) projectDir := filepath.Dir(filepath.Dir(filepath.Dir(thisfile))) - println("projectDir: ", projectDir) jitBinary = filepath.Join(projectDir, "target", "bin", "jit") } else { jitBinary = filepath.Join(filepath.Dir(executable), "jit") - println("inside else: ", jitBinary) } _, err = os.Stat(jitBinary) }