Skip to content

Commit

Permalink
Marketplace builder in tests (#1903)
Browse files Browse the repository at this point in the history
Marketplace builder in tests

- Adds marketplace builder based on marketplace-builder-core to be run in `TestNetwork`
- Adds config option to specify the builder's URL
- Builder is started if we either start with or upgrade to `MarketplaceVersion`
- Changes builder API hooks not to block transaction submission
- As a drive-by, fixes solver client version in auction implementation
  • Loading branch information
QuentinI authored Aug 27, 2024
1 parent 99d3e76 commit e0ebc7a
Show file tree
Hide file tree
Showing 12 changed files with 369 additions and 201 deletions.
16 changes: 10 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ark-ff = "0.4"
ark-poly = "0.4"
ark-serialize = "0.4"
ark-srs = "0.3.1"
async-broadcast = "0.7.0"
async-compatibility-layer = { version = "1.2.1", default-features = false, features = [
"logging-utils",
] }
Expand All @@ -56,7 +57,7 @@ hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.71" }
# Hotshot imports
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.43" }
marketplace-builder-core = { git = "https://github.com/EspressoSystems/marketplace-builder-core", tag = "0.0.6" }
marketplace-builder-core = { git = "https://github.com/EspressoSystems/marketplace-builder-core", tag = "0.0.7" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.42" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.71" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.53" }
Expand Down
2 changes: 1 addition & 1 deletion builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ libp2p = ["sequencer/libp2p"]

[dependencies]
anyhow = { workspace = true }
async-broadcast = "0.7.0"
async-broadcast = { workspace = true }
async-compatibility-layer = { workspace = true }
async-lock = "2.2"
async-std = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions marketplace-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ libp2p = ["sequencer/libp2p"]

[dependencies]
anyhow = { workspace = true }
async-broadcast = "0.7.0"
async-broadcast = { workspace = true }
async-compatibility-layer = { workspace = true }
async-lock = "3.4.0"
async-lock = "2.2"
async-std = { workspace = true }
async-trait = { workspace = true }
clap = { workspace = true }
Expand Down
16 changes: 2 additions & 14 deletions marketplace-builder/src/bin/marketplace-builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ struct NonPermissionedBuilderOptions {
#[clap(long, env = "ESPRESSO_BUILDER_EVENT_CHANNEL_CAPACITY")]
pub event_channel_capacity: NonZeroUsize,

/// NETWORK INITIAL NODE COUNT
#[clap(short, long, env = "ESPRESSO_BUILDER_INIT_NODE_COUNT")]
node_count: NonZeroUsize,

/// The amount of time a builder can wait before timing out a request to the API.
#[clap(
short,
Expand Down Expand Up @@ -136,15 +132,10 @@ async fn main() -> anyhow::Result<()> {

match (base, upgrade) {
(V0_1::VERSION, FeeVersion::VERSION) => {
run(genesis, opt, SequencerVersions::<V0_1, FeeVersion>::new()).await
run::<SequencerVersions<V0_1, FeeVersion>>(genesis, opt).await
}
(FeeVersion::VERSION, MarketplaceVersion::VERSION) => {
run(
genesis,
opt,
SequencerVersions::<FeeVersion, MarketplaceVersion>::new(),
)
.await
run::<SequencerVersions<FeeVersion, MarketplaceVersion>>(genesis, opt).await
}
_ => panic!(
"Invalid base ({base}) and upgrade ({upgrade}) versions specified in the toml file."
Expand All @@ -155,7 +146,6 @@ async fn main() -> anyhow::Result<()> {
async fn run<V: Versions>(
genesis: Genesis,
opt: NonPermissionedBuilderOptions,
versions: V,
) -> anyhow::Result<()> {
let l1_params = L1Params {
url: opt.l1_provider_url,
Expand Down Expand Up @@ -197,7 +187,6 @@ async fn run<V: Versions>(
bootstrapped_view,
opt.tx_channel_capacity,
opt.event_channel_capacity,
opt.node_count,
instance_state,
validated_state,
opt.hotshot_event_streaming_url,
Expand All @@ -208,7 +197,6 @@ async fn run<V: Versions>(
base_fee,
bid_config,
opt.solver_url,
versions,
)
.await?;

Expand Down
Loading

0 comments on commit e0ebc7a

Please sign in to comment.