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

Move marketplace to later version #2262

Merged
merged 6 commits into from
Dec 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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ jobs:
needs: [build-test-artifacts, build-test-bins]
strategy:
matrix:
version: [02,03]
version: [02,99]
include:
- version: 02
compose: "-f process-compose.yaml -D"

- version: 03
- version: 99
compose: "-f process-compose.yaml -f process-compose-mp.yml -D"
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub mod testing {
use async_lock::RwLock;
use committable::Committable;
use espresso_types::{
traits::SequencerPersistence, v0_3::ChainConfig, Event, FeeAccount, NamespaceId, NodeState,
PrivKey, PubKey, Transaction, ValidatedState,
traits::SequencerPersistence, v0_99::ChainConfig, Event, FeeAccount, NamespaceId,
NodeState, PrivKey, PubKey, Transaction, ValidatedState,
};
use ethers::utils::{Anvil, AnvilInstance};
use futures::stream::{Stream, StreamExt};
Expand Down
2 changes: 1 addition & 1 deletion builder/src/non_permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use async_broadcast::broadcast;
use async_compatibility_layer::art::async_spawn;
use async_std::sync::{Arc, RwLock};
use espresso_types::{
eth_signature_key::EthKeyPair, v0_3::ChainConfig, FeeAmount, NodeState, Payload, SeqTypes,
eth_signature_key::EthKeyPair, v0_99::ChainConfig, FeeAmount, NodeState, Payload, SeqTypes,
ValidatedState,
};
use hotshot::traits::BlockPayload;
Expand Down
Binary file not shown.
File renamed without changes.
Binary file renamed data/v3/header.bin → data/v99/header.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion data/v3/header.json → data/v99/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"version": {
"Version": {
"major": 0,
"minor": 3
"minor": 99
}
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ demo-native:
scripts/demo-native

demo-native-mp:
cargo build --release
cargo build --profile test
scripts/demo-native -f process-compose.yaml -f process-compose-mp.yml

demo-native-benchmark:
Expand Down
6 changes: 4 additions & 2 deletions marketplace-builder/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use async_lock::RwLock;
use async_std::sync::Arc;
use espresso_types::{
eth_signature_key::EthKeyPair,
v0_3::{ChainConfig, RollupRegistration},
v0_99::{ChainConfig, RollupRegistration},
FeeAmount, L1Client, MarketplaceVersion, MockSequencerVersions, NamespaceId, NodeState,
Payload, SeqTypes, SequencerVersions, ValidatedState, V0_1,
};
Expand Down Expand Up @@ -285,7 +285,7 @@ mod test {
use committable::Committable;
use espresso_types::{
mock::MockStateCatchup,
v0_3::{RollupRegistration, RollupRegistrationBody},
v0_99::{RollupRegistration, RollupRegistrationBody},
Event, FeeAccount, MarketplaceVersion, NamespaceId, PubKey, SeqTypes, SequencerVersions,
Transaction,
};
Expand Down Expand Up @@ -526,6 +526,8 @@ mod test {
parent_view_number: u64,
parent_commitment: VidCommitment,
) -> Bundle<SeqTypes> {
// FIXME error here:
Copy link
Contributor Author

@tbro tbro Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the 0.3 stated in the error is defined elsewhere? Hotshot or builder api?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// `{ status: StatusCode(400), message: "Version Mismatch! Expected 0.3, got 0.99"}`
builder_client
.get::<Bundle<SeqTypes>>(
format!(
Expand Down
4 changes: 2 additions & 2 deletions marketplace-builder/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use std::time::Duration;
use async_compatibility_layer::art::{async_sleep, async_spawn};
use async_lock::RwLock;
use async_trait::async_trait;
use espresso_types::v0_3::BidTxBody;
use espresso_types::v0_99::BidTxBody;

use espresso_types::v0_3::RollupRegistration;
use espresso_types::v0_99::RollupRegistration;

use espresso_types::MarketplaceVersion;
use espresso_types::SeqTypes;
Expand Down
2 changes: 1 addition & 1 deletion marketplace-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use async_trait::async_trait;
use espresso_types::{
eth_signature_key::EthKeyPair,
v0::traits::{PersistenceOptions, SequencerPersistence, StateCatchup},
v0_3::BidTxBody,
v0_99::BidTxBody,
FeeVersion, MarketplaceVersion, SeqTypes, SequencerVersions,
};
use ethers::{
Expand Down
2 changes: 1 addition & 1 deletion marketplace-solver/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
};

use espresso_types::{
v0_3::{BidTx, RollupRegistration, RollupUpdate},
v0_99::{BidTx, RollupRegistration, RollupUpdate},
NamespaceId,
};
use futures::FutureExt;
Expand Down
2 changes: 1 addition & 1 deletion marketplace-solver/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;
use async_trait::async_trait;
use committable::Committable;
use espresso_types::{
v0_3::{
v0_99::{
BidTx, RollupRegistration, RollupRegistrationBody, RollupUpdate, RollupUpdatebody,
SolverAuctionResults,
},
Expand Down
5 changes: 3 additions & 2 deletions marketplace-solver/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ impl MockSolver {

#[cfg(test)]
mod test {

use committable::Committable;
use espresso_types::{
v0_3::{BidTx, RollupRegistration, RollupRegistrationBody, RollupUpdate, RollupUpdatebody},
v0_99::{
BidTx, RollupRegistration, RollupRegistrationBody, RollupUpdate, RollupUpdatebody,
},
FeeAccount, MarketplaceVersion, SeqTypes,
Update::{Set, Skip},
};
Expand Down
2 changes: 1 addition & 1 deletion node-metrics/src/service/data_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ mod tests {
};
use async_std::{prelude::FutureExt, sync::RwLock};
use espresso_types::{
v0_3::ChainConfig, BlockMerkleTree, FeeMerkleTree, Leaf, NodeState, ValidatedState,
v0_99::ChainConfig, BlockMerkleTree, FeeMerkleTree, Leaf, NodeState, ValidatedState,
};
use futures::{channel::mpsc, SinkExt, StreamExt};
use hotshot_types::{signature_key::BLSPubKey, traits::signature_key::SignatureKey};
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use committable::{Commitment, Committable};
use data_source::{CatchupDataSource, SubmitDataSource};
use derivative::Derivative;
use espresso_types::{
retain_accounts, v0::traits::SequencerPersistence, v0_3::ChainConfig, AccountQueryData,
retain_accounts, v0::traits::SequencerPersistence, v0_99::ChainConfig, AccountQueryData,
BlockMerkleTree, FeeAccount, FeeAccountProof, FeeMerkleTree, MockSequencerVersions, NodeState,
PubKey, Transaction, ValidatedState,
};
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/api/data_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use async_trait::async_trait;
use committable::Commitment;
use espresso_types::{
v0::traits::{PersistenceOptions, SequencerPersistence},
v0_3::ChainConfig,
v0_99::ChainConfig,
FeeAccount, FeeAccountProof, FeeMerkleTree, NodeState, PubKey, Transaction,
};
use futures::future::Future;
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/api/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use async_trait::async_trait;
use committable::{Commitment, Committable};
use espresso_types::{
get_l1_deposits,
v0_3::{ChainConfig, IterableFeeInfo},
v0_99::{ChainConfig, IterableFeeInfo},
BlockMerkleTree, FeeAccount, FeeMerkleTree, Leaf, NodeState, ValidatedState,
};
use hotshot::traits::ValidatedState as _;
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/bin/dev-rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::Result;
use clap::{Parser, Subcommand};
use committable::Committable;
use espresso_types::{
v0_3::{RollupRegistration, RollupRegistrationBody, RollupUpdate, RollupUpdatebody},
v0_99::{RollupRegistration, RollupRegistrationBody, RollupUpdate, RollupUpdatebody},
MarketplaceVersion, SeqTypes, Update,
};
use hotshot::types::BLSPubKey;
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/bin/nasty-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use clap::Parser;
use committable::Committable;
use derivative::Derivative;
use espresso_types::{
parse_duration, v0_3::IterableFeeInfo, BlockMerkleTree, FeeMerkleTree, Header, SeqTypes,
parse_duration, v0_99::IterableFeeInfo, BlockMerkleTree, FeeMerkleTree, Header, SeqTypes,
};
use futures::{
future::{FutureExt, TryFuture, TryFutureExt},
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/catchup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use committable::Commitment;
use committable::Committable;
use espresso_types::{
v0::traits::{PersistenceOptions, StateCatchup},
v0_3::ChainConfig,
v0_99::ChainConfig,
BackoffParams, BlockMerkleTree, FeeAccount, FeeAccountProof, FeeMerkleCommitment,
FeeMerkleTree, Leaf, NodeState,
};
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{

use anyhow::Context;
use espresso_types::{
v0_3::ChainConfig, FeeAccount, FeeAmount, GenesisHeader, L1BlockInfo, L1Client, Timestamp,
v0_99::ChainConfig, FeeAccount, FeeAmount, GenesisHeader, L1BlockInfo, L1Client, Timestamp,
Upgrade, UpgradeType,
};
use ethers::types::H160;
Expand Down
10 changes: 5 additions & 5 deletions sequencer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::Arc;

use clap::Parser;
use espresso_types::{
traits::NullEventConsumer, FeeVersion, MarketplaceVersion, SequencerVersions,
traits::NullEventConsumer, FeeVersion, ProofOfStake, SequencerVersions,
SolverAuctionResultsProvider, V0_0,
};
use futures::future::FutureExt;
Expand Down Expand Up @@ -39,12 +39,12 @@ async fn main() -> anyhow::Result<()> {
let upgrade = genesis.upgrade_version;

match (base, upgrade) {
(FeeVersion::VERSION, MarketplaceVersion::VERSION) => {
(FeeVersion::VERSION, ProofOfStake::VERSION) => {
run(
genesis,
modules,
opt,
SequencerVersions::<FeeVersion, MarketplaceVersion>::new(),
SequencerVersions::<FeeVersion, ProofOfStake>::new(),
)
.await
}
Expand All @@ -57,12 +57,12 @@ async fn main() -> anyhow::Result<()> {
)
.await
}
(MarketplaceVersion::VERSION, _) => {
(ProofOfStake::VERSION, _) => {
run(
genesis,
modules,
opt,
SequencerVersions::<MarketplaceVersion, V0_0>::new(),
SequencerVersions::<ProofOfStake, V0_0>::new(),
)
.await
}
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! persistence which is _required_ to run a node.

use async_trait::async_trait;
use espresso_types::v0_3::ChainConfig;
use espresso_types::v0_99::ChainConfig;
use hotshot_query_service::data_source::fetching;

use crate::SeqTypes;
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/restart_tests.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use cdn_broker::{reexports::crypto::signature::KeyPair, Broker, Config as Broker
use cdn_marshal::{Config as MarshalConfig, Marshal};
use derivative::Derivative;
use espresso_types::{
eth_signature_key::EthKeyPair, traits::PersistenceOptions, v0_3::ChainConfig, FeeAccount,
eth_signature_key::EthKeyPair, traits::PersistenceOptions, v0_99::ChainConfig, FeeAccount,
MockSequencerVersions, PrivKey, PubKey, SeqTypes, Transaction,
};
use ethers::utils::{Anvil, AnvilInstance};
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{sync::Arc, time::Duration};
use anyhow::{bail, ensure, Context};
use async_std::stream::StreamExt;
use espresso_types::{
traits::StateCatchup, v0_3::ChainConfig, BlockMerkleTree, Delta, FeeAccount, FeeMerkleTree,
traits::StateCatchup, v0_99::ChainConfig, BlockMerkleTree, Delta, FeeAccount, FeeMerkleTree,
Leaf, ValidatedState,
};
use futures::future::Future;
Expand Down
28 changes: 14 additions & 14 deletions types/src/reference_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use crate::{

type V1Serializer = vbs::Serializer<StaticVersion<0, 1>>;
type V2Serializer = vbs::Serializer<StaticVersion<0, 2>>;
type V3Serializer = vbs::Serializer<StaticVersion<0, 3>>;
type V99Serializer = vbs::Serializer<StaticVersion<0, 99>>;

async fn reference_payload() -> Payload {
const NUM_NS_IDS: usize = 3;
Expand Down Expand Up @@ -92,8 +92,8 @@ fn reference_l1_block() -> L1BlockInfo {

const REFERENCE_L1_BLOCK_COMMITMENT: &str = "L1BLOCK~4HpzluLK2Isz3RdPNvNrDAyQcWOF2c9JeLZzVNLmfpQ9";

fn reference_chain_config() -> crate::v0_3::ChainConfig {
crate::v0_3::ChainConfig {
fn reference_chain_config() -> crate::v0_99::ChainConfig {
crate::v0_99::ChainConfig {
chain_id: 0x8a19.into(),
max_block_size: 10240.into(),
base_fee: 0.into(),
Expand All @@ -106,7 +106,7 @@ fn reference_chain_config() -> crate::v0_3::ChainConfig {
const REFERENCE_V1_CHAIN_CONFIG_COMMITMENT: &str =
"CHAIN_CONFIG~L6HmMktJbvnEGgpmRrsiYvQmIBstSj9UtDM7eNFFqYFO";

const REFERENCE_V3_CHAIN_CONFIG_COMMITMENT: &str =
const REFERENCE_V99_CHAIN_CONFIG_COMMITMENT: &str =
"CHAIN_CONFIG~1mJTBiaJ0Nyuu4Ir5IZTamyI8CjexbktPkRr6R1rtnGh";

fn reference_fee_info() -> FeeInfo {
Expand Down Expand Up @@ -154,7 +154,7 @@ async fn reference_header(version: Version) -> Header {

const REFERENCE_V1_HEADER_COMMITMENT: &str = "BLOCK~dh1KpdvvxSvnnPpOi2yI3DOg8h6ltr2Kv13iRzbQvtN2";
const REFERENCE_V2_HEADER_COMMITMENT: &str = "BLOCK~V0GJjL19nCrlm9n1zZ6gaOKEekSMCT6uR5P-h7Gi6UJR";
const REFERENCE_V3_HEADER_COMMITMENT: &str = "BLOCK~BGlAadiwOlxmhQxdp2HS7mHpG-ifDOx9ocBkTEJXx05_";
const REFERENCE_V99_HEADER_COMMITMENT: &str = "BLOCK~BGlAadiwOlxmhQxdp2HS7mHpG-ifDOx9ocBkTEJXx05_";

fn reference_transaction<R>(ns_id: NamespaceId, rng: &mut R) -> Transaction
where
Expand Down Expand Up @@ -231,7 +231,7 @@ change in the serialization of this data structure.
let actual = match version {
"v1" => V1Serializer::serialize(&reference).unwrap(),
"v2" => V2Serializer::serialize(&reference).unwrap(),
"v3" => V3Serializer::serialize(&reference).unwrap(),
"v99" => V99Serializer::serialize(&reference).unwrap(),
_ => panic!("invalid version"),
};
if actual != expected {
Expand Down Expand Up @@ -260,7 +260,7 @@ change in the serialization of this data structure.
let parsed: T = match version {
"v1" => V1Serializer::deserialize(&expected).unwrap(),
"v2" => V2Serializer::deserialize(&expected).unwrap(),
"v3" => V3Serializer::deserialize(&expected).unwrap(),
"v99" => V99Serializer::deserialize(&expected).unwrap(),
_ => panic!("invalid version"),
};

Expand Down Expand Up @@ -347,12 +347,12 @@ fn test_reference_v1_chain_config() {
}

#[test]
fn test_reference_v3_chain_config() {
fn test_reference_v99_chain_config() {
reference_test(
"v3",
"v99",
"chain_config",
reference_chain_config(),
REFERENCE_V3_CHAIN_CONFIG_COMMITMENT,
REFERENCE_V99_CHAIN_CONFIG_COMMITMENT,
);
}

Expand Down Expand Up @@ -387,12 +387,12 @@ async fn test_reference_header_v2() {
}

#[async_std::test]
async fn test_reference_header_v3() {
async fn test_reference_header_v99() {
reference_test(
"v3",
"v99",
"header",
reference_header(StaticVersion::<0, 3>::version()).await,
REFERENCE_V3_HEADER_COMMITMENT,
reference_header(StaticVersion::<0, 99>::version()).await,
REFERENCE_V99_HEADER_COMMITMENT,
);
}
#[test]
Expand Down
4 changes: 2 additions & 2 deletions types/src/v0/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ use vbs::version::Version;

use crate::{
v0_1::{self, ChainConfig},
v0_2, v0_3,
v0_2, v0_99,
};

/// Each variant represents a specific minor version header.
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
pub enum Header {
V1(v0_1::Header),
V2(v0_2::Header),
V3(v0_3::Header),
V99(v0_99::Header),
}

/// Enum to represent the first field of different versions of a header
Expand Down
4 changes: 2 additions & 2 deletions types/src/v0/impls/auction.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{state::ValidatedState, MarketplaceVersion};
use crate::{
eth_signature_key::{EthKeyPair, SigningError},
v0_3::{BidTx, BidTxBody, FullNetworkTx, SolverAuctionResults},
v0_99::{BidTx, BidTxBody, FullNetworkTx, SolverAuctionResults},
FeeAccount, FeeAmount, FeeError, FeeInfo, NamespaceId,
};
use anyhow::Context;
Expand Down Expand Up @@ -93,7 +93,7 @@ impl BidTxBody {
/// Sign Body and return a `BidTx`. This is the expected way to obtain a `BidTx`.
/// ```
/// # use espresso_types::FeeAccount;
/// # use espresso_types::v0_3::BidTxBody;
/// # use espresso_types::v0_99::BidTxBody;
///
/// BidTxBody::default().signed(&FeeAccount::test_key_pair()).unwrap();
/// ```
Expand Down
Loading
Loading