Skip to content

eth

Namespaces

Name
eth::abi
eth::rpc
eth::protocol
eth::codec
eth::cli

Classes

Name
struct eth::BridgeEventClaim
Transport-neutral bridge event claim signed by watcher nodes.
struct eth::BridgeEventObservation
Watcher signature over a normalized bridge event claim.
struct eth::BridgeEventKey
Dedupe/consumption key for a bridge event.
class eth::EventDeduper
In-memory event deduper keyed by source chain, transaction hash, and log index.
struct eth::ReceiptLogVerificationResult
class eth::ChainTracker
Tracks the chain tip and deduplicates block processing requests.
struct eth::EthPeerQueueConfig
Bounded peer producer queue policy.
struct eth::EthPeerQueueStatsSnapshot
struct eth::EthPeerDisconnectFeedback
Feedback from a completed or disconnected peer session.
class eth::EthPeerQueue
Producer/consumer boundary for eth-watch peer candidates.
struct eth::EthStatusHandshakeStart
Parameters for starting the ETH Status handshake on a negotiated session.
struct eth::EthStatusHandshakeResult
Result of the ETH Status startup handshake owned by the ETH layer.
struct eth::ReceiptResult
Receipt plus the chain context needed to verify and deduplicate a log.
struct eth::ReceiptBatch
Receipts from one block, normalized across RLPx, RPC, or certified sources.
class eth::IEthReceiptSource
Transport-neutral source of receipt/log evidence for EthWatchService.
class eth::EthReceiptSourceBridge
Connects a transport-neutral receipt source to the existing EthWatchService path.
class eth::IEthSessionChannel
Minimal session-facing seam used by ETH runner logic and tests.
class eth::RlpxEthSessionChannel
RlpxSession adapter implementing the minimal ETH session seam.
struct eth::ForkId
struct eth::StatusMessage68
ETH/68 Status message. Wire: [version, networkid, td, blockhash, genesis, forkid].
struct eth::StatusMessage69
ETH/69 Status message. Wire: [version, networkid, genesis, forkid, earliestBlock, latestBlock, latestBlockHash].
struct eth::CommonStatusFields
Fields common to both ETH/68 and ETH/69 Status messages.
struct eth::EthMessageFieldSchema
struct eth::EthMessageSchema
struct eth::NewBlockHashEntry
struct eth::NewBlockHashesMessage
struct eth::NewPooledTransactionHashesMessage
struct eth::BlockRangeUpdateMessage
struct eth::UpgradeStatusMessage
struct eth::GetBlockHeadersMessage
struct eth::BlockHeadersMessage
struct eth::GetReceiptsMessage
struct eth::ReceiptsMessage
struct eth::GetPooledTransactionsMessage
struct eth::PooledTransactionsMessage
struct eth::GetBlockBodiesMessage
Request for block bodies by hash (message id 0x05).
struct eth::BlockBody
A single block body: transactions + ommers (uncle headers).
struct eth::BlockBodiesMessage
Response to GetBlockBodies (message id 0x06).
struct eth::NewBlockMessage
Full new block announcement (message id 0x07).
class eth::EthWatchRunner
Per-session ETH watch runner layered above RLPx and EthWatchService.
struct eth::WatchEventContext
Context metadata attached to a filtered watch event.
struct eth::WatchEventNotification
Enriched event payload emitted by EthWatchRunner and EthWatchService.
struct eth::EthWatchConnectionConfig
Connection pool limits for eth watch peer sessions. Defaults keep three active dial/watch slots per chain.
struct eth::EthWatchEventSpec
Event filter registration consumed by the production watch runtime.
struct eth::EthWatchServiceConfig
Production eth-watch orchestration config.
struct eth::EthWatchRuntimeStatsSnapshot
struct eth::WatchStatsSnapshot
Snapshot of live EthWatchService traffic counters.
class eth::EthWatchService
Ties together EventWatcher, ABI decoding, and eth message dispatch.
struct eth::EventFilter
Specifies which logs to accept: by emitting address(es) and/or topic(s).
struct eth::MatchedEvent
A matched event: the original log decorated with block context.
class eth::EventWatcher
Registers filters and dispatches matching logs to callbacks.
struct eth::FinalityPolicy
struct eth::ChainHeadSnapshot
struct eth::FinalityDecision

