diff --git a/CHANGELOG.md b/CHANGELOG.md index b7c557b4c72..ead95e97d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [2551](https://github.com/FuelLabs/fuel-core/pull/2551): Enhanced the DA compressed block header to include block id. ### Fixed +- [2609](https://github.com/FuelLabs/fuel-core/pull/2609): Check response before trying to deserialize, return error instead - [2599](https://github.com/FuelLabs/fuel-core/pull/2599): Use the proper `url` apis to construct full url path in `BlockCommitterHttpApi` client ## [Version 0.41.0] diff --git a/crates/services/gas_price_service/Cargo.toml b/crates/services/gas_price_service/Cargo.toml index 385f24a668c..cda853ca4bd 100644 --- a/crates/services/gas_price_service/Cargo.toml +++ b/crates/services/gas_price_service/Cargo.toml @@ -22,7 +22,7 @@ num_enum = { workspace = true } parking_lot = { workspace = true } reqwest = { workspace = true, features = ["json"] } serde = { workspace = true } -serde_json = { workspace = true, optional = true } +serde_json = { workspace = true } strum = { workspace = true, features = ["derive"] } strum_macros = { workspace = true } thiserror = { workspace = true } @@ -39,4 +39,4 @@ mockito = { version = "1.6.1" } serde_json = { workspace = true } [features] -test-helpers = ["dep:mockito", "dep:serde_json"] +test-helpers = ["dep:mockito"] diff --git a/crates/services/gas_price_service/src/v1/da_source_service/block_committer_costs.rs b/crates/services/gas_price_service/src/v1/da_source_service/block_committer_costs.rs index 429880bae4c..d7ee82c82d5 100644 --- a/crates/services/gas_price_service/src/v1/da_source_service/block_committer_costs.rs +++ b/crates/services/gas_price_service/src/v1/da_source_service/block_committer_costs.rs @@ -134,7 +134,8 @@ impl BlockCommitterApi for BlockCommitterHttpApi { let path = format!("/v1/costs?variant=specific&value={l2_block_number}&limit={NUMBER_OF_BUNDLES}"); let full_path = url.join(&path)?; let response = self.client.get(full_path).send().await?; - let parsed = response.json::>().await?; + let text = response.text().await?; + let parsed: Vec = serde_json::from_str(&text).map_err(|e| { anyhow::anyhow!("Failed to get costs from block committer: {e} for the response {text}") })?; Ok(parsed) } else { Ok(vec![])