github.com/VietJr/bor@v1.0.3/core/beacon/errors.go (about)

     1  // Copyright 2022 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>
    16  
    17  package beacon
    18  
    19  import "github.com/ethereum/go-ethereum/rpc"
    20  
    21  var (
    22  	// VALID is returned by the engine API in the following calls:
    23  	//   - newPayloadV1:       if the payload was already known or was just validated and executed
    24  	//   - forkchoiceUpdateV1: if the chain accepted the reorg (might ignore if it's stale)
    25  	VALID = "VALID"
    26  
    27  	// INVALID is returned by the engine API in the following calls:
    28  	//   - newPayloadV1:       if the payload failed to execute on top of the local chain
    29  	//   - forkchoiceUpdateV1: if the new head is unknown, pre-merge, or reorg to it fails
    30  	INVALID = "INVALID"
    31  
    32  	// SYNCING is returned by the engine API in the following calls:
    33  	//   - newPayloadV1:       if the payload was accepted on top of an active sync
    34  	//   - forkchoiceUpdateV1: if the new head was seen before, but not part of the chain
    35  	SYNCING = "SYNCING"
    36  
    37  	// ACCEPTED is returned by the engine API in the following calls:
    38  	//   - newPayloadV1: if the payload was accepted, but not processed (side chain)
    39  	ACCEPTED = "ACCEPTED"
    40  
    41  	INVALIDBLOCKHASH     = "INVALID_BLOCK_HASH"
    42  	INVALIDTERMINALBLOCK = "INVALID_TERMINAL_BLOCK"
    43  
    44  	GenericServerError = rpc.CustomError{Code: -32000, ValidationError: "Server error"}
    45  	UnknownPayload     = rpc.CustomError{Code: -32001, ValidationError: "Unknown payload"}
    46  	InvalidTB          = rpc.CustomError{Code: -32002, ValidationError: "Invalid terminal block"}
    47  
    48  	STATUS_INVALID = ForkChoiceResponse{PayloadStatus: PayloadStatusV1{Status: INVALID}, PayloadID: nil}
    49  	STATUS_SYNCING = ForkChoiceResponse{PayloadStatus: PayloadStatusV1{Status: SYNCING}, PayloadID: nil}
    50  )