Types

Name
enum class ReceiptLogVerificationError
enum class HandshakeMessageDisposition { kIgnored, kAcceptedStatus, kRejected}
Result of processing one inbound ETH handshake-phase message.
enum class EthMessageFieldType
enum class StatusValidationError { kProtocolVersionMismatch, kNetworkIDMismatch, kGenesisMismatch, kInvalidBlockRange}
Errors returned by validate_status(), mirroring go-ethereum's readStatus error values from eth/protocols/eth/handshake.go.
enum class EthWatchDiscoveryMode { kCacheOnly, kDiscoverIfNeeded, kDiscoverFirst, kHybrid}
Peer source strategy for production eth-watch startup.
enum class FinalityHeadKind
using std::function< void(const StatusMessage &)> EthStatusAcceptedHandler
Callback invoked when the remote ETH Status message is accepted.
using std::function< void(rlpx::DisconnectReason)> EthStatusRemoteDisconnectHandler
Callback invoked when the remote sends an RLPx Disconnect during ETH Status.
using std::function< void(const ReceiptBatch &)> ReceiptBatchHandler
using rlp::Hash256 Hash256
using rlp::Address Address
using rlp::Bloom Bloom
using std::variant< StatusMessage68, StatusMessage69 > StatusMessage
Dual-version Status message (ETH/68 or ETH/69).
using WatchId EventWatchId
Subscription handle returned by EthWatchService::watch_event().
using std::function< void(const WatchEventNotification &)> WatchEventNotificationCallback
Callback invoked for each decoded filtered event with chain/session metadata.
using std::function< void( const MatchedEvent &, const std::vector< abi::AbiValue > &)> DecodedEventCallback
Typed callback for a decoded event log.
using std::function< void(uint8_t eth_msg_id, std::vector< uint8_t > payload)> SendCallback
Callback used by EthWatchService to send an outgoing eth message.
using uint32_t WatchId
Registration handle returned by EventWatcher::watch(). Passed back to EventWatcher::unwatch() to remove a subscription.
using std::function< void(const MatchedEvent &)> EventCallback
Callback invoked for every log that matches a registered filter.
using std::array< uint8_t, 32 > Secp256k1PrivateKey

Functions

