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

Fix split validation #2568

Merged
merged 8 commits into from
Aug 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions validator/client/validation_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ func (c *ValidationClient) Start(ctx context.Context) error {
return errors.New("couldn't read name from server")
}
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)
if err := c.client.CallContext(ctx, &stylusArchs, server_api.Namespace+"_stylusArchs"); err == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd favor checking the error message here to prevent network errors from being caught here. In fact, I think we can probably downcast this into a type with the JSON-RPC error code, and there's a specific error code for a method not existing.

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)
}
}
} else {
stylusArchs = []string{"pre-stylus"} // validation does not support stylus
}
var moduleRoots []common.Hash
if err := c.client.CallContext(ctx, &moduleRoots, server_api.Namespace+"_wasmModuleRoots"); err != nil {
Expand Down
Loading