Commit Graph

41 Commits

Author SHA1 Message Date
JoelKatz
35b6cf58c8 Cleanups. 2012-02-07 17:29:44 -08:00
JoelKatz
104fa67d86 Bugfix. 2012-02-07 17:02:59 -08:00
JoelKatz
29d24c0af8 Bugfixes and new unit test. 2012-02-07 16:54:59 -08:00
JoelKatz
ad61c7575f Bugfix. 2012-02-07 14:15:08 -08:00
JoelKatz
30c9bf0ed2 Major rewrite of the SHAMap code. This code performs much better
than the original version, particularly for smaller maps.
2012-02-05 06:54:44 -08:00
JoelKatz
41ce5fa7f9 Missing from previous commit. 2012-02-02 16:14:27 -08:00
JoelKatz
08d6b55fed Major optimization in the way we track SHAMaps. 2012-02-01 20:51:58 -08:00
JoelKatz
5888d19f2b SHAMap sync now passes its unit test with the "full below" optimization
disabled. There's a logic error in the implementation.
2012-02-01 19:10:07 -08:00
JoelKatz
f2130d4f6b Complete the SHAMapSync unit test. The test currently fails. Debug in progress 2012-02-01 14:22:34 -08:00
JoelKatz
bac03c31de Fixes and cleanups. 2012-01-31 18:44:59 -08:00
JoelKatz
eec4bfddff Need a 'walkTo' function. That walks as far as possible to tree
position.
2012-01-31 15:52:44 -08:00
JoelKatz
5a52d6fec3 More work on the ledger/SHAMap sync code. 2012-01-30 20:56:38 -08:00
JoelKatz
3740498b50 Some enhancements to this coded needed for the sync code to work. 2012-01-30 19:04:22 -08:00
JoelKatz
7885439bb4 Tiny optimization. 2012-01-27 11:34:55 -08:00
JoelKatz
f4e6a72e1c Logic to 'rebase' a ledger to a different previous ledger.
This code does not assume the new previous ledger is valid
or trusted.
1) Validate sequence numbers and basic information.
2) Create a new ledger based on the new previous ledger.
3) Compare the old previous ledger and the new previous
ledger.
4) Try to include any missing, valid transactions in
the current ledger.
5) Traverse the old ledger based on the old previous ledger,
try to import any transactions into the new ledger.
2012-01-24 21:30:27 -08:00
JoelKatz
780f94798e Cleanups and fixes. 2011-12-20 22:01:06 -08:00
JoelKatz
da5579f9fe Bugfixes and some copy avoidance. 2011-12-16 20:15:51 -08:00
JoelKatz
8083b677e2 A better way to convert between uint160 and uint256 types. 2011-12-15 16:52:50 -08:00
JoelKatz
c7f890ab47 Bugfixes. 2011-12-15 12:44:29 -08:00
JoelKatz
d1b2d12a04 Tie the SHAMap code to the HashedObject code in a much simpler way.
Write out dirty nodes when we accept a ledger.
2011-12-13 20:15:36 -08:00
JoelKatz
3d8dab3ae9 Don't use ScopedLock where the lighter recursive_mutex::ScopedLock will do. 2011-12-13 15:30:33 -08:00
JoelKatz
7572f0a3e3 Fix a bug where dirtying the root doesn't update the special root pointer. 2011-11-29 16:42:50 -08:00
JoelKatz
ff8b9aafa6 Remove debug code accidentally commited. 2011-11-29 16:22:17 -08:00
JoelKatz
66fec28ffe Cleanup, additional debug, and a very painful bugfix that turned out to be a
1 instead of a 0.
2011-11-29 11:26:45 -08:00
JoelKatz
ebb9a9c255 Build enough information into the leaf nodes so that they can be parsed
without knowledge of the objects they contain. This will allow new
transaction or account formats to be added (possibly with larger data sizes)
without breaking the ability to parse the hash trees. It also simplifies
the operation-specific tree code (since it doesn't have to parse the raw
leaf data).
2011-11-28 13:59:34 -08:00
JoelKatz
fe3acce262 Some missing functions. 2011-11-25 21:52:54 -08:00
JoelKatz
d176e9d2c7 Bugfixes. isChildLeaf had wrong test. peekNextItem walked the wrong way. 2011-11-25 17:10:42 -08:00
JoelKatz
a9e6f0b70f Bugfix: Put root node in map. 2011-11-25 13:51:34 -08:00
JoelKatz
0df9ec91fa Debug and unit test code. Copy on write logic. Bugfixes. 2011-11-25 00:03:33 -08:00
JoelKatz
83b2f8b73a Simplify. Rewrite SHAMap::dirtyUp. 2011-11-23 23:45:26 -08:00
JoelKatz
51f3f4e1a4 Some missing handlers. SHAMap traversal top-level code. 2011-11-23 14:57:11 -08:00
JoelKatz
17c265ee24 Some cleanups.
Add functions that avoid an allocate/copy/free where that's not needed.
2011-11-23 12:50:05 -08:00
JoelKatz
41309b6f72 Part of the 'tray' implementation to avoid a burst of load on ledger close 2011-11-21 13:10:12 -08:00
JoelKatz
fa60ccd2df Start tying all these classes together: 2011-11-18 11:23:06 -08:00
JoelKatz
76b7b3c68e More SHA map work. 2011-11-17 19:57:19 -08:00
JoelKatz
477b2df276 More work on the SHAMap/Serialize classes. 2011-11-17 18:11:11 -08:00
JoelKatz
e7bae43261 Continue implementation these classes. 2011-11-17 12:22:25 -08:00
JoelKatz
55b2111fd5 Updates. Create a class to hold an item in a SHAMap, separating the tag from
the data (it's not always the hash of the data). Make ScopedLock's recursive.
2011-11-15 10:49:14 -08:00
JoelKatz
fbf6967d82 Continue fleshing out these classes. 2011-11-14 17:32:05 -08:00
JoelKatz
ccea015c6a Start coding the guts of the SHAMap structure that will hold, synchronize,
sign, and validate our account balances and transactions.
2011-11-14 15:21:14 -08:00
JoelKatz
53b61d4d65 Start to flesh out this code. 2011-11-12 14:12:38 -08:00