Skip to content

consider smaller vardiff cycles #396

@plebhash

Description

@plebhash

after community testing, we're realizing that vardiff has been causing some confusion on people

currently, Pool + JDC + tProxy all have hardcoded 60s vardiff cycles:

async fn run_vardiff_loop(&self) -> PoolResult<(), error::ChannelManager> {
let mut ticker = tokio::time::interval(std::time::Duration::from_secs(60));
loop {
ticker.tick().await;
info!("Starting vardiff loop for downstreams");
if let Err(e) = self.run_vardiff().await {
error!(error = ?e, "Vardiff iteration failed");
}
}
}

async fn run_vardiff_loop(&self) -> JDCResult<(), error::ChannelManager> {
let mut ticker = tokio::time::interval(std::time::Duration::from_secs(60));
loop {
ticker.tick().await;
info!("Starting vardiff loop for downstreams");
if let Err(e) = self.run_vardiff().await {
error!(error = ?e, "Vardiff iteration failed");
}
}
}

pub async fn spawn_vardiff_loop(self: Arc<Self>) {
info!("Variable difficulty adjustment enabled - starting vardiff loop");
let mut ticker = tokio::time::interval(std::time::Duration::from_secs(60));
loop {
ticker.tick().await;
info!("Starting vardiff loop for downstreams");
self.handle_vardiff_updates().await;
}
}


we should consider making vardiff cycles smaller than 60s

that would allow the UI to display updates more often

two options:

  • set a universal constant on stratum-apps with a smaller value (e.g.: 10s)
  • make it user configurable via .toml file (and therefore also via sv2-ui wizard)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo 📝

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions