Conversation
should be reverted after all tests succeded on hfnet # Conflicts: # src/init.cpp # src/komodo_utils.cpp
height after which notary nodes allowed to mine extra mindiff block in case of stale, turned on by default on mainnet, and disabled at present for testnet and regtest.
hf22 rule will apply according to nAllowNotariesMineExtraBlockAfterStaleHeight set or not for current network, so no need to use hardcoded string check.
# Conflicts: # src/miner.cpp
next call to CheckProofOfWork will generate non-expected prioirty list, i.e. nth call: 1 - 0 1 2 3 4 5 ... 63 2 - 64 65 66 57 ... 127 3 - 128 129 130 ... 191 so, init of id should be non-static and outside lambda.
as HF22 changes will include few other consensus changes, better to give it more common name, not only extra block related for notaries.
also possible optimize of loop iterating txes, in case of height == 0, don't need to call komodo_block2height for each tx, call it once before iterating loop is enough. # Conflicts: # src/main.cpp
instead of block.nTime (pblock->nTime). This should prevent existance of txes, which are already added in mempool, but never will be added to a block (skipped on create blocktemplate stage), bcz of MTP too far away from block creation time in case of big gaps between blocks. # Conflicts: # src/miner.cpp
… error Before debug.log in case of komodo_validate_interest failed was like: 2022-04-29 03:14:33 AcceptToMemoryPool komodo_validate_interest failure 2022-04-29 03:14:33 ERROR: AcceptToMemoryPool: komodo_validate_interest failed We removed 1st message and added txid to 2nd. # Conflicts: # src/main.cpp
We don't need to call pindexPrev->GetMedianTimePast() on every mempool tx iteration, it's calculated before in nMedianTimePast. Also we don't need params variable, as we already have consensusParams defined above. # Conflicts: # src/miner.cpp
- re-format, remove useless comments and dead code. - remove unused variables. - remove set<CBitcoinAddress> setAddress and conditions containing it, bcz setAddress.size() is always 0, so these paths in the code are dead. - get rid of most pointer operations, instead of memcmp passed notarypub33, we construct targetP2PKScript and compare it with scripts from available utxos. - don't allow to spend unconfirmed 10k sat. utxos, bcz we don't ensure that they would be included in the same block. # Conflicts: # src/wallet/rpcwallet.cpp
to pass two params in a function earlier we used a (void **) to handle pointers on these 2 params in "array". also there was "hidden" parameter, this pointer itself, if pointer == 0 -> it before HF time, if pointer !=0 -> after HF time, and we should extract two params from array of passed pointers. of course it can be replaced with tuple, or boost::optional with tuple "inside", but much more simple way is to pass params (CScript and nLockTime) in komodo_notaryvin same way as they exits and assume that if passed CScript().size() == 0, it before HF and if size() > 0 - it after HF. # Conflicts: # src/miner.cpp
"Backport" of bitcoin/bitcoin#10534 to our codebase. TODO: consider to use latest prevector implementation from Bitcoin upstream.
|
There seems to be a certain level of counter-productivity in doing this and not removing the random delay when there are "too few" external miners as well |
This PR have no significant relationship to internal miner behavior. All substantial changes in internal miner that could be possible done in it will be done later, if will. What about delay you are talking about, yes, we are know about it, and it will be possible reconsidered / refactored / reduced / or, even removed, based on further analysis of the chain behavior / block creation, etc. Main goal of this PR is to introduce new consensus rules, which will be able to help overcome "chain stuck" issue and "disappearing transactions" issue, in-case of big gaps between blocks. |
Perhaps I used the wrong wording? If you want the chain to stick less and want NNs to assist in said goal then one important step in doing so would be removing a code block that intentionally delays them from sending blocks during the time you want them to be creating more blocks. The flaw in the notion that "no significant relationship to internal miner behavior" can solve a problem that the "internal miner behavior" is coded to create is that it's coded to fight against the goal of the PR. On one hand you're allowing NNs to mine more often, on the other hand you're keeping in code that, in most circumstances, disallows them from creating a block in the time frame you want them to create it in. |
Forget about internal miner implementation on a second. Let's imagine that part of NNs using it, and other part using other solution for creating blocks, you could imagine that NNs could create a block at the click of a finger 🪄, for example. In case of absent of "external" PoW miners ( And yes, we will return to timeframes, delays, and other "artificial things" in internal miner later, i.e. in other PRs. p.s. Try to abstract of internal miner usage for now, i mean when thinking of "how it will be". |
I would and I could, except for the fact that my mind is incapable of quietly seeing a thing fight against itself.
I sometimes think that people reject reading my words just because they come from me. |
It's not "ignoring". As i said above: "And yes, we will return to timeframes, delays, and other "artificial things" in internal miner later, i.e. in other PRs". At this stage let's separate internal miner things and consensus things. Within this PR we are talking only about consensus changes. |
Alrighttt
left a comment
There was a problem hiding this comment.
Consensus changes tested thoroughly via HFNET.
Thanks for the notaryvin clean up as well.
src/chainparams.cpp
Outdated
| vAlertPubKey = ParseHex("020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9"); | ||
| // (Zcash) vAlertPubKey = ParseHex("04b7ecf0baa90495ceb4e4090f6b2fd37eec1e9c85fac68a487f3ce11589692e4a317479316ee814e066638e1db54e37a10689b70286e6315b1087b6615d179264"); | ||
| nDefaultPort = 7770; | ||
| nDefaultPort = 8880; |
There was a problem hiding this comment.
| nDefaultPort = 8880; | |
| nDefaultPort = 7770; |
Do not change the p2p port in production.
src/chainparamsseeds.h
Outdated
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xee,0xdd,0x3d}, 7770}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0xde,0x65,0xf7}, 7770}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xc3,0x64,0x20}, 7770} | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x7f,0x3c,0x8e}, 8880}, |
There was a problem hiding this comment.
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x7f,0x3c,0x8e}, 8880}, | |
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x7f,0x3c,0x8e}, 7770}, |
src/chainparamsseeds.h
Outdated
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0xde,0x65,0xf7}, 7770}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xc3,0x64,0x20}, 7770} | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x7f,0x3c,0x8e}, 8880}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xee,0xdd,0x3d}, 8880}, |
There was a problem hiding this comment.
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xee,0xdd,0x3d}, 8880}, | |
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xee,0xdd,0x3d}, 7770}, |
src/chainparamsseeds.h
Outdated
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xc3,0x64,0x20}, 7770} | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x7f,0x3c,0x8e}, 8880}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xee,0xdd,0x3d}, 8880}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0xde,0x65,0xf7}, 8880}, |
There was a problem hiding this comment.
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0xde,0x65,0xf7}, 8880}, | |
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0xde,0x65,0xf7}, 7770}, |
src/chainparamsseeds.h
Outdated
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0x7f,0x3c,0x8e}, 8880}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xee,0xdd,0x3d}, 8880}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0xde,0x65,0xf7}, 8880}, | ||
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xc3,0x64,0x20}, 8880} |
There was a problem hiding this comment.
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xc3,0x64,0x20}, 8880} | |
| {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xc3,0x64,0x20}, 7770} |
src/komodo_port.c
Outdated
| { | ||
| if ( magic == 0x8de4eef9 ) | ||
| return(7770); | ||
| return(8880); |
There was a problem hiding this comment.
| return(8880); | |
| return(7770); |
src/komodo_port.c
Outdated
| { | ||
| *magicp = 0x8de4eef9; | ||
| return(7770); | ||
| return(8880); |
There was a problem hiding this comment.
| return(8880); | |
| return(7770); |
src/komodo_utils.cpp
Outdated
| { | ||
| if ( magic == 0x8de4eef9 ) | ||
| return(7770); | ||
| return(8880); |
There was a problem hiding this comment.
| return(8880); | |
| return(7770); |
src/komodo_utils.cpp
Outdated
| { | ||
| *magicp = 0x8de4eef9; | ||
| return(7770); | ||
| return(8880); |
There was a problem hiding this comment.
| return(8880); | |
| return(7770); |
src/komodo_utils.cpp
Outdated
| { | ||
| char fname[512],username[512],password[4096]; int32_t iter; FILE *fp; | ||
| ASSETCHAINS_P2PPORT = 7770; | ||
| ASSETCHAINS_P2PPORT = 8880; |
There was a problem hiding this comment.
| ASSETCHAINS_P2PPORT = 8880; | |
| ASSETCHAINS_P2PPORT = 7770; |
Release v1.1.0


Don't merge this PR till:
komodo_globals.h,komodo_hardfork.hwill be done.HFNETtesting in which we should test everything with 50% of existing nodes at least, to estimate maximum gap between blocks. ProbablyHFNETshould be re-created based on https://github.com/KomodoPlatform repo sources once again.nS6TestTimestampandnS6TestHardforkHeightwill be set in stone, we should setconsensus.nHF22Height, as a week afternS6TestHardforkHeightto not overlap two important consensus changes. This should be done before merging this PR.KomodoPlatform/komodorepodevbranch to match currentHFNETspinned-up by @Alrighttt , i mean this, available here - hfnet-alrighttt-changes.zip.HFNETand testing purposes.Currently i selected @ca333 , @Alrighttt and @smk762 for review, but later, after all tests, probably we should give a chance to look on all of these to @jmjatlanta and @dimxy .