Options type provides configuration parameters for fine-tuning the behavior of the Tashi Vertex consensus engine. It includes settings for timing, throughput, latency management, and network behavior.
Constructor
new
Initializes a default set of options.Returns
A new
Options instance with default values.Example
Options implements the Default trait, so you can also use Options::default().Configuration methods
Timing and intervals
set_base_min_event_interval_us
Sets the base minimum event interval (in microseconds).The minimum interval between events in microseconds
set_heartbeat_us
Sets the heartbeat interval (in microseconds).The heartbeat interval in microseconds. Default: 500,000 (500 milliseconds).
get_base_min_event_interval_us
Gets the base minimum event interval (in microseconds).get_heartbeat_us
Gets the heartbeat interval (in microseconds).Latency management
set_target_ack_latency_ms
Sets the target acknowledgment latency (in milliseconds).The target acknowledgment latency in milliseconds. Default: 400 milliseconds.
set_max_ack_latency_ms
Sets the maximum acknowledgment latency (in milliseconds).The maximum acknowledgment latency in milliseconds. Default: 600 milliseconds.
set_throttle_ack_latency_ms
Sets the throttle acknowledgment latency (in milliseconds).The throttle acknowledgment latency in milliseconds. Default: 900 milliseconds.
set_reset_ack_latency_ms
Sets the reset acknowledgment latency (in milliseconds).The reset acknowledgment latency in milliseconds. Default: 2000 milliseconds.
get_target_ack_latency_ms
Gets the target acknowledgment latency (in milliseconds).get_max_ack_latency_ms
Gets the maximum acknowledgment latency (in milliseconds).get_throttle_ack_latency_ms
Gets the throttle acknowledgment latency (in milliseconds).get_reset_ack_latency_ms
Gets the reset acknowledgment latency (in milliseconds).Peer management
set_fallen_behind_kick_s
Sets the number of seconds a creator can fall behind before being kicked.The number of seconds. If negative, the node will never vote to kick.
get_fallen_behind_kick_s
Gets the number of seconds a creator can fall behind before being kicked.Event reporting
set_report_gossip_events
Enables or disables reporting of gossip events.Whether to report gossip events
get_report_gossip_events
Gets whether reporting of gossip events is enabled.Dynamic epoch sizing
set_enable_dynamic_epoch_size
Enables or disables dynamic epoch sizing.Whether to enable dynamic epoch sizing. Default:
true.true, the node will vote to resize the epoch depending on network conditions. Depending on network conditions, rounds may pass more quickly or more slowly.
Whenever a creator joins or leaves, they’ll have to wait out the epoch before the address book change takes effect. A leaving creator doesn’t want to wait too long, and a joining creator needs a sufficiently long window in which to join.
Creators who don’t disable this config option will automatically vote to keep epoch lengths in the range of 1 to 3 seconds.
get_enable_dynamic_epoch_size
Gets whether dynamic epoch sizing is enabled.Transaction management
set_transaction_channel_size
Sets the transaction channel size.The maximum number of transactions to buffer. Default: 32.
set_max_unacknowledged_bytes
Sets the maximum number of unacknowledged bytes.The maximum number of unacknowledged bytes. Default: 524,288,000 (500 MiB).
get_transaction_channel_size
Gets the transaction channel size.get_max_unacknowledged_bytes
Gets the maximum number of unacknowledged bytes.Thread pool configuration
set_max_blocking_verify_threads
Sets the maximum number of blocking verify threads.The maximum number of threads. Default: number of CPU cores available.
get_max_blocking_verify_threads
Gets the maximum number of blocking verify threads.State sharing
set_enable_state_sharing
Enables or disables state sharing.Whether to enable state sharing. Default:
false.set_epoch_states_to_cache
Sets the number of epoch states to cache.The number of epoch states to cache. Default: 3.
get_enable_state_sharing
Gets whether state sharing is enabled.get_epoch_states_to_cache
Gets the number of epoch states to cache.Network features
set_enable_hole_punching
Enables or disables hole punching.Whether to enable hole punching. Default:
true.true, the node will attempt to use UDP hole punching to establish direct connections between creators behind NATs.
get_enable_hole_punching
Gets whether hole punching is enabled.Usage example
All setter methods modify the options in place. Configure all desired options before passing to
Engine::start().Related types
- Engine - Consumes the options when starting the engine