-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: bury v20 fork - fire up test chains by first block - 4/n #6225
Conversation
f8a4893
to
318df9e
Compare
src/evo/specialtxman.cpp
Outdated
if (!DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_V20)) { | ||
return state.Invalid(TxValidationResult::TX_CONSENSUS, "mnhf-before-v20"); | ||
} |
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.
dcab562: a devnet or something like that could have a mnhf tx get mined before v20 is active though right?
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.
dcab562 it would not affect mainnet, testnet, indeed.
UPD: dropped
src/evo/specialtxman.cpp
Outdated
if (!DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_V20)) { | ||
return state.Invalid(TxValidationResult::TX_CONSENSUS, "assetlocks-before-v20"); | ||
} |
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.
4afc853: I mean, this is kinda a breaking change no? Wouldn't affect mainnet but...
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.
4afc853 it would not affect mainnet, testnet, indeed.
UPD: dropped
if (!Params().IsValidMNActivation(mnhfTx.signal.versionBit, pindexPrev->GetMedianTimePast())) { | ||
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-mnhf-non-ehf"); | ||
} |
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.
6c69808: could probably be it's own distinct PR?
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.
could not, because it's impossible (or very hard) to implement this functionality in functional tests within v20 buried.
src/evo/mnhftx.cpp
Outdated
if (Params().IsValidMNActivation(versionBit, pindex->GetMedianTimePast())) { | ||
signals.insert({versionBit, mined_height}); | ||
} | ||
|
||
signals.insert({versionBit, mined_height}); |
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.
3cd7a42: how's this duplicated?
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.
see lines 222...225
This condition already checked for each signal in new_signals above and if it fails for any signal this function will return std::nullopt
as a result
@@ -192,7 +192,8 @@ class CMainParams : public CChainParams { | |||
consensus.DIP0024Height = 1737792; // 0000000000000001342be9c0b75ad40c276beaad91616423c4d9cb101b3db438 | |||
consensus.DIP0024QuorumsHeight = 1738698; // 000000000000001aa25181e4c466e593992c98f9eb21c69ee757b8bb0af50244 | |||
consensus.V19Height = 1899072; // 0000000000000015e32e73052d663626327004c81c5c22cb8b42c361015c0eae | |||
consensus.MinBIP9WarningHeight = 1899072 + 2016; // V19 activation height + miner confirmation window | |||
consensus.V20Height = 1987776; // 000000000000001bf41cff06b76780050682ca29e61a91c391893d4745579777 |
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.
what's the minimum set of commits needed in this PR to merge in 47def13?
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.
test/functional/feature_block.py
Outdated
self.extra_args = [[ | ||
'-dip3params=2000:2000', | ||
'-dip3params=2000:2000', # Must set '-dip3params=2000:2000' to create pre-dip3 blocks only |
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.
why not use testactivationheight?
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.
it's out of scope this PR, I will do that in PR where I set DIP3 activation from block 1
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.
clang-diff format is not happy
…locks during re-index Relevant crash dump: Assertion failed: detected inconsistent lock order for 'cs_main' in node/blockstorage.cpp:778 (in thread 'main'), details in debug log. Posix Signal: Aborted 0#: (0x62349D233974) stl_vector.h:115 - std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data::_M_copy_data(std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data const&) 1#: (0x62349D233974) stl_vector.h:127 - std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data::_M_swap_data(std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data&) 2#: (0x62349D233974) stl_vector.h:1959 - std::vector<unsigned long, std::allocator<unsigned long> >::_M_move_assign(std::vector<unsigned long, std::allocator<unsigned long> >&&, std::integral_constant<bool, true>) 3#: (0x62349D233974) stl_vector.h:768 - std::vector<unsigned long, std::allocator<unsigned long> >::operator=(std::vector<unsigned long, std::allocator<unsigned long> >&&) 4#: (0x62349D233974) stacktraces.cpp:777 - HandlePosixSignal 5#: (0x71E435442990) libc_sigaction.c - ??? 6#: (0x71E435499A1B) pthread_kill.c:44 - __pthread_kill_implementation 7#: (0x71E435499A1B) pthread_kill.c:78 - __pthread_kill_internal 8#: (0x71E435499A1B) pthread_kill.c:89 - __GI___pthread_kill 9#: (0x71E4354428E6) raise.c:27 - __GI_raise 10#: (0x71E4354268B7) abort.c:81 - __GI_abort 11#: (0x62349D239956) basic_string.h:390 - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_check_length(unsigned long, unsigned long, char const*) const 12#: (0x62349D239956) basic_string.h:1461 - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*) 13#: (0x62349D239956) basic_string.h:1365 - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*) 14#: (0x62349D239956) sync.cpp:114 - potential_deadlock_detected 15#: (0x62349D2403DE) sync.cpp:188 - push_lock<std::recursive_mutex> 16#: (0x62349D2403DE) sync.cpp:212 - void EnterCritical<std::recursive_mutex>(char const*, char const*, int, std::recursive_mutex*, bool) 17#: (0x62349CAA8B72) unique_lock.h:150 - std::unique_lock<std::recursive_mutex>::try_lock() 18#: (0x62349CAA8B72) sync.h:162 - UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::Enter(char const*, char const*, int) 19#: (0x62349CAA8B72) sync.h:183 - UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool) 20#: (0x62349CE349CD) chain.h:225 - CBlockIndex::GetBlockPos() const 21#: (0x62349CE349CD) blockstorage.cpp:778 - operator() 22#: (0x62349CE349CD) blockstorage.cpp:778 - ReadBlockFromDisk(CBlock&, CBlockIndex const*, Consensus::Params const&) 23#: (0x62349D102F82) mnhftx.cpp:284 - CMNHFManager::GetForBlock(CBlockIndex const*) 24#: (0x62349D103E9B) mnhftx.cpp:58 - CMNHFManager::GetSignalsStage(CBlockIndex const*) 25#: (0x62349D07F0E9) versionbits.cpp:222 - SignalHeight 26#: (0x62349D07F90D) versionbits.cpp:37 - AbstractThresholdConditionChecker::GetStateFor(CBlockIndex const*, Consensus::Params const&, std::map<CBlockIndex const*, ThresholdState, std::less<CBlockIndex const*>, std::allocator<std::pair<CBlockIndex const* const, ThresholdState> > >&) const 27#: (0x62349D080D93) sync.h:199 - UniqueLock<AnnotatedMixin<std::mutex>, std::unique_lock<std::mutex> >::~UniqueLock() 28#: (0x62349D080D93) versionbits.cpp:260 - VersionBitsCache::State(CBlockIndex const*, Consensus::Params const&, Consensus::DeploymentPos) 29#: (0x62349CC06C73) deterministicmns.cpp:227 - CDeterministicMNList::GetProjectedMNPayees(gsl::not_null<CBlockIndex const* const>, int) const Aborted (core dumped)
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.
generally LGMT; time for Udjin to review. I'll wanna reindex it, but I'll do that later
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.
reindexed with -assumevalid=0
on both mainnet and testnet, no issues
ACK 2381255
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.
utACK 2381255
Issue being fixed or feature implemented
V20 is activated on mainnet: time to bury it!
#6186
What was done?
Hard-fork v20 is buried and it requires to implement multiple fixes, simplifications, refactoring:
CMNHFManager::GetSignalsStage
How Has This Been Tested?
Some unit and functional tests to succeed.
Done reindex (just in case):
Breaking Changes
N/A
Checklist: