fix: devnet stuck on block 2 with crash#6375
Conversation
ogabrielides
left a comment
There was a problem hiding this comment.
utACK 6044e06c676c0f10f32e8f47dba629ea1fcc7e29
There was a problem hiding this comment.
Should be a part of GetCoinbaseTx (because that's where we get CCbTx from), should use DeploymentActiveAt (because pindex is the block we are trying to read, not the one after it), should be if (_not_ active) return nullopt. Should also drop all unrelated refactoring.
tldr: the patch should look like that
diff --git a/src/evo/cbtx.cpp b/src/evo/cbtx.cpp
index a5f8d6b1cd..48baccd9d9 100644
--- a/src/evo/cbtx.cpp
+++ b/src/evo/cbtx.cpp
@@ -454,6 +454,11 @@ std::optional<CCbTx> GetCoinbaseTx(const CBlockIndex* pindex)
return std::nullopt;
}
+ // There's no CbTx before DIP0003 activation
+ if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003)) {
+ return std::nullopt;
+ }
+
CBlock block;
if (!ReadBlockFromDisk(block, pindex, Params().GetConsensus())) {
return std::nullopt;There was a problem hiding this comment.
Good catch for DeploymentActiveAt, I don't know why it worked locally o_O
I'd prefer to drop GetCoinbaseTx completely because it's a confusing that do a lot of checks inside and used in only one module without any benefits, see commits
There was a problem hiding this comment.
I'd prefer to drop GetCoinbaseTx completely because it's a confusing that do a lot of checks inside and used in only one module without any benefits, see commits
I agree it's confusing but let's keep this PR focused
6044e06 to
dde1edf
Compare
UdjinM6
left a comment
There was a problem hiding this comment.
pls drop 24027f8e0e220d09dce2b1a4b5bfb73b7b1af02c
can you be consistent? #6336 (comment) previous review you blocked my PR because you didn't like my negative condition, and here: #6336 (comment) |
|
Guix Automation has began to build this PR tagged as v22.0.0-devpr6375.dde1edf3. A new comment will be made when the image is pushed. |
These are 2 completely different cases. vs |
|
btw If you still want to keep 24027f8e0e220d09dce2b1a4b5bfb73b7b1af02c, you should fix its title - it doesn't match the code rn |
… is activated
It's true, let's add a check here before asking GetTxPayload which causes assert
Assertion failure:
assertion: (tx.nType == T::SPECIALTX_TYPE)
file: ./evo/specialtx.h, line: 33
function: std::optional<_Tp> GetTxPayload(const TxType&, bool) [with T = CCbTx; TxType = CTransaction]
0#: (0x5CE686FB3AB0) stacktraces.cpp:655 - __wrap___assert_fail
1#: (0x5CE686BB9120) specialtx.h:33 - std::optional<CCbTx> GetTxPayload<CCbTx, CTransaction>(CTransaction const&, bool)
2#: (0x5CE686BB9120) cbtx.cpp:463 - GetCoinbaseTx(CBlockIndex const*)
3#: (0x5CE686BB916D) cbtx.cpp:470 - GetNonNullCoinbaseChainlock(CBlockIndex const*)
4#: (0x5CE686BB92AA) optional:469 - std::_Optional_base_impl<std::pair<CBLSSignature, unsigned int>, std::_Optional_base<std::pair<CBLSSignature, unsigned int>, false, false> >::_M_is_engaged() const
5#: (0x5CE686BB92AA) optional:986 - std::optional<std::pair<CBLSSignature, unsigned int> >::has_value() const
6#: (0x5CE686BB92AA) cbtx.cpp:401 - CalcCbTxBestChainlock(llmq::CChainLocksHandler const&, CBlockIndex const*, unsigned int&, CBLSSignature&)
7#: (0x5CE686D36318) miner.cpp:233 - BlockAssembler::CreateNewBlock(CScript const&)
8#: (0x5CE6869E450B) stl_tree.h:733 - std::_Rb_tree<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag>, boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag>, std::_Identity<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag> >, CompareIteratorByHash, std::allocator<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag> > >::_M_mbegin() const
9#: (0x5CE6869E450B) stl_tree.h:737 - std::_Rb_tree<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag>, boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag>, std::_Identity<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag> >, CompareIteratorByHash, std::allocator<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag> > >::_M_begin()
10#: (0x5CE6869E450B) stl_tree.h:982 - std::_Rb_tree<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag>, boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag>, std::_Identity<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag> >, CompareIteratorByHash, std::allocator<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag> > >::~_Rb_tree()
11#: (0x5CE6869E450B) stl_set.h:283 - std::set<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag>, CompareIteratorByHash, std::allocator<boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry> > > > > >, boost::multi_index::detail::bucket_array<std::allocator<CTxMemPoolEntry> >, boost::multi_index::detail::hashed_unique_tag, boost::multi_index::detail::hashed_index_global_iterator_tag> > >::~set()
12#: (0x5CE6869E450B) miner.h:146 - BlockAssembler::~BlockAssembler()
13#: (0x5CE6869E450B) mining.cpp:174 - generateBlocks
14#: (0x5CE6869E4C6E) prevector.h:479 - prevector<28u, unsigned char, unsigned int, int>::~prevector()
15#: (0x5CE6869E4C6E) script.h:393 - CScript::~CScript()
16#: (0x5CE6869E4C6E) mining.cpp:300 - operator()
17#: (0x5CE6869E4C6E) invoke.h:61 - __invoke_impl<UniValue, generatetoaddress()::<lambda(const RPCHelpMan&, const JSONRPCRequest&)>&, const RPCHelpMan&, const JSONRPCRequest&>
18#: (0x5CE6869E4C6E) invoke.h:116 - __invoke_r<UniValue, generatetoaddress()::<lambda(const RPCHelpMan&, const JSONRPCRequest&)>&, const RPCHelpMan&, const JSONRPCRequest&>
19#: (0x5CE6869E4C6E) std_function.h:291 - _M_invoke
20#: (0x5CE686F48F8E) util.cpp:541 - RPCHelpMan::HandleRequest(JSONRPCRequest const&) const
21#: (0x5CE68697CD18) univalue.h:17 - UniValue::operator=(UniValue&&)
22#: (0x5CE68697CD18) server.h:107 - CRPCCommand::CRPCCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, RPCHelpMan (*)())::{lambda(JSONRPCRequest const&, UniValue&, bool)#1}::operator()(JSONRPCRequest const&, UniValue&, bool) const
23#: (0x5CE68697D100) std_function.h:292 - std::_Function_handler<bool (JSONRPCRequest const&, UniValue&, bool), CRPCCommand::CRPCCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, RPCHelpMan (*)())::{lambda(JSONRPCRequest const&, UniValue&, bool)#1}>::_M_invoke(std::_Any_data const&, JSONRPCRequest const&, UniValue&, bool&&)
24#: (0x5CE686A876C0) std_function.h:591 - std::function<bool (JSONRPCRequest const&, UniValue&, bool)>::operator()(JSONRPCRequest const&, UniValue&, bool) const
25#: (0x5CE686A876C0) server.cpp:622 - ExecuteCommand
26#: (0x5CE686A889C6) server.cpp:511 - ExecuteCommands
27#: (0x5CE686A889C6) server.cpp:543 - CRPCTable::execute(JSONRPCRequest const&) const
28#: (0x5CE686C951B5) httprpc.cpp:247 - HTTPReq_JSONRPC
29#: (0x5CE686CA5406) unique_ptr.h:93 - std::default_delete<HTTPClosure>::operator()(HTTPClosure*) const
30#: (0x5CE686CA5406) unique_ptr.h:398 - std::unique_ptr<HTTPClosure, std::default_delete<HTTPClosure> >::~unique_ptr()
31#: (0x5CE686CA5406) httpserver.cpp:107 - WorkQueue<HTTPClosure>::Run()
dashd: ./evo/specialtx.h:33: std::optional<_Tp> GetTxPayload(const TxType&, bool) [with T = CCbTx; TxType = CTransaction]: Assertion `(tx.nType == T::SPECIALTX_TYPE)' failed.
dde1edf to
50ea5e1
Compare
|
Guix Automation has completed; a release should be present here: https://github.com/dashpay/dash-dev-branches/releases/tag/v22.0.0-devpr6375.dde1edf3. The image should be on dockerhub soon. |
e9387ee refactor: remove unused includes and forward declarations from headers (Konstantin Akimov) f2a186f refactor: remove definition IsQuorumDKGEnabled from header (Konstantin Akimov) 8a7941b refactor: merge helper GetCoinbaseTx which is used only once into GetNonNullCoinbaseChainlock (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented Split from #6375 and added some extra ## What was done? Tidy up headers of evo/ and llmq/: - removed unused includes and added missing - removed unused forward declarations and added missing - removed helper GetCoinbaseTx, moved helper IsQuorumDKGEnabled from header to implementation ## How Has This Been Tested? Run unit and functional tests Compilation time _in theory_ should be improved, in really it shaved just 2-5 seconds from 5 minutes by my benchmark. ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK e9387ee PastaPastaPasta: utACK e9387ee Tree-SHA512: 7b4795fe0bcea23b9f368a962b888d610cac94b42dd6419cfe06977c1a28bbe27a7a2ae2e4cd730ec0ca4f8b333f656a601ebb90bc271f4117dec7a424a08b45
Issue being fixed or feature implemented
Failure on devnet:
+extra logs haven't got to screenshot:
Locally similar error is caught with stacktrace:
What was done?
Added check if DIP0003 is indeed activated before retrieving Chainlock of previous block.
How Has This Been Tested?
No crash observed locally
Breaking Changes
N/A
Checklist: