Skip to content

Latest commit

 

History

History
102 lines (63 loc) · 3.07 KB

readme.adoc

File metadata and controls

102 lines (63 loc) · 3.07 KB

Tackler-NG

Tackler’s operations and results must always be correct and trustworthy. If there are any errors with journal, then it will fail fast and hard and won’t process dubious input as valid one.

Tackler-NG will strive for the same reliability level as Tackler.

At the moment as RIIR is still in progress, things are in flux a bit, but Tackler’s original test-vectors and Tackler Test Tracking Database (T3DB) are here:

Unsafe and unwrap

Unsafe code is forbidden in the code base.

All unwrap usage should be documented, either why they won’t panic or why it doesn’t matter.

rg 'unwrap\(' | egrep -v '(:ok:)|(:test:)'

Rust toolchain

Used Rust toolchain is the latest or fairly new version of Rust.

Number types: TacklerReal vs. rust_decimal

TacklerReal

Scala’s Scala BigDecimal with unlimited MathContext, with HALF_UP rounding mode.

Rust_decimal

Decimal represents a 128 bit representation of a fixed-precision decimal number. The finite set of values of type Decimal are of the form m / 10^e, where m is an integer such that -2^96 < m < 2^96, and e is an integer between 0 and 28 inclusive.

Design and Code Structure

At the moment design and code structure follows Tackler’s structure:

Parser definition

Tackler-NG uses winnow parser combinator library for parsing.

Parser functions are defined in the parser::parts module.

There is an old, ANTLR based grammar and lexer definition available.

These are only used as reference and preserved for historic reasons.

Running Tests

Run unit tests at the root of project’s workspace:

cargo test

Tackler test suite:

cargo build --release --bin tackler && tests/sh/test-runner-ng.sh

Simple Performance test:

cargo run --release -p tackler-core

Parser Benchmark test: ` cargo bench parser time: [3.1823 µs 3.2017 µs 3.2269 µs] change: [-0.1596% +0.5072% +1.1489%] (p = 0.13 > 0.05) No change in performance detected. `

Flamegraph for tackler

Run flamegraph on tackler-cli crate:

cd tackler-cli

CARGO_PROFILE_RELEASE_DEBUG=true \
    cargo flamegraph -- \
        --config ../examples/audit.toml \
        --input.git.ref txns-1E5