rust-lightning/lightning/Cargo.toml

71 lines
2.8 KiB
TOML
Raw Normal View History

2019-11-15 02:44:30 +00:00
[package]
name = "lightning"
version = "0.2.0+git"
2019-11-15 02:44:30 +00:00
authors = ["Matt Corallo"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
2019-11-15 02:44:30 +00:00
description = """
A Bitcoin Lightning library in Rust.
Does most of the hard work, without implying a specific runtime, requiring clients implement basic network logic, chain interactions and disk storage.
Still missing tons of error-handling. See GitHub issues for suggested projects if you want to contribute. Don't have to bother telling you not to use this for anything serious, because you'd have to build a client around it to even try.
"""
edition = "2021"
2019-11-15 02:44:30 +00:00
[package.metadata.docs.rs]
features = ["std", "dnssec"]
rustdoc-args = ["--cfg", "docsrs"]
2019-11-15 02:44:30 +00:00
[features]
# Internal test utilities exposed to other repo crates
_test_utils = ["regex", "bitcoin/bitcoinconsensus", "lightning-types/_test_utils"]
_externalize_tests = ["inventory", "_test_utils"]
# Allow signing of local transactions that may have been revoked or will be revoked, for functional testing (e.g. justice tx handling).
# This is unsafe to use in production because it may result in the counterparty publishing taking our funds.
unsafe_revoked_tx_signing = []
std = []
dnssec = ["dnssec-prover/validation"]
# Generates low-r bitcoin signatures, which saves 1 byte in 50% of the cases
grind_signatures = []
default = ["std", "grind_signatures"]
2019-11-15 02:44:30 +00:00
[dependencies]
lightning-types = { version = "0.3.0", path = "../lightning-types", default-features = false }
lightning-invoice = { version = "0.34.0", path = "../lightning-invoice", default-features = false }
Add support for mapping old fields to new ones in TLV read macros As we've grown, we regularly face a question of whether to "break out" of our nice TLV-based struct/enum reading/writing macros in order to handle mapping legacy fields to new ones, or deal with keeping the legacy fields and handling at runtime what should be hanlded at (de-)serialization time. This attempts to address this tradeoff by adding support for a "legacy" TLV type. This TLV style allows us to write a a value which is not in the struct/enum's layout in memory but can be calculated from its contents at write-time. The field will also be read and can be use to calculate other fiels defined with `static_value` or `default_value`. It takes a type and a `$write` expression. They are always read as `option`s to retain a future ability to remove the `legacy` fields. Sadly, there's two issues with doing this trivially which force us into `proc-macro` land: (a) when matching the original struct we want to list the fields in the match arm so that we have them available to write. Sadly, we can't call a macro to have it write out the field name based on the field type, so instead need to pass the whole match to a proc-macro and have it walk through to find the types and skip fields that are `legacy`. (b) when building a final struct/enum after reading, we need to list a few `$field: $expr`s and cannot decide whether to include a field based on a regular macro. The proc-macros to do so aren't trivial, but they aren't that bad either. We could instead try to rewrite our TLV stream processing macros to handle a new set of TLVs which are passed via a separate argument, but as TLVs are required to in ordered by type this requires a good chunk of additional generated code in each TLV write. It also would result in a somewhat less ergonomic callsite as it would no longer fit into our existing list of TLVs.
2024-10-21 23:07:26 +00:00
lightning-macros = { version = "0.2", path = "../lightning-macros" }
bech32 = { version = "0.11.0", default-features = false }
2024-08-16 08:02:50 -07:00
bitcoin = { version = "0.32.2", default-features = false, features = ["secp-recovery"] }
2019-11-15 02:44:30 +00:00
dnssec-prover = { version = "0.6", default-features = false }
hashbrown = { version = "0.13", default-features = false }
possiblyrandom = { version = "0.2", path = "../possiblyrandom", default-features = false }
2022-06-01 17:25:15 +02:00
regex = { version = "1.5.6", optional = true }
backtrace = { version = "0.3", optional = true }
libm = { version = "0.2", default-features = false }
inventory = { version = "0.3", optional = true }
2021-08-01 18:22:06 +02:00
2019-11-15 02:44:30 +00:00
[dev-dependencies]
2022-06-01 17:25:15 +02:00
regex = "1.5.6"
lightning-types = { version = "0.3.0", path = "../lightning-types", features = ["_test_utils"] }
lightning-macros = { path = "../lightning-macros" }
[dev-dependencies.bitcoin]
2024-08-16 08:02:50 -07:00
version = "0.32.2"
2021-08-01 18:22:06 +02:00
default-features = false
features = ["bitcoinconsensus", "secp-recovery"]
[target.'cfg(ldk_bench)'.dependencies]
criterion = { version = "0.4", optional = true, default-features = false }
[target.'cfg(taproot)'.dependencies]
2024-08-16 08:02:50 -07:00
musig2 = { git = "https://github.com/arik-so/rust-musig2", rev = "6f95a05718cbb44d8fe3fa6021aea8117aa38d50" }
[lints]
workspace = true