Name
bool operator==(const BridgeEventKey & lhs, const BridgeEventKey & rhs)
bool operator<(const BridgeEventKey & lhs, const BridgeEventKey & rhs)
BridgeEventKey bridge_event_key(const BridgeEventClaim & claim)
ReceiptLogVerificationResult verify_receipt_log(const ReceiptResult & receipt, const BridgeEventClaim & claim)
Hash256 compute_bridge_message_id(uint64_t src_chain_id, const Address & bridge_contract, const Hash256 & tx_hash, uint32_t log_index)
Canonical message identifier for an EVM bridge source event.
codec::ByteBuffer bridge_event_claim_payload(const BridgeEventClaim & claim)
Canonical bytes for bridge-event consensus payloads and watcher signatures.
std::optional< BridgeEventClaim > decode_bridge_event_claim_payload(const codec::ByteBuffer & payload)
Hash256 bridge_event_domain_separator(uint64_t src_chain_id, uint64_t dest_chain_id, const Address & bridge_contract)
Hash256 bridge_event_claim_hash(const BridgeEventClaim & claim)
std::optional< Address > observer_address_from_private_key(const Secp256k1PrivateKey & private_key)
std::optional< BridgeEventObservation > sign_bridge_event_claim(const BridgeEventClaim & claim, const Secp256k1PrivateKey & private_key)
bool verify_bridge_event_observation(const BridgeEventObservation & observation)
rlp::outcome::result< EthStatusHandshakeResult, StatusValidationError, rlp::outcome::policy::all_narrow > PerformEthStatusHandshake(const EthStatusHandshakeStart & start, boost::asio::yield_context yield)
Execute the ETH Status startup handshake for a negotiated ETH session.
std::optional< uint8_t > NormalizeEthWireMessageId(uint8_t wire_message_id, uint8_t negotiated_eth_offset)
Return the ETH-local message id for a wire-level message.
uint64_t ExtractLatestBlockNumber(const StatusMessage & status)
Return the latest block number from a validated ETH Status message.
rlp::outcome::result< StatusMessage, StatusValidationError, rlp::outcome::policy::all_narrow > DecodeValidatedStatusMessage(const rlpx::protocol::Message & message, uint8_t negotiated_eth_offset, uint8_t negotiated_eth_version, uint64_t network_id, const Hash256 & genesis_hash, const std::vector< EthMessageSchema > & eth_message_schemas ={})
Decode and validate an inbound ETH Status message.
HandshakeMessageDisposition HandleEthHandshakeMessage(const rlpx::protocol::Message & message, uint8_t negotiated_eth_offset, uint8_t negotiated_eth_version, uint64_t network_id, const Hash256 & genesis_hash, bool & status_received)
Process one inbound ETH handshake-phase message.
std::shared_ptr< EthPeerQueue > make_eth_peer_queue(std::shared_ptr< discv4::DialScheduler > scheduler, const discv4::ChainPeerConfig & chain_config, EthPeerQueueConfig config, bool preload_cached_peers)
Create an eth-watch peer queue and preload the chain cache split.
StatusMessage BuildLocalStatusMessage(uint8_t negotiated_protocol_version, uint64_t network_id, const Hash256 & genesis_hash, const ForkId & fork_id)
Build the local ETH Status message for the negotiated ETH protocol version.
protocol::ValidationResult ValidateRemoteStatusMessage(const StatusMessage & remote_status, uint8_t negotiated_protocol_version, uint64_t expected_network_id, const Hash256 & expected_genesis_hash)
Validate a remote ETH Status message against negotiated version and chain.
bool StartEthStatusHandshake(const EthStatusHandshakeStart & start)
Install post-handshake ETH inbound handling on a negotiated session.
EventFilter make_event_filter(const codec::Address & contract_address, const std::string & event_signature, std::optional< uint64_t > from_block, std::optional< uint64_t > to_block)
std::shared_ptr< discv4::WatcherPool > make_eth_watcher_pool(const EthWatchConnectionConfig & config)
Create the shared watcher connection pool used by chain peer dialers.
std::shared_ptr< discv4::DialScheduler > start_eth_watch_chain_peer_dialing(boost::asio::io_context & io, std::shared_ptr< discv4::WatcherPool > pool, discv4::DialFn dial_fn, const std::vector< discv4::ValidatedPeer > & peers)
Create a per-chain dial scheduler and enqueue the provided peer candidates.
FinalityPolicy finality_policy_for_chain_id(uint64_t chain_id)
FinalityDecision choose_finality_head(const FinalityPolicy & policy, const ChainHeadSnapshot & heads)
bool is_final_under_policy(uint64_t block_number, const FinalityPolicy & policy, const ChainHeadSnapshot & heads)
CommonStatusFields get_common_fields(const StatusMessage & msg)
Extract fields common to both ETH/68 and ETH/69 Status messages.
std::optional< Address > secp256k1_address_from_private_key(const Secp256k1PrivateKey & private_key)
std::optional< Address > secp256k1_recover_address(const Hash256 & message_hash, const codec::ByteBuffer & recoverable_signature)
std::optional< codec::ByteBuffer > secp256k1_sign_recoverable(const Hash256 & message_hash, const Secp256k1PrivateKey & private_key)
Hash256 bridge_message_id(const BridgeEventClaim & claim)
Convenience overload that extracts canonical fields from a claim.

Attributes

