Skip to content

update dev#20

Merged
ca333 merged 44 commits intoGLEECBTC:devfrom
jl777:dev
Apr 21, 2018
Merged

update dev#20
ca333 merged 44 commits intoGLEECBTC:devfrom
jl777:dev

Conversation

@ca333
Copy link
Copy Markdown

@ca333 ca333 commented Apr 21, 2018

No description provided.

jl777 and others added 14 commits April 20, 2018 17:16
Prior commits relate to supporting a limited size network.

It looks like there is an edge case where it is possible for a hash to
be in the mapIndex, without a pindex. If a block with such a hash is
tried to be Accepted, the AcceptBlockHeader returns true but with a
null pindex, and AcceptBlock fails.

The code says that this indicates that the hash was added from a
blockheader without a block, but I didn’t see that happening. In any
case, it happens a lot on a 2 node network. So much so that if one node
is just mining, before too long the other node will not accept the
block and once that happens, no subsequent block would work as the
prior block is missing.

Of course, with more nodes, these blocks will be around a lot more and
likely it won’t be such an issue, but not so sure that it doesn’t
require restarting the node to get it back on track again.

These prior commits implement a KOMODO_LIMITED_NETWORKSIZE logic where
if it sees that a block has come in which is in the mapIndex but has no
pindex, it automatically addtoblockindex.

There is one edge case still left where both the current block being
processed and its previous block are in this limbo state. Since the
pindex is not mapped to the block, it is problematic to retrieve the
CBlock for the pprev and without the valid pprev the pindex will have a
null pprev and no nHeight set. It is possible that all the other code
will properly deal with such a case and automatically fix it, but
rather than rely on that, in such a case the automatic addtoblockindex
is not done.

A node in such a state would need to exit and restart or somehow fill
in the data from other nodes.

From what I can tell, the above is the main reason why the PoS/PoW
networks were having problems staying in sync. Since even with one
mining node, it was just a matter of time before the other node got
stuck, with more than one mining node we end up with independent forks
that won’t reconcile until the node is restarted.
Fix polarity of compare
@ca333 ca333 merged commit d3c94f4 into GLEECBTC:dev Apr 21, 2018
himu007 pushed a commit that referenced this pull request Dec 16, 2018
ca333 pushed a commit that referenced this pull request Feb 24, 2019
ca333 pushed a commit that referenced this pull request Mar 3, 2019
merge latest jl777-FSM
jl777 pushed a commit to radix42/komodo that referenced this pull request Apr 17, 2019
- More constrained vins/vouts
- Fixed CC marker value
- Added validation of ChannelsOpen in all tx
- Switched to LOGSTREAM for logging
jl777 added a commit to radix42/komodo that referenced this pull request Apr 17, 2019
ca333 pushed a commit that referenced this pull request Nov 18, 2021
Support for CLTV txns in wallet, NSPV fixes and improvement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants