Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Heartbeat Tick Rate #143

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion relayer/src/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ impl RelayerImpl {
validator_packet_batch_size: usize,
forward_all: bool,
slot_lookahead: u64,
heartbeat_tick_time: u64,
) -> Self {
// receiver tracked as relayer_metrics.subscription_receiver_len
let (subscription_sender, subscription_receiver) =
Expand All @@ -451,6 +452,7 @@ impl RelayerImpl {
address_lookup_table_cache,
validator_packet_batch_size,
forward_all,
heartbeat_tick_time,
);
warn!("RelayerImpl thread exited with result {res:?}")
})
Expand Down Expand Up @@ -487,10 +489,11 @@ impl RelayerImpl {
address_lookup_table_cache: Arc<DashMap<Pubkey, AddressLookupTableAccount>>,
validator_packet_batch_size: usize,
forward_all: bool,
heartbeat_tick_time: u64,
) -> RelayerResult<()> {
let mut highest_slot = Slot::default();

let heartbeat_tick = crossbeam_channel::tick(Duration::from_millis(500));
let heartbeat_tick = crossbeam_channel::tick(Duration::from_millis(heartbeat_tick_time));
let metrics_tick = crossbeam_channel::tick(Duration::from_millis(1000));

let mut relayer_metrics = RelayerMetrics::new(
Expand Down
5 changes: 5 additions & 0 deletions transaction-relayer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ struct Args {
/// The slot lookahead to use when forwarding transactions
#[arg(long, env, default_value_t = 5)]
slot_lookahead: u64,

/// Time in milliseconds between heartbeat ticks
#[arg(long, env, default_value_t = 100)]
heartbeat_tick_time: u64,
}

#[derive(Debug)]
Expand Down Expand Up @@ -536,6 +540,7 @@ fn main() {
args.validator_packet_batch_size,
args.forward_all,
args.slot_lookahead,
args.heartbeat_tick_time,
);

let priv_key = fs::read(&args.signing_key_pem_path).unwrap_or_else(|_| {
Expand Down
Loading