mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-06-13 08:01:49 +08:00
Still brokenness part 2
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
This commit is contained in:
committed by
jferrant
parent
94ed10c767
commit
542954dfd4
@@ -687,9 +687,6 @@ impl RelayerThread {
|
||||
) -> Result<(), NakamotoNodeError> {
|
||||
let (last_committed_at, target_epoch_id, commit) =
|
||||
self.make_block_commit(&tenure_start_ch, &tenure_start_bh)?;
|
||||
|
||||
let mut op_signer = self.keychain.generate_op_signer();
|
||||
let mut txid = None;
|
||||
#[cfg(test)]
|
||||
{
|
||||
if TEST_SKIP_COMMIT_OP.lock().unwrap().unwrap_or(false) {
|
||||
@@ -697,31 +694,22 @@ impl RelayerThread {
|
||||
// if last_committed.consensus_hash == last_committed_at.consensus_hash {
|
||||
warn!("Relayer: not submitting block-commit to bitcoin network due to test directive.");
|
||||
return Ok(());
|
||||
// txid = self
|
||||
// .bitcoin_controller
|
||||
// .make_operation_tx(
|
||||
// target_epoch_id,
|
||||
// BlockstackOperationType::LeaderBlockCommit(commit.clone()),
|
||||
// &mut op_signer,
|
||||
// 1,
|
||||
// )
|
||||
// .map(|tx| tx.txid());
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
if txid.is_none() {
|
||||
txid = self.bitcoin_controller.submit_operation(
|
||||
let mut op_signer = self.keychain.generate_op_signer();
|
||||
let txid = self
|
||||
.bitcoin_controller
|
||||
.submit_operation(
|
||||
target_epoch_id,
|
||||
BlockstackOperationType::LeaderBlockCommit(commit),
|
||||
&mut op_signer,
|
||||
1,
|
||||
);
|
||||
}
|
||||
let txid = txid.ok_or_else(|| {
|
||||
warn!("Failed to submit block-commit bitcoin transaction");
|
||||
NakamotoNodeError::BurnchainSubmissionFailed
|
||||
})?;
|
||||
)
|
||||
.ok_or_else(|| {
|
||||
warn!("Failed to submit block-commit bitcoin transaction");
|
||||
NakamotoNodeError::BurnchainSubmissionFailed
|
||||
})?;
|
||||
info!(
|
||||
"Relayer: Submitted block-commit";
|
||||
"parent_consensus_hash" => %tenure_start_ch,
|
||||
|
||||
@@ -76,7 +76,6 @@ use stacks_common::util::sleep_ms;
|
||||
use super::bitcoin_regtest::BitcoinCoreController;
|
||||
use crate::config::{EventKeyType, EventObserverConfig, InitialBalance};
|
||||
use crate::nakamoto_node::miner::TEST_BROADCAST_STALL;
|
||||
use crate::nakamoto_node::relayer::TEST_SKIP_COMMIT_OP;
|
||||
use crate::neon::{Counters, RunLoopCounter};
|
||||
use crate::operations::BurnchainOpSigner;
|
||||
use crate::run_loop::boot_nakamoto;
|
||||
@@ -3253,11 +3252,11 @@ fn forked_tenure_is_ignored() {
|
||||
|
||||
// Do not submit the commit op and do not allow stacks blocks to be broadcasted
|
||||
TEST_BROADCAST_STALL.lock().unwrap().replace(true);
|
||||
TEST_SKIP_COMMIT_OP.lock().unwrap().replace(true);
|
||||
let commits_before = commits_submitted.load(Ordering::SeqCst);
|
||||
debug!("Starting tenure B.");
|
||||
next_block_and(&mut btc_regtest_controller, 60, || {
|
||||
let commits_count = commits_submitted.load(Ordering::SeqCst);
|
||||
Ok(commits_count >= 1)
|
||||
Ok(commits_count > commits_before)
|
||||
})
|
||||
.unwrap();
|
||||
// Wait a bit for a stacks block to be mined (but not broadcasted)
|
||||
@@ -3268,13 +3267,12 @@ fn forked_tenure_is_ignored() {
|
||||
&[sender_signer_sk],
|
||||
&signers,
|
||||
);
|
||||
|
||||
TEST_SKIP_COMMIT_OP.lock().unwrap().replace(false);
|
||||
debug!("Starting tenure C.");
|
||||
// Submit a block commit op for tenure C
|
||||
let commits_before = commits_submitted.load(Ordering::SeqCst);
|
||||
next_block_and(&mut btc_regtest_controller, 60, || {
|
||||
let commits_count = commits_submitted.load(Ordering::SeqCst);
|
||||
Ok(commits_count >= 1)
|
||||
Ok(commits_count > commits_before)
|
||||
})
|
||||
.unwrap();
|
||||
// Wait a bit for a the block commit to be mined
|
||||
|
||||
Reference in New Issue
Block a user