Skip to content

Commit

Permalink
Merge pull request #631 from EspressoSystems/hotshot/rc-0.5.57
Browse files Browse the repository at this point in the history
[WEEKLY RELEASE] HotShot 0.5.57
  • Loading branch information
jparr721 authored Jun 7, 2024
2 parents 54261a8 + 1907a0d commit e4bb98a
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 155 deletions.
218 changes: 92 additions & 126 deletions Cargo.lock

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

[package]
name = "hotshot-query-service"
version = "0.1.34"
version = "0.1.37"
authors = ["Espresso Systems <hello@espressosys.com>"]
edition = "2021"
license = "GPL-3.0-or-later"
Expand Down Expand Up @@ -75,19 +75,24 @@ derivative = "2.2"
derive_more = "0.99"
either = "1.12"
futures = "0.3"
hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.56" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.56" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.56" }
hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.57" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.57" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.57" }
itertools = "0.12.1"
jf-merkle-tree = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5", features = ["std"] }
jf-vid = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5", features = ["std", "parallel"] }
jf-merkle-tree = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5", features = [
"std",
] }
jf-vid = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5", features = [
"std",
"parallel",
] }
prometheus = "0.13"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
snafu = "0.8"
surf-disco = "0.7"
surf-disco = "0.8"
tagged-base64 = "0.4"
tide-disco = "0.7"
tide-disco = "0.8"
time = "0.3"
toml = "0.8"
tracing = "0.1"
Expand All @@ -112,7 +117,7 @@ tokio-postgres = { version = "0.7", optional = true, default-features = false, f

# Dependencies enabled by feature "testing".
espresso-macros = { git = "https://github.com/EspressoSystems/espresso-macros.git", tag = "0.1.0", optional = true }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.56", optional = true }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.57", optional = true }
portpicker = { version = "0.1", optional = true }
rand = { version = "0.8", optional = true }
spin_sleep = { version = "1.2", optional = true }
Expand All @@ -133,7 +138,7 @@ backtrace-on-stack-overflow = { version = "0.3", optional = true }
clap = { version = "4.5", features = ["derive", "env"] }
espresso-macros = { git = "https://github.com/EspressoSystems/espresso-macros.git", tag = "0.1.0" }
generic-array = "0.14"
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.56" }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.57" }
portpicker = "0.1"
rand = "0.8"
reqwest = "0.12.3"
Expand Down
8 changes: 4 additions & 4 deletions src/availability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ impl Error {
pub fn internal<M: Display>(message: M) -> Self {
Self::Custom {
message: message.to_string(),
status: StatusCode::InternalServerError,
status: StatusCode::INTERNAL_SERVER_ERROR,
}
}

pub fn status(&self) -> StatusCode {
match self {
Self::Request { .. } => StatusCode::BadRequest,
Self::Request { .. } => StatusCode::BAD_REQUEST,
Self::FetchLeaf { .. } | Self::FetchBlock { .. } | Self::FetchTransaction { .. } => {
StatusCode::NotFound
StatusCode::NOT_FOUND
}
Self::InvalidTransactionIndex { .. } => StatusCode::NotFound,
Self::InvalidTransactionIndex { .. } => StatusCode::NOT_FOUND,
Self::Custom { status, .. } => *status,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Error {
pub fn internal<M: Display>(message: M) -> Self {
Self::Custom {
message: message.to_string(),
status: StatusCode::InternalServerError,
status: StatusCode::INTERNAL_SERVER_ERROR,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/explorer/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct Unimplemented {}

impl Unimplemented {
pub fn status(&self) -> StatusCode {
StatusCode::NotImplemented
StatusCode::NOT_IMPLEMENTED
}
}

Expand Down Expand Up @@ -90,7 +90,7 @@ pub struct InvalidLimit {}

impl InvalidLimit {
pub fn status(&self) -> StatusCode {
StatusCode::BadRequest
StatusCode::BAD_REQUEST
}
}

Expand Down Expand Up @@ -133,7 +133,7 @@ pub struct NotFound {

impl NotFound {
pub fn status(&self) -> StatusCode {
StatusCode::NotFound
StatusCode::NOT_FOUND
}

pub fn key(&self) -> &str {
Expand Down Expand Up @@ -235,7 +235,7 @@ pub struct BadQuery {}

impl BadQuery {
pub fn status(&self) -> StatusCode {
StatusCode::BadRequest
StatusCode::BAD_REQUEST
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
//! .await
//! .ok_or_else(|| availability::Error::Custom {
//! message: format!("no such UTXO {}", utxo_index),
//! status: StatusCode::NotFound,
//! status: StatusCode::NOT_FOUND,
//! })?;
//! let block = state
//! .get_block(block_index)
Expand Down Expand Up @@ -468,8 +468,8 @@ pub enum QueryError {
impl QueryError {
pub fn status(&self) -> StatusCode {
match self {
Self::NotFound | Self::Missing => StatusCode::NotFound,
Self::Error { .. } => StatusCode::InternalServerError,
Self::NotFound | Self::Missing => StatusCode::NOT_FOUND,
Self::Error { .. } => StatusCode::INTERNAL_SERVER_ERROR,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/merklized_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub enum Error {
impl Error {
pub fn status(&self) -> StatusCode {
match self {
Self::Request { .. } => StatusCode::BadRequest,
Self::Request { .. } => StatusCode::BAD_REQUEST,
Self::Query { source, .. } => source.status(),
Self::Custom { status, .. } => *status,
}
Expand Down Expand Up @@ -102,7 +102,7 @@ where
let key = req.string_param("key")?;
let key = key.parse::<M::Key>().map_err(|_| Error::Custom {
message: "failed to parse Key param".to_string(),
status: StatusCode::InternalServerError,
status: StatusCode::INTERNAL_SERVER_ERROR,
})?;

state.get_path(snapshot, key).await.context(QuerySnafu)
Expand Down
4 changes: 2 additions & 2 deletions src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ impl Error {
pub fn internal<M: Display>(message: M) -> Self {
Self::Custom {
message: message.to_string(),
status: StatusCode::InternalServerError,
status: StatusCode::INTERNAL_SERVER_ERROR,
}
}

pub fn status(&self) -> StatusCode {
match self {
Self::Request { .. } => StatusCode::BadRequest,
Self::Request { .. } => StatusCode::BAD_REQUEST,
Self::Query { source, .. }
| Self::QueryVid { source, .. }
| Self::QueryWindow { source, .. } => source.status(),
Expand Down
6 changes: 3 additions & 3 deletions src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ pub enum Error {
impl Error {
pub fn status(&self) -> StatusCode {
match self {
Self::Request { .. } => StatusCode::BadRequest,
Self::Internal { .. } => StatusCode::InternalServerError,
Self::Request { .. } => StatusCode::BAD_REQUEST,
Self::Internal { .. } => StatusCode::INTERNAL_SERVER_ERROR,
}
}
}
Expand Down Expand Up @@ -172,7 +172,7 @@ mod test {
.unwrap();

// Make sure it has the correct response code
assert_eq!(res.status(), StatusCode::Ok);
assert_eq!(res.status(), StatusCode::OK);
let prometheus = res.text().await.unwrap();
let lines = prometheus.lines().collect::<Vec<_>>();
assert!(
Expand Down

0 comments on commit e4bb98a

Please sign in to comment.