api

package
v0.0.0-...-50bfe8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Implement the wrapping calls to the wrapped engines. Forwards the RPC call to op-geth server while directly calling the cosmos sdk engine. See https://ethereum.github.io/execution-apis/api-documentation/

types.go holds any additional required type definitions for the server implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EngineForkStates

func EngineForkStates(blockStore BlockStore, interceptorForkState eth.ForkchoiceState) (eth.ForkchoiceState, eth.ForkchoiceState)

EngineForkStates takes in the interceptor fork state and the blockstore and creates two states for abci and geth.

func GetCosmosAPI

func GetCosmosAPI(mempoolNode MempoolNode, peptideRPC client.RPC, logger log.Logger) rpc.API

func GetEngineAPI

func GetEngineAPI(interceptor Interceptor, ethPRC, peptideRPC client.RPC, logger log.Logger) []rpc.API

TODO(jim): passed by lock.

func GetEthAPI

func GetEthAPI(blockStore BlockStore, ethRPC, peptideRPC client.RPC, logger log.Logger) rpc.API

func IsIBCBridgeTx

func IsIBCBridgeTx(data hexutil.Bytes) bool

IsIBCBridgeTx returns true if the transaction is a transaction sent to the IBCStandardBridge. tx is a hex encoded marshalled types.Transaction (op-geth/core/types/transaction.go)

Types

type BlockStore

type BlockStore interface {
	GetCompositeBlock(common.Hash) eetypes.CompositeBlock
	SaveCompositeBlock(eetypes.CompositeBlock)
}

BlockStore allows accessing/modifying/inspecting the compose blocks.

type Hash

type Hash = eetypes.Hash

type Interceptor

type Interceptor interface {
	MempoolNode
	BlockStore
	PayloadStore
}

type MempoolNode

type MempoolNode interface {
	// HasMsgs returns true if the mempool has messages.
	HasMsgs() bool
	// GetMsgs returns all messages in the mempool.
	GetMsgs() [][]byte
	// ClearMsgs clears all messages from the mempool.
	ClearMsgs()
	// AddMsgToMempool adds a message to the mempool.
	AddMsgToMempool(bz []byte)
}

MempoolNode allows accessing/modifying/inspecting the mempool.

type PayloadStore

type PayloadStore interface {
	GetCompositePayload(eth.PayloadID) eetypes.CompositePayload
	SaveCompositePayload(eetypes.CompositePayload)
}

type SendCosmosTxResult

type SendCosmosTxResult struct{}

TODO(jim): Ethereum JSON/RPC dictates responses should either return 0, 1 (response or error) or 2 (response and error). For now, we return 2 just to keep separated.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL