diff --git a/types/src/v0/impls/auction.rs b/types/src/v0/impls/auction.rs index ac6ae11b1..28491a7cc 100644 --- a/types/src/v0/impls/auction.rs +++ b/types/src/v0/impls/auction.rs @@ -2,7 +2,7 @@ use super::state::ValidatedState; use crate::{ eth_signature_key::{EthKeyPair, SigningError}, v0_3::{BidTx, BidTxBody, FullNetworkTx, SolverAuctionResults}, - FeeAccount, FeeAmount, FeeError, FeeInfo, NamespaceId, SeqTypes, + FeeAccount, FeeAmount, FeeError, FeeInfo, NamespaceId, SequencerVersions, }; use anyhow::Context; use async_trait::async_trait; @@ -11,7 +11,7 @@ use hotshot_types::{ data::ViewNumber, traits::{ auction_results_provider::AuctionResultsProvider, - node_implementation::{ConsensusTime, HasUrls, NodeType}, + node_implementation::{ConsensusTime, HasUrls, NodeType, Versions}, signature_key::BuilderSignatureKey, }, }; @@ -279,7 +279,7 @@ impl HasUrls for SolverAuctionResults { } } -type SurfClient = surf_disco::Client::Base>; +type SurfClient = surf_disco::Client::Base>; #[derive(Debug, Clone, Eq, PartialEq, Hash)] /// Auction Results provider holding the Url of the solver in order to fetch auction results. diff --git a/types/src/v0/impls/header.rs b/types/src/v0/impls/header.rs index 2a34201c9..6e12bf08d 100644 --- a/types/src/v0/impls/header.rs +++ b/types/src/v0/impls/header.rs @@ -3,7 +3,6 @@ use ark_serialize::CanonicalSerialize; use committable::{Commitment, Committable, RawCommitmentBuilder}; use hotshot_query_service::{availability::QueryableHeader, explorer::ExplorerHeader}; use hotshot_types::{ - constants::MarketplaceVersion, traits::{ block_contents::{BlockHeader, BuilderFee}, node_implementation::NodeType, @@ -22,7 +21,7 @@ use serde_json::{Map, Value}; use std::fmt; use thiserror::Error; use time::OffsetDateTime; -use vbs::version::{StaticVersionType, Version}; +use vbs::version::{StaticVersion, StaticVersionType, Version}; use crate::{ v0::header::{EitherOrVersion, VersionedHeader}, @@ -425,7 +424,7 @@ impl Header { fee_amount, } in &builder_fee { - if version < MarketplaceVersion::VERSION { + if version < StaticVersion::<0, 3>::version() { ensure!( fee_account.validate_fee_signature( fee_signature, diff --git a/types/src/v0/impls/instance_state.rs b/types/src/v0/impls/instance_state.rs index 9b121b033..ad66d4a7c 100644 --- a/types/src/v0/impls/instance_state.rs +++ b/types/src/v0/impls/instance_state.rs @@ -1,8 +1,10 @@ +use crate::SequencerVersions; use crate::{ v0::traits::StateCatchup, v0_3::ChainConfig, GenesisHeader, L1BlockInfo, L1Client, PubKey, - SeqTypes, Timestamp, Upgrade, UpgradeMode, + Timestamp, Upgrade, UpgradeMode, }; -use hotshot_types::traits::{node_implementation::NodeType, states::InstanceState}; +use hotshot_types::traits::node_implementation::Versions; +use hotshot_types::traits::states::InstanceState; use hotshot_types::HotShotConfig; use std::{collections::BTreeMap, sync::Arc}; use vbs::version::{StaticVersionType, Version}; @@ -59,7 +61,7 @@ impl NodeState { }, l1_genesis: None, upgrades: Default::default(), - current_version: ::Base::version(), + current_version: ::Base::version(), } } diff --git a/types/src/v0/mod.rs b/types/src/v0/mod.rs index f9218e5e7..57582eeca 100644 --- a/types/src/v0/mod.rs +++ b/types/src/v0/mod.rs @@ -2,7 +2,10 @@ use hotshot::traits::election::static_committee::GeneralStaticCommittee; use hotshot_types::{ data::ViewNumber, signature_key::BLSPubKey, - traits::{node_implementation::NodeType, signature_key::SignatureKey}, + traits::{ + node_implementation::{NodeType, Versions}, + signature_key::SignatureKey, + }, }; use serde::{Deserialize, Serialize}; @@ -130,14 +133,22 @@ impl NodeType for SeqTypes { type ValidatedState = ValidatedState; type Membership = GeneralStaticCommittee; type BuilderSignatureKey = FeeAccount; + type AuctionResult = SolverAuctionResults; +} +#[derive(Clone, Debug, Copy)] +pub struct SequencerVersions {} + +impl Versions for SequencerVersions { type Base = StaticVersion<0, 1>; type Upgrade = StaticVersion<0, 2>; - type AuctionResult = SolverAuctionResults; const UPGRADE_HASH: [u8; 32] = [ 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, ]; + + type Marketplace = StaticVersion<0, 3>; } + pub type Leaf = hotshot_types::data::Leaf; pub type Event = hotshot::types::Event;