Documentation
¶
Overview ¶
Package chain holds the typed domain values used across chain-commons.
All types here are pure data with no I/O dependencies. Aliases over go-ethereum's common.* types let consumers avoid importing go-ethereum just to name a hash or address.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockNumber ¶
type BlockNumber uint64
BlockNumber is an L1 or L2 block height. Always non-negative.
func (BlockNumber) BigInt ¶
func (b BlockNumber) BigInt() *big.Int
BigInt returns the value as a *big.Int (heap-allocated). Useful for passing to go-ethereum APIs that take *big.Int.
func (BlockNumber) Bytes ¶
func (b BlockNumber) Bytes() []byte
Bytes returns the value as 8 bytes big-endian. Used as a BoltDB key.
func (BlockNumber) String ¶
func (b BlockNumber) String() string
String returns the decimal string form for logs and CLI output.
type ChainID ¶
type ChainID uint64
ChainID identifies which Ethereum-compatible chain the daemon talks to. Arbitrum One is 42161; Arbitrum Sepolia is 421614; Anvil is operator-set.
type GasPrice ¶
GasPrice is an alias for Wei used in gas-pricing contexts. Same underlying type; the alias documents intent.
type Round ¶
type Round struct {
// Number is the protocol round number (currently active when this Round
// event fires).
Number RoundNumber
// StartBlock is the L2 block at which this round became current.
StartBlock BlockNumber
// L1StartBlock is the Arbitrum-recorded L1 block at which this round
// became current. Sourced from the L2 block header's l1BlockNumber field.
L1StartBlock BlockNumber
// Length is the round length in blocks.
Length BlockNumber
// Initialized reports whether RoundsManager.initializeRound() has been
// called for this round. Some consumers (e.g., reward) only act on
// initialized rounds.
Initialized bool
// LastInitialized is RoundsManager.lastInitializedRound() at the time
// the event fires — the most recent round whose initializeRound() has
// been called and whose blockHashForRound() is non-zero. When
// Initialized is true this equals Number; otherwise it trails Number
// by 1+ rounds. Consumers that need a round whose blockHash is
// guaranteed available (payment-daemon's ticket creationRound) read
// this field; consumers that act on the protocol round itself
// (protocol-daemon initialize/reward calling) read Number.
LastInitialized RoundNumber
// BlockHash is RoundsManager.blockHashForRound at the time the event
// fires. Zero value until set on-chain.
BlockHash TxHash
}
Round is the typed event struct emitted by services/roundclock and consumed by daemons that react to round transitions.
type RoundNumber ¶
type RoundNumber uint64
RoundNumber is a Livepeer protocol round number. Always non-negative.
func (RoundNumber) BigInt ¶
func (r RoundNumber) BigInt() *big.Int
BigInt returns the value as a *big.Int.
func (RoundNumber) Bytes ¶
func (r RoundNumber) Bytes() []byte
Bytes returns the value as 8 bytes big-endian.
func (RoundNumber) String ¶
func (r RoundNumber) String() string
String returns the decimal string form.