-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use RBF for recovering from fast blocks #2383
Conversation
14d49ff
to
ecda499
Compare
20856ed
to
d06be96
Compare
testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs
Outdated
Show resolved
Hide resolved
testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs
Outdated
Show resolved
Hide resolved
testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs
Outdated
Show resolved
Hide resolved
} | ||
|
||
// Did a re-org occurred since we fetched our UTXOs | ||
if let Err(e) = burnchain_db.get_burnchain_block(&ongoing_op.utxos.bhh) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is ever going to fail. We don't delete data from BurnchainDB
, so a sibling Bitcoin block's block hash (and all its associated ops) would continue to be accessible through get_burnchain_block
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I added this condition to have a green light from the test bitcoind_forking_test
. Do you think we should leave that condition, or rewrite that test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the error path here can arise and is definitely worth handling, but I think the check you want here is to verify whether or not ongoing_op.utxos.bhh
is still on the canonical burnchain fork (note that this case can flip-flop -- the burn header hash can be on the canonical fork, then off the canonical fork, and then back on it). You can tell by either looking at the SPV headers, or by looking at the sortition DB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed with b03495b
Fix: #2389 Mempool walks, add `try-mine` CLI command
1007387
to
4d576c9
Compare
Fix: atlas attachment serving + broken test
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR is superseding #2363 and addressing a few issues, with one refactoring;
I was able to test the miner against a puppet chain and see the RBF logic successfully kicking in with multiple consecutive flash blocks (3 consecutive RBF, 1 final mined transaction), I should also be able to write some unit tests.
How to test:
$ cd testnet/puppet-chain $ DYNAMIC_GENESIS_TIMESTAMP=1 cargo run local-leader.toml.default
in
core/mod.rs
update the constantsI'd also recommend enforce usage of a sampled genesis.
$ cd testnet/stacks-node $ STACKS_LOG_PP=1 cargo run start --config=./conf/local-leader-conf.toml
The puppet chain will basically be messing around with bitcoind between block 307 and block 312, generating flash blocks and buffering transactions coming from the stacks-node.
When everything goes back to normal and inspecting block 313, we can see that all the block commit that happened during 307 and 312 have been RBF, and we only have one clean block commit.