2023-07-08 17:42:30 +03:00
|
|
|
package execution_client
|
|
|
|
|
|
|
|
import (
|
|
|
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
|
|
|
|
|
|
|
"github.com/ledgerwatch/erigon/cl/cltypes"
|
2023-08-18 15:43:22 +02:00
|
|
|
"github.com/ledgerwatch/erigon/core/types"
|
2023-07-08 17:42:30 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var errContextExceeded = "rpc error: code = DeadlineExceeded desc = context deadline exceeded"
|
|
|
|
|
|
|
|
// ExecutionEngine is used only for syncing up very close to chain tip and to stay in sync.
|
|
|
|
// It pretty much mimics engine API.
|
|
|
|
type ExecutionEngine interface {
|
2023-08-01 16:01:26 +05:30
|
|
|
NewPayload(payload *cltypes.Eth1Block, beaconParentRoot *libcommon.Hash) (bool, error)
|
2023-07-08 17:42:30 +03:00
|
|
|
ForkChoiceUpdate(finalized libcommon.Hash, head libcommon.Hash) error
|
2023-08-18 15:43:22 +02:00
|
|
|
SupportInsertion() bool
|
|
|
|
InsertBlocks([]*types.Block) error
|
|
|
|
InsertBlock(*types.Block) error
|
|
|
|
IsCanonicalHash(libcommon.Hash) (bool, error)
|
|
|
|
Ready() (bool, error)
|
2023-08-29 02:37:30 +02:00
|
|
|
// Range methods
|
|
|
|
GetBodiesByRange(start, count uint64) ([]*types.RawBody, error)
|
|
|
|
GetBodiesByHashes(hashes []libcommon.Hash) ([]*types.RawBody, error)
|
2023-07-08 17:42:30 +03:00
|
|
|
}
|