Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong pr #619

Closed
wants to merge 68 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
5d3b10f
Refactor pruning proof validation to many functions
coderofstuff Jun 4, 2024
40f1cc9
Use blue score as work for higher levels
coderofstuff Jun 4, 2024
4af6773
Remove pruning processor dependency on gd managers
coderofstuff Jun 4, 2024
1df5a22
Consistency renaming
coderofstuff Jun 4, 2024
d12592c
Update db version
coderofstuff Jun 4, 2024
2bea765
GD Optimizations
coderofstuff Jun 4, 2024
902b217
Remove remnant of old impl. optimize db prefixes
coderofstuff Jun 4, 2024
7f1f412
Ensure parents are in relations; Add comments
coderofstuff Jun 19, 2024
f49478a
Match depth check to block_at_depth logic
coderofstuff Jun 19, 2024
879c135
Use singular GD store for header processing
coderofstuff Jun 19, 2024
56c0b40
Relax the panic to warn when finished_headers and couldn't find suffi…
coderofstuff Jun 12, 2024
43e9f9e
Error handling for gd on higher levels
coderofstuff Jun 19, 2024
34f20ab
remove using deeper requirements in lower levels
coderofstuff Jun 15, 2024
2654b25
Fix missed references to self.ghostdag_stores in validate_pruning_poi…
coderofstuff Jun 18, 2024
ba04929
Refactoring for single GD header processing
coderofstuff Jun 19, 2024
a45b571
Add assertion to check root vs old_root
coderofstuff Jun 19, 2024
edb5cd3
Lint fix current_dag_level
coderofstuff Jun 19, 2024
e81394f
Keep DB Version at 3
coderofstuff Jun 19, 2024
0e8c788
Cleanup apply_proof logic and handle more ghostdag_stores logic
coderofstuff Jun 19, 2024
56f9dab
remove simpa changes
coderofstuff Jun 19, 2024
c5be8ad
Remove rewriting origin to primary GD
coderofstuff Jun 19, 2024
8d15e27
More refactoring to use single GD store/manager
coderofstuff Jun 19, 2024
1c6b585
Lint fixes
coderofstuff Jun 21, 2024
273aa81
warn to trace for common retry
coderofstuff Jun 21, 2024
f9b3fda
Address initial comments
coderofstuff Jun 26, 2024
ca8bb42
Remove "primary" in ghostdag store/manager references
coderofstuff Jun 26, 2024
61183fa
Add small safety margin to proof at level 0
coderofstuff Jun 27, 2024
34bc88f
Revert to only do proof rebuilding on sanity check
coderofstuff Jun 29, 2024
da1cfe3
Proper "better" proof check
coderofstuff Jun 29, 2024
a23d1dd
Update comment on find_selected_parent_header_at_level
coderofstuff Jul 5, 2024
974d200
Re-apply missed comment
coderofstuff Jul 5, 2024
6ea8328
Implement db upgrade logic from 3 to 4
coderofstuff Jul 4, 2024
f8baf69
Explain further the workaround for GD ordering.rs
coderofstuff Jul 10, 2024
4f6ad73
Minor update to Display of TempGD keys
coderofstuff Jul 10, 2024
bc56e65
Various fixes
coderofstuff Jul 10, 2024
efbb083
Revert "Various fixes"
coderofstuff Jul 14, 2024
a585be7
Revert better proof check
coderofstuff Jul 16, 2024
e7625c7
Fix: use cc gd store
coderofstuff Jul 16, 2024
0741151
When building pruning point proof ghostdag data, ignore blocks before…
someone235 Aug 18, 2024
d48e049
Merge branch 'dev' into gd-optimization
coderofstuff Aug 20, 2024
89f1701
Add trusted blocks to all relevant levels during apply_proof
coderofstuff Aug 23, 2024
3e249f9
Merge branch 'dev' into gd-optimization
coderofstuff Aug 23, 2024
fb3d1e9
Calculate headers estimate in init proof stores
coderofstuff Aug 24, 2024
c9855d3
Explain finished headers logic
coderofstuff Aug 24, 2024
a63acdb
clarify comment
coderofstuff Aug 24, 2024
46dbac3
Rename old_root to depth_based_root
coderofstuff Aug 24, 2024
bdf205e
Merge branch 'dev' into gd-optimization
coderofstuff Aug 27, 2024
4c9f997
More merge fixes
coderofstuff Aug 27, 2024
42a3030
Merge pull request #9 from someone235/gd-proof-ignore-root-past
coderofstuff Aug 27, 2024
4f2aace
Merge branch 'dev' into gd-optimization
coderofstuff Aug 27, 2024
bc2e648
Merge branch 'dev' into gd-optimization
coderofstuff Aug 28, 2024
56b4392
Refactor relations services into self
coderofstuff Aug 28, 2024
14376d2
Squashed commit of the following:
michaelsutton Aug 29, 2024
5742d25
reachability constants
michaelsutton Aug 29, 2024
5446898
bump version to 0.14.4
michaelsutton Aug 29, 2024
f8bd05e
Merge branch 'dev' into gd-tn11-uni-2
michaelsutton Sep 1, 2024
2d2dba2
Merge branch 'dev' into gd-tn11-uni-2
michaelsutton Sep 2, 2024
a633da8
Squashed commit of the following:
michaelsutton Sep 2, 2024
fd9e93d
Merge branch 'dev' into gd-tn11-uni-2
michaelsutton Sep 2, 2024
81fe3d1
Squashed commit of the following:
michaelsutton Sep 6, 2024
a9888c4
bump to version 0.14.6
michaelsutton Sep 6, 2024
5a80f53
introduce db trait
biryukovmaxim Sep 11, 2024
81998f5
introduce db trait to support different dbs
biryukovmaxim Sep 11, 2024
f547bb6
tmp works
biryukovmaxim Sep 12, 2024
38b3d43
impl dbaccess for redb
biryukovmaxim Sep 12, 2024
5ffbf31
extend vcc endpoint to pass sp blue score, group up transactions by m…
biryukovmaxim Dec 24, 2024
52fa6b6
style fmt
biryukovmaxim Dec 24, 2024
0fe7a7f
Merge branch 'gd-tn11-uni-2-redb' into VCCv254
biryukovmaxim Dec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 6 additions & 2 deletions components/consensusmanager/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use kaspa_consensus_core::{
use kaspa_utils::sync::rwlock::*;
use std::{ops::Deref, sync::Arc};

pub use tokio::task::spawn_blocking;

use crate::BlockProcessingBatch;
use kaspa_consensus_core::header::CompactHeaderData;
pub use tokio::task::spawn_blocking;

#[allow(dead_code)]
#[derive(Clone)]
Expand Down Expand Up @@ -358,6 +358,10 @@ impl ConsensusSessionOwned {
self.clone().spawn_blocking(move |c| c.get_block(hash)).await
}

pub async fn async_get_compact_header_data(&self, hash: Hash) -> ConsensusResult<CompactHeaderData> {
self.clone().spawn_blocking(move |c| c.get_compact_header_data(hash)).await
}

pub async fn async_get_block_even_if_header_only(&self, hash: Hash) -> ConsensusResult<Block> {
self.clone().spawn_blocking(move |c| c.get_block_even_if_header_only(hash)).await
}
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
Loading