Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arity is already available as an associated constant. #2259

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions sequencer/src/api/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ use std::{

use anyhow::Result;
use committable::Committable;
use espresso_types::{
FeeAccount, FeeMerkleTree, NamespaceId, NsProof, PubKey, Transaction, FEE_MERKLE_TREE_ARITY,
};
use espresso_types::{FeeAccount, FeeMerkleTree, NamespaceId, NsProof, PubKey, Transaction};
use futures::{try_join, FutureExt};
use hotshot_query_service::merklized_state::Snapshot;
use hotshot_query_service::{
Expand All @@ -27,6 +25,7 @@ use hotshot_types::{
node_implementation::{ConsensusTime, Versions},
},
};
use jf_merkle_tree::MerkleTreeScheme;
use serde::{de::Error as _, Deserialize, Serialize};
use snafu::OptionExt;
use tagged_base64::TaggedBase64;
Expand Down Expand Up @@ -54,7 +53,7 @@ where
Ver: 'static + StaticVersionType,
<State as ReadState>::State: Send
+ Sync
+ MerklizedStateDataSource<SeqTypes, FeeMerkleTree, FEE_MERKLE_TREE_ARITY>
+ MerklizedStateDataSource<SeqTypes, FeeMerkleTree, { FeeMerkleTree::ARITY }>
+ MerklizedStateHeightPersistence,
{
let mut options = merklized_state::Options::default();
Expand Down
4 changes: 2 additions & 2 deletions types/src/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub type NetworkConfig = hotshot_types::network::NetworkConfig<PubKey>;

pub use self::impls::{NodeState, SolverAuctionResultsProvider, ValidatedState};
pub use crate::v0_1::{
BLOCK_MERKLE_TREE_HEIGHT, FEE_MERKLE_TREE_ARITY, FEE_MERKLE_TREE_HEIGHT, NS_ID_BYTE_LEN,
NS_OFFSET_BYTE_LEN, NUM_NSS_BYTE_LEN, NUM_TXS_BYTE_LEN, TX_OFFSET_BYTE_LEN,
BLOCK_MERKLE_TREE_HEIGHT, FEE_MERKLE_TREE_HEIGHT, NS_ID_BYTE_LEN, NS_OFFSET_BYTE_LEN,
NUM_NSS_BYTE_LEN, NUM_TXS_BYTE_LEN, TX_OFFSET_BYTE_LEN,
};
use crate::v0_3::SolverAuctionResults;
2 changes: 1 addition & 1 deletion types/src/v0/v0_1/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub type FeeMerkleCommitment = <FeeMerkleTree as MerkleTreeScheme>::Commitment;

pub const BLOCK_MERKLE_TREE_HEIGHT: usize = 32;
pub const FEE_MERKLE_TREE_HEIGHT: usize = 20;
pub const FEE_MERKLE_TREE_ARITY: usize = 256;
const FEE_MERKLE_TREE_ARITY: usize = 256;

#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)]
pub struct Delta {
Expand Down