From 53e28ead5eebf1bc4e713ec1a5d6f580d33db2cf Mon Sep 17 00:00:00 2001 From: ss-es <155648797+ss-es@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:38:16 -0400 Subject: [PATCH] Revert "gate vote commitment again (#3732)" (#3786) --- .../src/network/behaviours/dht/store.rs | 12 ++---------- crates/types/src/simple_vote.rs | 16 +++++----------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/crates/libp2p-networking/src/network/behaviours/dht/store.rs b/crates/libp2p-networking/src/network/behaviours/dht/store.rs index cf5c22d61e..6969ced1ff 100644 --- a/crates/libp2p-networking/src/network/behaviours/dht/store.rs +++ b/crates/libp2p-networking/src/network/behaviours/dht/store.rs @@ -37,16 +37,8 @@ impl RecordStore for ValidatedStore where K: 'static, { - type ProvidedIter<'a> - = R::ProvidedIter<'a> - where - R: 'a, - K: 'a; - type RecordsIter<'a> - = R::RecordsIter<'a> - where - R: 'a, - K: 'a; + type ProvidedIter<'a> = R::ProvidedIter<'a> where R: 'a, K: 'a; + type RecordsIter<'a> = R::RecordsIter<'a> where R: 'a, K: 'a; // Delegate all `RecordStore` methods except `put` to the inner store delegate! { diff --git a/crates/types/src/simple_vote.rs b/crates/types/src/simple_vote.rs index 1c1fcba31b..07c3139eef 100644 --- a/crates/types/src/simple_vote.rs +++ b/crates/types/src/simple_vote.rs @@ -11,7 +11,7 @@ use std::{fmt::Debug, hash::Hash, marker::PhantomData}; use anyhow::Result; use committable::{Commitment, Committable}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use vbs::version::{StaticVersionType, Version}; +use vbs::version::Version; use crate::{ data::Leaf, @@ -240,16 +240,10 @@ impl Committable for VersionedVoteData { fn commit(&self) -> Commitment { - if self.version < V::Marketplace::VERSION { - let bytes: [u8; 32] = self.data.commit().into(); - - Commitment::::from_raw(bytes) - } else { - committable::RawCommitmentBuilder::new("Vote") - .var_size_bytes(self.data.commit().as_ref()) - .u64(*self.view) - .finalize() - } + committable::RawCommitmentBuilder::new("Vote") + .var_size_bytes(self.data.commit().as_ref()) + .u64(*self.view) + .finalize() } }