Commit f8b1bb6a authored by KailMillor's avatar KailMillor Committed by GitHub

op-node/derive: linter fix (#11265)

* linter fix

* use sentinel error

* fix format
parent d1499b04
...@@ -30,6 +30,7 @@ var ( ...@@ -30,6 +30,7 @@ var (
L1InfoFuncEcotoneBytes4 = crypto.Keccak256([]byte(L1InfoFuncEcotoneSignature))[:4] L1InfoFuncEcotoneBytes4 = crypto.Keccak256([]byte(L1InfoFuncEcotoneSignature))[:4]
L1InfoDepositerAddress = common.HexToAddress("0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001") L1InfoDepositerAddress = common.HexToAddress("0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001")
L1BlockAddress = predeploys.L1BlockAddr L1BlockAddress = predeploys.L1BlockAddr
ErrInvalidFormat = errors.New("invalid ecotone l1 block info format")
) )
const ( const (
...@@ -210,19 +211,19 @@ func (info *L1BlockInfo) unmarshalBinaryEcotone(data []byte) error { ...@@ -210,19 +211,19 @@ func (info *L1BlockInfo) unmarshalBinaryEcotone(data []byte) error {
return err return err
} }
if err := binary.Read(r, binary.BigEndian, &info.BaseFeeScalar); err != nil { if err := binary.Read(r, binary.BigEndian, &info.BaseFeeScalar); err != nil {
return fmt.Errorf("invalid ecotone l1 block info format") return ErrInvalidFormat
} }
if err := binary.Read(r, binary.BigEndian, &info.BlobBaseFeeScalar); err != nil { if err := binary.Read(r, binary.BigEndian, &info.BlobBaseFeeScalar); err != nil {
return fmt.Errorf("invalid ecotone l1 block info format") return ErrInvalidFormat
} }
if err := binary.Read(r, binary.BigEndian, &info.SequenceNumber); err != nil { if err := binary.Read(r, binary.BigEndian, &info.SequenceNumber); err != nil {
return fmt.Errorf("invalid ecotone l1 block info format") return ErrInvalidFormat
} }
if err := binary.Read(r, binary.BigEndian, &info.Time); err != nil { if err := binary.Read(r, binary.BigEndian, &info.Time); err != nil {
return fmt.Errorf("invalid ecotone l1 block info format") return ErrInvalidFormat
} }
if err := binary.Read(r, binary.BigEndian, &info.Number); err != nil { if err := binary.Read(r, binary.BigEndian, &info.Number); err != nil {
return fmt.Errorf("invalid ecotone l1 block info format") return ErrInvalidFormat
} }
if info.BaseFee, err = solabi.ReadUint256(r); err != nil { if info.BaseFee, err = solabi.ReadUint256(r); err != nil {
return err return err
......
...@@ -39,7 +39,7 @@ func (s *PlasmaDataSource) Next(ctx context.Context) (eth.Data, error) { ...@@ -39,7 +39,7 @@ func (s *PlasmaDataSource) Next(ctx context.Context) (eth.Data, error) {
// there is not commitment in the current origin. // there is not commitment in the current origin.
if err := s.fetcher.AdvanceL1Origin(ctx, s.l1, s.id.ID()); err != nil { if err := s.fetcher.AdvanceL1Origin(ctx, s.l1, s.id.ID()); err != nil {
if errors.Is(err, plasma.ErrReorgRequired) { if errors.Is(err, plasma.ErrReorgRequired) {
return nil, NewResetError(fmt.Errorf("new expired challenge")) return nil, NewResetError(errors.New("new expired challenge"))
} }
return nil, NewTemporaryError(fmt.Errorf("failed to advance plasma L1 origin: %w", err)) return nil, NewTemporaryError(fmt.Errorf("failed to advance plasma L1 origin: %w", err))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment