diff --git a/validator/client/validation_client.go b/validator/client/validation_client.go index f436f0ba14..fa6b9000f2 100644 --- a/validator/client/validation_client.go +++ b/validator/client/validation_client.go @@ -158,7 +158,11 @@ func (c *ExecutionClient) LatestWasmModuleRoot() containers.PromiseInterface[com func (c *ExecutionClient) WriteToFile(input *validator.ValidationInput, expOut validator.GoGlobalState, moduleRoot common.Hash) containers.PromiseInterface[struct{}] { jsonInput := server_api.ValidationInputToJson(input) - jsonInput.WriteToFile() + if err := jsonInput.WriteToFile(); err != nil { + return stopwaiter.LaunchPromiseThread[struct{}](c, func(ctx context.Context) (struct{}, error) { + return struct{}{}, err + }) + } return stopwaiter.LaunchPromiseThread[struct{}](c, func(ctx context.Context) (struct{}, error) { err := c.client.CallContext(ctx, nil, server_api.Namespace+"_writeToFile", jsonInput, expOut, moduleRoot) return struct{}{}, err diff --git a/validator/server_api/json.go b/validator/server_api/json.go index 3cec92418f..3dd817d5ae 100644 --- a/validator/server_api/json.go +++ b/validator/server_api/json.go @@ -71,7 +71,7 @@ func (i *InputJSON) WriteToFile() error { if err != nil { return err } - if err = os.WriteFile(fmt.Sprintf("block_inputs_%d.json", i.Id), contents, 0644); err != nil { + if err = os.WriteFile(fmt.Sprintf("block_inputs_%d.json", i.Id), contents, 0600); err != nil { return err } return nil