]> git.bitcoin.ninja Git - dnssec-prover/commitdiff
Add a feature to slow things down for a smaller binary
authorMatt Corallo <git@bluematt.me>
Thu, 1 Aug 2024 21:32:47 +0000 (21:32 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 1 Aug 2024 21:54:56 +0000 (21:54 +0000)
Cargo.toml
README
src/lib.rs
test.sh
validation_bloat_test/Cargo.toml

index f4c142318940f869f0951ed796c682e20205d0ae..e3dcc76c1cec3910e72c8c8d846c5db937405d13 100644 (file)
@@ -19,6 +19,7 @@ std = []
 validation = ["bitcoin_hashes", "hex_lit"]
 tokio = ["tokio_crate/net", "tokio_crate/io-util", "std"]
 build_server = ["tokio", "tokio_crate/rt-multi-thread", "tokio_crate/macros"]
+slower_smaller_binary = []
 
 [dependencies]
 bitcoin_hashes = { version = "0.14", default-features = false, optional = true }
diff --git a/README b/README
index c2b5f72302f69c90dff46c01deee2b86848ff2f8..0d5746a3ad2435ce349d8d1c2e60f6a2d6c8de92 100644 (file)
--- a/README
+++ b/README
@@ -21,6 +21,10 @@ There are numerous APIs present:
    `/dnssecproof?d=domain&t=rr_type`, returning the binary proof containing and
    proving the Resource Record of type `rr_type` at `domain`.
 
+The `slower_smaller_binary` feature slows proof validation down by 50%+ for a
+very marginal reduction in binary size, but those who are extremely binary size
+constrained may still find it useful.
+
 See https://docs.rs/dnssec-prover for full API details on the Rust API.
 There's also a website which demonstrates the WASM build of this crate at
 https://http-dns-prover.as397444.net/ which allows for making validated queries.
index 5a8f33c8232d9f2ed00d98eeca2907ef0c3ce0da..f08034f687b1bdba1f43d34f30a1e2667a335f41 100644 (file)
 //!  * Finally, the crate can be built as a binary using the `build_server` feature, responding to
 //!    queries over HTTP GET calls to `/dnssecproof?d=domain.name.&t=RecordType` with DNSSEC
 //!    proofs.
+//!
+//! The `slower_smaller_binary` feature slows proof validation down by 50%+ for a very marginal
+//! reduction in binary size, but those who are extremely binary size constrained may still find it
+//! useful.
 
 #![deny(missing_docs)]
 #![deny(rustdoc::broken_intra_doc_links)]
diff --git a/test.sh b/test.sh
index 2a1ed1f9ba6600cd39bd55adac0b3300df54abb7..b0877fd3f7cdf4644f1babfa13de8a705ab936d8 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -7,6 +7,7 @@ cargo $RUST_VERSION test --no-default-features --features std
 cargo $RUST_VERSION test --no-default-features --features tokio
 cargo $RUST_VERSION test --no-default-features --features validation
 cargo $RUST_VERSION test --features std,tokio,validation
+cargo $RUST_VERSION test --features std,tokio,validation,slower_smaller_binary
 cargo $RUST_VERSION test --no-default-features --features build_server
 cargo $RUST_VERSION build --lib
 cargo $RUST_VERSION build --lib --features std
index 1b23fb4b1e1e7383da37ce6fefa34e6c3b12d800..530d08a8c2cbe06c2f2844fde87632853f01072c 100644 (file)
@@ -4,4 +4,4 @@ version = "0.1.0"
 edition = "2021"
 
 [dependencies]
-dnssec-prover = { path = "../", default-features = false, features = ["validation"] }
+dnssec-prover = { path = "../", default-features = false, features = ["validation", "slower_smaller_binary"] }