encoding

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaikoL1ABI          *abi.ABI
	TaikoL2ABI          *abi.ABI
	TaikoTokenABI       *abi.ABI
	GuardianProverABI   *abi.ABI
	LibProposingABI     *abi.ABI
	LibProvingABI       *abi.ABI
	LibUtilsABI         *abi.ABI
	LibVerifyingABI     *abi.ABI
	AssignmentHookABI   *abi.ABI
	SGXVerifierABI      *abi.ABI
	GuardianVerifierABI *abi.ABI
)

Contract ABIs.

View Source
var (
	TierOptimisticID   uint16 = 100
	TierSgxID          uint16 = 200
	TierSgxAndZkVMID   uint16 = 300
	TierGuardianID     uint16 = 1000
	ProtocolTiers             = []uint16{TierOptimisticID, TierSgxID, TierSgxAndZkVMID, TierGuardianID}
	GoldenTouchPrivKey        = "92954368afd3caa1f3ce3ead0069c1af414054aefe1ef9aeacc1bf426222ce38"
)

Tier IDs defined in protocol.

Functions

func BloomToBytes

func BloomToBytes(bloom types.Bloom) [8][32]byte

BloomToBytes converts a types.Bloom to [8][32]byte slice.

func BytesToBloom added in v0.1.5

func BytesToBloom(b [8][32]byte) types.Bloom

BytesToBloom converts a [8][32]byte slice to types.Bloom.

func EncodeAssignmentHookInput added in v0.18.0

func EncodeAssignmentHookInput(input *AssignmentHookInput) ([]byte, error)

EncodeAssignmentHookInput performs the solidity `abi.encode` for the given input

func EncodeBlockParams added in v0.18.0

func EncodeBlockParams(params *BlockParams) ([]byte, error)

EncodeBlockParams performs the solidity `abi.encode` for the given blockParams.

func EncodeProveBlockInput

func EncodeProveBlockInput(
	meta *bindings.TaikoDataBlockMetadata,
	transition *bindings.TaikoDataTransition,
	tierProof *bindings.TaikoDataTierProof,
) ([]byte, error)

EncodeProveBlockInput performs the solidity `abi.encode` for the given TaikoL1.proveBlock input.

func EncodeProverAssignmentPayload added in v0.17.0

func EncodeProverAssignmentPayload(
	chainID uint64,
	taikoAddress common.Address,
	assignmentHookAddress common.Address,
	blockProposer common.Address,
	assignedProver common.Address,
	blobHash common.Hash,
	feeToken common.Address,
	expiry uint64,
	maxBlockID uint64,
	maxProposedIn uint64,
	tierFees []TierFee,
) ([]byte, error)

EncodeProverAssignmentPayload performs the solidity `abi.encode` for the given proverAssignment payload.

func ToExecutableData added in v0.9.0

func ToExecutableData(header *types.Header) *engine.ExecutableData

ToExecutableData converts a GETH *types.Header to *engine.ExecutableData.

func TryParsingCustomError added in v0.5.0

func TryParsingCustomError(originalError error) error

TryParsingCustomError tries to checks whether the given error is one of the custom errors defined the protocol ABIs, if so, it will return the matched custom error, otherwise, it simply returns the original error.

func UnpackTxListBytes

func UnpackTxListBytes(txData []byte) ([]byte, error)

UnpackTxListBytes unpacks the input data of a TaikoL1.proposeBlock transaction, and returns the txList bytes.

Types

type AssignmentHookInput added in v0.18.0

type AssignmentHookInput struct {
	Assignment *ProverAssignment
	Tip        *big.Int
}

AssignmentHookInput should be same as AssignmentHook.Input

type BlockParams added in v0.18.0

type BlockParams struct {
	AssignedProver common.Address
	Coinbase       common.Address
	ExtraData      [32]byte
	ParentMetaHash [32]byte
	HookCalls      []HookCall
	Signature      []byte
}

BlockParams should be same with TaikoData.BlockParams.

type HookCall added in v0.18.0

type HookCall struct {
	Hook common.Address
	Data []byte
}

HookCall should be same with TaikoData.HookCall

type ProverAssignment added in v0.15.0

type ProverAssignment struct {
	FeeToken       common.Address
	Expiry         uint64
	MaxBlockId     uint64 // nolint: revive,stylecheck
	MaxProposedIn  uint64
	MetaHash       [32]byte
	ParentMetaHash [32]byte
	TierFees       []TierFee
	Signature      []byte
}

ProverAssignment should be same with TaikoData.ProverAssignment.

type TierFee added in v0.17.0

type TierFee struct {
	Tier uint16
	Fee  *big.Int
}

TierFee should be same with TaikoData.TierFee.

Jump to

Keyboard shortcuts

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