# # patch "ChangeLog" # from [f38abc132453d7274edb806d9556a41a1ff7bc18] # to [dc27c6d632887b760d6b6dcec5d61936d4020da4] # # patch "netsync.cc" # from [46cef8d28ddd981f6ca9c8483434fa59efad0f0d] # to [5d33f00ec5c8e80c76ace7d2cbeb494c8a99424a] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,8 @@ +2005-06-07 Nathaniel Smith + + * netsync.cc (rebuild_merkle_trees): Add a comment describing how + this code should work (and why it currently doesn't quite). + 2005-06-05 Nathaniel Smith * tests/t_bad_packets.at: Expect certs on a non-existent rev to --- netsync.cc +++ netsync.cc @@ -3610,6 +3610,21 @@ ticker certs_ticker("certs", "c", 256); ticker keys_ticker("keys", "k", 1); + // this code is wrong. the way the logic _should_ work is: + // -- start with all branches we want to include + // -- for each such branch, find all branch certs for that branch + // -- for each such cert, note down its revision + // (or these two steps can be replaced with anything else that gives us + // list of all revisions in the branch) + // -- expand this set of revisions to include all of their ancestors + // -- for each such revision, insert all of its certs into the cert table, + // and note all of its branches and keys + // -- for each such branch, insert its epoch into the epoch table, and for + // each such key, insert its key into the key table. + // this somewhat convoluted approach is necessary to handle cases where + // ancestors leave the branch inclusion set, where revisions carry branches + // that are otherwise outside of the inclusion set, etc. + set revision_ids; set inserted_keys;