Name
size_t kAbiWordSize
EVM ABI encoding constants (ABI spec: https://docs.soliditylang.org/en/latest/abi-spec.html).
size_t kAbiAddressSize
Ethereum address is 20 bytes.
size_t kAbiAddressPadding
12 bytes of left-padding
size_t kAbiBoolByteIndex
Canonical bool lives in rightmost byte (index 31).
uint8_t kRlpListPrefixMin
EVM / RLP encoding thresholds.
size_t kTypedTxPrefixSize
EIP-2718 typed transaction envelope.
uint64_t kDefaultChainId
Default chain ID used when none is specified (Ethereum mainnet).
size_t kKeccak256Size
Keccak-256 digest size (bytes).
uint8_t kEthProtocolVersion66
uint8_t kEthProtocolVersion67
uint8_t kEthProtocolVersion68
uint8_t kEthProtocolVersion69

Types Documentation

enum ReceiptLogVerificationError

Enumerator Value Description
kNone
kMissingReceiptStatus
kReceiptFailed
kBlockHashMismatch
kTxHashMismatch
kLogIndexOutOfRange
kContractMismatch
kTopic0Mismatch
kTopicsMismatch
kDataMismatch

enum HandshakeMessageDisposition

Enumerator Value Description
kIgnored
kAcceptedStatus
kRejected

Result of processing one inbound ETH handshake-phase message.

enum EthMessageFieldType

Enumerator Value Description
kUint8
kUint16
kUint32
kUint64
kUint256
kHash32
kHash4
kForkId
kBytes
kBool
kHashOrNumber
kHashList
kUintList
kUint32List
kBytesList
kBlockHashEntries
kGetBlockHeadersQuery
kBlockHeaders
kBlockBodies
kBlock
kTransactions
kReceipts
kPooledTransactions

enum StatusValidationError

Enumerator Value Description
kProtocolVersionMismatch status.ProtocolVersion != negotiated version
kNetworkIDMismatch status.NetworkID != expected network ID
kGenesisMismatch status.Genesis != our genesis hash
kInvalidBlockRange status.EarliestBlock > status.LatestBlock

Errors returned by validate_status(), mirroring go-ethereum's readStatus error values from eth/protocols/eth/handshake.go.

enum EthWatchDiscoveryMode

Enumerator Value Description
kCacheOnly Use cached nodes only; never start discovery from bootnodes.
kDiscoverIfNeeded Use cached nodes; start discovery only when no cached nodes are available.
kDiscoverFirst Start from discovery bootnodes and do not enqueue cached nodes initially.
kHybrid Enqueue cached nodes and also start discovery from bootnodes.

Peer source strategy for production eth-watch startup.

enum FinalityHeadKind

Enumerator Value Description
kUnavailable
kFinalized
kSafe
kConfirmedLatest

using EthStatusAcceptedHandler

using eth::EthStatusAcceptedHandler = std::function<void(const StatusMessage&)>;

Callback invoked when the remote ETH Status message is accepted.

using EthStatusRemoteDisconnectHandler

using eth::EthStatusRemoteDisconnectHandler = std::function<void(rlpx::DisconnectReason)>;

Callback invoked when the remote sends an RLPx Disconnect during ETH Status.

using ReceiptBatchHandler

using eth::ReceiptBatchHandler = std::function<void(const ReceiptBatch&)>;

using Hash256

using eth::Hash256 = rlp::Hash256;

using Address

using eth::Address = rlp::Address;

using Bloom

using eth::Bloom = rlp::Bloom;

using StatusMessage

using eth::StatusMessage = std::variant<StatusMessage68, StatusMessage69>;

Dual-version Status message (ETH/68 or ETH/69).

using EventWatchId

using eth::EventWatchId = WatchId;

Subscription handle returned by EthWatchService::watch_event().

using WatchEventNotificationCallback

using eth::WatchEventNotificationCallback = std::function<void(const WatchEventNotification&)>;

Callback invoked for each decoded filtered event with chain/session metadata.

using DecodedEventCallback

using eth::DecodedEventCallback = std::function<void(
   const MatchedEvent&,
   const std::vector<abi::AbiValue>&)>;

Typed callback for a decoded event log.

using SendCallback

using eth::SendCallback = std::function<void(uint8_t eth_msg_id, std::vector<uint8_t> payload)>;

Callback used by EthWatchService to send an outgoing eth message.

Parameters:

  • eth_msg_id Eth-layer message id (before adding the rlpx offset).
  • payload Encoded message bytes.

using WatchId

using eth::WatchId = uint32_t;

Registration handle returned by EventWatcher::watch(). Passed back to EventWatcher::unwatch() to remove a subscription.

using EventCallback

using eth::EventCallback = std::function<void(const MatchedEvent&)>;

Callback invoked for every log that matches a registered filter.

using Secp256k1PrivateKey

using eth::Secp256k1PrivateKey = std::array<uint8_t, 32>;

Functions Documentation

function operator==

bool operator==(
    const BridgeEventKey & lhs,
    const BridgeEventKey & rhs
)

function operator<

bool operator<(
    const BridgeEventKey & lhs,
    const BridgeEventKey & rhs
)

function bridge_event_key

BridgeEventKey bridge_event_key(
    const BridgeEventClaim & claim
)

function verify_receipt_log

ReceiptLogVerificationResult verify_receipt_log(
    const ReceiptResult & receipt,
    const BridgeEventClaim & claim
)

function compute_bridge_message_id

Hash256 compute_bridge_message_id(
    uint64_t src_chain_id,
    const Address & bridge_contract,
    const Hash256 & tx_hash,
    uint32_t log_index
)

Canonical message identifier for an EVM bridge source event.

Parameters:

  • src_chain_id Numeric source chain ID.
  • bridge_contract Bridge contract address on the source chain.
  • tx_hash Transaction hash containing the event log.
  • log_index Log index within the transaction receipt.

Return: 32-byte keccak-256 hash serving as the canonical message_id.

Computed as keccak256 over a deterministic big-endian encoding of: src_chain_id (8 bytes) || bridge_contract (20 bytes) || tx_hash (32 bytes) || log_index (4 bytes)

This identifier is stable across observers, replay attempts, and consensus rounds. It is used for deduplication, processing-state tracking, slot-key assignment, and anti-double-mint persistence.

function bridge_event_claim_payload

codec::ByteBuffer bridge_event_claim_payload(
    const BridgeEventClaim & claim
)

Canonical bytes for bridge-event consensus payloads and watcher signatures.

function decode_bridge_event_claim_payload

std::optional< BridgeEventClaim > decode_bridge_event_claim_payload(
    const codec::ByteBuffer & payload
)

function bridge_event_domain_separator

Hash256 bridge_event_domain_separator(
    uint64_t src_chain_id,
    uint64_t dest_chain_id,
    const Address & bridge_contract
)

function bridge_event_claim_hash

Hash256 bridge_event_claim_hash(
    const BridgeEventClaim & claim
)

function observer_address_from_private_key

std::optional< Address > observer_address_from_private_key(
    const Secp256k1PrivateKey & private_key
)

function sign_bridge_event_claim

std::optional< BridgeEventObservation > sign_bridge_event_claim(
    const BridgeEventClaim & claim,
    const Secp256k1PrivateKey & private_key
)

function verify_bridge_event_observation

bool verify_bridge_event_observation(
    const BridgeEventObservation & observation
)

function PerformEthStatusHandshake

rlp::outcome::result< EthStatusHandshakeResult, StatusValidationError, rlp::outcome::policy::all_narrow > PerformEthStatusHandshake(
    const EthStatusHandshakeStart & start,
    boost::asio::yield_context yield
)

Execute the ETH Status startup handshake for a negotiated ETH session.

Parameters:

  • start Handshake parameters bound to the negotiated ETH session/channel.
  • yield Boost.Asio stackful coroutine context used to await the first ETH message.

Return: ETH-layer handshake result containing the validated remote status.

function NormalizeEthWireMessageId

std::optional< uint8_t > NormalizeEthWireMessageId(
    uint8_t wire_message_id,
    uint8_t negotiated_eth_offset
)

Return the ETH-local message id for a wire-level message.

Parameters:

  • wire_message_id Wire-level RLPx message id.
  • negotiated_eth_offset Negotiated ETH wire offset.

Return: ETH-local message id if the wire id belongs to ETH; std::nullopt otherwise.

function ExtractLatestBlockNumber

uint64_t ExtractLatestBlockNumber(
    const StatusMessage & status
)

Return the latest block number from a validated ETH Status message.

Parameters:

  • status Decoded ETH Status message.

Return: Latest block number for ETH/69, or 0 for earlier layouts.

function DecodeValidatedStatusMessage

rlp::outcome::result< StatusMessage, StatusValidationError, rlp::outcome::policy::all_narrow > DecodeValidatedStatusMessage(
    const rlpx::protocol::Message & message,
    uint8_t negotiated_eth_offset,
    uint8_t negotiated_eth_version,
    uint64_t network_id,
    const Hash256 & genesis_hash,
    const std::vector< EthMessageSchema > & eth_message_schemas ={}
)

Decode and validate an inbound ETH Status message.

Parameters:

  • message Inbound wire-level RLPx message.
  • negotiated_eth_offset Negotiated ETH wire offset.
  • negotiated_eth_version Negotiated ETH version.
  • network_id Expected local network identifier.
  • genesis_hash Expected local genesis hash.

Return: Decoded valid ETH Status message, or a validation/decode error.

function HandleEthHandshakeMessage

HandshakeMessageDisposition HandleEthHandshakeMessage(
    const rlpx::protocol::Message & message,
    uint8_t negotiated_eth_offset,
    uint8_t negotiated_eth_version,
    uint64_t network_id,
    const Hash256 & genesis_hash,
    bool & status_received
)

Process one inbound ETH handshake-phase message.

Parameters:

  • message Inbound wire-level RLPx message.
  • negotiated_eth_offset Negotiated ETH wire offset.
  • negotiated_eth_version Negotiated ETH version.
  • network_id Expected local network identifier.
  • genesis_hash Expected local genesis hash.
  • status_received Whether a valid remote ETH Status was already accepted.

Return: Disposition indicating whether the message was ignored, accepted, or rejected.

function make_eth_peer_queue

std::shared_ptr< EthPeerQueue > make_eth_peer_queue(
    std::shared_ptr< discv4::DialScheduler > scheduler,
    const discv4::ChainPeerConfig & chain_config,
    EthPeerQueueConfig config,
    bool preload_cached_peers
)

Create an eth-watch peer queue and preload the chain cache split.

function BuildLocalStatusMessage

StatusMessage BuildLocalStatusMessage(
    uint8_t negotiated_protocol_version,
    uint64_t network_id,
    const Hash256 & genesis_hash,
    const ForkId & fork_id
)

Build the local ETH Status message for the negotiated ETH protocol version.

Parameters:

  • negotiated_protocol_version The negotiated ETH subprotocol version.
  • network_id Local chain network id.
  • genesis_hash Local chain genesis hash.
  • fork_id Local chain fork id.

Return: ETH/68 or ETH/69 Status message matching the negotiated version.

function ValidateRemoteStatusMessage

protocol::ValidationResult ValidateRemoteStatusMessage(
    const StatusMessage & remote_status,
    uint8_t negotiated_protocol_version,
    uint64_t expected_network_id,
    const Hash256 & expected_genesis_hash
)

Validate a remote ETH Status message against negotiated version and chain.

Parameters:

  • remote_status Decoded remote Status message.
  • negotiated_protocol_version Negotiated ETH subprotocol version.
  • expected_network_id Expected chain network id.
  • expected_genesis_hash Expected chain genesis hash.

Return: Success when the status matches the negotiated version and chain.

function StartEthStatusHandshake

bool StartEthStatusHandshake(
    const EthStatusHandshakeStart & start
)

Install post-handshake ETH inbound handling on a negotiated session.

Parameters:

  • start Handshake start parameters bound to the negotiated session/channel.

Return: True when the post-handshake handler was installed successfully.

function make_event_filter

EventFilter make_event_filter(
    const codec::Address & contract_address,
    const std::string & event_signature,
    std::optional< uint64_t > from_block,
    std::optional< uint64_t > to_block
)

function make_eth_watcher_pool

std::shared_ptr< discv4::WatcherPool > make_eth_watcher_pool(
    const EthWatchConnectionConfig & config
)

Create the shared watcher connection pool used by chain peer dialers.

Parameters:

  • config Pool limits.

Return: Shared watcher pool.

function start_eth_watch_chain_peer_dialing

std::shared_ptr< discv4::DialScheduler > start_eth_watch_chain_peer_dialing(
    boost::asio::io_context & io,
    std::shared_ptr< discv4::WatcherPool > pool,
    discv4::DialFn dial_fn,
    const std::vector< discv4::ValidatedPeer > & peers
)

Create a per-chain dial scheduler and enqueue the provided peer candidates.

Parameters:

  • io Boost.Asio context used by the scheduler.
  • pool Shared watcher pool.
  • dial_fn Callback used for each dial attempt.
  • peers Validated RLPx/ETH peer candidates from chain_enodes.json.nodes.

Return: Scheduler that owns the dial queue and active sessions.

function finality_policy_for_chain_id

FinalityPolicy finality_policy_for_chain_id(
    uint64_t chain_id
)

function choose_finality_head

FinalityDecision choose_finality_head(
    const FinalityPolicy & policy,
    const ChainHeadSnapshot & heads
)

function is_final_under_policy

bool is_final_under_policy(
    uint64_t block_number,
    const FinalityPolicy & policy,
    const ChainHeadSnapshot & heads
)

function get_common_fields

CommonStatusFields get_common_fields(
    const StatusMessage & msg
)

Extract fields common to both ETH/68 and ETH/69 Status messages.

function secp256k1_address_from_private_key

std::optional< Address > secp256k1_address_from_private_key(
    const Secp256k1PrivateKey & private_key
)

function secp256k1_recover_address

std::optional< Address > secp256k1_recover_address(
    const Hash256 & message_hash,
    const codec::ByteBuffer & recoverable_signature
)

function secp256k1_sign_recoverable

std::optional< codec::ByteBuffer > secp256k1_sign_recoverable(
    const Hash256 & message_hash,
    const Secp256k1PrivateKey & private_key
)

function bridge_message_id

inline Hash256 bridge_message_id(
    const BridgeEventClaim & claim
)

Convenience overload that extracts canonical fields from a claim.

Parameters:

  • claim Bridge event claim with populated source identity fields.

Return: Canonical message_id for the claim.

Attributes Documentation

variable kAbiWordSize

static size_t kAbiWordSize = 32;

EVM ABI encoding constants (ABI spec: https://docs.soliditylang.org/en/latest/abi-spec.html).

Every ABI head/tail slot is 32 bytes

variable kAbiAddressSize

static size_t kAbiAddressSize = 20;

Ethereum address is 20 bytes.

variable kAbiAddressPadding

static size_t kAbiAddressPadding = kAbiWordSize - kAbiAddressSize;

12 bytes of left-padding

variable kAbiBoolByteIndex

static size_t kAbiBoolByteIndex = kAbiWordSize - 1;

Canonical bool lives in rightmost byte (index 31).

variable kRlpListPrefixMin

static uint8_t kRlpListPrefixMin = 0xC0U;

EVM / RLP encoding thresholds.

First byte >= 0xC0 signals an RLP list

variable kTypedTxPrefixSize

static size_t kTypedTxPrefixSize = 1;

EIP-2718 typed transaction envelope.

One type-byte precedes the RLP payload

variable kDefaultChainId

static uint64_t kDefaultChainId = 1ULL;

Default chain ID used when none is specified (Ethereum mainnet).

variable kKeccak256Size

static size_t kKeccak256Size = 32;

Keccak-256 digest size (bytes).

variable kEthProtocolVersion66

uint8_t kEthProtocolVersion66 = 66U;

variable kEthProtocolVersion67

uint8_t kEthProtocolVersion67 = 67U;

variable kEthProtocolVersion68

uint8_t kEthProtocolVersion68 = 68U;

variable kEthProtocolVersion69

uint8_t kEthProtocolVersion69 = 69U;

Updated on 2026-06-05 at 17:22:18 -0700