diff --git a/block/block.go b/block/block.go index 4b4562794..fc9ade90e 100644 --- a/block/block.go +++ b/block/block.go @@ -142,7 +142,7 @@ func (m *Manager) applyBlock(block *types.Block, commit *types.Commit, blockMeta // Proposer cannot be empty while applying the block proposer := m.State.GetProposer() if proposer == nil { - return fmt.Errorf("logic error: got nil proposer while applying block") + return errors.New("logic error: got nil proposer while applying block") } batch := m.Store.NewBatch() diff --git a/block/modes.go b/block/modes.go index adfd56432..3e2e37d0e 100644 --- a/block/modes.go +++ b/block/modes.go @@ -62,7 +62,7 @@ func (m *Manager) runAsProposer(ctx context.Context, eg *errgroup.Group) error { return fmt.Errorf("am i proposer on SL: %w", err) } if !amIProposerOnSL { - return fmt.Errorf("the node is no longer the proposer. please restart.") + return errors.New("the node is no longer the proposer. please restart.") } // update l2 proposer from SL in case it changed after syncing diff --git a/block/slvalidator.go b/block/slvalidator.go index bf9b8ac0a..1d80d675f 100644 --- a/block/slvalidator.go +++ b/block/slvalidator.go @@ -189,7 +189,7 @@ func (v *SettlementValidator) ValidateDaBlocks(slBatch *settlement.ResultRetriev if slBatch.NextSequencer != slBatch.Sequencer { nextSequencer, found := v.blockManager.Sequencers.GetByAddress(slBatch.NextSequencer) if !found { - return fmt.Errorf("next sequencer not found") + return errors.New("next sequencer not found") } copy(expectedNextSeqHash[:], nextSequencer.MustHash()) } diff --git a/cmd/dymint/commands/start.go b/cmd/dymint/commands/start.go index 3bfa6e503..110ddb36e 100644 --- a/cmd/dymint/commands/start.go +++ b/cmd/dymint/commands/start.go @@ -6,6 +6,7 @@ import ( "crypto/sha256" "encoding/hex" "encoding/json" + "errors" "fmt" "io" "os" @@ -141,7 +142,7 @@ func startInProcess(config *cfg.NodeConfig, tmConfig *tmcfg.Config, logger log.L func checkGenesisHash(config *tmcfg.Config) error { if config.Genesis == "" { - return fmt.Errorf("genesis file is not set") + return errors.New("genesis file is not set") } if len(genesisHash) == 0 { diff --git a/da/da.go b/da/da.go index 3bde8023f..c15c97849 100644 --- a/da/da.go +++ b/da/da.go @@ -2,7 +2,7 @@ package da import ( "encoding/hex" - "fmt" + "errors" "strconv" "strings" @@ -113,7 +113,7 @@ func (d *DASubmitMetaData) ToPath() string { func (d *DASubmitMetaData) FromPath(path string) (*DASubmitMetaData, error) { pathParts := strings.FieldsFunc(path, func(r rune) bool { return r == rune(PathSeparator[0]) }) if len(pathParts) < 2 { - return nil, fmt.Errorf("invalid DA path") + return nil, errors.New("invalid DA path") } height, err := strconv.ParseUint(pathParts[1], 10, 64) diff --git a/test/loadtime/cmd/load/main.go b/test/loadtime/cmd/load/main.go index 456f78b1d..80a915970 100644 --- a/test/loadtime/cmd/load/main.go +++ b/test/loadtime/cmd/load/main.go @@ -1,7 +1,7 @@ package main import ( - "fmt" + "errors" "github.com/google/uuid" "github.com/informalsystems/tm-load-test/pkg/loadtest" @@ -51,7 +51,7 @@ func (f *ClientFactory) ValidateConfig(cfg loadtest.Config) error { return err } if psb > cfg.Size { - return fmt.Errorf("payload size exceeds configured size") + return errors.New("payload size exceeds configured size") } return nil }