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 (
L1InfoFuncEcotoneBytes4 = crypto.Keccak256([]byte(L1InfoFuncEcotoneSignature))[:4]
L1InfoDepositerAddress = common.HexToAddress("0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001")
L1BlockAddress = predeploys.L1BlockAddr
ErrInvalidFormat = errors.New("invalid ecotone l1 block info format")
)
const (
......@@ -210,19 +211,19 @@ func (info *L1BlockInfo) unmarshalBinaryEcotone(data []byte) error {
return err
}
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 {
return fmt.Errorf("invalid ecotone l1 block info format")
return ErrInvalidFormat
}
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 {
return fmt.Errorf("invalid ecotone l1 block info format")
return ErrInvalidFormat
}
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 {
return err
......
......@@ -39,7 +39,7 @@ func (s *PlasmaDataSource) Next(ctx context.Context) (eth.Data, error) {
// there is not commitment in the current origin.
if err := s.fetcher.AdvanceL1Origin(ctx, s.l1, s.id.ID()); err != nil {
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))
}
......
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