Skip to content

Commit

Permalink
Merge branch 'gd-tn11-uni-2-redb' into VCCv254
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/deploy.yaml
#	Cargo.lock
#	Cargo.toml
#	consensus/benches/check_scripts.rs
#	consensus/core/src/hashing/sighash.rs
#	consensus/src/consensus/mod.rs
#	consensus/src/consensus/services.rs
#	consensus/src/consensus/storage.rs
#	consensus/src/model/stores/ghostdag.rs
#	consensus/src/model/stores/mod.rs
#	consensus/src/pipeline/body_processor/processor.rs
#	consensus/src/pipeline/header_processor/processor.rs
#	consensus/src/pipeline/virtual_processor/processor.rs
#	consensus/src/processes/ghostdag/protocol.rs
#	consensus/src/processes/pruning.rs
#	consensus/src/processes/pruning_proof/mod.rs
#	consensus/src/processes/sync/mod.rs
#	consensus/src/processes/transaction_validator/tx_validation_in_utxo_context.rs
#	crypto/txscript/src/data_stack.rs
#	crypto/txscript/src/lib.rs
#	crypto/txscript/src/opcodes/mod.rs
#	crypto/txscript/src/standard/multisig.rs
#	database/src/access.rs
#	mining/src/mempool/check_transaction_standard.rs
#	rpc/wrpc/server/Cargo.toml
#	utils/src/option.rs
#	wallet/pskt/src/pskt.rs
  • Loading branch information
