Skip to content

Commit 77375f6

Browse files
committed
CRC: update no_reorg_due_to_successive_block_validation_ok to also test change
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent befd09a commit 77375f6

File tree

2 files changed

+23
-1
lines changed
  • stacks-node/src/tests/signer
  • stacks-signer/src/chainstate

2 files changed

+23
-1
lines changed

stacks-node/src/tests/signer/v0.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11783,6 +11783,28 @@ fn no_reorg_due_to_successive_block_validation_ok() {
1178311783
TEST_STALL_BLOCK_VALIDATION_SUBMISSION.set(false);
1178411784

1178511785
info!("------------------------- Confirm N+1' is Rejected ------------------------");
11786+
// Confirm that every single signer has rejected the block and recorded its own rejection signature in its own DB
11787+
wait_for(30, || {
11788+
Ok(miners.signer_test.signer_configs.iter().all(|config| {
11789+
let conn = Connection::open(config.db_path.clone()).unwrap();
11790+
let mut stmt = conn
11791+
.prepare(
11792+
"SELECT 1 FROM block_rejection_signer_addrs
11793+
WHERE signer_signature_hash = ?1 AND signer_addr = ?2
11794+
LIMIT 1",
11795+
)
11796+
.unwrap();
11797+
11798+
let mut rows = stmt
11799+
.query(rusqlite::params![
11800+
block_n_1_prime_signature_hash,
11801+
config.stacks_address
11802+
])
11803+
.unwrap();
11804+
rows.next().unwrap().is_some()
11805+
}))
11806+
})
11807+
.expect("Failed to verify all signers recorded a signature rejection");
1178611808
wait_for_block_global_rejection(30, block_n_1_prime_signature_hash, num_signers)
1178711809
.expect("Failed to find block N+1'");
1178811810

stacks-signer/src/chainstate/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ impl SortitionData {
317317

318318
if let Some(info) = last_block_info {
319319
// N.B. this block might not be the last globally accepted block across the network;
320-
// it's just the highest one in this tenure that we knnge: &TenureChangePow about. If this given block is
320+
// it's just the highest one in this tenure that we know about. If this given block is
321321
// no higher than it, then it's definitely no higher than the last globally accepted
322322
// block across the network, so we can do an early rejection here.
323323
if block.header.chain_length <= info.block.header.chain_length {

0 commit comments

Comments
 (0)