Skip to content

Commit 4a7dd42

Browse files
committed
chore: fix clippy warns, index creation error in CI
1 parent bd11355 commit 4a7dd42

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

stacks-signer/src/chainstate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ impl SortitionsView {
670670
}
671671
}
672672
}
673-
return Ok(tip.height() < block.header.chain_length);
673+
Ok(tip.height() < block.header.chain_length)
674674
}
675675

676676
/// Check if the tenure change block confirms the expected parent block

stacks-signer/src/v0/signer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -995,25 +995,25 @@ impl Signer {
995995
"proposed_block_signer_signature_hash" => %signer_signature_hash,
996996
"proposed_chain_length" => proposed_block.header.chain_length,
997997
);
998-
return Some(self.create_block_rejection(
998+
Some(self.create_block_rejection(
999999
RejectReason::SortitionViewMismatch,
10001000
proposed_block,
1001-
));
1001+
))
10021002
} else {
1003-
return None;
1003+
None
10041004
}
10051005
}
10061006
Err(e) => {
10071007
warn!("{self}: Failed to check block against signer db: {e}";
10081008
"signer_signature_hash" => %signer_signature_hash,
10091009
"block_id" => %proposed_block.block_id()
10101010
);
1011-
return Some(self.create_block_rejection(
1011+
Some(self.create_block_rejection(
10121012
RejectReason::ConnectivityIssues(
10131013
"failed to check block against signer db".to_string(),
10141014
),
10151015
proposed_block,
1016-
));
1016+
))
10171017
}
10181018
}
10191019
}

stackslib/src/chainstate/stacks/db/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,10 @@ const CHAINSTATE_SCHEMA_4: &[&str] = &[
863863
];
864864

865865
const CHAINSTATE_SCHEMA_5: &[&str] = &[
866-
// schema change is JUST a new index, so just bump db_config.version
867-
// and add the index to `CHAINSTATE_INDEXES` (which gets re-execed
868-
// on every schema change)
869-
r#"
870-
UPDATE db_config SET version = "10";
871-
"#,
866+
// schema change is JUST a new index, but the index is on a table
867+
// created by a migration, so don't add the index to the CHAINSTATE_INDEXES
868+
r#"UPDATE db_config SET version = "10";"#,
869+
"CREATE INDEX IF NOT EXISTS nakamoto_block_headers_by_ch_bv ON nakamoto_block_headers(consensus_hash, burn_view);"
872870
];
873871

874872
const CHAINSTATE_INDEXES: &[&str] = &[
@@ -896,7 +894,6 @@ const CHAINSTATE_INDEXES: &[&str] = &[
896894
"CREATE INDEX IF NOT EXISTS index_block_header_by_height_and_affirmation_weight ON block_headers(block_height,affirmation_weight);",
897895
"CREATE INDEX IF NOT EXISTS index_headers_by_consensus_hash ON block_headers(consensus_hash);",
898896
"CREATE INDEX IF NOT EXISTS processable_block ON staging_blocks(processed, orphaned, attachable);",
899-
"CREATE INDEX IF NOT EXISTS nakamoto_block_headers_by_ch_bv ON nakamoto_block_headers(consensus_hash, burn_view);"
900897
];
901898

902899
pub use stacks_common::consts::MINER_REWARD_MATURITY;

0 commit comments

Comments
 (0)