Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce a more descriptive error when validation server url is not set to a WS/WSS server #2475

Merged
merged 6 commits into from
Jul 12, 2024
8 changes: 7 additions & 1 deletion staker/stateless_block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"errors"
"fmt"
"net/url"
"testing"

"github.com/offchainlabs/nitro/arbstate/daprovider"
Expand Down Expand Up @@ -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" {
ganeshvanahalli marked this conversation as resolved.
Show resolved Hide resolved
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
}
}
Expand Down
Loading