diff --git a/driver/state/l1_current.go b/driver/state/l1_current.go index efea71690..425ec1556 100644 --- a/driver/state/l1_current.go +++ b/driver/state/l1_current.go @@ -2,7 +2,7 @@ package state import ( "context" - "fmt" + "errors" "math/big" "github.com/ethereum/go-ethereum/common" @@ -29,7 +29,7 @@ func (s *State) SetL1Current(h *types.Header) { // BlockProposed event with given blockID / blockHash. func (s *State) ResetL1Current(ctx context.Context, blockID *big.Int) error { if blockID == nil { - return fmt.Errorf("empty block ID") + return errors.New("empty block ID") } log.Info("Reset L1 current cursor", "blockID", blockID) diff --git a/pkg/rpc/engine.go b/pkg/rpc/engine.go index b1bb2c753..00bc9e011 100644 --- a/pkg/rpc/engine.go +++ b/pkg/rpc/engine.go @@ -2,7 +2,7 @@ package rpc import ( "context" - "fmt" + "errors" "math/big" "github.com/ethereum/go-ethereum/beacon/engine" @@ -22,7 +22,7 @@ type EngineClient struct { func NewJWTEngineClient(url, jwtSecret string) (*EngineClient, error) { var jwt = StringToBytes32(jwtSecret) if jwt == (common.Hash{}) || url == "" { - return nil, fmt.Errorf("url is empty or jwt secret is illegal") + return nil, errors.New("url is empty or jwt secret is illegal") } authClient, err := rpc.DialOptions(context.Background(), url, rpc.WithHTTPAuth(node.NewJWTAuth(jwt))) if err != nil { diff --git a/pkg/rpc/methods.go b/pkg/rpc/methods.go index a8f6b8b64..b5af64a34 100644 --- a/pkg/rpc/methods.go +++ b/pkg/rpc/methods.go @@ -638,7 +638,7 @@ func (c *Client) getSyncedL1SnippetFromAnchor( common.Hash{}, 0, 0, - fmt.Errorf("failed to parse l1BlockHash from anchor transaction calldata") + errors.New("failed to parse l1BlockHash from anchor transaction calldata") } l1StateRoot, ok = args["_l1StateRoot"].([32]byte) if !ok { @@ -646,7 +646,7 @@ func (c *Client) getSyncedL1SnippetFromAnchor( common.Hash{}, 0, 0, - fmt.Errorf("failed to parse l1StateRoot from anchor transaction calldata") + errors.New("failed to parse l1StateRoot from anchor transaction calldata") } l1Height, ok = args["_l1BlockId"].(uint64) if !ok { @@ -654,7 +654,7 @@ func (c *Client) getSyncedL1SnippetFromAnchor( common.Hash{}, 0, 0, - fmt.Errorf("failed to parse l1Height from anchor transaction calldata") + errors.New("failed to parse l1Height from anchor transaction calldata") } parentGasUsed, ok = args["_parentGasUsed"].(uint32) if !ok { @@ -662,7 +662,7 @@ func (c *Client) getSyncedL1SnippetFromAnchor( common.Hash{}, 0, 0, - fmt.Errorf("failed to parse parentGasUsed from anchor transaction calldata") + errors.New("failed to parse parentGasUsed from anchor transaction calldata") } return l1BlockHash, l1StateRoot, l1Height, parentGasUsed, nil diff --git a/prover/config.go b/prover/config.go index c0508e04a..fc3150a0f 100644 --- a/prover/config.go +++ b/prover/config.go @@ -120,7 +120,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { // If we are not running a guardian prover, a raiko host endpoint is required. if !c.IsSet(flags.GuardianProver.Name) && !c.IsSet(flags.RaikoHostEndpoint.Name) { - return nil, fmt.Errorf("raiko host not provided") + return nil, errors.New("raiko host not provided") } var (