Skip to content

Commit

Permalink
fix v0.13.4 gateway deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
cchudant committed Mar 6, 2025
1 parent 00b432d commit e369fa2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- fix(gateway-client): fix v0.13.4 gateway deserialization
- chore: Merge entire madara-orchestrator project into this one
- fix(primitives): limit legacy class sizes
- fix(block_production): dynamic block closing now adds special address with prev block hash
Expand Down
2 changes: 1 addition & 1 deletion madara/crates/client/gateway/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ starknet-types-core.workspace = true
anyhow.workspace = true
bytes.workspace = true
futures.workspace = true
http.workspace = true
http-body-util.workspace = true
http.workspace = true
hyper = { workspace = true, features = ["full"] }
hyper-tls.workspace = true
hyper-util.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion madara/crates/client/gateway/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ hyper-util.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
thiserror.workspace = true
tokio.workspace = true
tokio-util.workspace = true
tokio.workspace = true
tracing.workspace = true

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion madara/crates/client/mempool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ mockall = { workspace = true, optional = true }
reqwest.workspace = true
serde.workspace = true
thiserror.workspace = true
tokio.workspace = true
tokio-util.workspace = true
tokio.workspace = true

#Instrumentation
opentelemetry = { workspace = true, features = ["metrics", "logs"] }
Expand Down
19 changes: 9 additions & 10 deletions madara/crates/primitives/gateway/src/block.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use super::{
receipt::{ConfirmedReceipt, MsgToL2},
transaction::Transaction,
};
use anyhow::Context;
use mp_block::header::{BlockTimestamp, L1DataAvailabilityMode};
use mp_chain_config::StarknetVersion;
Expand All @@ -6,11 +10,6 @@ use serde::{Deserialize, Serialize};
use serde_with::serde_as;
use starknet_types_core::felt::Felt;

use super::{
receipt::{ConfirmedReceipt, MsgToL2},
transaction::Transaction,
};

#[derive(Debug, Clone, PartialEq, Serialize)] // no Deserialize because it's untagged
#[serde(untagged)]
#[allow(clippy::large_enum_variant)]
Expand Down Expand Up @@ -57,7 +56,7 @@ impl ProviderBlockPendingMaybe {
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
#[cfg_attr(test, derive(Eq))]
pub struct ProviderBlock {
pub block_hash: Felt,
Expand Down Expand Up @@ -170,7 +169,7 @@ impl ProviderBlock {
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
#[cfg_attr(test, derive(Eq))]
pub struct ProviderBlockPending {
pub parent_block_hash: Felt,
Expand Down Expand Up @@ -250,7 +249,7 @@ impl ProviderBlockPending {
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
#[cfg_attr(test, derive(Eq))]
pub struct ProviderBlockSignature {
pub block_hash: Felt,
Expand All @@ -259,7 +258,7 @@ pub struct ProviderBlockSignature {

#[serde_as]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
#[cfg_attr(test, derive(Eq))]
pub struct ResourcePrice {
#[serde_as(as = "U128AsHex")]
Expand All @@ -270,7 +269,7 @@ pub struct ResourcePrice {

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
pub enum BlockStatus {
Pending,
Aborted,
Expand Down

0 comments on commit e369fa2

Please sign in to comment.