From fc8a132ea607c0e74290ad6ec3426b0b5164feee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20=C4=8Cerni=C4=8D?= Date: Thu, 23 Jan 2025 13:39:03 +0100 Subject: [PATCH 1/2] chore: move lid to the provider server --- Cargo.lock | 29 +++-------------- Cargo.toml | 2 -- storage-provider/server/Cargo.toml | 9 +++++- .../server}/src/local_index_directory/mod.rs | 0 .../server}/src/local_index_directory/rdb.rs | 0 .../src/local_index_directory/rdb_ext.rs | 0 storage-provider/server/src/main.rs | 1 + storage-retrieval/lib/Cargo.toml | 1 - storage/polka-index/Cargo.toml | 32 ------------------- storage/polka-index/README.md | 2 -- storage/polka-index/src/lib.rs | 1 - 11 files changed, 14 insertions(+), 63 deletions(-) rename {storage/polka-index => storage-provider/server}/src/local_index_directory/mod.rs (100%) rename {storage/polka-index => storage-provider/server}/src/local_index_directory/rdb.rs (100%) rename {storage/polka-index => storage-provider/server}/src/local_index_directory/rdb_ext.rs (100%) delete mode 100644 storage/polka-index/Cargo.toml delete mode 100644 storage/polka-index/README.md delete mode 100644 storage/polka-index/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index e22139c93..aa4d6d1fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13777,29 +13777,6 @@ dependencies = [ "tracing-subscriber 0.3.19", ] -[[package]] -name = "polka-index" -version = "0.1.0" -dependencies = [ - "async-channel 2.3.1", - "base64 0.22.1", - "chrono", - "ciborium", - "cid 0.11.1", - "clap", - "integer-encoding", - "jsonrpsee 0.24.7", - "rocksdb", - "serde", - "sha2 0.10.8", - "tempfile", - "thiserror 2.0.8", - "tokio", - "tracing", - "tracing-subscriber 0.3.19", - "uuid", -] - [[package]] name = "polka-storage-node" version = "0.0.0" @@ -13942,12 +13919,16 @@ version = "0.1.0" dependencies = [ "async-trait", "axum", + "base64 0.22.1", + "chrono", + "ciborium", "cid 0.11.1", "clap", "ed25519-dalek", "futures", "hex", "hyper 1.5.2", + "integer-encoding", "jsonrpsee 0.24.7", "libp2p 0.54.1", "mater", @@ -13960,6 +13941,7 @@ dependencies = [ "sc-cli", "serde", "serde_json", + "sha2 0.10.8", "storagext", "subxt 0.38.0", "tempfile", @@ -13992,7 +13974,6 @@ dependencies = [ "libp2p-swarm 0.45.1", "mater", "multihash-codetable", - "polka-index", "thiserror 2.0.8", "tokio", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 96c4a40de..431134584 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ members = [ "storage-provider/server", "storage-retrieval/cli", "storage-retrieval/lib", - "storage/polka-index", "storagext/cli", "storagext/lib", ] @@ -145,7 +144,6 @@ pallet-market = { path = "pallets/market", default-features = false } pallet-proofs = { path = "pallets/proofs", default-features = false } pallet-randomness = { path = "pallets/randomness", default-features = false } pallet-storage-provider = { path = "pallets/storage-provider", default-features = false } -polka-index = { path = "storage/polka-index" } polka-storage-proofs = { path = "lib/polka-storage-proofs", default-features = false } polka-storage-provider-common = { path = "storage-provider/common" } polka-storage-retrieval = { path = "storage-retrieval/lib" } diff --git a/storage-provider/server/Cargo.toml b/storage-provider/server/Cargo.toml index 820d185dd..f57570b60 100644 --- a/storage-provider/server/Cargo.toml +++ b/storage-provider/server/Cargo.toml @@ -21,6 +21,9 @@ storagext = { workspace = true, features = ["clap"] } async-trait = { workspace = true } axum = { workspace = true, features = ["macros", "multipart"] } +base64 = { workspace = true } +chrono = { workspace = true, features = ["serde"] } +ciborium = { workspace = true } cid = { workspace = true, features = ["serde", "std"] } clap = { workspace = true, features = ["derive"] } codec = { workspace = true } @@ -28,6 +31,7 @@ ed25519-dalek = { workspace = true, features = ["pem", "std"] } futures = { workspace = true } hex = { workspace = true, features = ["std"] } hyper = { workspace = true } +integer-encoding = { workspace = true } jsonrpsee = { workspace = true, features = ["http-client", "macros", "server", "ws-client"] } libp2p = { workspace = true, features = ["identify", "macros", "noise", "rendezvous", "tcp", "tokio", "yamux"] } rand = { workspace = true } @@ -47,7 +51,10 @@ tracing = { workspace = true } tracing-appender = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } url = { workspace = true, features = ["serde"] } -uuid = { workspace = true, features = ["v4"] } +uuid = { workspace = true, features = ["serde", "v4"] } + +[dev-dependencies] +sha2 = { workspace = true } [lints] workspace = true diff --git a/storage/polka-index/src/local_index_directory/mod.rs b/storage-provider/server/src/local_index_directory/mod.rs similarity index 100% rename from storage/polka-index/src/local_index_directory/mod.rs rename to storage-provider/server/src/local_index_directory/mod.rs diff --git a/storage/polka-index/src/local_index_directory/rdb.rs b/storage-provider/server/src/local_index_directory/rdb.rs similarity index 100% rename from storage/polka-index/src/local_index_directory/rdb.rs rename to storage-provider/server/src/local_index_directory/rdb.rs diff --git a/storage/polka-index/src/local_index_directory/rdb_ext.rs b/storage-provider/server/src/local_index_directory/rdb_ext.rs similarity index 100% rename from storage/polka-index/src/local_index_directory/rdb_ext.rs rename to storage-provider/server/src/local_index_directory/rdb_ext.rs diff --git a/storage-provider/server/src/main.rs b/storage-provider/server/src/main.rs index 388d841af..de5386909 100644 --- a/storage-provider/server/src/main.rs +++ b/storage-provider/server/src/main.rs @@ -4,6 +4,7 @@ mod config; mod db; +mod local_index_directory; mod p2p; mod pipeline; mod rpc; diff --git a/storage-retrieval/lib/Cargo.toml b/storage-retrieval/lib/Cargo.toml index 8352ea728..9abc9b2f7 100644 --- a/storage-retrieval/lib/Cargo.toml +++ b/storage-retrieval/lib/Cargo.toml @@ -22,7 +22,6 @@ libp2p = { workspace = true, features = ["macros", "noise", "tcp", "tokio", "yam libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } mater = { workspace = true, features = ["blockstore"] } -polka-index = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "sync", "time"] } tracing = { workspace = true } diff --git a/storage/polka-index/Cargo.toml b/storage/polka-index/Cargo.toml deleted file mode 100644 index bae36235b..000000000 --- a/storage/polka-index/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -authors.workspace = true -edition.workspace = true -homepage.workspace = true -license-file.workspace = true -name = "polka-index" -repository.workspace = true -version = "0.1.0" - -[dependencies] -async-channel = { workspace = true } -base64 = { workspace = true } -chrono = { workspace = true, features = ["serde"] } -ciborium = { workspace = true } -cid = { workspace = true, features = ["serde", "std"] } -clap = { workspace = true, features = ["derive", "string"] } -integer-encoding = { workspace = true } -jsonrpsee = { workspace = true, features = ["server"] } -rocksdb = { workspace = true } -serde = { workspace = true } -thiserror = { workspace = true } -tokio = { workspace = true, features = ["full"] } -tracing = { workspace = true } -tracing-subscriber = { workspace = true, features = ["env-filter"] } -uuid = { workspace = true, features = ["serde", "v4"] } - -[dev-dependencies] -sha2 = { workspace = true } -tempfile = { workspace = true } - -[lints] -workspace = true diff --git a/storage/polka-index/README.md b/storage/polka-index/README.md deleted file mode 100644 index 2a1f34b2f..000000000 --- a/storage/polka-index/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Polka Index - diff --git a/storage/polka-index/src/lib.rs b/storage/polka-index/src/lib.rs deleted file mode 100644 index a3596e595..000000000 --- a/storage/polka-index/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod local_index_directory; From 567a002f493cff6714e6b44e3b41291ebf745271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20=C4=8Cerni=C4=8D?= Date: Thu, 23 Jan 2025 14:24:55 +0100 Subject: [PATCH 2/2] add comment --- storage-provider/server/src/local_index_directory/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storage-provider/server/src/local_index_directory/mod.rs b/storage-provider/server/src/local_index_directory/mod.rs index a77a08a43..395589e17 100644 --- a/storage-provider/server/src/local_index_directory/mod.rs +++ b/storage-provider/server/src/local_index_directory/mod.rs @@ -1,3 +1,6 @@ +// TODO(@cernicc,23/01/2025): Remove this after the index is integrated +#![allow(dead_code)] + use std::{ops::Deref, string}; use base64::Engine;