Skip to content

Commit 7789907

Browse files
committed
CRC: add index and fix function comment
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 3c60f02 commit 7789907

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

stacks-signer/src/signerdb.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,11 @@ static ADD_BURN_BLOCK_RECEIVED_TIMES_CONSENSUS_HASH_INDEX: &str = r#"
632632
CREATE INDEX IF NOT EXISTS burn_block_updates_received_times_consensus_hash ON burn_block_updates_received_times(burn_block_consensus_hash, received_time ASC);
633633
"#;
634634

635+
// Used by get_last_globally_accepted_block_signed_self
636+
static ADD_BLOCK_SIGNED_SELF_INDEX: &str = r#"
637+
CREATE INDEX idx_blocks_query_opt ON blocks (consensus_hash, state, signed_self, burn_block_height DESC);
638+
"#;
639+
635640
static DROP_BLOCK_SIGNATURES_TABLE: &str = r#"
636641
DROP TABLE IF EXISTS block_signatures;
637642
"#;
@@ -773,6 +778,7 @@ static SCHEMA_15: &[&str] = &[
773778
static SCHEMA_16: &[&str] = &[
774779
CREATE_BURN_BLOCK_UPDATES_RECEIVED_TIME_TABLE,
775780
ADD_BURN_BLOCK_RECEIVED_TIMES_CONSENSUS_HASH_INDEX,
781+
ADD_BLOCK_SIGNED_SELF_INDEX,
776782
DROP_BLOCK_SIGNATURES_TABLE,
777783
CREATE_BLOCK_SIGNATURES_TABLE_V16,
778784
DROP_BLOCK_REJECTION_SIGNER_ADDRS,
@@ -1152,7 +1158,7 @@ impl SignerDb {
11521158
try_deserialize(result)
11531159
}
11541160

1155-
/// Return the last globally accepted block that was signed by the local signer in a tenure (identified by its consensus hash).
1161+
/// Return the last globally accepted block self_signed time in a given tenure (identified by its consensus hash).
11561162
pub fn get_last_globally_accepted_block_signed_self(
11571163
&self,
11581164
tenure: &ConsensusHash,

0 commit comments

Comments
 (0)