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
Copy file name to clipboardExpand all lines: stacks-signer/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
10
10
## Added
11
11
12
12
- Introduced the `block_proposal_max_age_secs` configuration option for signers, enabling them to automatically ignore block proposals that exceed the specified age in seconds.
13
+
- When a new block proposal is received while the signer is waiting for an existing proposal to be validated, the signer will wait until the existing block is done validating before submitting the new one for validating. ([#5453](https://github.com/stacks-network/stacks-core/pull/5453))
13
14
14
15
## Changed
15
16
- Improvements to the stale signer cleanup logic: deletes the prior signer if it has no remaining unprocessed blocks in its database
// Register helper function for determining if a block is a tenure change transaction
@@ -654,7 +688,8 @@ impl SignerDb {
654
688
2 => Self::schema_3_migration(&sql_tx)?,
655
689
3 => Self::schema_4_migration(&sql_tx)?,
656
690
4 => Self::schema_5_migration(&sql_tx)?,
657
-
5 => break,
691
+
5 => Self::schema_6_migration(&sql_tx)?,
692
+
6 => break,
658
693
x => returnErr(DBError::Other(format!(
659
694
"Database schema is newer than supported by this binary. Expected version = {}, Database version = {x}",
660
695
Self::SCHEMA_VERSION,
@@ -960,6 +995,43 @@ impl SignerDb {
960
995
Ok(Some(broadcasted))
961
996
}
962
997
998
+
/// Get a pending block validation, sorted by the time at which it was added to the pending table.
999
+
/// If found, remove it from the pending table.
1000
+
pubfnget_and_remove_pending_block_validation(
1001
+
&self,
1002
+
) -> Result<Option<Sha512Trunc256Sum>,DBError>{
1003
+
let qry = "DELETE FROM block_validations_pending WHERE signer_signature_hash = (SELECT signer_signature_hash FROM block_validations_pending ORDER BY added_time ASC LIMIT 1) RETURNING signer_signature_hash";
1004
+
let args = params![];
1005
+
letmut stmt = self.db.prepare(qry)?;
1006
+
let sighash:Option<String> = stmt.query_row(args, |row| row.get(0)).optional()?;
let query = "SELECT tenure_change, proposed_time, validation_time_ms FROM blocks WHERE consensus_hash = ?1 AND state = ?2 ORDER BY stacks_height DESC";
@@ -1022,6 +1094,26 @@ impl SignerDb {
1022
1094
);
1023
1095
tenure_extend_timestamp
1024
1096
}
1097
+
1098
+
/// Mark a block as globally accepted. This removes the block from the pending
1099
+
/// validations table. This does **not** update the block's state in SignerDb.
0 commit comments