Improve RBF behavior in `BitcoinRegtestController`
When sending a block commit, a miner needs to be cautious about which Bitcoin block it gets included in. If the miner intends to RBF a block commit targeting block X, but then block X is mined, it should not submit that block commit for block X+1. The logic in bitcoin_regtest_controller.rs should be able to handle this if the necessary information is passed along to the correct functions.
@kantai I think to resolve this, I basically just want to delete this code:
https://github.com/stacks-network/stacks-core/blob/c125757949409beb70614bbe3f4768fe458a9266/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs#L1620-L1629
Does that seem right to you? I don't think that case will ever be good for the miner.
It's going to be difficult to test 😰.
Also this I think:
diff --git a/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs b/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs
index 5cab6be2ad..2447152293 100644
--- a/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs
+++ b/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs
@@ -1539,6 +1539,12 @@ impl BitcoinRegtestController {
Ok(true)
);
if ongoing_tx_confirmed {
+ if ongoing_op.payload == payload {
+ info!("Abort attempt to re-submit confirmed LeaderBlockCommit");
+ self.ongoing_block_commit = Some(ongoing_op);
+ return Err(BurnchainControllerError::IdenticalOperation);
+ }
+
debug!("Was able to retrieve confirmation of ongoing burnchain TXID - {txid}");
let res = self.send_block_commit_operation(
epoch_id,
PR #6157
This was resolved in #6219.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.