You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The number of state machine changes in signer agreement protocol. `reason` can be one of: 'burn_block_arrival', 'stacks_block_arrival', 'inactive_miner', 'protocol_upgrade'",
84
+
"The number of state machine changes in signer agreement protocol. `reason` can be one of: 'burn_block_arrival', 'stacks_block_arrival', 'inactive_miner', 'protocol_upgrade', 'miner_view_update', 'miner_parent_tenure_update'",
"The number of state machine conflicts in signer agreement protocol. `conflict` can be one of: 'burn_block_delay', 'stacks_block_delay', 'miner_view'",
Copy file name to clipboardExpand all lines: stacks-signer/src/signerdb.rs
+105-1Lines changed: 105 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -528,7 +528,7 @@ CREATE TABLE IF NOT EXISTS signer_state_machine_updates (
528
528
signer_addr TEXT NOT NULL,
529
529
reward_cycle INTEGER NOT NULL,
530
530
state_update TEXT NOT NULL,
531
-
received_time TEXT NOT NULL,
531
+
received_time INTEGER NOT NULL,
532
532
PRIMARY KEY (signer_addr, reward_cycle)
533
533
) STRICT;"#;
534
534
@@ -1412,6 +1412,22 @@ impl SignerDb {
1412
1412
}
1413
1413
Ok(result)
1414
1414
}
1415
+
1416
+
/// Retrieve the elapsed time (in seconds) between
1417
+
/// the oldest and the newest state machine update messages
1418
+
/// produced by the signer set
1419
+
pubfnget_signer_state_machine_updates_latency(
1420
+
&self,
1421
+
reward_cycle:u64,
1422
+
) -> Result<u64,DBError>{
1423
+
let query = "SELECT COALESCE( (MAX(received_time) - MIN(received_time)), 0 ) AS elapsed_time FROM signer_state_machine_updates WHERE reward_cycle = ?1";
1424
+
let args = params![u64_to_sql(reward_cycle)?];
1425
+
let elapsed_time_opt:Option<u64> = query_row(&self.db, query, args)?;
0 commit comments