Skip to content

Commit

Permalink
Revert "gate vote commitment again (#3732)" (#3786)
Browse files Browse the repository at this point in the history
  • Loading branch information
ss-es authored Oct 22, 2024
1 parent 0c8fea0 commit 53e28ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
12 changes: 2 additions & 10 deletions crates/libp2p-networking/src/network/behaviours/dht/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,8 @@ impl<R: RecordStore, K: SignatureKey> RecordStore for ValidatedStore<R, K>
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! {
Expand Down
16 changes: 5 additions & 11 deletions crates/types/src/simple_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -240,16 +240,10 @@ impl<TYPES: NodeType, DATA: Voteable, V: Versions> Committable
for VersionedVoteData<TYPES, DATA, V>
{
fn commit(&self) -> Commitment<Self> {
if self.version < V::Marketplace::VERSION {
let bytes: [u8; 32] = self.data.commit().into();

Commitment::<Self>::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()
}
}

Expand Down

0 comments on commit 53e28ea

Please sign in to comment.