diff --git a/Cargo.lock b/Cargo.lock index 46a52c3..cd9abcb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7232,7 +7232,7 @@ dependencies = [ [[package]] name = "sqd-bloom-filter" version = "0.1.0" -source = "git+https://github.com/subsquid/data.git?rev=b10a969#b10a9692b92920e4d97306f8dd32c77c79291983" +source = "git+https://github.com/subsquid/data.git?rev=ad62dc2#ad62dc206e4ae7d0edc79e6875876dea1f2639df" dependencies = [ "xxhash-rust", ] @@ -7309,7 +7309,7 @@ dependencies = [ [[package]] name = "sqd-polars" version = "0.1.0" -source = "git+https://github.com/subsquid/data.git?rev=b10a969#b10a9692b92920e4d97306f8dd32c77c79291983" +source = "git+https://github.com/subsquid/data.git?rev=ad62dc2#ad62dc206e4ae7d0edc79e6875876dea1f2639df" dependencies = [ "anyhow", "arrow", @@ -7321,12 +7321,12 @@ dependencies = [ [[package]] name = "sqd-primitives" version = "0.1.0" -source = "git+https://github.com/subsquid/data.git?rev=b10a969#b10a9692b92920e4d97306f8dd32c77c79291983" +source = "git+https://github.com/subsquid/data.git?rev=ad62dc2#ad62dc206e4ae7d0edc79e6875876dea1f2639df" [[package]] name = "sqd-query" version = "0.1.0" -source = "git+https://github.com/subsquid/data.git?rev=b10a969#b10a9692b92920e4d97306f8dd32c77c79291983" +source = "git+https://github.com/subsquid/data.git?rev=ad62dc2#ad62dc206e4ae7d0edc79e6875876dea1f2639df" dependencies = [ "anyhow", "arrow", @@ -7345,6 +7345,7 @@ dependencies = [ "sqd-bloom-filter", "sqd-polars", "sqd-primitives", + "tracing", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c490de3..886761a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,10 @@ license = "AGPL-3.0-or-later" version = "2.10.0" edition = "2021" -[dependencies] +[features] +query-tracing = ["sqd-query/max_level_trace"] + +[dependencies] anyhow = "1.0" async-compression = { version = "0.4.27", features = ["gzip", "tokio"] } async-stream = "0.3.5" @@ -62,8 +65,9 @@ sqd-contract-client = { git = "https://github.com/subsquid/sqd-network.git", rev sqd-messages = { git = "https://github.com/subsquid/sqd-network.git", rev = "7ac249a", version = "2.0.2", features = ["bitstring"] } sqd-network-transport = { git = "https://github.com/subsquid/sqd-network.git", rev = "7ac249a", version = "3.0.0", features = ["worker", "metrics"] } -sqd-query = { git = "https://github.com/subsquid/data.git", rev = "b10a969", features = ["parquet"] } -sqd-polars = { git = "https://github.com/subsquid/data.git", rev = "b10a969" } +sqd-query = { git = "https://github.com/subsquid/data.git", rev = "ad62dc2", features = ["parquet"] } +sqd-polars = { git = "https://github.com/subsquid/data.git", rev = "ad62dc2" } + sql_query_plan = {git = "https://github.com/subsquid/qplan.git", rev = "658f88f" } [profile.release] diff --git a/src/controller/p2p.rs b/src/controller/p2p.rs index 9b6c199..e39d8f6 100644 --- a/src/controller/p2p.rs +++ b/src/controller/p2p.rs @@ -485,7 +485,8 @@ impl + Send + 'static> P2PController for QueryError { } impl From for QueryError { - fn from(value: anyhow::Error) -> Self { - Self::Other(value.to_string()) + fn from(err: anyhow::Error) -> Self { + let is_bad_request = err.is::() || err.is::(); + + if is_bad_request { + QueryError::BadRequest(err.to_string()) + } else { + Self::Other(err.to_string()) + } } }