Okay, long delay since the last milestone update, but here's #3:
BlockchainDB's documentation is now Doxygen-compliant and up-to-date with recent changes.
A couple of things were renamed, as their purpose had changed but their names implied the old purpose.
It's amazing how much things change in under a year. BlockchainDB has undergone many changes, so the new documentation is not guaranteed to be 100% correct. I'll be attaching my notes to the end of this post, some of them refer to bits I still need to ask about (or spend time looking into). I'll also paste the commit logs at the end, because why not.
If anyone has thoughts on my notes below, please don't hesitate, as many of them I'm not 100% sure what the best course of action is at this time.
As always, you can follow updates on my github repo.
Current TODO list
General:
Discuss updating function names to better reflect their purpose.
Fix inconsistent indentation.
evaluate return values of all functions (lots of bool return values not being used, etc.)
related to this, consider throwing rather than returning empty containers
where a container is the return type
src/
cryptonote_core/
cryptonote_core.*/
move BlockchainDB initialization and DB-specific code from cryptonote_core.* to better places
blockchain.*/
evaluate locking mechanism and possibility of separate reader/writer locks
blockchain_db/
blockchain_db.*/
remove_transaction_data() should not remove outputs as well, but currently
subclasses do so. This should be reorganized. The current subclass function
to do so is remove_tx_outputs()
global output index counting should maybe be handled in the parent class,
up for debate.
Need to make sure that aborting a partial add_block after an exception
will not error out part way through due to another exception. This could
be tricky, as "remove_*" might fail because it hadn't been added yet, or
it might fail because of a database issue. This will likely require more
fine-grained exceptions. For now, with the exceptions that exist, I think
that a generic DB_ERROR is suitable for, well, a db error, and the DNE
exceptions should be used as such. This will likely be sufficient to
differentiate.
add_transaction (concrete in parent) takes a pointer to a tx hash as a
parameter. This should be a reference, but perhaps there's a reason it
is not. Needs looking into.
Destructor: should it call sync() and close() if open?
open: db_flags should either be handled in subclass implementations
or standardized among all blockchaindbs.
batch transactions: batch_stop and batch_commit both have commit code,
batch_stop should call to batch_commit instead.
IMPORTANT: make sure BlockchainDB (and/or subclasses) handles correctly
removing partial block data in the event of a failure during a block add.
get_blocks_range: should this throw if the request is out of range, or
should it let get_block_from_height throw and just ignore it as it does
now?
get_tx_list: much the same as above with get_blocks_range.
*important* hardfork functions: verify that documented functionality is true/correct
** Git log **
commit cc3394b38d87785aafe850e58dc2d79cd65d47de
Author: Thomas Winget
Date: Tue Dec 1 17:38:22 2015 -0500
Update BlockchainDB documentation
BlockchainDB is now Doxygen-compliant and its documentation is
up-to-date with recent changes.
src/blockchain_db/blockchain_db.h | 1063 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
1 file changed, 911 insertions(+), 152 deletions(-)
commit 204ed981b0e114dc122de16d8642ec44745074f1
Author: Thomas Winget
Date: Tue Dec 1 15:03:46 2015 -0500
Rename function for clarity
As BlockchainDB::get_output_key was changed to return a struct containing
the output key along with two other pieces of metadata for the output, the
function name is now changed to be get_output_data.
In addition, the database handles in db_bdb and db_lmdb were renamed
from m_output_keys to m_output_data to mirror this.
src/blockchain_db/berkeleydb/db_bdb.cpp | 28 ++++++++++++++--------------
src/blockchain_db/berkeleydb/db_bdb.h | 8 ++++----
src/blockchain_db/blockchain_db.h | 8 ++++----
src/blockchain_db/lmdb/db_lmdb.cpp | 22 +++++++++++-----------
src/blockchain_db/lmdb/db_lmdb.h | 8 ++++----
src/blockchain_utilities/blockchain_dump.cpp | 2 +-
src/cryptonote_core/blockchain.cpp | 10 +++++-----
7 files changed, 43 insertions(+), 43 deletions(-)