Documentation
¶
Index ¶
- Constants
- Variables
- func AddressAsLeftPaddedHash(addr common.Address) (out common.Hash)
- func CalcBlobFeeCancun(excessBlobGas uint64) *big.Int
- func CheckEcotoneL1SystemConfigScalar(scalar [32]byte) error
- func CheckRecentTxs(ctx context.Context, l1 L1Client, depth int, addr common.Address) (blockNum uint64, found bool, err error)
- func DecodeRawReceipts(block BlockID, rawReceipts []hexutil.Bytes, txHashes []common.Hash) ([]*types.Receipt, error)
- func DecodeTransactions(data []hexutil.Bytes) ([]*types.Transaction, error)
- func EncodeOperatorFeeParams(params OperatorFeeParams) (scalar [32]byte)
- func EncodeReceipts(elems []*types.Receipt) ([]hexutil.Bytes, error)
- func EncodeScalar(scalars EcotoneScalars) (scalar [32]byte)
- func EncodeTransactions(elems []*types.Transaction) ([]hexutil.Bytes, error)
- func EvilChainIDToUInt64(id ChainID) uint64
- func ForkchoiceUpdateErr(payloadStatus PayloadStatusV1) error
- func GetLogAtIndex(receipts []*types.Receipt, logIndex uint) (*types.Log, error)
- func GweiToWei(gwei float64) (*big.Int, error)
- func KZGToVersionedHash(commitment kzg4844.Commitment) (out common.Hash)
- func L1ChainConfigByChainID(chainID ChainID) *params.ChainConfig
- func MaybeAsNotFoundErr(err error) error
- func NewPayloadErr(payload *ExecutionPayload, payloadStatus *PayloadStatusV1) error
- func PollBlockChanges(log log.Logger, src L1BlockRefsSource, fn HeadSignalFn, label BlockLabel, ...) ethereum.Subscription
- func SortChainID(ids []ChainID)
- func TransactionsToHashes(elems []*types.Transaction) []common.Hash
- func VerifyBlobProof(blob *Blob, commitment kzg4844.Commitment, proof kzg4844.Proof) error
- func WatchHeadChanges(ctx context.Context, src NewHeadSource, fn HeadSignalFn) (ethereum.Subscription, error)
- func WeiToEther(wei *big.Int) float64
- type APIBeaconBlobsResponse
- type APIBlobSidecar
- type APIConfigResponse
- type APIGenesisResponse
- type APIGetBlobSidecarsResponse
- type APIVersionResponse
- type AccountResult
- type BeaconBlockHeader
- type Blob
- func (b *Blob) Clear()
- func (b *Blob) ComputeKZGCommitment() (kzg4844.Commitment, error)
- func (b *Blob) FromData(data Data) error
- func (b *Blob) KZGBlob() *kzg4844.Blob
- func (b *Blob) MarshalText() ([]byte, error)
- func (b *Blob) String() string
- func (b *Blob) TerminalString() string
- func (b *Blob) ToData() (Data, error)
- func (b *Blob) UnmarshalJSON(text []byte) error
- func (b *Blob) UnmarshalText(text []byte) error
- type BlobSidecar
- type BlockID
- type BlockInfo
- type BlockLabel
- type BlockRef
- type BlockVersion
- type Bytes256
- type Bytes32
- type Bytes48
- type Bytes65
- type Bytes8
- type Bytes96
- type BytesMax32
- type ChainID
- func (id ChainID) Bytes32() [32]byte
- func (id ChainID) Cmp(other ChainID) int
- func (id ChainID) IsUint64() bool
- func (id ChainID) LogValue() slog.Value
- func (id ChainID) MarshalText() ([]byte, error)
- func (id ChainID) String() string
- func (id ChainID) ToBig() *big.Int
- func (id ChainID) Uint64() (v uint64, ok bool)
- func (id *ChainID) UnmarshalText(data []byte) error
- type ChainIDAndOutput
- type ChainRootInfo
- type Data
- type ETH
- func (e ETH) Add(v ETH) (out ETH)
- func (e ETH) AddOverflow(v ETH) (out ETH, overflow bool)
- func (e ETH) Bytes32() [32]byte
- func (e ETH) Decimal() string
- func (e ETH) Div(denominator uint64) (out ETH)
- func (e ETH) EtherString() string
- func (e ETH) Format(s fmt.State, ch rune)
- func (e ETH) Gt(v ETH) bool
- func (e ETH) Hex() string
- func (e ETH) IsZero() bool
- func (e ETH) Lt(v ETH) bool
- func (e ETH) MarshalText() ([]byte, error)
- func (e ETH) Mul(scalar uint64) (out ETH)
- func (e ETH) MulOverflow(scalar uint64) (out ETH, overflow bool)
- func (e ETH) String() string
- func (e ETH) Sub(v ETH) (out ETH)
- func (e ETH) SubUnderflow(v ETH) (out ETH, underflow bool)
- func (e ETH) ToBig() *big.Int
- func (e ETH) ToU256() *uint256.Int
- func (e *ETH) UnmarshalJSON(data []byte) error
- func (e *ETH) UnmarshalText(data []byte) error
- func (e ETH) WeiFloat() float64
- type EcotoneScalars
- type EngineAPIMethod
- type ErrorCode
- type ExecutePayloadStatus
- type ExecutionPayload
- func (payload *ExecutionPayload) BlockRef() BlockRef
- func (p *ExecutionPayload) CheckEqual(o *ExecutionPayload) error
- func (payload *ExecutionPayload) ID() BlockID
- func (payload *ExecutionPayload) MarshalSSZ(w io.Writer) (n int, err error)
- func (payload *ExecutionPayload) ParentID() BlockID
- func (payload *ExecutionPayload) SizeSSZ() (full uint32)
- func (payload *ExecutionPayload) String() string
- func (payload *ExecutionPayload) UnmarshalSSZ(version BlockVersion, scope uint32, r io.Reader) error
- type ExecutionPayloadEnvelope
- func (envelope *ExecutionPayloadEnvelope) CheckBlockHash() (actual common.Hash, ok bool)
- func (env *ExecutionPayloadEnvelope) ID() BlockID
- func (envelope *ExecutionPayloadEnvelope) MarshalSSZ(w io.Writer) (n int, err error)
- func (env *ExecutionPayloadEnvelope) String() string
- func (envelope *ExecutionPayloadEnvelope) UnmarshalSSZ(version BlockVersion, scope uint32, r io.Reader) error
- type ExecutionWitness
- type FCUState
- type ForkchoiceState
- type ForkchoiceUpdatedResult
- type HeadSignalFn
- type IndexedBlobHash
- type InputError
- type L1BlockRef
- type L1BlockRefsSource
- type L1Client
- type L2BlockRef
- type NewHeadSource
- type NumberAndHash
- type OperatorFeeParams
- type Output
- type OutputResponse
- type OutputV0
- type PayloadAttributes
- type PayloadID
- type PayloadInfo
- type PayloadStatusV1
- type ReducedConfigData
- type ReducedGenesisData
- type SafeHeadResponse
- type SignedBeaconBlockHeader
- type StorageKey
- type StorageProofEntry
- type Super
- type SuperRootResponse
- type SuperV1
- type SupervisorChainSyncStatus
- type SupervisorSyncStatus
- type SyncStatus
- type SyncTesterSession
- func (s *SyncTesterSession) FinishELSync(target uint64)
- func (s *SyncTesterSession) IsELSyncFinished() bool
- func (s *SyncTesterSession) ResetSession()
- func (s *SyncTesterSession) UpdateFCUFinalized(finalized uint64)
- func (s *SyncTesterSession) UpdateFCULatest(latest uint64)
- func (s *SyncTesterSession) UpdateFCUSafe(safe uint64)
- type SystemConfig
- type Uint256Quantity
- type Uint64Quantity
- type Uint64String
- type VersionInformation
Constants ¶
const ( BlobSize = 4096 * 32 MaxBlobDataSize = (4*31+3)*1024 - 4 EncodingVersion = 0 VersionOffset = 1 // offset of the version byte in the blob encoding Rounds = 1024 // number of encode/decode rounds )
const ( // Unsafe is: // - L1: absolute head of the chain // - L2: absolute head of the chain, not confirmed on L1 Unsafe = "latest" // Safe is: // - L1: Justified checkpoint, beacon chain: 1 epoch of 2/3 of the validators attesting the epoch. // - L2: Derived chain tip from L1 data Safe = "safe" // Finalized is: // - L1: Finalized checkpoint, beacon chain: 2+ justified epochs with "supermajority link" (see FFG docs). // More about FFG: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/gasper/ // - L2: Derived chain tip from finalized L1 data Finalized = "finalized" )
const ( // L1ScalarBedrock is implied pre-Ecotone, encoding just a regular-gas scalar. L1ScalarBedrock = byte(0) // L1ScalarEcotone is new in Ecotone, allowing configuration of both a regular and a blobs scalar. L1ScalarEcotone = byte(1) )
The Ecotone upgrade introduces a versioned L1 scalar format that is backward-compatible with pre-Ecotone L1 scalar values.
const ( // SuperRootVersionV1MinLen is the minimum length of a V1 super root prior to hashing // Must contain a 1 byte version, uint64 timestamp and at least one chain's output root hash SuperRootVersionV1MinLen = 1 + 8 + chainIDAndOutputLen )
Variables ¶
var ( ErrBlobInvalidFieldElement = errors.New("invalid field element") ErrBlobInvalidEncodingVersion = errors.New("invalid encoding version") ErrBlobInvalidLength = errors.New("invalid length for blob") ErrBlobInputTooLarge = errors.New("too much data to encode in one blob") ErrBlobExtraneousData = errors.New("non-zero data encountered where blob should be empty") ErrBlobExtraneousDataFieldElement = errors.New("non-zero data encountered where field element should be empty") )
var ( MaxU256Wei = ETH(uint256.Int{0: ^uint64(0), 1: ^uint64(0), 2: ^uint64(0), 3: ^uint64(0)}) MaxU128Wei = ETH(uint256.Int{0: ^uint64(0), 1: ^uint64(0), 2: 0, 3: 0}) MaxU64Wei = ETH(uint256.Int{0: ^uint64(0), 1: 0, 2: 0, 3: 0}) BillionEther = Ether(1000_000_000) MillionEther = Ether(1000_000) ThousandEther = Ether(1000) HundredEther = Ether(100) TenEther = Ether(10) OneEther = Ether(1) HalfEther = GWei(500_000_000) OneThirdEther = GWei(333_333_333) OneTenthEther = GWei(100_000_000) NineHundredthsEther = GWei(90_000_000) EightHundredthsEther = GWei(80_000_000) SevenHundredthsEther = GWei(70_000_000) SixHundredthsEther = GWei(60_000_000) FiveHundredthsEther = GWei(50_000_000) FourHundredthsEther = GWei(40_000_000) ThreeHundredthsEther = GWei(30_000_000) TwoHundredthsEther = GWei(20_000_000) OneHundredthEther = GWei(10_000_000) OneGWei = GWei(1) OneWei = WeiU64(1) ZeroWei = WeiU64(0) )
var ( ErrInvalidOutput = errors.New("invalid output") ErrInvalidOutputVersion = errors.New("invalid output version") OutputVersionV0 = Bytes32{} )
var ( // ErrExtraDataTooLarge occurs when the ExecutionPayload's ExtraData field // is too large to be properly represented in SSZ. ErrExtraDataTooLarge = errors.New("extra data too large") ErrBadTransactionOffset = errors.New("transactions offset is smaller than extra data offset, aborting") ErrBadWithdrawalsOffset = errors.New("withdrawals offset is smaller than transaction offset, aborting") ErrBadExtraDataOffset = errors.New("unexpected extra data offset") ErrScopeTooSmall = errors.New("scope too small to decode execution payload") ErrMissingData = errors.New("execution payload envelope is missing data") )
var ( ErrInvalidSuperRoot = errors.New("invalid super root") ErrInvalidSuperRootVersion = errors.New("invalid super root version") SuperRootVersionV1 = byte(1) )
var ErrBedrockScalarPaddingNotEmpty = errors.New("version 0 scalar value has non-empty padding")
Functions ¶
func AddressAsLeftPaddedHash ¶ added in v1.4.2
AddressAsLeftPaddedHash converts an address to a hash by left-padding it with zeros. No hashing is performed. This was previously known as Address.Hash(), but removed from go-ethereum in PR 28228, because the naming was not clear.
func CalcBlobFeeCancun ¶ added in v1.12.0
CalcBlobFeeCancun calculates the blob fee for the given header using the default blob schedule for Cancun. This function only exists to support the L1 Pectra Blob Schedule Fix. The geth function eip4844.CalcBlobFee should be used instead.
func CheckEcotoneL1SystemConfigScalar ¶ added in v1.5.0
func CheckRecentTxs ¶ added in v1.7.4
func CheckRecentTxs( ctx context.Context, l1 L1Client, depth int, addr common.Address, ) (blockNum uint64, found bool, err error)
CheckRecentTxs checks the depth recent blocks for txs from the account with address addr and returns either:
- blockNum containing the last tx and true if any was found
- the oldest block checked and false if no nonce change was found
func DecodeRawReceipts ¶
func DecodeRawReceipts(block BlockID, rawReceipts []hexutil.Bytes, txHashes []common.Hash) ([]*types.Receipt, error)
DecodeRawReceipts decodes receipts and adds additional blocks metadata. The contract-deployment addresses are not set however (high cost, depends on nonce values, unused by op-node).
func DecodeTransactions ¶
func DecodeTransactions(data []hexutil.Bytes) ([]*types.Transaction, error)
DecodeTransactions decodes a list of opaque transactions into transactions.
func EncodeOperatorFeeParams ¶ added in v1.12.0
func EncodeOperatorFeeParams(params OperatorFeeParams) (scalar [32]byte)
EncodeOperatorFeeParams encodes the OperatorFeeParams into a 32-byte value
func EncodeReceipts ¶
EncodeReceipts encodes a list of receipts into raw receipts. Some non-consensus meta-data may be lost.
func EncodeScalar ¶ added in v1.7.3
func EncodeScalar(scalars EcotoneScalars) (scalar [32]byte)
EncodeScalar encodes the EcotoneScalars into a 32-byte scalar value for the Ecotone serialization format.
func EncodeTransactions ¶
func EncodeTransactions(elems []*types.Transaction) ([]hexutil.Bytes, error)
EncodeTransactions encodes a list of transactions into opaque transactions.
func EvilChainIDToUInt64 ¶ added in v1.11.0
EvilChainIDToUInt64 converts a ChainID to a uint64 and panic's if the ChainID is too large for a UInt64 It is "evil" because 32 byte ChainIDs should be universally supported which this method breaks. It is provided for legacy purposes to facilitate a transition to full 32 byte chain ID support and should not be used in new code. Existing calls should be replaced with full 32 byte support whenever possible.
func ForkchoiceUpdateErr ¶
func ForkchoiceUpdateErr(payloadStatus PayloadStatusV1) error
func GetLogAtIndex ¶ added in v1.13.3
Assumes receipts are sorted by transaction index.
func KZGToVersionedHash ¶ added in v1.4.2
func KZGToVersionedHash(commitment kzg4844.Commitment) (out common.Hash)
KZGToVersionedHash computes the "blob hash" (a.k.a. versioned-hash) of a blob-commitment, as used in a blob-tx. We implement it here because it is unfortunately not (currently) exposed by geth.
func L1ChainConfigByChainID ¶ added in v1.14.0
func L1ChainConfigByChainID(chainID ChainID) *params.ChainConfig
L1ChainConfigByChainID returns the chain config for the given chain ID, if it is in the set of known chain IDs (Mainnet, Sepolia, Holesky, Hoodi). If the chain ID is not known, it returns nil.
func MaybeAsNotFoundErr ¶ added in v1.13.5
MaybeAsNotFoundErr checks if the error is an ethereum.NotFound error or has an error string that heuristically indicates that it is this error. If so, it returns ethereum.NotFound, otherwise it returns the original error.
Note that correct implementations of the execution layer API must return an empty result and no error if the block or header is not found. So using this translation hardens against wrong implementations of the execution layer API only.
func NewPayloadErr ¶
func NewPayloadErr(payload *ExecutionPayload, payloadStatus *PayloadStatusV1) error
func PollBlockChanges ¶
func PollBlockChanges(log log.Logger, src L1BlockRefsSource, fn HeadSignalFn, label BlockLabel, interval time.Duration, timeout time.Duration) ethereum.Subscription
PollBlockChanges opens a polling loop to fetch the L1 block reference with the given label, on provided interval and with request timeout. Results are returned with provided callback fn, which may block to pause/back-pressure polling.
func SortChainID ¶ added in v1.13.1
func SortChainID(ids []ChainID)
SortChainID sorts chain IDs in ascending order, in-place.
func TransactionsToHashes ¶
func TransactionsToHashes(elems []*types.Transaction) []common.Hash
TransactionsToHashes computes the transaction-hash for every transaction in the input.
func VerifyBlobProof ¶ added in v1.4.2
VerifyBlobProof verifies that the given blob and proof corresponds to the given commitment, returning error if the verification fails.
func WatchHeadChanges ¶
func WatchHeadChanges(ctx context.Context, src NewHeadSource, fn HeadSignalFn) (ethereum.Subscription, error)
WatchHeadChanges wraps a new-head subscription from NewHeadSource to feed the given Tracker. The ctx is only used to create the subscription, and does not affect the returned subscription.
func WeiToEther ¶ added in v1.7.7
WeiToEther divides the wei value by 10^18 to get a number in ether as a float64
Types ¶
type APIBeaconBlobsResponse ¶ added in v1.14.1
type APIBeaconBlobsResponse struct {
Data []*Blob `json:"data"`
}
type APIBlobSidecar ¶ added in v1.5.0
type APIBlobSidecar struct {
Index Uint64String `json:"index"`
Blob Blob `json:"blob"`
KZGCommitment Bytes48 `json:"kzg_commitment"`
KZGProof Bytes48 `json:"kzg_proof"`
SignedBlockHeader SignedBeaconBlockHeader `json:"signed_block_header"`
InclusionProof []Bytes32 `json:"kzg_commitment_inclusion_proof"`
}
func (*APIBlobSidecar) BlobSidecar ¶ added in v1.5.0
func (sc *APIBlobSidecar) BlobSidecar() *BlobSidecar
type APIConfigResponse ¶ added in v1.4.2
type APIConfigResponse struct {
Data ReducedConfigData `json:"data"`
}
type APIGenesisResponse ¶ added in v1.4.2
type APIGenesisResponse struct {
Data ReducedGenesisData `json:"data"`
}
type APIGetBlobSidecarsResponse ¶ added in v1.4.2
type APIGetBlobSidecarsResponse struct {
Data []*APIBlobSidecar `json:"data"`
}
type APIVersionResponse ¶ added in v1.5.0
type APIVersionResponse struct {
Data VersionInformation `json:"data"`
}
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"`
// Optional
StorageProof []StorageProofEntry `json:"storageProof,omitempty"`
}
func (*AccountResult) Verify ¶
func (res *AccountResult) Verify(stateRoot common.Hash) error
Verify an account (and optionally storage) proof from the getProof RPC. See https://eips.ethereum.org/EIPS/eip-1186
type BeaconBlockHeader ¶ added in v1.5.0
type BeaconBlockHeader struct {
Slot Uint64String `json:"slot"`
ProposerIndex Uint64String `json:"proposer_index"`
ParentRoot Bytes32 `json:"parent_root"`
StateRoot Bytes32 `json:"state_root"`
BodyRoot Bytes32 `json:"body_root"`
}
type Blob ¶ added in v1.4.2
func (*Blob) ComputeKZGCommitment ¶ added in v1.4.2
func (b *Blob) ComputeKZGCommitment() (kzg4844.Commitment, error)
func (*Blob) FromData ¶ added in v1.4.3
FromData encodes the given input data into this blob. The encoding scheme is as follows:
In each round we perform 7 reads of input of lengths (31,1,31,1,31,1,31) bytes respectively for a total of 127 bytes. This data is encoded into the next 4 field elements of the output by placing each of the 4x31 byte chunks into bytes [1:32] of its respective field element. The three single byte chunks (24 bits) are split into 4x6-bit chunks, each of which is written into the top most byte of its respective field element, leaving the top 2 bits of each field element empty to avoid modulus overflow. This process is repeated for up to 1024 rounds until all data is encoded.
For only the very first output field, bytes [1:5] are used to encode the version and the length of the data.
func (*Blob) MarshalText ¶ added in v1.4.2
func (*Blob) TerminalString ¶ added in v1.4.2
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Blob) ToData ¶ added in v1.4.3
ToData decodes the blob into raw byte data. See FromData above for details on the encoding format. If error is returned it will be one of InvalidFieldElementError, InvalidEncodingVersionError and InvalidLengthError.
func (*Blob) UnmarshalJSON ¶ added in v1.4.2
func (*Blob) UnmarshalText ¶ added in v1.4.2
type BlobSidecar ¶ added in v1.4.2
type BlobSidecar struct {
Blob Blob `json:"blob"`
Index Uint64String `json:"index"`
KZGCommitment Bytes48 `json:"kzg_commitment"`
KZGProof Bytes48 `json:"kzg_proof"`
}
type BlockID ¶
func HeaderBlockID ¶ added in v1.4.3
func ReceiptBlockID ¶ added in v1.4.3
func ToBlockID ¶
func ToBlockID(b NumberAndHash) BlockID
func (BlockID) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type BlockInfo ¶
type BlockInfo interface {
Hash() common.Hash
ParentHash() common.Hash
Coinbase() common.Address
Root() common.Hash // state-root
NumberU64() uint64
Time() uint64
// MixDigest field, reused for randomness after The Merge (Bellatrix hardfork)
MixDigest() common.Hash
BaseFee() *big.Int
// BlobBaseFee returns the result of computing the blob fee from excessDataGas, or nil if the
// block isn't a Dencun (4844 capable) block
BlobBaseFee(chainConfig *params.ChainConfig) *big.Int
ExcessBlobGas() *uint64
ReceiptHash() common.Hash
GasUsed() uint64
GasLimit() uint64
ParentBeaconRoot() *common.Hash // Dencun extension
WithdrawalsRoot() *common.Hash // Isthmus extension
// HeaderRLP returns the RLP of the block header as per consensus rules
// Returns an error if the header RLP could not be written
HeaderRLP() ([]byte, error)
}
func BlockToInfo ¶
func HeaderBlockInfo ¶
HeaderBlockInfo returns h as a BlockInfo implementation, with pre-cached blockhash.
type BlockLabel ¶
type BlockLabel string
func (BlockLabel) Arg ¶
func (label BlockLabel) Arg() any
func (BlockLabel) CheckID ¶
func (BlockLabel) CheckID(id BlockID) error
type BlockRef ¶ added in v1.9.4
type BlockRef = L1BlockRef
BlockRef is a Block Ref independent of L1 or L2 Because L1BlockRefs are strict subsets of L2BlockRefs, BlockRef is a direct alias of L1BlockRef
func BlockRefFromHeader ¶ added in v1.12.1
type BlockVersion ¶ added in v1.4.2
type BlockVersion int
const ( BlockV1 BlockVersion = iota BlockV2 BlockV3 BlockV4 )
func (BlockVersion) HasBlobProperties ¶ added in v1.5.0
func (v BlockVersion) HasBlobProperties() bool
func (BlockVersion) HasParentBeaconBlockRoot ¶ added in v1.5.0
func (v BlockVersion) HasParentBeaconBlockRoot() bool
func (BlockVersion) HasWithdrawals ¶ added in v1.5.0
func (v BlockVersion) HasWithdrawals() bool
func (BlockVersion) HasWithdrawalsRoot ¶ added in v1.11.0
func (v BlockVersion) HasWithdrawalsRoot() bool
type Bytes256 ¶
type Bytes256 [256]byte
func (Bytes256) MarshalText ¶
func (Bytes256) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Bytes256) UnmarshalJSON ¶
func (*Bytes256) UnmarshalText ¶
type Bytes32 ¶
type Bytes32 [32]byte
func OutputRoot ¶
OutputRoot returns the keccak256 hash of the marshaled L2 output
func (Bytes32) MarshalText ¶
func (Bytes32) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Bytes32) UnmarshalJSON ¶
func (*Bytes32) UnmarshalText ¶
type Bytes48 ¶ added in v1.4.2
type Bytes48 [48]byte
func (Bytes48) MarshalText ¶ added in v1.4.2
func (Bytes48) TerminalString ¶ added in v1.4.2
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Bytes48) UnmarshalJSON ¶ added in v1.4.2
func (*Bytes48) UnmarshalText ¶ added in v1.4.2
type Bytes65 ¶ added in v1.12.0
type Bytes65 [65]byte
Bytes65 is a 65-byte long byte string, and encoded with 0x-prefix in hex. This can be used to represent encoded secp256k ethereum signatures.
func (Bytes65) MarshalText ¶ added in v1.12.0
func (Bytes65) TerminalString ¶ added in v1.12.0
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Bytes65) UnmarshalJSON ¶ added in v1.12.0
func (*Bytes65) UnmarshalText ¶ added in v1.12.0
type Bytes8 ¶ added in v1.9.5
type Bytes8 [8]byte
func (Bytes8) MarshalText ¶ added in v1.9.5
func (Bytes8) TerminalString ¶ added in v1.9.5
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Bytes8) UnmarshalJSON ¶ added in v1.9.5
func (*Bytes8) UnmarshalText ¶ added in v1.9.5
type Bytes96 ¶ added in v1.5.0
type Bytes96 [96]byte
func (Bytes96) MarshalText ¶ added in v1.5.0
func (Bytes96) TerminalString ¶ added in v1.5.0
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Bytes96) UnmarshalJSON ¶ added in v1.5.0
func (*Bytes96) UnmarshalText ¶ added in v1.5.0
type BytesMax32 ¶
type BytesMax32 []byte
func (BytesMax32) MarshalText ¶
func (b BytesMax32) MarshalText() ([]byte, error)
func (BytesMax32) String ¶
func (b BytesMax32) String() string
func (*BytesMax32) UnmarshalJSON ¶
func (b *BytesMax32) UnmarshalJSON(text []byte) error
func (*BytesMax32) UnmarshalText ¶
func (b *BytesMax32) UnmarshalText(text []byte) error
type ChainID ¶ added in v1.11.0
func ChainIDFromBig ¶ added in v1.11.0
func ChainIDFromBytes32 ¶ added in v1.11.0
func ChainIDFromString ¶ added in v1.13.4
func ChainIDFromUInt64 ¶ added in v1.11.0
func ParseDecimalChainID ¶ added in v1.11.0
func ParseHexChainID ¶ added in v1.13.4
func (ChainID) MarshalText ¶ added in v1.11.0
MarshalText marshals into the decimal representation of the chainID
func (ChainID) Uint64 ¶ added in v1.13.1
Uint64 is a convenience function, to turn the chainID into 64 bits. Not all chain IDs fit in 64 bits. This should be used only for compatibility with legacy tools / libs that do not use the full 32 byte chainID type.
func (*ChainID) UnmarshalText ¶ added in v1.11.0
UnmarshalText can unmarshal both a hexadecimal (must have 0x prefix) or decimal chainID
type ChainIDAndOutput ¶ added in v1.11.0
func (*ChainIDAndOutput) Marshal ¶ added in v1.11.0
func (c *ChainIDAndOutput) Marshal() []byte
type ChainRootInfo ¶ added in v1.11.0
type ChainRootInfo struct {
ChainID ChainID `json:"chainID"`
// Canonical is the output root of the latest canonical block at a particular Timestamp.
Canonical Bytes32 `json:"canonical"`
// Pending is the output root preimage for the latest block at a particular Timestamp prior to validation of
// executing messages. If the original block was valid, this will be the preimage of the
// output root from the Canonical array. If it was invalid, it will be the output root preimage from the
// Optimistic Block Deposited Transaction added to the deposit-only block.
Pending []byte `json:"pending"`
}
func (ChainRootInfo) MarshalJSON ¶ added in v1.11.0
func (i ChainRootInfo) MarshalJSON() ([]byte, error)
func (*ChainRootInfo) UnmarshalJSON ¶ added in v1.11.0
func (i *ChainRootInfo) UnmarshalJSON(input []byte) error
type ETH ¶ added in v1.13.2
ETH is a typed ETH (test-)currency integer, expressed in number of wei. Most methods and usages prefer a flat value presentation, instead of pointer. And return the new value, instead of mutating in-place. This type is not optimized for speed, but is instead designed for readability and to remove mutability foot-guns.
func Ether ¶ added in v1.13.2
Ether turns the given amount of ether into ETH-typed wei. I.e. this multiplies the amount by 1e18 to denominate into wei.
func GWei ¶ added in v1.13.2
GWei turns the given amount of GWei into ETH-typed wei. I.e. this multiplies the amount by 1e9 to denominate into wei.
func WeiBig ¶ added in v1.13.2
WeiBig turns the given big.Int amount of wei into ETH-typed wei. This panics if the amount does not fit in 256 bits, or if it is negative.
func WeiU256 ¶ added in v1.13.2
WeiU256 turns the given uint256.Int amount of wei into ETH-typed wei.
func WeiU64 ¶ added in v1.13.2
WeiU64 turns the given uint64 amount of wei into ETH-typed wei. The upper 192 bits are zeroed.
func (ETH) Add ¶ added in v1.13.2
Add adds v and returns the result. No value is mutated. Add panics if the computation overflows uint256.
func (ETH) AddOverflow ¶ added in v1.13.2
AddOverflow adds v and returns the result. No value is mutated. This also returns a boolean indicating if the computation overflowed.
func (ETH) Div ¶ added in v1.13.2
Div returns the quotient self/denominator. Div performs integer division and always rounds down. No value is mutated. If denominator == 0, this returns 0.
func (ETH) EtherString ¶ added in v1.13.2
EtherString returns the amount, string-ified, forced in ether units (excl. unit suffix)
func (ETH) Hex ¶ added in v1.13.2
Hex returns the amount, in wei, in hexadecimal form with 0x prefix.
func (ETH) MarshalText ¶ added in v1.13.2
MarshalText marshals as decimal number, without comma separators or unit
func (ETH) Mul ¶ added in v1.13.2
Mul multiplies by the given uint64 scalar, and returns the result. No value is mutated. Mul panics if the given computation overflows uin256.
func (ETH) MulOverflow ¶ added in v1.13.2
MulOverflow multiplies by the given scalar, and returns the result. No value is mutated. This also returns a boolean indicating if the result overflowed.
func (ETH) String ¶ added in v1.13.2
String prints the amount of ETH, with thousands comma-separators, and unit. If the amount is perfectly divisible by 1 ether, the amount is printed in ethers. If the amount is perfectly divisible by 1 gwei, the amount is printed in gwei. If not neatly divisible, the amount is printed in wei. This String function is optimized for readability, without precision loss, to not hide any precision data during debugging.
func (ETH) Sub ¶ added in v1.13.2
Sub subtracts v and returns the result. No value is mutated. Sub panics if the computation underflows.
func (ETH) SubUnderflow ¶ added in v1.13.2
SubUnderflow subtracts v and returns the result. No value is mutated. This also returns a boolean indicating if the computation underflowed.
func (ETH) ToU256 ¶ added in v1.13.2
ToU256 converts to *uint256.Int, in wei. This returns a clone, not the underlying uint256.Int type.
func (*ETH) UnmarshalJSON ¶ added in v1.13.3
UnmarshalJSON implements json.Unmarshaler. UnmarshalJSON accepts either - Quoted string: either hexadecimal OR decimal - Not quoted string: only decimal
func (*ETH) UnmarshalText ¶ added in v1.13.2
UnmarshalText supports hexadecimal (0x prefix) and decimal.
type EcotoneScalars ¶ added in v1.7.6
func DecodeScalar ¶ added in v1.7.3
func DecodeScalar(scalar [32]byte) (EcotoneScalars, error)
DecodeScalar decodes the blobBaseFeeScalar and baseFeeScalar from a 32-byte scalar value. It uses the first byte to determine the scalar format.
type EngineAPIMethod ¶ added in v1.5.1
type EngineAPIMethod string
const ( FCUV1 EngineAPIMethod = "engine_forkchoiceUpdatedV1" FCUV2 EngineAPIMethod = "engine_forkchoiceUpdatedV2" FCUV3 EngineAPIMethod = "engine_forkchoiceUpdatedV3" NewPayloadV2 EngineAPIMethod = "engine_newPayloadV2" NewPayloadV3 EngineAPIMethod = "engine_newPayloadV3" NewPayloadV4 EngineAPIMethod = "engine_newPayloadV4" GetPayloadV2 EngineAPIMethod = "engine_getPayloadV2" GetPayloadV3 EngineAPIMethod = "engine_getPayloadV3" GetPayloadV4 EngineAPIMethod = "engine_getPayloadV4" )
type ErrorCode ¶
type ErrorCode int
const ( MethodNotFound ErrorCode = -32601 // RPC method not found or not available. InvalidParams ErrorCode = -32602 UnknownPayload ErrorCode = -38001 // Payload does not exist / is not available. InvalidForkchoiceState ErrorCode = -38002 // Forkchoice state is invalid / inconsistent. InvalidPayloadAttributes ErrorCode = -38003 // Payload attributes are invalid / inconsistent. TooLargeEngineRequest ErrorCode = -38004 // Unused, here for completeness, only used by engine_getPayloadBodiesByHashV1 UnsupportedFork ErrorCode = -38005 // Unused, see issue #11130. )
Engine error codes used to be -3200x, but were rebased to -3800x: https://github.com/ethereum/execution-apis/pull/214
func (ErrorCode) IsEngineError ¶ added in v1.8.0
func (ErrorCode) IsGenericRPCError ¶ added in v1.9.5
type ExecutePayloadStatus ¶
type ExecutePayloadStatus string
const ( // given payload is valid ExecutionValid ExecutePayloadStatus = "VALID" // given payload is invalid ExecutionInvalid ExecutePayloadStatus = "INVALID" // sync process is in progress ExecutionSyncing ExecutePayloadStatus = "SYNCING" // returned if the payload is not fully validated, and does not extend the canonical chain, // but will be remembered for later (on reorgs or sync updates and such) ExecutionAccepted ExecutePayloadStatus = "ACCEPTED" // if the block-hash in the payload is not correct ExecutionInvalidBlockHash ExecutePayloadStatus = "INVALID_BLOCK_HASH" // proof-of-stake transition only, not used in rollup ExecutionInvalidTerminalBlock ExecutePayloadStatus = "INVALID_TERMINAL_BLOCK" )
type ExecutionPayload ¶
type ExecutionPayload struct {
ParentHash common.Hash `json:"parentHash"`
FeeRecipient common.Address `json:"feeRecipient"`
StateRoot Bytes32 `json:"stateRoot"`
ReceiptsRoot Bytes32 `json:"receiptsRoot"`
LogsBloom Bytes256 `json:"logsBloom"`
PrevRandao Bytes32 `json:"prevRandao"`
BlockNumber Uint64Quantity `json:"blockNumber"`
GasLimit Uint64Quantity `json:"gasLimit"`
GasUsed Uint64Quantity `json:"gasUsed"`
Timestamp Uint64Quantity `json:"timestamp"`
ExtraData BytesMax32 `json:"extraData"`
BaseFeePerGas Uint256Quantity `json:"baseFeePerGas"`
BlockHash common.Hash `json:"blockHash"`
// Array of transaction objects, each object is a byte list (DATA) representing
// TransactionType || TransactionPayload or LegacyTransaction as defined in EIP-2718
Transactions []Data `json:"transactions"`
// Nil if not present (Bedrock)
Withdrawals *types.Withdrawals `json:"withdrawals,omitempty"`
// Nil if not present (Bedrock, Canyon, Delta)
BlobGasUsed *Uint64Quantity `json:"blobGasUsed,omitempty"`
// Nil if not present (Bedrock, Canyon, Delta)
ExcessBlobGas *Uint64Quantity `json:"excessBlobGas,omitempty"`
// Nil if not present (Bedrock, Canyon, Delta, Ecotone, Fjord, Granite, Holocene)
WithdrawalsRoot *common.Hash `json:"withdrawalsRoot,omitempty"`
}
func BlockAsPayload ¶
func BlockAsPayload(bl *types.Block, config *params.ChainConfig) (*ExecutionPayload, error)
BlockAsPayload converts a *types.Block to an ExecutionPayload. It can only be used to convert OP-Stack blocks, as it follows Canyon and Isthmus rules to set the Withdrawals and WithdrawalsRoot fields.
func (*ExecutionPayload) BlockRef ¶ added in v1.11.0
func (payload *ExecutionPayload) BlockRef() BlockRef
func (*ExecutionPayload) CheckEqual ¶ added in v1.13.6
func (p *ExecutionPayload) CheckEqual(o *ExecutionPayload) error
func (*ExecutionPayload) ID ¶
func (payload *ExecutionPayload) ID() BlockID
func (*ExecutionPayload) MarshalSSZ ¶
func (payload *ExecutionPayload) MarshalSSZ(w io.Writer) (n int, err error)
MarshalSSZ encodes the ExecutionPayload as SSZ type
func (*ExecutionPayload) ParentID ¶
func (payload *ExecutionPayload) ParentID() BlockID
func (*ExecutionPayload) SizeSSZ ¶
func (payload *ExecutionPayload) SizeSSZ() (full uint32)
func (*ExecutionPayload) String ¶ added in v1.12.0
func (payload *ExecutionPayload) String() string
func (*ExecutionPayload) UnmarshalSSZ ¶
func (payload *ExecutionPayload) UnmarshalSSZ(version BlockVersion, scope uint32, r io.Reader) error
UnmarshalSSZ decodes the ExecutionPayload as SSZ type
type ExecutionPayloadEnvelope ¶ added in v1.4.2
type ExecutionPayloadEnvelope struct {
ParentBeaconBlockRoot *common.Hash `json:"parentBeaconBlockRoot,omitempty"`
ExecutionPayload *ExecutionPayload `json:"executionPayload"`
}
func BlockAsPayloadEnv ¶ added in v1.7.2
func BlockAsPayloadEnv(bl *types.Block, config *params.ChainConfig) (*ExecutionPayloadEnvelope, error)
func (*ExecutionPayloadEnvelope) CheckBlockHash ¶ added in v1.5.0
func (envelope *ExecutionPayloadEnvelope) CheckBlockHash() (actual common.Hash, ok bool)
CheckBlockHash recomputes the block hash and returns if the embedded block hash matches.
func (*ExecutionPayloadEnvelope) ID ¶ added in v1.12.0
func (env *ExecutionPayloadEnvelope) ID() BlockID
func (*ExecutionPayloadEnvelope) MarshalSSZ ¶ added in v1.5.0
func (envelope *ExecutionPayloadEnvelope) MarshalSSZ(w io.Writer) (n int, err error)
MarshalSSZ encodes the ExecutionPayload as SSZ type
func (*ExecutionPayloadEnvelope) String ¶ added in v1.12.0
func (env *ExecutionPayloadEnvelope) String() string
func (*ExecutionPayloadEnvelope) UnmarshalSSZ ¶ added in v1.5.0
func (envelope *ExecutionPayloadEnvelope) UnmarshalSSZ(version BlockVersion, scope uint32, r io.Reader) error
UnmarshalSSZ decodes the ExecutionPayloadEnvelope as SSZ type
type ExecutionWitness ¶ added in v1.9.5
type FCUState ¶ added in v1.13.6
type FCUState struct {
Latest uint64 `json:"latest"`
Safe uint64 `json:"safe"`
Finalized uint64 `json:"finalized"`
}
FCUState represents the Fork Choice Update state with Latest, Safe, and Finalized block numbers
type ForkchoiceState ¶
type ForkchoiceState struct {
// block hash of the head of the canonical chain
HeadBlockHash common.Hash `json:"headBlockHash"`
// safe block hash in the canonical chain
SafeBlockHash common.Hash `json:"safeBlockHash"`
// block hash of the most recent finalized block
FinalizedBlockHash common.Hash `json:"finalizedBlockHash"`
}
type ForkchoiceUpdatedResult ¶
type ForkchoiceUpdatedResult struct {
// the result of the payload execution
PayloadStatus PayloadStatusV1 `json:"payloadStatus"`
// the payload id if requested
PayloadID *PayloadID `json:"payloadId"`
}
type HeadSignalFn ¶
type HeadSignalFn func(ctx context.Context, sig L1BlockRef)
HeadSignalFn is used as callback function to accept head-signals
type IndexedBlobHash ¶ added in v1.4.3
type IndexedBlobHash struct {
Index uint64 // absolute index in the block, a.k.a. position in sidecar blobs array
Hash common.Hash // hash of the blob, used for consistency checks
}
IndexedBlobHash represents a blob hash that commits to a single blob confirmed in a block. The index helps us avoid unnecessary blob to blob hash conversions to find the right content in a sidecar.
type InputError ¶
InputError can be used to create rpc.Error instances with a specific error code.
func (InputError) Error ¶
func (ie InputError) Error() string
func (InputError) ErrorCode ¶ added in v1.9.5
func (ie InputError) ErrorCode() int
Makes InputError implement the rpc.Error interface
func (InputError) Is ¶
func (ie InputError) Is(target error) bool
Is checks if the error is the given target type. Any type of InputError counts, regardless of code.
func (InputError) Unwrap ¶
func (ie InputError) Unwrap() error
type L1BlockRef ¶
type L1BlockRef struct {
Hash common.Hash `json:"hash"`
Number uint64 `json:"number"`
ParentHash common.Hash `json:"parentHash"`
Time uint64 `json:"timestamp"`
}
func InfoToL1BlockRef ¶
func InfoToL1BlockRef(info BlockInfo) L1BlockRef
func (L1BlockRef) ID ¶
func (id L1BlockRef) ID() BlockID
func (L1BlockRef) ParentID ¶
func (id L1BlockRef) ParentID() BlockID
func (L1BlockRef) String ¶
func (id L1BlockRef) String() string
func (L1BlockRef) TerminalString ¶
func (id L1BlockRef) TerminalString() string
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type L1BlockRefsSource ¶
type L1BlockRefsSource interface {
L1BlockRefByLabel(ctx context.Context, label BlockLabel) (L1BlockRef, error)
}
type L2BlockRef ¶
type L2BlockRef struct {
Hash common.Hash `json:"hash"`
Number uint64 `json:"number"`
ParentHash common.Hash `json:"parentHash"`
Time uint64 `json:"timestamp"`
L1Origin BlockID `json:"l1origin"`
SequenceNumber uint64 `json:"sequenceNumber"` // distance to first block of epoch
}
func (L2BlockRef) BlockRef ¶ added in v1.9.5
func (id L2BlockRef) BlockRef() BlockRef
func (L2BlockRef) ID ¶
func (id L2BlockRef) ID() BlockID
func (L2BlockRef) ParentID ¶
func (id L2BlockRef) ParentID() BlockID
func (L2BlockRef) String ¶
func (id L2BlockRef) String() string
func (L2BlockRef) TerminalString ¶
func (id L2BlockRef) TerminalString() string
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type NewHeadSource ¶
type NumberAndHash ¶
type OperatorFeeParams ¶ added in v1.12.0
func DecodeOperatorFeeParams ¶ added in v1.12.0
func DecodeOperatorFeeParams(scalar [32]byte) OperatorFeeParams
DecodeScalar decodes the operatorFeeScalar and operatorFeeConstant from a 32-byte scalar value. It uses the first byte to determine the scalar format.
type Output ¶
type Output interface {
// Version returns the version of the L2 output
Version() Bytes32
// Marshal a L2 output into a byte slice for hashing
Marshal() []byte
}
func UnmarshalOutput ¶
type OutputResponse ¶
type OutputResponse struct {
Version Bytes32 `json:"version"`
OutputRoot Bytes32 `json:"outputRoot"`
BlockRef L2BlockRef `json:"blockRef"`
WithdrawalStorageRoot common.Hash `json:"withdrawalStorageRoot"`
StateRoot common.Hash `json:"stateRoot"`
Status *SyncStatus `json:"syncStatus"`
}
type OutputV0 ¶
type PayloadAttributes ¶
type PayloadAttributes struct {
// value for the timestamp field of the new payload
Timestamp Uint64Quantity `json:"timestamp"`
// value for the random field of the new payload
PrevRandao Bytes32 `json:"prevRandao"`
// suggested value for the coinbase field of the new payload
SuggestedFeeRecipient common.Address `json:"suggestedFeeRecipient"`
// Withdrawals to include into the block -- should be nil or empty depending on Shanghai enablement
Withdrawals *types.Withdrawals `json:"withdrawals,omitempty"`
// parentBeaconBlockRoot optional extension in Dencun
ParentBeaconBlockRoot *common.Hash `json:"parentBeaconBlockRoot,omitempty"`
// Transactions to force into the block (always at the start of the transactions list).
Transactions []Data `json:"transactions,omitempty"`
// NoTxPool to disable adding any transactions from the transaction-pool.
NoTxPool bool `json:"noTxPool,omitempty"`
// GasLimit override
GasLimit *Uint64Quantity `json:"gasLimit,omitempty"`
// EIP-1559 parameters, to be specified only post-Holocene
EIP1559Params *Bytes8 `json:"eip1559Params,omitempty"`
// MinBaseFee is the minimum base fee, to be specified only post-Jovian
MinBaseFee *uint64 `json:"minBaseFee,omitempty"`
}
func (*PayloadAttributes) IsDepositsOnly ¶ added in v1.9.5
func (a *PayloadAttributes) IsDepositsOnly() bool
IsDepositsOnly returns whether all transactions of the PayloadAttributes are of Deposit type. Empty transactions are also considered non-Deposit transactions.
func (*PayloadAttributes) WithDepositsOnly ¶ added in v1.9.5
func (a *PayloadAttributes) WithDepositsOnly() *PayloadAttributes
WithDepositsOnly return a shallow clone with all non-Deposit transactions stripped from its transactions. The order is preserved.
type PayloadInfo ¶ added in v1.5.1
type PayloadStatusV1 ¶
type PayloadStatusV1 struct {
// the result of the payload execution
Status ExecutePayloadStatus `json:"status"`
// the hash of the most recent valid block in the branch defined by payload and its ancestors (optional field)
LatestValidHash *common.Hash `json:"latestValidHash,omitempty"`
// additional details on the result (optional field)
ValidationError *string `json:"validationError,omitempty"`
}
type ReducedConfigData ¶ added in v1.4.2
type ReducedConfigData struct {
SecondsPerSlot Uint64String `json:"SECONDS_PER_SLOT"`
}
type ReducedGenesisData ¶ added in v1.4.2
type ReducedGenesisData struct {
GenesisTime Uint64String `json:"genesis_time"`
}
type SafeHeadResponse ¶ added in v1.7.2
type SignedBeaconBlockHeader ¶ added in v1.5.0
type SignedBeaconBlockHeader struct {
Message BeaconBlockHeader `json:"message"`
Signature hexutil.Bytes `json:"signature"`
}
type StorageKey ¶ added in v1.11.0
type StorageKey []byte
StorageKey is a marshaling utility for hex-encoded storage keys, which can have leading 0s and are an arbitrary length.
func (StorageKey) MarshalText ¶ added in v1.11.0
func (k StorageKey) MarshalText() ([]byte, error)
func (StorageKey) String ¶ added in v1.11.0
func (k StorageKey) String() string
func (*StorageKey) UnmarshalText ¶ added in v1.11.0
func (k *StorageKey) UnmarshalText(text []byte) error
type StorageProofEntry ¶
type StorageProofEntry struct {
Key StorageKey `json:"key"`
Value hexutil.Big `json:"value"`
Proof []hexutil.Bytes `json:"proof"`
}
type Super ¶ added in v1.11.0
func UnmarshalSuperRoot ¶ added in v1.11.0
type SuperRootResponse ¶ added in v1.11.0
type SuperRootResponse struct {
CrossSafeDerivedFrom BlockID `json:"crossSafeDerivedFrom"`
Timestamp uint64 `json:"timestamp"`
SuperRoot Bytes32 `json:"superRoot"`
Version byte `json:"version"`
// Chains is the list of ChainRootInfo for each chain in the dependency set.
// It represents the state of the chain at or before the Timestamp.
Chains []ChainRootInfo `json:"chains"`
}
func (SuperRootResponse) MarshalJSON ¶ added in v1.11.0
func (r SuperRootResponse) MarshalJSON() ([]byte, error)
func (SuperRootResponse) ToSuper ¶ added in v1.12.0
func (s SuperRootResponse) ToSuper() (Super, error)
func (*SuperRootResponse) UnmarshalJSON ¶ added in v1.11.0
func (r *SuperRootResponse) UnmarshalJSON(input []byte) error
type SuperV1 ¶ added in v1.11.0
type SuperV1 struct {
Timestamp uint64
Chains []ChainIDAndOutput
}
func NewSuperV1 ¶ added in v1.11.0
func NewSuperV1(timestamp uint64, chains ...ChainIDAndOutput) *SuperV1
type SupervisorChainSyncStatus ¶ added in v1.11.0
type SupervisorChainSyncStatus struct {
// LocalUnsafe is the latest L2 block that has been processed by the supervisor.
LocalUnsafe BlockRef `json:"localUnsafe"`
LocalSafe BlockID `json:"localSafe"`
CrossUnsafe BlockID `json:"crossUnsafe"`
// Some fault-proof releases may already depend on `safe`, so we keep JSON field name as `safe`.
CrossSafe BlockID `json:"safe"`
Finalized BlockID `json:"finalized"`
}
SupervisorChainSyncStatus is the status of a chain as seen by the supervisor.
type SupervisorSyncStatus ¶ added in v1.11.0
type SupervisorSyncStatus struct {
// MinSyncedL1 is the highest L1 block that has been processed by all supervisor nodes.
// This is not the same as the latest L1 block known to the supervisor,
// but rather the L1 block view of the supervisor nodes.
// This L1 block may not be fully derived into L2 data on all nodes yet.
MinSyncedL1 L1BlockRef `json:"minSyncedL1"`
SafeTimestamp uint64 `json:"safeTimestamp"`
FinalizedTimestamp uint64 `json:"finalizedTimestamp"`
Chains map[ChainID]*SupervisorChainSyncStatus `json:"chains"`
}
type SyncStatus ¶
type SyncStatus struct {
// CurrentL1 is the L1 block that the derivation process is last idled at.
// This may not be fully derived into L2 data yet.
// The safe L2 blocks were produced/included fully from the L1 chain up to _but excluding_ this L1 block.
// If the node is synced, this matches the HeadL1, minus the verifier confirmation distance.
CurrentL1 L1BlockRef `json:"current_l1"`
// CurrentL1Finalized is a legacy sync-status attribute. This is deprecated.
// A previous version of the L1 finalization-signal was updated only after the block was retrieved by number.
// This attribute just matches FinalizedL1 now.
CurrentL1Finalized L1BlockRef `json:"current_l1_finalized"`
// HeadL1 is the perceived head of the L1 chain, no confirmation distance.
// The head is not guaranteed to build on the other L1 sync status fields,
// as the node may be in progress of resetting to adapt to a L1 reorg.
HeadL1 L1BlockRef `json:"head_l1"`
SafeL1 L1BlockRef `json:"safe_l1"`
FinalizedL1 L1BlockRef `json:"finalized_l1"`
// UnsafeL2 is the absolute tip of the L2 chain,
// pointing to block data that has not been submitted to L1 yet.
// The sequencer is building this, and verifiers may also be ahead of the
// SafeL2 block if they sync blocks via p2p or other offchain sources.
// This is considered to only be local-unsafe post-interop, see CrossUnsafe for cross-L2 guarantees.
UnsafeL2 L2BlockRef `json:"unsafe_l2"`
// SafeL2 points to the L2 block that was derived from the L1 chain.
// This point may still reorg if the L1 chain reorgs.
// This is considered to be cross-safe post-interop, see LocalSafe to ignore cross-L2 guarantees.
SafeL2 L2BlockRef `json:"safe_l2"`
// FinalizedL2 points to the L2 block that was derived fully from
// finalized L1 information, thus irreversible.
FinalizedL2 L2BlockRef `json:"finalized_l2"`
// PendingSafeL2 points to the L2 block processed from the batch, but not consolidated to the safe block yet.
PendingSafeL2 L2BlockRef `json:"pending_safe_l2"`
// CrossUnsafeL2 is an unsafe L2 block, that has been verified to match cross-L2 dependencies.
// Pre-interop every unsafe L2 block is also cross-unsafe.
CrossUnsafeL2 L2BlockRef `json:"cross_unsafe_l2"`
// LocalSafeL2 is an L2 block derived from L1, not yet verified to have valid cross-L2 dependencies.
LocalSafeL2 L2BlockRef `json:"local_safe_l2"`
}
SyncStatus is a snapshot of the driver. Values may be zeroed if not yet initialized.
type SyncTesterSession ¶ added in v1.13.6
type SyncTesterSession struct {
sync.Mutex
SessionID string `json:"session_id"`
// Non canonical view of the chain
Validated uint64 `json:"validated"`
// Canonical view of the chain
CurrentState FCUState `json:"current_state"`
// payloads
Payloads map[PayloadID]*ExecutionPayloadEnvelope `json:"-"`
ELSyncTarget uint64 `json:"el_sync_target"`
ELSyncActive bool `json:"el_sync_active"`
InitialState FCUState `json:"initial_state"`
InitialELSyncActive bool `json:"initial_el_sync_active"`
}
func NewSyncTesterSession ¶ added in v1.13.7
func NewSyncTesterSession(sessionID string, latest, safe, finalized, elSyncTarget uint64, elSyncActive bool) *SyncTesterSession
func (*SyncTesterSession) FinishELSync ¶ added in v1.13.7
func (s *SyncTesterSession) FinishELSync(target uint64)
func (*SyncTesterSession) IsELSyncFinished ¶ added in v1.13.7
func (s *SyncTesterSession) IsELSyncFinished() bool
func (*SyncTesterSession) ResetSession ¶ added in v1.13.7
func (s *SyncTesterSession) ResetSession()
func (*SyncTesterSession) UpdateFCUFinalized ¶ added in v1.13.7
func (s *SyncTesterSession) UpdateFCUFinalized(finalized uint64)
func (*SyncTesterSession) UpdateFCULatest ¶ added in v1.13.7
func (s *SyncTesterSession) UpdateFCULatest(latest uint64)
func (*SyncTesterSession) UpdateFCUSafe ¶ added in v1.13.7
func (s *SyncTesterSession) UpdateFCUSafe(safe uint64)
type SystemConfig ¶
type SystemConfig struct {
// BatcherAddr identifies the batch-sender address used in batch-inbox data-transaction filtering.
BatcherAddr common.Address `json:"batcherAddr"`
// Overhead identifies the L1 fee overhead.
// Pre-Ecotone this is passed as-is to the engine.
// Post-Ecotone this is always zero, and not passed into the engine.
Overhead Bytes32 `json:"overhead"`
// Scalar identifies the L1 fee scalar
// Pre-Ecotone this is passed as-is to the engine.
// Post-Ecotone this encodes multiple pieces of scalar data.
Scalar Bytes32 `json:"scalar"`
// GasLimit identifies the L2 block gas limit
GasLimit uint64 `json:"gasLimit"`
// EIP1559Params contains the Holocene-encoded EIP-1559 parameters. This
// value will be 0 if Holocene is not active, or if derivation has yet to
// process any EIP_1559_PARAMS system config update events.
EIP1559Params Bytes8 `json:"eip1559Params"`
// OperatorFeeParams identifies the operator fee parameters.
OperatorFeeParams Bytes32 `json:"operatorFeeParams"`
// MinBaseFee identifies the minimum base fee.
MinBaseFee uint64 `json:"minBaseFee"`
// MarshalPreHolocene indicates whether or not this struct should be
// marshaled in the pre-Holocene format. The pre-Holocene format does
// not marshal the EIP1559Params field. The presence of this field in
// pre-Holocene codebases causes the rollup config to be rejected.
MarshalPreHolocene bool `json:"-"`
}
SystemConfig represents the rollup system configuration that carries over in every L2 block, and may be changed through L1 system config events. The initial SystemConfig at rollup genesis is embedded in the rollup configuration.
func (*SystemConfig) EcotoneScalars ¶ added in v1.5.0
func (sysCfg *SystemConfig) EcotoneScalars() (EcotoneScalars, error)
func (SystemConfig) MarshalJSON ¶ added in v1.9.5
func (sysCfg SystemConfig) MarshalJSON() ([]byte, error)
func (*SystemConfig) OperatorFee ¶ added in v1.12.0
func (sysCfg *SystemConfig) OperatorFee() OperatorFeeParams
type Uint256Quantity ¶
type Uint64Quantity ¶
type Uint64String ¶ added in v1.4.2
type Uint64String uint64
Uint64String is a decimal string representation of an uint64, for usage in the Beacon API JSON encoding
func (Uint64String) MarshalText ¶ added in v1.4.2
func (v Uint64String) MarshalText() (out []byte, err error)
func (*Uint64String) UnmarshalText ¶ added in v1.4.2
func (v *Uint64String) UnmarshalText(b []byte) error
type VersionInformation ¶ added in v1.5.0
type VersionInformation struct {
Version string `json:"version"`
}