mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-23 03:59:37 +00:00
Compare commits
4 commits
604ecc8393
...
f7ecd747c5
Author | SHA1 | Date | |
---|---|---|---|
|
f7ecd747c5 | ||
|
63216aecae | ||
|
b8e2d00af4 | ||
|
4b350e897d |
30 changed files with 297 additions and 136 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -995,6 +995,7 @@ dependencies = [
|
||||||
"cuprate-consensus",
|
"cuprate-consensus",
|
||||||
"cuprate-consensus-context",
|
"cuprate-consensus-context",
|
||||||
"cuprate-consensus-rules",
|
"cuprate-consensus-rules",
|
||||||
|
"cuprate-constants",
|
||||||
"cuprate-cryptonight",
|
"cuprate-cryptonight",
|
||||||
"cuprate-dandelion-tower",
|
"cuprate-dandelion-tower",
|
||||||
"cuprate-database",
|
"cuprate-database",
|
||||||
|
|
29
Cargo.toml
29
Cargo.toml
|
@ -50,6 +50,35 @@ opt-level = 1
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
# Cuprate members
|
||||||
|
cuprate-fast-sync = { path = "consensus/fast-sync" ,default-features = false}
|
||||||
|
cuprate-consensus-rules = { path = "consensus/rules" ,default-features = false}
|
||||||
|
cuprate-constants = { path = "constants" ,default-features = false}
|
||||||
|
cuprate-consensus = { path = "consensus" ,default-features = false}
|
||||||
|
cuprate-consensus-context = { path = "consensus/context" ,default-features = false}
|
||||||
|
cuprate-cryptonight = { path = "cryptonight" ,default-features = false}
|
||||||
|
cuprate-helper = { path = "helper" ,default-features = false}
|
||||||
|
cuprate-epee-encoding = { path = "net/epee-encoding" ,default-features = false}
|
||||||
|
cuprate-fixed-bytes = { path = "net/fixed-bytes" ,default-features = false}
|
||||||
|
cuprate-levin = { path = "net/levin" ,default-features = false}
|
||||||
|
cuprate-wire = { path = "net/wire" ,default-features = false}
|
||||||
|
cuprate-p2p = { path = "p2p/p2p" ,default-features = false}
|
||||||
|
cuprate-p2p-core = { path = "p2p/p2p-core" ,default-features = false}
|
||||||
|
cuprate-dandelion-tower = { path = "p2p/dandelion-tower" ,default-features = false}
|
||||||
|
cuprate-async-buffer = { path = "p2p/async-buffer" ,default-features = false}
|
||||||
|
cuprate-address-book = { path = "p2p/address-book" ,default-features = false}
|
||||||
|
cuprate-blockchain = { path = "storage/blockchain" ,default-features = false}
|
||||||
|
cuprate-database = { path = "storage/database" ,default-features = false}
|
||||||
|
cuprate-database-service = { path = "storage/service" ,default-features = false}
|
||||||
|
cuprate-txpool = { path = "storage/txpool" ,default-features = false}
|
||||||
|
cuprate-pruning = { path = "pruning" ,default-features = false}
|
||||||
|
cuprate-test-utils = { path = "test-utils" ,default-features = false}
|
||||||
|
cuprate-types = { path = "types" ,default-features = false}
|
||||||
|
cuprate-json-rpc = { path = "rpc/json-rpc" ,default-features = false}
|
||||||
|
cuprate-rpc-types = { path = "rpc/types" ,default-features = false}
|
||||||
|
cuprate-rpc-interface = { path = "rpc/interface" ,default-features = false}
|
||||||
|
|
||||||
|
# External dependencies
|
||||||
anyhow = { version = "1.0.89", default-features = false }
|
anyhow = { version = "1.0.89", default-features = false }
|
||||||
async-trait = { version = "0.1.82", default-features = false }
|
async-trait = { version = "0.1.82", default-features = false }
|
||||||
bitflags = { version = "2.6.0", default-features = false }
|
bitflags = { version = "2.6.0", default-features = false }
|
||||||
|
|
|
@ -9,31 +9,32 @@ repository = "https://github.com/Cuprate/cuprate/tree/main/binaries/cuprated"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# TODO: after v1.0.0, remove unneeded dependencies.
|
# TODO: after v1.0.0, remove unneeded dependencies.
|
||||||
cuprate-consensus = { path = "../../consensus" }
|
cuprate-consensus = { workspace = true }
|
||||||
cuprate-consensus-context = { path = "../../consensus/context" }
|
cuprate-fast-sync = { workspace = true }
|
||||||
cuprate-consensus-rules = { path = "../../consensus/rules" }
|
cuprate-consensus-context = { workspace = true }
|
||||||
cuprate-fast-sync = { path = "../../consensus/fast-sync" }
|
cuprate-consensus-rules = { workspace = true }
|
||||||
cuprate-cryptonight = { path = "../../cryptonight" }
|
cuprate-constants = { workspace = true }
|
||||||
cuprate-helper = { path = "../../helper" }
|
cuprate-cryptonight = { workspace = true }
|
||||||
cuprate-epee-encoding = { path = "../../net/epee-encoding" }
|
cuprate-helper = { workspace = true }
|
||||||
cuprate-fixed-bytes = { path = "../../net/fixed-bytes" }
|
cuprate-epee-encoding = { workspace = true }
|
||||||
cuprate-levin = { path = "../../net/levin" }
|
cuprate-fixed-bytes = { workspace = true }
|
||||||
cuprate-wire = { path = "../../net/wire" }
|
cuprate-levin = { workspace = true }
|
||||||
cuprate-p2p = { path = "../../p2p/p2p" }
|
cuprate-wire = { workspace = true }
|
||||||
cuprate-p2p-core = { path = "../../p2p/p2p-core" }
|
cuprate-p2p = { workspace = true }
|
||||||
cuprate-dandelion-tower = { path = "../../p2p/dandelion-tower" }
|
cuprate-p2p-core = { workspace = true }
|
||||||
cuprate-async-buffer = { path = "../../p2p/async-buffer" }
|
cuprate-dandelion-tower = { workspace = true }
|
||||||
cuprate-address-book = { path = "../../p2p/address-book" }
|
cuprate-async-buffer = { workspace = true }
|
||||||
cuprate-blockchain = { path = "../../storage/blockchain", features = ["service"] }
|
cuprate-address-book = { workspace = true }
|
||||||
cuprate-database-service = { path = "../../storage/service" }
|
cuprate-blockchain = { workspace = true, features = ["service"] }
|
||||||
cuprate-txpool = { path = "../../storage/txpool" }
|
cuprate-database-service = { workspace = true }
|
||||||
cuprate-database = { path = "../../storage/database" }
|
cuprate-txpool = { workspace = true }
|
||||||
cuprate-pruning = { path = "../../pruning" }
|
cuprate-database = { workspace = true }
|
||||||
cuprate-test-utils = { path = "../../test-utils" }
|
cuprate-pruning = { workspace = true }
|
||||||
cuprate-types = { path = "../../types" }
|
cuprate-test-utils = { workspace = true }
|
||||||
cuprate-json-rpc = { path = "../../rpc/json-rpc" }
|
cuprate-types = { workspace = true }
|
||||||
cuprate-rpc-interface = { path = "../../rpc/interface" }
|
cuprate-json-rpc = { workspace = true }
|
||||||
cuprate-rpc-types = { path = "../../rpc/types" }
|
cuprate-rpc-interface = { workspace = true }
|
||||||
|
cuprate-rpc-types = { workspace = true }
|
||||||
|
|
||||||
# TODO: after v1.0.0, remove unneeded dependencies.
|
# TODO: after v1.0.0, remove unneeded dependencies.
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
|
|
|
@ -8,10 +8,10 @@ authors = ["Boog900"]
|
||||||
repository = "https://github.com/Cuprate/cuprate/tree/main/consensus"
|
repository = "https://github.com/Cuprate/cuprate/tree/main/consensus"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-helper = { path = "../helper", default-features = false, features = ["std", "asynch", "num"] }
|
cuprate-helper = { workspace = true, default-features = false, features = ["std", "asynch", "num"] }
|
||||||
cuprate-consensus-rules = { path = "./rules", features = ["rayon"] }
|
cuprate-consensus-rules = { workspace = true, features = ["rayon"] }
|
||||||
cuprate-types = { path = "../types" }
|
cuprate-types = { workspace = true }
|
||||||
cuprate-consensus-context = { path = "./context" }
|
cuprate-consensus-context = { workspace = true }
|
||||||
|
|
||||||
cfg-if = { workspace = true }
|
cfg-if = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
@ -28,8 +28,8 @@ hex = { workspace = true }
|
||||||
rand = { workspace = true }
|
rand = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cuprate-test-utils = { path = "../test-utils" }
|
cuprate-test-utils = { workspace = true }
|
||||||
cuprate-consensus-rules = {path = "./rules", features = ["proptest"]}
|
cuprate-consensus-rules = { workspace = true, features = ["proptest"]}
|
||||||
|
|
||||||
hex-literal = { workspace = true }
|
hex-literal = { workspace = true }
|
||||||
curve25519-dalek = { workspace = true }
|
curve25519-dalek = { workspace = true }
|
||||||
|
|
|
@ -6,9 +6,9 @@ license = "MIT"
|
||||||
authors = ["SyntheticBird","Boog900"]
|
authors = ["SyntheticBird","Boog900"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-consensus-rules = { path = "../rules", features = ["proptest"]}
|
cuprate-consensus-rules = { workspace = true, features = ["proptest"]}
|
||||||
cuprate-helper = { path = "../../helper", default-features = false, features = ["std", "cast"] }
|
cuprate-helper = { workspace = true, default-features = false, features = ["std", "cast", "num", "asynch"] }
|
||||||
cuprate-types = { path = "../../types", default-features = false }
|
cuprate-types = { workspace = true, default-features = false, features = ["blockchain"] }
|
||||||
|
|
||||||
futures = { workspace = true, features = ["std", "async-await"] }
|
futures = { workspace = true, features = ["std", "async-await"] }
|
||||||
tokio = { workspace = true, features = ["rt-multi-thread", "macros"]}
|
tokio = { workspace = true, features = ["rt-multi-thread", "macros"]}
|
||||||
|
@ -22,3 +22,6 @@ randomx-rs = { workspace = true }
|
||||||
rayon = { workspace = true }
|
rayon = { workspace = true }
|
||||||
thread_local = { workspace = true }
|
thread_local = { workspace = true }
|
||||||
hex = { workspace = true }
|
hex = { workspace = true }
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
|
|
|
@ -329,7 +329,7 @@ fn next_difficulty(
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: do checked operations here and unwrap so we don't silently overflow?
|
// TODO: do checked operations here and unwrap so we don't silently overflow?
|
||||||
(windowed_work * hf.block_time().as_secs() as u128 + time_span - 1) / time_span
|
(windowed_work * u128::from(hf.block_time().as_secs()) + time_span - 1) / time_span
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the start and end of the window to calculate difficulty.
|
/// Get the start and end of the window to calculate difficulty.
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
//! This crate contains a service to get cached context from the blockchain: [`BlockChainContext`].
|
//! This crate contains a service to get cached context from the blockchain: [`BlockChainContext`].
|
||||||
//! This is used during contextual validation, this does not have all the data for contextual validation
|
//! This is used during contextual validation, this does not have all the data for contextual validation
|
||||||
//! (outputs) for that you will need a [`Database`].
|
//! (outputs) for that you will need a [`Database`].
|
||||||
//!
|
|
||||||
|
// Used in documentation references for [`BlockChainContextRequest`]
|
||||||
|
// FIXME: should we pull in a dependency just to link docs?
|
||||||
|
use monero_serai as _;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
cmp::min,
|
cmp::min,
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
|
|
|
@ -9,12 +9,12 @@ name = "cuprate-fast-sync-create-hashes"
|
||||||
path = "src/create.rs"
|
path = "src/create.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-blockchain = { path = "../../storage/blockchain" }
|
cuprate-blockchain = { workspace = true }
|
||||||
cuprate-consensus = { path = ".." }
|
cuprate-consensus = { workspace = true }
|
||||||
cuprate-consensus-rules = { path = "../rules" }
|
cuprate-consensus-rules = { workspace = true }
|
||||||
cuprate-consensus-context = { path = "../context" }
|
cuprate-consensus-context = { workspace = true }
|
||||||
cuprate-types = { path = "../../types" }
|
cuprate-types = { workspace = true }
|
||||||
cuprate-helper = { path = "../../helper", features = ["cast"] }
|
cuprate-helper = { workspace = true, features = ["cast"] }
|
||||||
|
|
||||||
clap = { workspace = true, features = ["derive", "std"] }
|
clap = { workspace = true, features = ["derive", "std"] }
|
||||||
hex = { workspace = true }
|
hex = { workspace = true }
|
||||||
|
|
|
@ -11,10 +11,10 @@ proptest = ["cuprate-types/proptest"]
|
||||||
rayon = ["dep:rayon"]
|
rayon = ["dep:rayon"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-constants = { path = "../../constants", default-features = false }
|
cuprate-constants = { workspace = true, default-features = false, features = ["block"] }
|
||||||
cuprate-helper = { path = "../../helper", default-features = false, features = ["std", "cast"] }
|
cuprate-helper = { workspace = true, default-features = false, features = ["std", "cast"] }
|
||||||
cuprate-types = { path = "../../types", default-features = false }
|
cuprate-types = { workspace = true, default-features = false }
|
||||||
cuprate-cryptonight = {path = "../../cryptonight"}
|
cuprate-cryptonight = { workspace = true }
|
||||||
|
|
||||||
monero-serai = { workspace = true, features = ["std"] }
|
monero-serai = { workspace = true, features = ["std"] }
|
||||||
curve25519-dalek = { workspace = true, features = ["alloc", "zeroize", "precomputed-tables"] }
|
curve25519-dalek = { workspace = true, features = ["alloc", "zeroize", "precomputed-tables"] }
|
||||||
|
|
|
@ -63,9 +63,9 @@ where
|
||||||
/// An internal function that returns an iterator or a parallel iterator if the
|
/// An internal function that returns an iterator or a parallel iterator if the
|
||||||
/// `rayon` feature is enabled.
|
/// `rayon` feature is enabled.
|
||||||
#[cfg(not(feature = "rayon"))]
|
#[cfg(not(feature = "rayon"))]
|
||||||
fn try_par_iter<T>(t: T) -> impl std::iter::Iterator<Item = T::Item>
|
fn try_par_iter<T>(t: T) -> impl Iterator<Item = T::Item>
|
||||||
where
|
where
|
||||||
T: std::iter::IntoIterator,
|
T: IntoIterator,
|
||||||
{
|
{
|
||||||
t.into_iter()
|
t.into_iter()
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,4 +19,4 @@ rpc = []
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -16,6 +16,7 @@ atomic = ["dep:crossbeam"]
|
||||||
asynch = ["dep:futures", "dep:rayon"]
|
asynch = ["dep:futures", "dep:rayon"]
|
||||||
cast = []
|
cast = []
|
||||||
constants = []
|
constants = []
|
||||||
|
crypto = ["dep:curve25519-dalek", "dep:monero-serai", "std"]
|
||||||
fs = ["dep:dirs"]
|
fs = ["dep:dirs"]
|
||||||
num = []
|
num = []
|
||||||
map = ["cast", "dep:monero-serai", "dep:cuprate-constants"]
|
map = ["cast", "dep:monero-serai", "dep:cuprate-constants"]
|
||||||
|
@ -24,14 +25,15 @@ thread = ["std", "dep:target_os_lib"]
|
||||||
tx = ["dep:monero-serai"]
|
tx = ["dep:monero-serai"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-constants = { path = "../constants", optional = true, features = ["block"] }
|
cuprate-constants = { workspace = true, optional = true, features = ["block"] }
|
||||||
|
|
||||||
crossbeam = { workspace = true, optional = true }
|
chrono = { workspace = true, optional = true, features = ["std", "clock"] }
|
||||||
chrono = { workspace = true, optional = true, features = ["std", "clock"] }
|
crossbeam = { workspace = true, optional = true }
|
||||||
dirs = { workspace = true, optional = true }
|
curve25519-dalek = { workspace = true, optional = true }
|
||||||
futures = { workspace = true, optional = true, features = ["std"] }
|
dirs = { workspace = true, optional = true }
|
||||||
monero-serai = { workspace = true, optional = true }
|
futures = { workspace = true, optional = true, features = ["std"] }
|
||||||
rayon = { workspace = true, optional = true }
|
monero-serai = { workspace = true, optional = true }
|
||||||
|
rayon = { workspace = true, optional = true }
|
||||||
|
|
||||||
# This is kinda a stupid work around.
|
# This is kinda a stupid work around.
|
||||||
# [thread] needs to activate one of these libs (windows|libc)
|
# [thread] needs to activate one of these libs (windows|libc)
|
||||||
|
|
122
helper/src/crypto.rs
Normal file
122
helper/src/crypto.rs
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
//! Crypto related functions and runtime initialized constants
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------- Use
|
||||||
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
|
use curve25519_dalek::{
|
||||||
|
constants::ED25519_BASEPOINT_POINT, edwards::VartimeEdwardsPrecomputation,
|
||||||
|
traits::VartimePrecomputedMultiscalarMul, EdwardsPoint, Scalar,
|
||||||
|
};
|
||||||
|
use monero_serai::generators::H;
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------- Pre-computation
|
||||||
|
|
||||||
|
/// This is the decomposed amount table containing the mandatory Pre-RCT amounts. It is used to pre-compute
|
||||||
|
/// zero commitments at runtime.
|
||||||
|
///
|
||||||
|
/// Defined at:
|
||||||
|
/// - <https://github.com/monero-project/monero/blob/893916ad091a92e765ce3241b94e706ad012b62a/src/ringct/rctOps.cpp#L44>
|
||||||
|
#[rustfmt::skip]
|
||||||
|
pub const ZERO_COMMITMENT_DECOMPOSED_AMOUNT: [u64; 172] = [
|
||||||
|
1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||||
|
10, 20, 30, 40, 50, 60, 70, 80, 90,
|
||||||
|
100, 200, 300, 400, 500, 600, 700, 800, 900,
|
||||||
|
1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000,
|
||||||
|
10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000,
|
||||||
|
100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000,
|
||||||
|
1000000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000,
|
||||||
|
10000000, 20000000, 30000000, 40000000, 50000000, 60000000, 70000000, 80000000, 90000000,
|
||||||
|
100000000, 200000000, 300000000, 400000000, 500000000, 600000000, 700000000, 800000000, 900000000,
|
||||||
|
1000000000, 2000000000, 3000000000, 4000000000, 5000000000, 6000000000, 7000000000, 8000000000, 9000000000,
|
||||||
|
10000000000, 20000000000, 30000000000, 40000000000, 50000000000, 60000000000, 70000000000, 80000000000, 90000000000,
|
||||||
|
100000000000, 200000000000, 300000000000, 400000000000, 500000000000, 600000000000, 700000000000, 800000000000, 900000000000,
|
||||||
|
1000000000000, 2000000000000, 3000000000000, 4000000000000, 5000000000000, 6000000000000, 7000000000000, 8000000000000, 9000000000000,
|
||||||
|
10000000000000, 20000000000000, 30000000000000, 40000000000000, 50000000000000, 60000000000000, 70000000000000, 80000000000000, 90000000000000,
|
||||||
|
100000000000000, 200000000000000, 300000000000000, 400000000000000, 500000000000000, 600000000000000, 700000000000000, 800000000000000, 900000000000000,
|
||||||
|
1000000000000000, 2000000000000000, 3000000000000000, 4000000000000000, 5000000000000000, 6000000000000000, 7000000000000000, 8000000000000000, 9000000000000000,
|
||||||
|
10000000000000000, 20000000000000000, 30000000000000000, 40000000000000000, 50000000000000000, 60000000000000000, 70000000000000000, 80000000000000000, 90000000000000000,
|
||||||
|
100000000000000000, 200000000000000000, 300000000000000000, 400000000000000000, 500000000000000000, 600000000000000000, 700000000000000000, 800000000000000000, 900000000000000000,
|
||||||
|
1000000000000000000, 2000000000000000000, 3000000000000000000, 4000000000000000000, 5000000000000000000, 6000000000000000000, 7000000000000000000, 8000000000000000000, 9000000000000000000,
|
||||||
|
10000000000000000000
|
||||||
|
];
|
||||||
|
|
||||||
|
/// Runtime initialized [`H`] generator.
|
||||||
|
static H_PRECOMP: LazyLock<VartimeEdwardsPrecomputation> =
|
||||||
|
LazyLock::new(|| VartimeEdwardsPrecomputation::new([*H, ED25519_BASEPOINT_POINT]));
|
||||||
|
|
||||||
|
/// Runtime initialized zero commitment lookup table
|
||||||
|
///
|
||||||
|
/// # Invariant
|
||||||
|
/// This function assumes that the [`ZERO_COMMITMENT_DECOMPOSED_AMOUNT`]
|
||||||
|
/// table is sorted.
|
||||||
|
pub static ZERO_COMMITMENT_LOOKUP_TABLE: LazyLock<[EdwardsPoint; 172]> = LazyLock::new(|| {
|
||||||
|
let mut lookup_table: [EdwardsPoint; 172] = [ED25519_BASEPOINT_POINT; 172];
|
||||||
|
|
||||||
|
for (i, amount) in ZERO_COMMITMENT_DECOMPOSED_AMOUNT.into_iter().enumerate() {
|
||||||
|
lookup_table[i] = ED25519_BASEPOINT_POINT + *H * Scalar::from(amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
lookup_table
|
||||||
|
});
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------- Free functions
|
||||||
|
|
||||||
|
/// This function computes the zero commitment given a specific amount.
|
||||||
|
///
|
||||||
|
/// It will first attempt to lookup into the table of known Pre-RCT value.
|
||||||
|
/// Compute it otherwise.
|
||||||
|
#[expect(clippy::cast_possible_truncation)]
|
||||||
|
pub fn compute_zero_commitment(amount: u64) -> EdwardsPoint {
|
||||||
|
// OPTIMIZATION: Unlike monerod which execute a linear search across its lookup
|
||||||
|
// table (O(n)). Cuprate is making use of an arithmetic based constant time
|
||||||
|
// version (O(1)). It has been benchmarked in both hit and miss scenarios against
|
||||||
|
// a binary search lookup (O(log2(n))). To understand the following algorithm it
|
||||||
|
// is important to observe the pattern that follows the values of
|
||||||
|
// [`ZERO_COMMITMENT_DECOMPOSED_AMOUNT`].
|
||||||
|
|
||||||
|
// First obtain the logarithm base 10 of the amount. and extend it back to obtain
|
||||||
|
// the amount without its most significant digit.
|
||||||
|
let Some(log) = amount.checked_ilog10() else {
|
||||||
|
// amount = 0 so H component is 0.
|
||||||
|
return ED25519_BASEPOINT_POINT;
|
||||||
|
};
|
||||||
|
let div = 10_u64.pow(log);
|
||||||
|
|
||||||
|
// Extract the most significant digit.
|
||||||
|
let most_significant_digit = amount / div;
|
||||||
|
|
||||||
|
// If the *rounded* version is different than the exact amount. Then
|
||||||
|
// there aren't only trailing zeroes behind the most significant digit.
|
||||||
|
// The amount is not part of the table and can calculated apart.
|
||||||
|
if most_significant_digit * div != amount {
|
||||||
|
return H_PRECOMP.vartime_multiscalar_mul([Scalar::from(amount), Scalar::ONE]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculating the index back by progressing within the powers of 10.
|
||||||
|
// The index of the first value in the cached amount's row.
|
||||||
|
let row_start = u64::from(log) * 9;
|
||||||
|
// The index of the cached amount
|
||||||
|
let index = (most_significant_digit - 1 + row_start) as usize;
|
||||||
|
|
||||||
|
ZERO_COMMITMENT_LOOKUP_TABLE[index]
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------- Tests
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use curve25519_dalek::{traits::VartimePrecomputedMultiscalarMul, Scalar};
|
||||||
|
|
||||||
|
use crate::crypto::{compute_zero_commitment, H_PRECOMP, ZERO_COMMITMENT_DECOMPOSED_AMOUNT};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
/// Compare the output of `compute_zero_commitment` for all
|
||||||
|
/// preRCT decomposed amounts against their actual computation.
|
||||||
|
///
|
||||||
|
/// Assert that the lookup table returns the correct commitments
|
||||||
|
fn compare_lookup_with_computation() {
|
||||||
|
for amount in ZERO_COMMITMENT_DECOMPOSED_AMOUNT {
|
||||||
|
let commitment = H_PRECOMP.vartime_multiscalar_mul([Scalar::from(amount), Scalar::ONE]);
|
||||||
|
assert!(commitment == compute_zero_commitment(amount));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,6 +30,9 @@ pub mod time;
|
||||||
|
|
||||||
#[cfg(feature = "tx")]
|
#[cfg(feature = "tx")]
|
||||||
pub mod tx;
|
pub mod tx;
|
||||||
|
|
||||||
|
#[cfg(feature = "crypto")]
|
||||||
|
pub mod crypto;
|
||||||
//---------------------------------------------------------------------------------------------------- Private Usage
|
//---------------------------------------------------------------------------------------------------- Private Usage
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -15,8 +15,8 @@ default = ["std"]
|
||||||
std = ["dep:thiserror", "bytes/std", "cuprate-fixed-bytes/std"]
|
std = ["dep:thiserror", "bytes/std", "cuprate-fixed-bytes/std"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-helper = { path = "../../helper", default-features = false, features = ["cast"] }
|
cuprate-helper = { workspace = true, default-features = false, features = ["cast"] }
|
||||||
cuprate-fixed-bytes = { path = "../fixed-bytes", default-features = false }
|
cuprate-fixed-bytes = { workspace = true, default-features = false }
|
||||||
|
|
||||||
paste = "1.0.15"
|
paste = "1.0.15"
|
||||||
ref-cast = "1.0.23"
|
ref-cast = "1.0.23"
|
||||||
|
@ -27,4 +27,4 @@ thiserror = { workspace = true, optional = true}
|
||||||
hex = { workspace = true, features = ["default"] }
|
hex = { workspace = true, features = ["default"] }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -12,7 +12,7 @@ default = []
|
||||||
tracing = ["dep:tracing", "tokio-util/tracing"]
|
tracing = ["dep:tracing", "tokio-util/tracing"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-helper = { path = "../../helper", default-features = false, features = ["cast"] }
|
cuprate-helper = { workspace = true, default-features = false, features = ["cast"] }
|
||||||
|
|
||||||
cfg-if = { workspace = true }
|
cfg-if = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
@ -30,4 +30,4 @@ tokio = { workspace = true, features = ["full"] }
|
||||||
futures = { workspace = true, features = ["std"] }
|
futures = { workspace = true, features = ["std"] }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -11,11 +11,11 @@ default = []
|
||||||
tracing = ["cuprate-levin/tracing"]
|
tracing = ["cuprate-levin/tracing"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-levin = { path = "../levin" }
|
cuprate-levin = { workspace = true }
|
||||||
cuprate-epee-encoding = { path = "../epee-encoding" }
|
cuprate-epee-encoding = { workspace = true }
|
||||||
cuprate-fixed-bytes = { path = "../fixed-bytes" }
|
cuprate-fixed-bytes = { workspace = true }
|
||||||
cuprate-types = { path = "../../types", default-features = false, features = ["epee"] }
|
cuprate-types = { workspace = true, default-features = false, features = ["epee"] }
|
||||||
cuprate-helper = { path = "../../helper", default-features = false, features = ["map"] }
|
cuprate-helper = { workspace = true, default-features = false, features = ["map"] }
|
||||||
|
|
||||||
bitflags = { workspace = true, features = ["std"] }
|
bitflags = { workspace = true, features = ["std"] }
|
||||||
bytes = { workspace = true, features = ["std"] }
|
bytes = { workspace = true, features = ["std"] }
|
||||||
|
|
|
@ -7,9 +7,9 @@ authors = ["Boog900"]
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-constants = { path = "../../constants" }
|
cuprate-constants = { workspace = true }
|
||||||
cuprate-pruning = { path = "../../pruning" }
|
cuprate-pruning = { workspace = true }
|
||||||
cuprate-p2p-core = { path = "../p2p-core" }
|
cuprate-p2p-core = { workspace = true }
|
||||||
|
|
||||||
tower = { workspace = true, features = ["util"] }
|
tower = { workspace = true, features = ["util"] }
|
||||||
tokio = { workspace = true, features = ["time", "fs", "rt"]}
|
tokio = { workspace = true, features = ["time", "fs", "rt"]}
|
||||||
|
@ -26,9 +26,9 @@ rand = { workspace = true, features = ["std", "std_rng"] }
|
||||||
borsh = { workspace = true, features = ["derive", "std"]}
|
borsh = { workspace = true, features = ["derive", "std"]}
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cuprate-test-utils = {path = "../../test-utils"}
|
cuprate-test-utils = { workspace = true }
|
||||||
|
|
||||||
tokio = { workspace = true, features = ["rt-multi-thread", "macros"]}
|
tokio = { workspace = true, features = ["rt-multi-thread", "macros"]}
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -10,10 +10,10 @@ default = ["borsh"]
|
||||||
borsh = ["dep:borsh", "cuprate-pruning/borsh"]
|
borsh = ["dep:borsh", "cuprate-pruning/borsh"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-helper = { path = "../../helper", features = ["asynch"], default-features = false }
|
cuprate-helper = { workspace = true, features = ["asynch"], default-features = false }
|
||||||
cuprate-wire = { path = "../../net/wire", features = ["tracing"] }
|
cuprate-wire = { workspace = true, features = ["tracing"] }
|
||||||
cuprate-pruning = { path = "../../pruning" }
|
cuprate-pruning = { workspace = true }
|
||||||
cuprate-types = { path = "../../types" }
|
cuprate-types = { workspace = true }
|
||||||
|
|
||||||
tokio = { workspace = true, features = ["net", "sync", "macros", "time", "rt", "rt-multi-thread"]}
|
tokio = { workspace = true, features = ["net", "sync", "macros", "time", "rt", "rt-multi-thread"]}
|
||||||
tokio-util = { workspace = true, features = ["codec"] }
|
tokio-util = { workspace = true, features = ["codec"] }
|
||||||
|
@ -30,10 +30,10 @@ hex-literal = { workspace = true }
|
||||||
borsh = { workspace = true, features = ["derive", "std"], optional = true }
|
borsh = { workspace = true, features = ["derive", "std"], optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cuprate-test-utils = { path = "../../test-utils" }
|
cuprate-test-utils = { workspace = true }
|
||||||
|
|
||||||
hex = { workspace = true, features = ["std"] }
|
hex = { workspace = true, features = ["std"] }
|
||||||
tokio-test = { workspace = true }
|
tokio-test = { workspace = true }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -6,15 +6,15 @@ license = "MIT"
|
||||||
authors = ["Boog900"]
|
authors = ["Boog900"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-constants = { path = "../../constants" }
|
cuprate-constants = { workspace = true }
|
||||||
cuprate-fixed-bytes = { path = "../../net/fixed-bytes" }
|
cuprate-fixed-bytes = { workspace = true }
|
||||||
cuprate-wire = { path = "../../net/wire" }
|
cuprate-wire = { workspace = true }
|
||||||
cuprate-p2p-core = { path = "../p2p-core", features = ["borsh"] }
|
cuprate-p2p-core = { workspace = true, features = ["borsh"] }
|
||||||
cuprate-address-book = { path = "../address-book" }
|
cuprate-address-book = { workspace = true }
|
||||||
cuprate-pruning = { path = "../../pruning" }
|
cuprate-pruning = { workspace = true }
|
||||||
cuprate-helper = { path = "../../helper", features = ["asynch"], default-features = false }
|
cuprate-helper = { workspace = true, features = ["asynch"], default-features = false }
|
||||||
cuprate-async-buffer = { path = "../async-buffer" }
|
cuprate-async-buffer = { workspace = true }
|
||||||
cuprate-types = { path = "../../types", default-features = false }
|
cuprate-types = { workspace = true, default-features = false }
|
||||||
|
|
||||||
monero-serai = { workspace = true, features = ["std"] }
|
monero-serai = { workspace = true, features = ["std"] }
|
||||||
|
|
||||||
|
@ -35,10 +35,10 @@ tracing = { workspace = true, features = ["std", "attributes"] }
|
||||||
borsh = { workspace = true, features = ["derive", "std"] }
|
borsh = { workspace = true, features = ["derive", "std"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cuprate-test-utils = { path = "../../test-utils" }
|
cuprate-test-utils = { workspace = true }
|
||||||
indexmap = { workspace = true }
|
indexmap = { workspace = true }
|
||||||
proptest = { workspace = true }
|
proptest = { workspace = true }
|
||||||
tokio-test = { workspace = true }
|
tokio-test = { workspace = true }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -10,11 +10,11 @@ default = []
|
||||||
borsh = ["dep:borsh"]
|
borsh = ["dep:borsh"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-constants = { path = "../constants" }
|
cuprate-constants = { workspace = true }
|
||||||
|
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
|
||||||
borsh = { workspace = true, features = ["derive", "std"], optional = true }
|
borsh = { workspace = true, features = ["derive", "std"], optional = true }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -13,10 +13,10 @@ default = ["dummy", "serde"]
|
||||||
dummy = []
|
dummy = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-epee-encoding = { path = "../../net/epee-encoding", default-features = false }
|
cuprate-epee-encoding = { workspace = true, default-features = false }
|
||||||
cuprate-json-rpc = { path = "../json-rpc", default-features = false }
|
cuprate-json-rpc = { workspace = true, default-features = false }
|
||||||
cuprate-rpc-types = { path = "../types", features = ["serde", "epee"], default-features = false }
|
cuprate-rpc-types = { workspace = true, features = ["serde", "epee"], default-features = false }
|
||||||
cuprate-helper = { path = "../../helper", features = ["asynch"], default-features = false }
|
cuprate-helper = { workspace = true, features = ["asynch"], default-features = false }
|
||||||
|
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
axum = { version = "0.7.5", features = ["json"], default-features = false }
|
axum = { version = "0.7.5", features = ["json"], default-features = false }
|
||||||
|
@ -26,7 +26,7 @@ paste = { workspace = true }
|
||||||
futures = { workspace = true }
|
futures = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cuprate-test-utils = { path = "../../test-utils" }
|
cuprate-test-utils = { workspace = true }
|
||||||
|
|
||||||
axum = { version = "0.7.5", features = ["json", "tokio", "http2"] }
|
axum = { version = "0.7.5", features = ["json", "tokio", "http2"] }
|
||||||
serde_json = { workspace = true, features = ["std"] }
|
serde_json = { workspace = true, features = ["std"] }
|
||||||
|
|
|
@ -14,18 +14,18 @@ serde = ["dep:serde", "cuprate-fixed-bytes/serde", "cuprate-types/serde"]
|
||||||
epee = ["dep:cuprate-epee-encoding", "cuprate-types/epee"]
|
epee = ["dep:cuprate-epee-encoding", "cuprate-types/epee"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-epee-encoding = { path = "../../net/epee-encoding", optional = true }
|
cuprate-epee-encoding = { workspace = true, optional = true }
|
||||||
cuprate-fixed-bytes = { path = "../../net/fixed-bytes" }
|
cuprate-fixed-bytes = { workspace = true }
|
||||||
cuprate-types = { path = "../../types", default-features = false }
|
cuprate-types = { workspace = true, default-features = false }
|
||||||
|
|
||||||
paste = { workspace = true }
|
paste = { workspace = true }
|
||||||
serde = { workspace = true, optional = true }
|
serde = { workspace = true, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cuprate-test-utils = { path = "../../test-utils" }
|
cuprate-test-utils = { workspace = true }
|
||||||
|
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -18,11 +18,11 @@ redb-memory = ["cuprate-database/redb-memory"]
|
||||||
service = ["dep:thread_local", "dep:rayon", "cuprate-helper/thread"]
|
service = ["dep:thread_local", "dep:rayon", "cuprate-helper/thread"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-database = { path = "../database" }
|
cuprate-database = { workspace = true }
|
||||||
cuprate-database-service = { path = "../service" }
|
cuprate-database-service = { workspace = true }
|
||||||
cuprate-helper = { path = "../../helper", features = ["fs", "map"] }
|
cuprate-helper = { workspace = true, features = ["fs", "map", "crypto"] }
|
||||||
cuprate-types = { path = "../../types", features = ["blockchain"] }
|
cuprate-types = { workspace = true, features = ["blockchain"] }
|
||||||
cuprate-pruning = { path = "../../pruning" }
|
cuprate-pruning = { workspace = true }
|
||||||
|
|
||||||
bitflags = { workspace = true, features = ["std", "serde", "bytemuck"] }
|
bitflags = { workspace = true, features = ["std", "serde", "bytemuck"] }
|
||||||
bytemuck = { workspace = true, features = ["must_cast", "derive", "min_const_generics", "extern_crate_alloc"] }
|
bytemuck = { workspace = true, features = ["must_cast", "derive", "min_const_generics", "extern_crate_alloc"] }
|
||||||
|
@ -37,9 +37,9 @@ thread_local = { workspace = true, optional = true }
|
||||||
rayon = { workspace = true, optional = true }
|
rayon = { workspace = true, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cuprate-constants = { path = "../../constants" }
|
cuprate-constants = { workspace = true }
|
||||||
cuprate-helper = { path = "../../helper", features = ["thread", "cast"] }
|
cuprate-helper = { workspace = true, features = ["thread", "cast"] }
|
||||||
cuprate-test-utils = { path = "../../test-utils" }
|
cuprate-test-utils = { workspace = true }
|
||||||
|
|
||||||
tokio = { workspace = true, features = ["full"] }
|
tokio = { workspace = true, features = ["full"] }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
//! Output functions.
|
//! Output functions.
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------- Import
|
//---------------------------------------------------------------------------------------------------- Import
|
||||||
use curve25519_dalek::{constants::ED25519_BASEPOINT_POINT, edwards::CompressedEdwardsY, Scalar};
|
use curve25519_dalek::edwards::CompressedEdwardsY;
|
||||||
use monero_serai::{generators::H, transaction::Timelock};
|
use monero_serai::transaction::Timelock;
|
||||||
|
|
||||||
use cuprate_database::{
|
use cuprate_database::{
|
||||||
RuntimeError, {DatabaseRo, DatabaseRw},
|
RuntimeError, {DatabaseRo, DatabaseRw},
|
||||||
};
|
};
|
||||||
|
use cuprate_helper::crypto::compute_zero_commitment;
|
||||||
use cuprate_helper::map::u64_to_timelock;
|
use cuprate_helper::map::u64_to_timelock;
|
||||||
use cuprate_types::OutputOnChain;
|
use cuprate_types::OutputOnChain;
|
||||||
|
|
||||||
|
@ -155,9 +156,7 @@ pub fn output_to_output_on_chain(
|
||||||
amount: Amount,
|
amount: Amount,
|
||||||
table_tx_unlock_time: &impl DatabaseRo<TxUnlockTime>,
|
table_tx_unlock_time: &impl DatabaseRo<TxUnlockTime>,
|
||||||
) -> Result<OutputOnChain, RuntimeError> {
|
) -> Result<OutputOnChain, RuntimeError> {
|
||||||
// FIXME: implement lookup table for common values:
|
let commitment = compute_zero_commitment(amount);
|
||||||
// <https://github.com/monero-project/monero/blob/c8214782fb2a769c57382a999eaf099691c836e7/src/ringct/rctOps.cpp#L322>
|
|
||||||
let commitment = ED25519_BASEPOINT_POINT + *H * Scalar::from(amount);
|
|
||||||
|
|
||||||
let time_lock = if output
|
let time_lock = if output
|
||||||
.output_flags
|
.output_flags
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------- Import
|
//---------------------------------------------------------------------------------------------------- Import
|
||||||
use bytemuck::TransparentWrapper;
|
use bytemuck::TransparentWrapper;
|
||||||
use curve25519_dalek::{constants::ED25519_BASEPOINT_POINT, Scalar};
|
|
||||||
use monero_serai::transaction::{Input, Timelock, Transaction};
|
use monero_serai::transaction::{Input, Timelock, Transaction};
|
||||||
|
|
||||||
use cuprate_database::{DatabaseRo, DatabaseRw, RuntimeError, StorableVec};
|
use cuprate_database::{DatabaseRo, DatabaseRw, RuntimeError, StorableVec};
|
||||||
|
use cuprate_helper::crypto::compute_zero_commitment;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
ops::{
|
ops::{
|
||||||
|
@ -136,12 +136,9 @@ pub fn add_tx(
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, output)| {
|
.map(|(i, output)| {
|
||||||
// Create commitment.
|
// Create commitment.
|
||||||
// <https://github.com/Cuprate/cuprate/pull/102#discussion_r1559489302>
|
|
||||||
// FIXME: implement lookup table for common values:
|
|
||||||
// <https://github.com/monero-project/monero/blob/c8214782fb2a769c57382a999eaf099691c836e7/src/ringct/rctOps.cpp#L322>
|
|
||||||
let commitment = if miner_tx {
|
let commitment = if miner_tx {
|
||||||
ED25519_BASEPOINT_POINT
|
compute_zero_commitment(output.amount.unwrap_or(0))
|
||||||
+ *monero_serai::generators::H * Scalar::from(output.amount.unwrap_or(0))
|
|
||||||
} else {
|
} else {
|
||||||
proofs
|
proofs
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|
|
@ -9,8 +9,8 @@ repository = "https://github.com/Cuprate/cuprate/tree/main/storage/service"
|
||||||
keywords = ["cuprate", "service", "database"]
|
keywords = ["cuprate", "service", "database"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-database = { path = "../database" }
|
cuprate-database = { workspace = true }
|
||||||
cuprate-helper = { path = "../../helper", features = ["fs", "thread", "map"] }
|
cuprate-helper = { workspace = true, features = ["fs", "thread", "map"] }
|
||||||
|
|
||||||
serde = { workspace = true, optional = true }
|
serde = { workspace = true, optional = true }
|
||||||
rayon = { workspace = true }
|
rayon = { workspace = true }
|
||||||
|
|
|
@ -19,10 +19,10 @@ service = ["dep:tower", "dep:rayon", "dep:cuprate-database-service"]
|
||||||
serde = ["dep:serde", "cuprate-database/serde", "cuprate-database-service/serde"]
|
serde = ["dep:serde", "cuprate-database/serde", "cuprate-database-service/serde"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-database = { path = "../database", features = ["heed"] }
|
cuprate-database = { workspace = true, features = ["heed"] }
|
||||||
cuprate-database-service = { path = "../service", optional = true }
|
cuprate-database-service = { workspace = true, optional = true }
|
||||||
cuprate-types = { path = "../../types" }
|
cuprate-types = { workspace = true }
|
||||||
cuprate-helper = { path = "../../helper", default-features = false, features = ["constants"] }
|
cuprate-helper = { workspace = true, default-features = false, features = ["constants"] }
|
||||||
|
|
||||||
monero-serai = { workspace = true, features = ["std"] }
|
monero-serai = { workspace = true, features = ["std"] }
|
||||||
bytemuck = { workspace = true, features = ["must_cast", "derive", "min_const_generics", "extern_crate_alloc"] }
|
bytemuck = { workspace = true, features = ["must_cast", "derive", "min_const_generics", "extern_crate_alloc"] }
|
||||||
|
@ -36,11 +36,11 @@ rayon = { workspace = true, optional = true }
|
||||||
serde = { workspace = true, optional = true }
|
serde = { workspace = true, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cuprate-test-utils = { path = "../../test-utils" }
|
cuprate-test-utils = { workspace = true }
|
||||||
|
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
hex-literal = { workspace = true }
|
hex-literal = { workspace = true }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -6,10 +6,10 @@ license = "MIT"
|
||||||
authors = ["Boog900", "hinto-janai"]
|
authors = ["Boog900", "hinto-janai"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-types = { path = "../types" }
|
cuprate-types = { workspace = true }
|
||||||
cuprate-helper = { path = "../helper", features = ["map", "tx"] }
|
cuprate-helper = { workspace = true, features = ["map", "tx"] }
|
||||||
cuprate-wire = { path = "../net/wire" }
|
cuprate-wire = { workspace = true }
|
||||||
cuprate-p2p-core = { path = "../p2p/p2p-core", features = ["borsh"] }
|
cuprate-p2p-core = { workspace = true, features = ["borsh"] }
|
||||||
|
|
||||||
hex = { workspace = true }
|
hex = { workspace = true }
|
||||||
hex-literal = { workspace = true }
|
hex-literal = { workspace = true }
|
||||||
|
@ -31,4 +31,4 @@ hex = { workspace = true }
|
||||||
pretty_assertions = { workspace = true }
|
pretty_assertions = { workspace = true }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -18,9 +18,9 @@ json = ["hex", "dep:cuprate-helper"]
|
||||||
hex = ["dep:hex"]
|
hex = ["dep:hex"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cuprate-epee-encoding = { path = "../net/epee-encoding", optional = true }
|
cuprate-epee-encoding = { workspace = true, optional = true, features = ["std"] }
|
||||||
cuprate-helper = { path = "../helper", optional = true, features = ["cast"] }
|
cuprate-helper = { workspace = true, optional = true, features = ["cast"] }
|
||||||
cuprate-fixed-bytes = { path = "../net/fixed-bytes" }
|
cuprate-fixed-bytes = { workspace = true }
|
||||||
|
|
||||||
bytes = { workspace = true }
|
bytes = { workspace = true }
|
||||||
curve25519-dalek = { workspace = true }
|
curve25519-dalek = { workspace = true }
|
||||||
|
@ -39,4 +39,4 @@ pretty_assertions = { workspace = true }
|
||||||
serde_json = { workspace = true, features = ["std"] }
|
serde_json = { workspace = true, features = ["std"] }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
Loading…
Reference in a new issue