4 releases
0.1.16-alpha.0 | Mar 31, 2023 |
---|---|
0.1.13-alpha.0 | Mar 17, 2023 |
0.1.12-alpha.0 | Jan 19, 2023 |
0.1.10-alpha.0 | Jan 18, 2023 |
#36 in #stored
410 downloads per month
Used in 114 crates
(9 directly)
1MB
1.5K
SLoC
bitcoinleveldb-log
This Rust crate is a direct translation from the Bitcoin Core C++ implementation of the log component into Rust. It provides a set of types and functions for working with log records, log writers, and log readers.
The crate includes types such as LogRecordType
and ExtendedRecordTypes
which define the types
of records that can be written to the log,
including data records and other special-purpose
records. The crate also provides the LogWriter
and LogReader
types which can be used to write
and read log records.
One important feature of the log is that it
includes checksums for every record to ensure that
data corruption can be detected. The crate
provides the fix_checksum
function which can be
used to fix the checksum of a record that has been
corrupted.
This crate is still in the process of being translated from C++ to Rust, so some of the function bodies may still be incomplete. However, once the translation process is complete, the system will become testable.
Notice: This crate is part of a direct translation from C++ to Rust of the Bitcoin Core. As such, some of the function bodies may still be in the process of translation. Please note that this system will become testable once the translation process is complete.
38> how does this apply to leveldb?
The bitcoinleveldb-log crate is a Rust implementation of the logging system used in the Bitcoin Core software, which is based on the LevelDB library.
In LevelDB, the log is a write-ahead log that records every modification made to the database. The log records are stored sequentially, and the log is typically stored on disk for durability. The log provides a way to recover the database in case of a crash or other failure, by replaying the log to bring the database up to date.
The Rust implementation in this crate provides similar functionality to the C++ implementation in Bitcoin Core, with support for reading and writing log records, performing checksum validation, and handling various error conditions. The crate includes various test functions to ensure the correctness of the implementation, including tests for reading and writing log records, handling errors, and verifying the integrity of the log.
Overall, this crate provides a key component of the LevelDB storage engine used by Bitcoin Core, enabling reliable data storage and recovery in the event of failures.
Dependencies
~89MB
~848K SLoC