Documentation ¶
Index ¶
- func BlockToBatch(config *rollup.Config, block *types.Block) (*derive.BatchData, error)
- func ComputeL2OutputRoot(l2OutputRootVersion eth.Bytes32, blockHash common.Hash, blockRoot common.Hash, ...) eth.Bytes32
- type AccountResult
- type ReadOnlySource
- func (s *ReadOnlySource) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (s *ReadOnlySource) GetBlockHeader(ctx context.Context, blockTag string) (*types.Header, error)
- func (s *ReadOnlySource) GetProof(ctx context.Context, address common.Address, blockTag string) (*AccountResult, error)
- func (s *ReadOnlySource) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
- func (s *ReadOnlySource) L2BlockRefByNumber(ctx context.Context, l2Num *big.Int) (eth.L2BlockRef, error)
- type Source
- func (s *Source) Close()
- func (s *Source) ForkchoiceUpdate(ctx context.Context, fc *eth.ForkchoiceState, ...) (*eth.ForkchoiceUpdatedResult, error)
- func (s *Source) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayload, error)
- func (s *Source) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
- func (s *Source) L2BlockRefByNumber(ctx context.Context, l2Num *big.Int) (eth.L2BlockRef, error)
- func (s *Source) L2BlockRefHead(ctx context.Context) (eth.L2BlockRef, error)
- func (s *Source) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
- func (s *Source) PayloadByHash(ctx context.Context, hash common.Hash) (*eth.ExecutionPayload, error)
- func (s *Source) PayloadByNumber(ctx context.Context, number uint64) (*eth.ExecutionPayload, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockToBatch ¶
BlockToBatch converts a L2 block to batch-data. Invalid L2 blocks may return an error.
Types ¶
type AccountResult ¶
type AccountResult struct { AccountProof []hexutil.Bytes `json:"accountProof"` Address common.Address `json:"address"` Balance *hexutil.Big `json:"balance"` CodeHash common.Hash `json:"codeHash"` Nonce hexutil.Uint64 `json:"nonce"` StorageHash common.Hash `json:"storageHash"` }
func (*AccountResult) Verify ¶
func (res *AccountResult) Verify(stateRoot common.Hash) error
Verify an account proof from the getProof RPC. See https://eips.ethereum.org/EIPS/eip-1186
type ReadOnlySource ¶
type ReadOnlySource struct {
// contains filtered or unexported fields
}
func NewReadOnlySource ¶
func (*ReadOnlySource) BlockByNumber ¶
func (*ReadOnlySource) GetBlockHeader ¶
func (*ReadOnlySource) GetProof ¶
func (s *ReadOnlySource) GetProof(ctx context.Context, address common.Address, blockTag string) (*AccountResult, error)
func (*ReadOnlySource) L2BlockRefByHash ¶
func (s *ReadOnlySource) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
L2BlockRefByHash returns the block & parent ids based on the supplied hash. The returned BlockRef may not be in the canonical chain
func (*ReadOnlySource) L2BlockRefByNumber ¶
func (s *ReadOnlySource) L2BlockRefByNumber(ctx context.Context, l2Num *big.Int) (eth.L2BlockRef, error)
L2BlockRefByNumber returns the canonical block and parent ids.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) ForkchoiceUpdate ¶
func (s *Source) ForkchoiceUpdate(ctx context.Context, fc *eth.ForkchoiceState, attributes *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
ForkchoiceUpdate updates the forkchoice on the execution client. If attributes is not nil, the engine client will also begin building a block based on attributes after the new head block and return the payload ID. May return an error in ForkChoiceResult, but the error is marshalled into the error return
func (*Source) GetPayload ¶
func (s *Source) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayload, error)
GetPayload gets the execution payload associated with the PayloadId
func (*Source) L2BlockRefByHash ¶
L2BlockRefByHash returns the block & parent ids based on the supplied hash. The returned BlockRef may not be in the canonical chain
func (*Source) L2BlockRefByNumber ¶
L2BlockRefByNumber returns the canonical block and parent ids.
func (*Source) L2BlockRefHead ¶
L2BlockRefHead returns the canonical block and parent ids.
func (*Source) NewPayload ¶
func (s *Source) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
ExecutePayload executes a built block on the execution engine and returns an error if it was not successful.