Commit graph

11 commits

Author SHA1 Message Date
Tzu-Jung Lee
f4a5c5ee8d trie: change the Value.Hash() to return pointer.
When nil is returned by Hash(), the merkle generation will treat it as a
nil node, and ignore the hash along the way.
2018-07-16 23:20:11 -07:00
Tzu-Jung Lee
374a75fea6 misc changes 2018-07-16 08:25:52 -07:00
Tzu-Jung Lee
a5627ecfcc claimnode: Add the example on the whitepaper as a testcase.
Note: all the test cases will be reworked to a more compact form.
2018-07-11 12:40:13 -07:00
Tzu-Jung Lee
5e642e642f claimnode: Support to BestClaim becomes Active immediately. 2018-07-11 11:51:20 -07:00
Tzu-Jung Lee
212fd1983a trie: update merkle hash when stage is commited 2018-07-11 09:54:41 -07:00
Tzu-Jung Lee
d3419ea775 cleanup: refactor, bugfix, and comment. 2018-07-11 01:22:18 -07:00
Tzu-Jung Lee
8e1ae77aad cleanup: bring the merkletrie in as trie. 2018-07-09 10:48:33 -07:00
Tzu-Jung Lee
ed4478bc72 cleanup: reorg the code for dependencies.
Move self-contained pieces into their own package.
This spells out the depedencies and the context each
sub-package focuses on.

Not the final structure as it's WIP.
Just tying the knots while climbing up the rope.
2018-07-09 10:48:33 -07:00
Tzu-Jung Lee
fa2e276f3d fix Bidding logics, and port some tests cases from lbrycrd 2018-07-08 22:12:57 -07:00
Tzu-Jung Lee
84c64c1018 wip: misc updates
AddClaim / AddSupport is working with minimal testing done so far.
RemoveClaim / RemoveSupport is implemented, but not tested yet.

Some known issues:

Currently, we update the BestClaim for each node in a lazy fashion.
Each node could add/remove claims/supports without recalculating hash
until its being obeserved externally.

However, due to the "Takeover Delay" bidding rule, as the block number
increases, the bestClaim might changes implicitly. The Trie can't detect
this passively, and would need some mechanism for this.
2018-07-03 22:03:55 -07:00
Tzu-Jung Lee
8eae587539 initial import 2018-07-03 14:56:10 -07:00