From 90797a1b04f0f80b60182c4afdb1a7e1114ccbfd Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 23 Jan 2023 17:24:22 +1100 Subject: [PATCH] Fix serde quoting of u64 lists & vectors --- Cargo.lock | 6 +++--- Cargo.toml | 2 ++ consensus/types/src/beacon_state.rs | 9 +++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68c5ddfa87..e22d17718b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4704,7 +4704,7 @@ dependencies = [ [[package]] name = "milhouse" version = "0.1.0" -source = "git+https://github.com/sigp/milhouse?branch=main#7712800a18796640a722a219997fc6b2cd745ba2" +source = "git+https://github.com/sigp/milhouse?branch=main#373b601b12c5b0038681334716cc671f76aea31c" dependencies = [ "derivative", "ethereum_hashing", @@ -7341,13 +7341,13 @@ dependencies = [ [[package]] name = "ssz_types" version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "babb2d535656e2f243adc91642033d476f0b411a7c6fbc338f4bc89ef50261d0" +source = "git+https://github.com/sigp/ssz_types?branch=abstract-serde#eab67903fe39828d5735ab48910556445b0fa3d2" dependencies = [ "arbitrary", "derivative", "ethereum_serde_utils", "ethereum_ssz", + "itertools", "serde", "serde_derive", "smallvec", diff --git a/Cargo.toml b/Cargo.toml index b19b11a06d..7cf2cd8938 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,6 +87,8 @@ resolver = "2" [patch.crates-io] fixed-hash = { git = "https://github.com/paritytech/parity-common", rev="df638ab0885293d21d656dc300d39236b69ce57d" } warp = { git = "https://github.com/macladson/warp", rev="7e75acc368229a46a236a8c991bf251fe7fe50ef" } +# FIXME(sproul): remove +ssz_types = { git = "https://github.com/sigp/ssz_types", branch = "abstract-serde" } [profile.maxperf] inherits = "release" diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index 5122ada9e5..0ed8371d4f 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -283,8 +283,7 @@ where // Registry #[test_random(default)] pub validators: VList, - // FIXME(sproul): serde quoting - // #[serde(with = "ssz_types::serde_utils::quoted_u64_var_list")] + #[serde(with = "ssz_types::serde_utils::quoted_u64_var_list")] #[test_random(default)] pub balances: VList, @@ -294,8 +293,7 @@ where // Slashings #[test_random(default)] - // FIXME(sproul): serde quoting - // #[serde(with = "ssz_types::serde_utils::quoted_u64_fixed_vec")] + #[serde(with = "ssz_types::serde_utils::quoted_u64_fixed_vec")] pub slashings: FixedVector, // Attestations (genesis fork only) @@ -329,8 +327,7 @@ where pub finalized_checkpoint: Checkpoint, // Inactivity - // FIXME(sproul): quoting - // #[serde(with = "ssz_types::serde_utils::quoted_u64_var_list")] + #[serde(with = "ssz_types::serde_utils::quoted_u64_var_list")] #[superstruct(only(Altair, Merge))] #[test_random(default)] pub inactivity_scores: VList,