biryukovmaxim committed Dec 24, 2024
2 parents 52fa6b6 + 38b3d43 commit 0fe7a7f
Show file tree
Hide file tree
Showing 67 changed files with 935 additions and 2,082 deletions.
169 changes: 83 additions & 86 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ members = [
"rpc/wrpc/proxy",
"rpc/wrpc/wasm",
"rpc/wrpc/examples/subscriber",
"rpc/wrpc/examples/simple_client",
"mining",
"mining/errors",
"protocol/p2p",
Expand All @@ -62,8 +61,8 @@ members = [
]

[workspace.package]
rust-version = "1.82.0"
version = "0.15.4"
rust-version = "1.80.0"
version = "0.14.6"
authors = ["Kaspa developers"]
license = "ISC"
repository = "https://github.com/kaspanet/rusty-kaspa"
Expand All @@ -80,61 +79,61 @@ include = [
]

[workspace.dependencies]
# kaspa-testing-integration = { version = "0.15.4", path = "testing/integration" }
kaspa-addresses = { version = "0.15.4", path = "crypto/addresses" }
kaspa-addressmanager = { version = "0.15.4", path = "components/addressmanager" }
kaspa-bip32 = { version = "0.15.4", path = "wallet/bip32" }
kaspa-cli = { version = "0.15.4", path = "cli" }
kaspa-connectionmanager = { version = "0.15.4", path = "components/connectionmanager" }
kaspa-consensus = { version = "0.15.4", path = "consensus" }
kaspa-consensus-core = { version = "0.15.4", path = "consensus/core" }
kaspa-consensus-client = { version = "0.15.4", path = "consensus/client" }
kaspa-consensus-notify = { version = "0.15.4", path = "consensus/notify" }
kaspa-consensus-wasm = { version = "0.15.4", path = "consensus/wasm" }
kaspa-consensusmanager = { version = "0.15.4", path = "components/consensusmanager" }
kaspa-core = { version = "0.15.4", path = "core" }
kaspa-daemon = { version = "0.15.4", path = "daemon" }
kaspa-database = { version = "0.15.4", path = "database" }
kaspa-grpc-client = { version = "0.15.4", path = "rpc/grpc/client" }
kaspa-grpc-core = { version = "0.15.4", path = "rpc/grpc/core" }
kaspa-grpc-server = { version = "0.15.4", path = "rpc/grpc/server" }
kaspa-hashes = { version = "0.15.4", path = "crypto/hashes" }
kaspa-index-core = { version = "0.15.4", path = "indexes/core" }
kaspa-index-processor = { version = "0.15.4", path = "indexes/processor" }
kaspa-math = { version = "0.15.4", path = "math" }
kaspa-merkle = { version = "0.15.4", path = "crypto/merkle" }
kaspa-metrics-core = { version = "0.15.4", path = "metrics/core" }
kaspa-mining = { version = "0.15.4", path = "mining" }
kaspa-mining-errors = { version = "0.15.4", path = "mining/errors" }
kaspa-muhash = { version = "0.15.4", path = "crypto/muhash" }
kaspa-notify = { version = "0.15.4", path = "notify" }
kaspa-p2p-flows = { version = "0.15.4", path = "protocol/flows" }
kaspa-p2p-lib = { version = "0.15.4", path = "protocol/p2p" }
kaspa-perf-monitor = { version = "0.15.4", path = "metrics/perf_monitor" }
kaspa-pow = { version = "0.15.4", path = "consensus/pow" }
kaspa-rpc-core = { version = "0.15.4", path = "rpc/core" }
kaspa-rpc-macros = { version = "0.15.4", path = "rpc/macros" }
kaspa-rpc-service = { version = "0.15.4", path = "rpc/service" }
kaspa-txscript = { version = "0.15.4", path = "crypto/txscript" }
kaspa-txscript-errors = { version = "0.15.4", path = "crypto/txscript/errors" }
kaspa-utils = { version = "0.15.4", path = "utils" }
kaspa-utils-tower = { version = "0.15.4", path = "utils/tower" }
kaspa-utxoindex = { version = "0.15.4", path = "indexes/utxoindex" }
kaspa-wallet = { version = "0.15.4", path = "wallet/native" }
kaspa-wallet-cli-wasm = { version = "0.15.4", path = "wallet/wasm" }
kaspa-wallet-keys = { version = "0.15.4", path = "wallet/keys" }
kaspa-wallet-pskt = { version = "0.15.4", path = "wallet/pskt" }
kaspa-wallet-core = { version = "0.15.4", path = "wallet/core" }
kaspa-wallet-macros = { version = "0.15.4", path = "wallet/macros" }
kaspa-wasm = { version = "0.15.4", path = "wasm" }
kaspa-wasm-core = { version = "0.15.4", path = "wasm/core" }
kaspa-wrpc-client = { version = "0.15.4", path = "rpc/wrpc/client" }
kaspa-wrpc-proxy = { version = "0.15.4", path = "rpc/wrpc/proxy" }
kaspa-wrpc-server = { version = "0.15.4", path = "rpc/wrpc/server" }
kaspa-wrpc-wasm = { version = "0.15.4", path = "rpc/wrpc/wasm" }
kaspa-wrpc-example-subscriber = { version = "0.15.4", path = "rpc/wrpc/examples/subscriber" }
kaspad = { version = "0.15.4", path = "kaspad" }
kaspa-alloc = { version = "0.15.4", path = "utils/alloc" }
# kaspa-testing-integration = { version = "0.14.6", path = "testing/integration" }
kaspa-addresses = { version = "0.14.6", path = "crypto/addresses" }
kaspa-addressmanager = { version = "0.14.6", path = "components/addressmanager" }
kaspa-bip32 = { version = "0.14.6", path = "wallet/bip32" }
kaspa-cli = { version = "0.14.6", path = "cli" }
kaspa-connectionmanager = { version = "0.14.6", path = "components/connectionmanager" }
kaspa-consensus = { version = "0.14.6", path = "consensus" }
kaspa-consensus-core = { version = "0.14.6", path = "consensus/core" }
kaspa-consensus-client = { version = "0.14.6", path = "consensus/client" }
kaspa-consensus-notify = { version = "0.14.6", path = "consensus/notify" }
kaspa-consensus-wasm = { version = "0.14.6", path = "consensus/wasm" }
kaspa-consensusmanager = { version = "0.14.6", path = "components/consensusmanager" }
kaspa-core = { version = "0.14.6", path = "core" }
kaspa-daemon = { version = "0.14.6", path = "daemon" }
kaspa-database = { version = "0.14.6", path = "database" }
kaspa-grpc-client = { version = "0.14.6", path = "rpc/grpc/client" }
kaspa-grpc-core = { version = "0.14.6", path = "rpc/grpc/core" }
kaspa-grpc-server = { version = "0.14.6", path = "rpc/grpc/server" }
kaspa-hashes = { version = "0.14.6", path = "crypto/hashes" }
kaspa-index-core = { version = "0.14.6", path = "indexes/core" }
kaspa-index-processor = { version = "0.14.6", path = "indexes/processor" }
kaspa-math = { version = "0.14.6", path = "math" }
kaspa-merkle = { version = "0.14.6", path = "crypto/merkle" }
kaspa-metrics-core = { version = "0.14.6", path = "metrics/core" }
kaspa-mining = { version = "0.14.6", path = "mining" }
kaspa-mining-errors = { version = "0.14.6", path = "mining/errors" }
kaspa-muhash = { version = "0.14.6", path = "crypto/muhash" }
kaspa-notify = { version = "0.14.6", path = "notify" }
kaspa-p2p-flows = { version = "0.14.6", path = "protocol/flows" }
kaspa-p2p-lib = { version = "0.14.6", path = "protocol/p2p" }
kaspa-perf-monitor = { version = "0.14.6", path = "metrics/perf_monitor" }
kaspa-pow = { version = "0.14.6", path = "consensus/pow" }
kaspa-rpc-core = { version = "0.14.6", path = "rpc/core" }
kaspa-rpc-macros = { version = "0.14.6", path = "rpc/macros" }
kaspa-rpc-service = { version = "0.14.6", path = "rpc/service" }
kaspa-txscript = { version = "0.14.6", path = "crypto/txscript" }
kaspa-txscript-errors = { version = "0.14.6", path = "crypto/txscript/errors" }
kaspa-utils = { version = "0.14.6", path = "utils" }
kaspa-utils-tower = { version = "0.14.6", path = "utils/tower" }
kaspa-utxoindex = { version = "0.14.6", path = "indexes/utxoindex" }
kaspa-wallet = { version = "0.14.6", path = "wallet/native" }
kaspa-wallet-cli-wasm = { version = "0.14.6", path = "wallet/wasm" }
kaspa-wallet-keys = { version = "0.14.6", path = "wallet/keys" }
kaspa-wallet-pskt = { version = "0.14.6", path = "wallet/pskt" }
kaspa-wallet-core = { version = "0.14.6", path = "wallet/core" }
kaspa-wallet-macros = { version = "0.14.6", path = "wallet/macros" }
kaspa-wasm = { version = "0.14.6", path = "wasm" }
kaspa-wasm-core = { version = "0.14.6", path = "wasm/core" }
kaspa-wrpc-client = { version = "0.14.6", path = "rpc/wrpc/client" }
kaspa-wrpc-proxy = { version = "0.14.6", path = "rpc/wrpc/proxy" }
kaspa-wrpc-server = { version = "0.14.6", path = "rpc/wrpc/server" }
kaspa-wrpc-wasm = { version = "0.14.6", path = "rpc/wrpc/wasm" }
kaspa-wrpc-example-subscriber = { version = "0.14.6", path = "rpc/wrpc/examples/subscriber" }
kaspad = { version = "0.14.6", path = "kaspad" }
kaspa-alloc = { version = "0.14.6", path = "utils/alloc" }

# external
aes = "0.8.3"
Expand All @@ -150,7 +149,6 @@ bincode = { version = "1.3.3", default-features = false }
blake2b_simd = "1.0.2"
borsh = { version = "1.5.1", features = ["derive", "rc"] }
bs58 = { version = "0.5.0", features = ["check"], default-features = false }
bytes = "1.7.1"
cc = "1.0.83"
cfb-mode = "0.8.2"
cfg-if = "1.0.0"
Expand Down Expand Up @@ -189,8 +187,6 @@ hex-literal = "0.4.1"
hexplay = "0.3.0"
hmac = { version = "0.12.1", default-features = false }
home = "0.5.5"
http-body = "1.0.1"
http-body-util = "0.1.2"
igd-next = { version = "0.14.2", features = ["aio_tokio"] }
indexmap = "2.1.0"
intertrait = "0.2.2"
Expand All @@ -214,17 +210,18 @@ parking_lot = "0.12.1"
paste = "1.0.14"
pbkdf2 = "0.12.2"
portable-atomic = { version = "1.5.1", features = ["float"] }
prost = "0.13.2"
prost = "0.12.1"
# prost = "0.13.1"
rand = "0.8.5"
rand_chacha = "0.3.1"
rand_core = { version = "0.6.4", features = ["std"] }
rand_distr = "0.4.3"
rayon = "1.8.0"
redb = "2.1.2"
regex = "1.10.2"
ripemd = { version = "0.1.3", default-features = false }
rlimit = "0.10.1"
rocksdb = "0.22.0"
rv = "0.16.4"
secp256k1 = { version = "0.29.0", features = [
"global-context",
"rand-std",
Expand All @@ -244,6 +241,8 @@ sha3 = "0.10.8"
slugify-rs = "0.0.3"
smallvec = { version = "1.11.1", features = ["serde"] }
sorted-insert = "0.2.3"
statest = "0.2.2"
statrs = "0.13.0" # TODO "0.16.0"
subtle = { version = "2.5.0", default-features = false }
sysinfo = "0.31.2"
tempfile = "3.8.1"
Expand All @@ -252,8 +251,8 @@ thiserror = "1.0.50"
tokio = { version = "1.33.0", features = ["sync", "rt-multi-thread"] }
tokio-stream = "0.1.14"
toml = "0.8.8"
tonic = { version = "0.12.3", features = ["tls-webpki-roots", "gzip", "transport"] }
tonic-build = { version = "0.12.3", features = ["prost"] }
tonic = { version = "0.10.2", features = ["tls", "gzip", "transport"] }
tonic-build = { version = "0.10.2", features = ["prost"] }
triggered = "0.1.2"
uuid = { version = "1.5.0", features = ["v4", "fast-rng", "serde"] }
wasm-bindgen = { version = "0.2.93", features = ["serde-serialize"] }
Expand All @@ -263,61 +262,59 @@ web-sys = "0.3.70"
xxhash-rust = { version = "0.8.7", features = ["xxh3"] }
zeroize = { version = "1.6.0", default-features = false, features = ["alloc"] }
pin-project-lite = "0.2.13"
tower-http = { version = "0.5.2", features = [
tower-http = { version = "0.4.4", features = [
"map-response-body",
"map-request-body",
] }
tower = "0.5.1"
tower = "0.4.7"
hyper = "0.14.27"
chrono = "0.4.31"
indexed_db_futures = "0.5.0"
# workflow dependencies that are not a part of core libraries

# workflow-perf-monitor = { path = "../../../workflow-perf-monitor-rs" }
workflow-perf-monitor = "0.0.2"
nw-sys = "0.1.6"
rustls = { version = "0.23", default-features = false, features = ["ring"] }

# workflow dependencies
workflow-core = { version = "0.18.0" }
workflow-d3 = { version = "0.18.0" }
workflow-dom = { version = "0.18.0" }
workflow-http = { version = "0.18.0", default-features = false, features = ["rustls-tls-webpki-roots", "http2", "charset", "macos-system-configuration"] }
workflow-log = { version = "0.18.0" }
workflow-node = { version = "0.18.0" }
workflow-nw = { version = "0.18.0" }
workflow-rpc = { version = "0.18.0", default-features = false, features = ["rustls-tls-webpki-roots"] }
workflow-serializer = { version = "0.18.0" }
workflow-store = { version = "0.18.0" }
workflow-terminal = { version = "0.18.0" }
workflow-wasm = { version = "0.18.0" }
workflow-core = { version = "0.17.0" }
workflow-d3 = { version = "0.17.0" }
workflow-dom = { version = "0.17.0" }
workflow-http = { version = "0.17.0" }
workflow-log = { version = "0.17.0" }
workflow-node = { version = "0.17.0" }
workflow-nw = { version = "0.17.0" }
workflow-rpc = { version = "0.17.0" }
workflow-serializer = { version = "0.17.0" }
workflow-store = { version = "0.17.0" }
workflow-terminal = { version = "0.17.0" }
workflow-wasm = { version = "0.17.0" }

# if below is enabled, this means that there is an ongoing work
# on the workflow-rs crate. This requires that you clone workflow-rs
# into a sibling folder from https://github.com/workflow-rs/workflow-rs
# workflow-core = { path = "../workflow-rs/core" }
# workflow-d3 = { path = "../workflow-rs/d3" }
# workflow-dom = { path = "../workflow-rs/dom" }
# # Same features as default but with rustls-tls-webpki-roots instead of native-tls
# workflow-http = { path = "../workflow-rs/http", default-features = false, features = ["rustls-tls-webpki-roots", "http2", "charset", "macos-system-configuration"] }
# workflow-http = { path = "../workflow-rs/http" }
# workflow-log = { path = "../workflow-rs/log" }
# workflow-node = { path = "../workflow-rs/node" }
# workflow-nw = { path = "../workflow-rs/nw" }
# workflow-rpc = { path = "../workflow-rs/rpc", default-features = false, features = ["rustls-tls-webpki-roots"] }
# workflow-rpc = { path = "../workflow-rs/rpc" }
# workflow-serializer = { path = "../workflow-rs/serializer" }
# workflow-store = { path = "../workflow-rs/store" }
# workflow-terminal = { path = "../workflow-rs/terminal" }
# workflow-wasm = { path = "../workflow-rs/wasm" }


# ---
# workflow-core = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-d3 = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-dom = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-http = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master", default-features = false, features = ["rustls-tls-webpki-roots", "http2", "charset", "macos-system-configuration"] }
# workflow-http = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-log = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-node = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-nw = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-rpc = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master", default-features = false, features = ["rustls-tls-webpki-roots"] }
# workflow-rpc = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-serializer = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-store = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-terminal = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
Expand Down
10 changes: 5 additions & 5 deletions components/addressmanager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use itertools::{
};
use kaspa_consensus_core::config::Config;
use kaspa_core::{debug, info, task::tick::TickService, time::unix_now, warn};
use kaspa_database::prelude::{CachePolicy, StoreResultExtensions, DB};
use kaspa_database::prelude::{CachePolicy, RocksDB, StoreResultExtensions};
use kaspa_utils::networking::IpAddress;
use local_ip_address::list_afinet_netifas;
use parking_lot::Mutex;
Expand Down Expand Up @@ -59,7 +59,7 @@ pub struct AddressManager {
}

impl AddressManager {
pub fn new(config: Arc<Config>, db: Arc<DB>, tick_service: Arc<TickService>) -> (Arc<Mutex<Self>>, Option<Extender>) {
pub fn new(config: Arc<Config>, db: Arc<RocksDB>, tick_service: Arc<TickService>) -> (Arc<Mutex<Self>>, Option<Extender>) {
let mut instance = Self {
banned_address_store: DbBannedAddressesStore::new(db.clone(), CachePolicy::Count(MAX_ADDRESSES)),
address_store: address_store_with_cache::new(db),
Expand Down Expand Up @@ -337,7 +337,7 @@ mod address_store_with_cache {
};

use itertools::Itertools;
use kaspa_database::prelude::{CachePolicy, DB};
use kaspa_database::prelude::{CachePolicy, RocksDB};
use kaspa_utils::networking::PrefixBucket;
use rand::{
distributions::{WeightedError, WeightedIndex},
Expand All @@ -358,7 +358,7 @@ mod address_store_with_cache {
}

impl Store {
fn new(db: Arc<DB>) -> Self {
fn new(db: Arc<RocksDB>) -> Self {
// We manage the cache ourselves on this level, so we disable the inner builtin cache
let db_store = DbAddressesStore::new(db, CachePolicy::Empty);
let mut addresses = HashMap::new();
Expand Down Expand Up @@ -457,7 +457,7 @@ mod address_store_with_cache {
}
}

pub fn new(db: Arc<DB>) -> Store {
pub fn new(db: Arc<RocksDB>) -> Store {
Store::new(db)
}

Expand Down
6 changes: 3 additions & 3 deletions components/addressmanager/src/stores/address_store.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use kaspa_database::{
prelude::DB,
prelude::RocksDB,
prelude::{CachePolicy, StoreError, StoreResult},
prelude::{CachedDbAccess, DirectDbWriter},
registry::DatabaseStorePrefixes,
Expand Down Expand Up @@ -74,12 +74,12 @@ impl From<DbAddressKey> for AddressKey {

#[derive(Clone)]
pub struct DbAddressesStore {
db: Arc<DB>,
db: Arc<RocksDB>,
access: CachedDbAccess<DbAddressKey, Entry>,
}

impl DbAddressesStore {
pub fn new(db: Arc<DB>, cache_policy: CachePolicy) -> Self {
pub fn new(db: Arc<RocksDB>, cache_policy: CachePolicy) -> Self {
Self { db: Arc::clone(&db), access: CachedDbAccess::new(db, cache_policy, DatabaseStorePrefixes::Addresses.into()) }
}

Expand Down
6 changes: 3 additions & 3 deletions components/addressmanager/src/stores/banned_address_store.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use kaspa_database::{
prelude::{CachePolicy, StoreError, StoreResult},
prelude::{CachedDbAccess, DirectDbWriter, DB},
prelude::{CachedDbAccess, DirectDbWriter, RocksDB},
registry::DatabaseStorePrefixes,
};
use kaspa_utils::mem_size::MemSizeEstimator;
Expand Down Expand Up @@ -68,12 +68,12 @@ impl From<AddressKey> for IpAddr {

#[derive(Clone)]
pub struct DbBannedAddressesStore {
db: Arc<DB>,
db: Arc<RocksDB>,
access: CachedDbAccess<AddressKey, ConnectionBanTimestamp>,
}

impl DbBannedAddressesStore {
pub fn new(db: Arc<DB>, cache_policy: CachePolicy) -> Self {
pub fn new(db: Arc<RocksDB>, cache_policy: CachePolicy) -> Self {
Self { db: Arc::clone(&db), access: CachedDbAccess::new(db, cache_policy, DatabaseStorePrefixes::BannedAddresses.into()) }
}

Expand Down
4 changes: 4 additions & 0 deletions consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ harness = false
name = "check_scripts"
harness = false

[[bench]]
name = "check_scripts"
harness = false

[features]
html_reports = []
devnet-prealloc = ["kaspa-consensus-core/devnet-prealloc"]
Loading

0 comments on commit 0fe7a7f

Please sign in to comment.