Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12190)

Issue 14386045: implement a proper representation of the compact tree

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by infinity0
Modified:
10 years, 6 months ago
Reviewers:
ekasper, Eran
CC:
Ben Laurie (Google), ctlog-opensource-review_google.com
Visibility:
Public.

Description

implement a proper representation of the compact tree does book-keeping and maintenance of data structures and state in the monitor. the actual hashing algorithm for extending existing trees will be in a separate patch after this one, and likely only affect merkle.py (plus the FLAG pruning).

Patch Set 1 #

Patch Set 2 : #

Total comments: 28

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -79 lines) Patch
M src/python/ct/client/monitor.py View 1 2 3 4 5 6 7 8 7 chunks +19 lines, -30 lines 0 comments Download
M src/python/ct/client/monitor_test.py View 1 2 3 4 5 6 7 8 8 chunks +29 lines, -21 lines 0 comments Download
M src/python/ct/crypto/merkle.py View 1 2 3 4 5 6 7 8 4 chunks +102 lines, -23 lines 0 comments Download
M src/python/ct/crypto/merkle_test.py View 1 2 3 4 1 chunk +4 lines, -3 lines 0 comments Download
M src/python/ct/proto/client.proto View 2 chunks +10 lines, -2 lines 0 comments Download

Messages

Total messages: 9
infinity0
10 years, 6 months ago (2013-10-04 17:19:17 UTC) #1
infinity0
https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py File src/python/ct/crypto/merkle.py (right): https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py#newcode50 src/python/ct/crypto/merkle.py:50: return "%s(%r)" % (self.__class__.__name__, self.hashfunc) The reason why I ...
10 years, 6 months ago (2013-10-04 17:26:59 UTC) #2
ekasper
https://codereview.appspot.com/14386045/diff/3001/src/python/ct/client/monitor.py File src/python/ct/client/monitor.py (right): https://codereview.appspot.com/14386045/diff/3001/src/python/ct/client/monitor.py#newcode61 src/python/ct/client/monitor.py:61: if self.__verified_tree: When would this be false? https://codereview.appspot.com/14386045/diff/3001/src/python/ct/client/monitor_test.py File ...
10 years, 6 months ago (2013-10-08 08:17:11 UTC) #3
Eran
drive-by review. https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py File src/python/ct/crypto/merkle.py (right): https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py#newcode31 src/python/ct/crypto/merkle.py:31: def count_bits_set(i): On 2013/10/08 08:17:11, ekasper wrote: ...
10 years, 6 months ago (2013-10-09 12:42:13 UTC) #4
infinity0
Will do some tests re the bit-counting stuff. https://codereview.appspot.com/14386045/diff/3001/src/python/ct/client/monitor.py File src/python/ct/client/monitor.py (right): https://codereview.appspot.com/14386045/diff/3001/src/python/ct/client/monitor.py#newcode61 src/python/ct/client/monitor.py:61: if ...
10 years, 6 months ago (2013-10-10 11:42:54 UTC) #5
infinity0
https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py File src/python/ct/crypto/merkle.py (right): https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py#newcode31 src/python/ct/crypto/merkle.py:31: def count_bits_set(i): On 2013/10/09 12:42:13, Eran wrote: > On ...
10 years, 6 months ago (2013-10-10 14:32:39 UTC) #6
ekasper
Only a few minor comments left. https://codereview.appspot.com/14386045/diff/3001/src/python/ct/client/monitor_test.py File src/python/ct/client/monitor_test.py (right): https://codereview.appspot.com/14386045/diff/3001/src/python/ct/client/monitor_test.py#newcode104 src/python/ct/client/monitor_test.py:104: except: On 2013/10/10 ...
10 years, 6 months ago (2013-10-11 11:54:09 UTC) #7
infinity0
https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py File src/python/ct/crypto/merkle.py (right): https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py#newcode35 src/python/ct/crypto/merkle.py:35: def foldr(binop, ll): On 2013/10/11 11:54:09, ekasper wrote: > ...
10 years, 6 months ago (2013-10-14 16:55:27 UTC) #8
ekasper
10 years, 6 months ago (2013-10-16 13:51:00 UTC) #9
LGTM

Job well done. I'm out of office atm so it may take a day or two before I get to
pushing this upstream.

On 2013/10/14 16:55:27, infinity0 wrote:
>
https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle.py
> File src/python/ct/crypto/merkle.py (right):
> 
>
https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle...
> src/python/ct/crypto/merkle.py:35: def foldr(binop, ll):
> On 2013/10/11 11:54:09, ekasper wrote:
> > On 2013/10/10 11:42:54, infinity0 wrote:
> > > On 2013/10/08 08:17:11, ekasper wrote:
> > > > Use reduce().
> > > 
> > > Done.
> > 
> > I've meanwhile learned that you should use a for loop instead of reduce
> (linter
> > will nag). Sorry.
> > 
> > Since this foldr is only used with hash_children to fold hashes (I think),
> make
> > it an explicit fold_hashes() method of the TreeHasher?
> > 
> 
> Done.
> 
>
https://codereview.appspot.com/14386045/diff/3001/src/python/ct/crypto/merkle...
> src/python/ct/crypto/merkle.py:144: def root_hash(self):
> On 2013/10/11 11:54:09, ekasper wrote:
> > On 2013/10/10 11:42:54, infinity0 wrote:
> > > On 2013/10/08 08:17:11, ekasper wrote:
> > > > Same here, probably shouldn't disguise it as a property if it involves a
> > > > significant amount of work.
> > > 
> > > Added a cache for the value, is this better?
> > 
> > Hm, well, the cache is a good idea but I would still remove the @property,
> which
> > suggests it's a read-only op.
> > 
> > I think it's fine to have to call root_hash(), and you could add a comment
> that
> > this triggers computation if the tree has changed.
> > 
> 
> Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b