Skip to content

Commit

Permalink
chore!: Upgrade dependencies but exclude the ones that are patched by…
Browse files Browse the repository at this point in the history
… risc0 (#292)
  • Loading branch information
oblique authored Jun 14, 2024
1 parent 8701c6b commit 502128e
Show file tree
Hide file tree
Showing 15 changed files with 1,190 additions and 733 deletions.
1,648 changes: 1,035 additions & 613 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ resolver = "2"
members = ["cli", "node", "node-wasm", "proto", "rpc", "types"]

[workspace.dependencies]
blockstore = "0.5"
blockstore = "0.5.0"
lumina-node = { version = "0.2.0", path = "node" }
lumina-node-wasm = { version = "0.1.1", path = "node-wasm" }
celestia-proto = { version = "0.2.0", path = "proto" }
celestia-rpc = { version = "0.2.0", path = "rpc", default-features = false }
celestia-types = { version = "0.2.0", path = "types", default-features = false }
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,19 @@ Run tests
```bash
cargo test
```

## Upgrading dependencies

Some of our users use `celestia-types` with [risc0](https://github.com/risc0)
zkVM, which applies some acceleration on dependencies related to cryptography.
Such dependency is `sha2`.

Because of that we created `./tools/upgrade-deps.sh` script which upgrades all
dependencies in `Cargo.toml` except the ones that are patched by risc0.

How to upgrade:

```bash
./tools/upgrade-deps.sh -i # `-i` upgrades incompatible versions too
cargo update
```
30 changes: 15 additions & 15 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ celestia-types = { workspace = true }
libp2p = { workspace = true }
lumina-node = { workspace = true }

anyhow = "1.0.71"
axum = "0.6.20"
clap = { version = "4.4.4", features = ["derive"] }
anyhow = "1.0.86"
axum = "0.7.5"
clap = { version = "4.5.7", features = ["derive"] }
directories = "5.0.1"
dotenvy = "0.15.7"
mime_guess = "2.0"
redb = "2"
rust-embed = { version = "8.0.0", features = ["interpolate-folder-path"] }
serde = "1.0.189"
serde_repr = "0.1"
tokio = { version = "1.29.0", features = ["macros", "rt-multi-thread"] }
tracing = "0.1.37"
tracing-appender = "0.2.2"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
mime_guess = "2.0.4"
redb = "2.1.1"
rust-embed = { version = "8.4.0", features = ["interpolate-folder-path"] }
serde = "1.0.203"
serde_repr = "0.1.19"
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
tracing = "0.1.40"
tracing-appender = "0.2.3"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }

[build-dependencies]
envy = "0.4"
anyhow = "1.0"
serde = { version = "1.0", features = ["derive"] }
envy = "0.4.2"
anyhow = "1.0.86"
serde = { version = "1.0.203", features = ["derive"] }

[features]
browser-node = []
12 changes: 7 additions & 5 deletions cli/src/server.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
use std::net::SocketAddr;

use anyhow::Result;
use axum::body::Body;
use axum::extract::{Path, State};
use axum::http::{header, StatusCode};
use axum::response::Response;
use axum::routing::get;
use axum::{body, Json, Router};
use axum::{Json, Router};
use celestia_types::hash::Hash;
use clap::Args;
use libp2p::multiaddr::Protocol;
use libp2p::Multiaddr;
use lumina_node::network::{canonical_network_bootnodes, network_genesis};
use rust_embed::RustEmbed;
use serde::Serialize;
use tokio::net::TcpListener;
use tracing::info;

use crate::common::ArgNetwork;
Expand Down Expand Up @@ -74,9 +76,9 @@ pub(crate) async fn run(args: Params) -> Result<()> {
.with_state(state);

info!("listening on {}", args.listen_addr);
Ok(axum::Server::bind(&args.listen_addr)
.serve(app.into_make_service())
.await?)
let listener = TcpListener::bind(&args.listen_addr).await?;

Ok(axum::serve(listener, app.into_make_service()).await?)
}

async fn serve_index_html() -> Result<Response, StatusCode> {
Expand All @@ -90,7 +92,7 @@ async fn serve_embedded_path<Source: RustEmbed>(
let mime = mime_guess::from_path(&path).first_or_octet_stream();
Ok(Response::builder()
.header(header::CONTENT_TYPE, mime.as_ref())
.body(body::boxed(body::Full::from(content.data)))
.body(Body::from(content.data))
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?)
} else {
Err(StatusCode::NOT_FOUND)
Expand Down
22 changes: 11 additions & 11 deletions node-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ celestia-types = { workspace = true }
libp2p = { workspace = true }
lumina-node = { workspace = true }

anyhow = "1.0.71"
anyhow = "1.0.86"
console_error_panic_hook = "0.1.7"
js-sys = "0.3.68"
serde = { version = "1.0.164", features = ["derive"] }
serde_repr = "0.1"
serde-wasm-bindgen = "0.6.0"
time = { version = "0.3", features = ["wasm-bindgen"] }
tracing = "0.1.37"
js-sys = "0.3.69"
serde = { version = "1.0.203", features = ["derive"] }
serde_repr = "0.1.19"
serde-wasm-bindgen = "0.6.5"
time = { version = "0.3.36", features = ["wasm-bindgen"] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["time"] }
tracing-web = "0.1.2"
wasm-bindgen = "0.2.88"
wasm-bindgen-futures = "0.4.37"
web-sys = { version = "0.3.68", features = ["BroadcastChannel", "Crypto"] }
tracing-web = "0.1.3"
wasm-bindgen = "0.2.92"
wasm-bindgen-futures = "0.4.42"
web-sys = { version = "0.3.69", features = ["BroadcastChannel", "Crypto"] }

[package.metadata.docs.rs]
targets = ["wasm32-unknown-unknown"]
54 changes: 27 additions & 27 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ libp2p = { workspace = true, features = [
"kad",
] }

async-trait = "0.1.73"
beetswap = "0.1"
cid = { version = "0.11.0", features = ["serde-codec"] }
async-trait = "0.1.80"
beetswap = "0.1.1"
cid = { version = "0.11.1", features = ["serde-codec"] }
dashmap = "5.5.3"
futures = "0.3.28"
futures = "0.3.30"
hex = "0.4.3"
instant = "0.1.12"
itertools = "0.13"
prost = "0.12.0"
instant = "0.1.13"
itertools = "0.13.0"
prost = "0.12.6"
rand = "0.8.5"
serde = { version = "1.0.164", features = ["derive"] }
smallvec = { version = "1.11.1", features = ["union", "const_generics", "serde"] }
thiserror = "1.0.48"
tokio = { version = "1.32.0", features = ["macros", "sync"] }
tokio-util = "0.7.9"
tracing = "0.1.37"
web-time = "1"
serde = { version = "1.0.203", features = ["derive"] }
smallvec = { version = "1.13.2", features = ["union", "const_generics", "serde"] }
thiserror = "1.0.61"
tokio = { version = "1.38.0", features = ["macros", "sync"] }
tokio-util = "0.7.11"
tracing = "0.1.40"
web-time = "1.1.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
backoff = { version = "0.4.0", features = ["tokio"] }
blockstore = { workspace = true, features = ["redb"] }
tokio = { version = "1.32.0", features = ["rt-multi-thread", "time"] }
tokio = { version = "1.38.0", features = ["rt-multi-thread", "time"] }
libp2p = { workspace = true, features = [
"noise",
"dns",
Expand All @@ -63,41 +63,41 @@ libp2p = { workspace = true, features = [
"yamux",
"quic",
] }
redb = "2"
redb = "2.1.1"

[target.'cfg(target_arch = "wasm32")'.dependencies]
backoff = { version = "0.4.0", features = ["wasm-bindgen"] }
beetswap = { version = "0.1", features = ["wasm-bindgen"] }
beetswap = { version = "0.1.1", features = ["wasm-bindgen"] }
blockstore = { workspace = true, features = ["indexeddb"] }
celestia-types = { workspace = true, features = ["wasm-bindgen"] }
getrandom = { version = "0.2.10", features = ["js"] }
getrandom = { version = "0.2.15", features = ["js"] }
gloo-timers = { version = "0.3.0", features = ["futures"] }
libp2p = { workspace = true, features = [
"wasm-bindgen",
"webtransport-websys",
] }
pin-project = "1.1.3"
pin-project = "1.1.5"
rexie = "0.5.0"
send_wrapper = { version = "0.6.0", features = ["futures"] }
serde-wasm-bindgen = "0.6.0"
wasm-bindgen = "0.2.88"
wasm-bindgen-futures = "0.4.37"
serde-wasm-bindgen = "0.6.5"
wasm-bindgen = "0.2.92"
wasm-bindgen-futures = "0.4.42"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
function_name = "0.3.0"
wasm-bindgen-test = "0.3"
wasm-bindgen-test = "0.3.42"

[dev-dependencies]
bytes = "1.4.0"
bytes = "1.6.0"
celestia-rpc = { workspace = true, features = ["p2p"] }
celestia-types = { workspace = true, features = ["test-utils"] }
dotenvy = "0.15.7"
# required to have path based dependency here to allow `cargo publish` to work
# https://github.com/rust-lang/cargo/pull/7333
lumina-node = { path = ".", features = ["test-utils"] }
rstest = "0.18.2"
serde_json = "1.0.107"
tempfile = "3.9.0"
rstest = "0.21.0"
serde_json = "1.0.117"
tempfile = "3.10.1"

[features]
test-utils = ["celestia-types/test-utils"]
Expand Down
14 changes: 7 additions & 7 deletions proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ categories = ["encoding", "cryptography::cryptocurrencies"]

[dependencies]
celestia-tendermint-proto = { workspace = true }
prost = "0.12.0"
prost-types = "0.12.0"
serde = { version = "1.0.188", features = ["derive"] }
prost = "0.12.6"
prost-types = "0.12.6"
serde = { version = "1.0.203", features = ["derive"] }

[build-dependencies]
anyhow = "1.0.75"
prost-build = "0.12.0"
anyhow = "1.0.86"
prost-build = "0.12.6"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3"
wasm-bindgen-test = "0.3.42"

[dev-dependencies]
serde_json = "1.0.105"
serde_json = "1.0.117"
26 changes: 13 additions & 13 deletions rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ categories = [
]

[dependencies]
async-trait = "0.1"
async-trait = "0.1.80"
celestia-types = { workspace = true }
jsonrpsee = { version = "0.20", features = ["client-core", "macros"] }
serde = { version = "1.0.188", features = ["derive"] }
thiserror = "1.0.40"
tracing = "0.1.37"
jsonrpsee = { version = "0.23.1", features = ["client-core", "macros"] }
serde = { version = "1.0.203", features = ["derive"] }
thiserror = "1.0.61"
tracing = "0.1.40"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
http = "0.2.9"
jsonrpsee = { version = "0.20", features = ["http-client", "ws-client"] }
http = "1.1.0"
jsonrpsee = { version = "0.23.1", features = ["http-client", "ws-client"] }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
libp2p = { workspace = true, features = [
Expand All @@ -38,17 +38,17 @@ libp2p = { workspace = true, features = [
"noise",
"yamux",
] }
anyhow = "1.0.71"
anyhow = "1.0.86"
dotenvy = "0.15.7"
futures = "0.3.28"
futures = "0.3.30"
nmt-rs = "0.1.0"
rand = "0.8.5"
tokio = { version = "1.32.0", features = ["rt", "macros"] }
tracing = "0.1.37"
tokio = { version = "1.38.0", features = ["rt", "macros"] }
tracing = "0.1.40"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
getrandom = { version = "0.2", features = ["js"] }
wasm-bindgen-test = "0.3.0"
getrandom = { version = "0.2.15", features = ["js"] }
wasm-bindgen-test = "0.3.42"

[features]
default = ["p2p"]
Expand Down
Loading

0 comments on commit 502128e

Please sign in to comment.