Crate timeboost_rs

Source
Expand description

timeboost-rs implements the time boost protocol for ordering blockchain transactions as specified in the paper titled “Buying Time: Latency Racing vs. Bidding for Transaction Ordering” published at https://arxiv.org/pdf/2306.02179.pdf. Instead of individually boosting transactions, this implementation of the protocol operates in fixed rounds of length G milliseconds, where G is the parameter defined in the paper.

Structs§

BoostableTx
A BoostableTx represents three important values: a unique id, a bid, and a timestamp. Bid and timestamp values are used when performing the time boost protocol by the TimeBoostService at intervals of G milliseconds.
TIME_BOOST_ROUNDS_TOTAL
The number of elapsed time boost rounds, which occur in intervals of G milliseconds, exposed as prometheus int counter.
TimeBoostService
The TimeBoostService struct is a long-running service that will receive transactions from an input channel, push them to a priority queue where they are sorted by max bid, and then releases them at discrete time intervals defined by a parameter G (in milliseconds).

Constants§

DEFAULT_INPUT_FEED_BUFFER_CAP
The default capacity for the transaction input channel used by TimeBoostService to receive txs from outside sources. Can be adjusted using the input_feed_buffer_capacity method when building a TimeBoostService struct.
DEFAULT_MAX_BOOST_FACTOR
A default max boost factor, set to 500ms after empirical evaluations for Ethereum Layer 2s from the time boost paper. Can be adjusted using the g_factor method when building a TimeBoostService struct.