Skip to content

Commit e207d1a

Browse files
committed
Merge branch 'main' of github.com:EspressoSystems/espresso-sequencer into hotshot/rc-0.5.69
2 parents 18646d3 + f1270db commit e207d1a

File tree

14 files changed

+207
-182
lines changed

14 files changed

+207
-182
lines changed

Cargo.lock

Lines changed: 86 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ark-poly = "0.4"
3434
ark-serialize = "0.4"
3535
ark-srs = "0.3.1"
3636
async-compatibility-layer = { version = "1.2.1", default-features = false, features = [
37-
"logging-utils",
37+
"logging-utils",
3838
] }
3939
async-once-cell = "0.5"
4040
async-std = { version = "1.12.0", features = ["attributes", "tokio1"] }
@@ -52,22 +52,22 @@ dotenvy = "0.15"
5252
ethers = { version = "2.0", features = ["solc"] }
5353
futures = "0.3"
5454

55-
hotshot = { git = "https://github.com/EspressoSystems/hotshot", branch = "bump/0.5.69" }
55+
hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.70" }
5656
# Hotshot imports
57-
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", branch = "bump/0.5.69" }
58-
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", branch = "hotshot/rc-0.5.69" }
59-
marketplace-builder-core = { git = "https://github.com/EspressoSystems/marketplace-builder-core", branch = "hotshot/rc-0.5.69" }
60-
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", branch = "hotshot/rc-0.5.69" }
61-
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", branch = "bump/0.5.69" }
62-
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", branch = "hotshot/rc-0.5.69" }
63-
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", branch = "bump/0.5.69" }
57+
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.70" }
58+
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "rc-0.1.40" }
59+
marketplace-builder-core = { git = "https://github.com/EspressoSystems/marketplace-builder-core", tag = "rc-0.0.3" }
60+
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.39" }
61+
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.70" }
62+
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "rc-0.1.51" }
63+
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.70" }
6464
hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" }
65-
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", branch = "bump/0.5.69" }
66-
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", branch = "bump/0.5.69" }
67-
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", branch = "bump/0.5.69" }
65+
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.70" }
66+
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.70" }
67+
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.70" }
6868
hotshot-contract-adapter = { version = "0.1.0", path = "contracts/rust/adapter" }
6969
# Temporary, used to pull in the mock auction results provider
70-
hotshot-example-types = { git = "https://github.com/EspressoSystems/hotshot", branch = "bump/0.5.69" }
70+
hotshot-example-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.70" }
7171

7272
# Push CDN imports
7373
cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [

builder/src/permissioned.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ use async_std::{
2626
use espresso_types::{
2727
eth_signature_key::EthKeyPair,
2828
v0::traits::{PersistenceOptions, SequencerPersistence, StateCatchup},
29-
FeeAmount, L1Client, NodeState, Payload, PubKey, SeqTypes, ValidatedState,
29+
FeeAmount, L1Client, NodeState, Payload, PubKey, SeqTypes, SolverAuctionResultsProvider,
30+
ValidatedState,
3031
};
3132
use ethers::{
3233
core::k256::ecdsa::SigningKey,
@@ -387,8 +388,10 @@ pub async fn init_hotshot<
387388
ConsensusMetricsValue::new(metrics),
388389
da_storage,
389390
MarketplaceConfig {
390-
auction_results_provider: Arc::new(TestAuctionResultsProvider::default()),
391-
generic_builder_url: Url::from_str("http://localhost").unwrap(),
391+
auction_results_provider: Arc::new(SolverAuctionResultsProvider(
392+
Url::from_str("https://some.solver").unwrap(),
393+
)),
394+
generic_builder_url: Url::from_str("https://some.builder").unwrap(),
392395
},
393396
)
394397
.await

docker-compose.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,12 @@ services:
662662
ports:
663663
- "$ESPRESSO_NODE_VALIDATOR_PORT:$ESPRESSO_NODE_VALIDATOR_PORT"
664664
environment:
665+
- RUST_LOG
666+
- RUST_LOG_FORMAT
667+
- ESPRESSO_NODE_VALIDATOR_PORT
665668
- ESPRESSO_NODE_VALIDATOR_STAKE_TABLE_SOURCE_BASE_URL=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/v0/
666669
- ESPRESSO_NODE_VALIDATOR_LEAF_STREAM_SOURCE_BASE_URL=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/v0/
667-
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT,http://sequencer1:$ESPRESSO_SEQUENCER1_API_PORT,http://sequencer2:$ESPRESSO_SEQUENCER2_API_PORT,http://sequencer3:$ESPRESSO_SEQUENCER3_API_PORT,http://sequencer4:$ESPRESSO_SEQUENCER4_API_PORT
670+
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/,http://sequencer1:$ESPRESSO_SEQUENCER_API_PORT/,http://sequencer2:$ESPRESSO_SEQUENCER_API_PORT/,http://sequencer3:$ESPRESSO_SEQUENCER_API_PORT/,http://sequencer4:$ESPRESSO_SEQUENCER_API_PORT/
668671
depends_on:
669672
sequencer0:
670673
condition: service_healthy
@@ -733,7 +736,8 @@ services:
733736
ports:
734737
- "$ESPRESSO_BLOCK_EXPLORER_PORT:3000"
735738
environment:
736-
- QUERY_SERVICE_URI:http://localhost:$ESPRESSO_SEQUENCER1_API_PORT/v0/
739+
- QUERY_SERVICE_URI=http://localhost:$ESPRESSO_SEQUENCER1_API_PORT/v0/
740+
- NODE_VALIDATOR_URI=ws://localhost:$ESPRESSO_NODE_VALIDATOR_PORT/v0/
737741
depends_on:
738742
sequencer1:
739743
condition: service_healthy

marketplace-builder/src/hooks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ impl BuilderHooks<SeqTypes> for EspressoReserveHooks {
8989
view_number + 3, // We submit a bid 3 views in advance.
9090
self.namespaces.iter().cloned().collect(),
9191
self.builder_api_base_url.clone(),
92+
Default::default(),
9293
)
9394
.signed(&self.bid_key_pair)
9495
{

process-compose.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ environment:
1010
- ESPRESSO_DEMO_L1_HTTP_PROVIDER=$ESPRESSO_SEQUENCER_L1_PROVIDER
1111
- ESPRESSO_STATE_RELAY_SERVER_URL=http://localhost:$ESPRESSO_STATE_RELAY_SERVER_PORT
1212
- QUERY_SERVICE_URI=http://localhost:$ESPRESSO_SEQUENCER1_API_PORT/v0/
13+
- NODE_VALIDATOR_URI=ws://localhost:$ESPRESSO_NODE_VALIDATOR_PORT/v0/
1314
processes:
1415
# Cheating a bit here but since we don't usually have to debug go-ethereum
1516
# it's using the docker compose service which is a bit easier.
@@ -338,11 +339,11 @@ processes:
338339
failure_threshold: 100
339340

340341
node_validator:
341-
command: node-metrics --
342+
command: RUST_LOG=debug node-metrics --
342343
environment:
343344
- ESPRESSO_NODE_VALIDATOR_STAKE_TABLE_SOURCE_BASE_URL=http://localhost:$ESPRESSO_SEQUENCER_API_PORT/v0/
344345
- ESPRESSO_NODE_VALIDATOR_LEAF_STREAM_SOURCE_BASE_URL=http://localhost:$ESPRESSO_SEQUENCER_API_PORT/v0/
345-
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://localhost:$ESPRESSO_SEQUENCER_API_PORT,http://localhost:$ESPRESSO_SEQUENCER1_API_PORT,http://localhost:$ESPRESSO_SEQUENCER2_API_PORT,http://localhost:$ESPRESSO_SEQUENCER3_API_PORT,http://localhost:$ESPRESSO_SEQUENCER4_API_PORT
346+
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://localhost:$ESPRESSO_SEQUENCER_API_PORT/,http://localhost:$ESPRESSO_SEQUENCER1_API_PORT/,http://localhost:$ESPRESSO_SEQUENCER2_API_PORT/,http://localhost:$ESPRESSO_SEQUENCER3_API_PORT/,http://localhost:$ESPRESSO_SEQUENCER4_API_PORT/
346347
depends_on:
347348
broker_0:
348349
condition: process_healthy
@@ -656,7 +657,7 @@ processes:
656657

657658
block-explorer:
658659
command:
659-
docker run --rm -p $ESPRESSO_BLOCK_EXPLORER_PORT:3000 -e QUERY_SERVICE_URI
660+
docker run --rm -p $ESPRESSO_BLOCK_EXPLORER_PORT:3000 -e QUERY_SERVICE_URI -e NODE_VALIDATOR_URI
660661
ghcr.io/espressosystems/espresso-block-explorer:main
661662
depends_on:
662663
sequencer1:

sequencer/src/context.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ use futures::{
1616
use hotshot::{
1717
traits::election::static_committee::GeneralStaticCommittee,
1818
types::{Event, EventType, SystemContextHandle},
19-
Memberships, SystemContext,
19+
MarketplaceConfig, Memberships, SystemContext,
2020
};
2121
use hotshot_events_service::events_source::{EventConsumer, EventsStreamer};
22-
use hotshot_example_types::auction_results_provider_types::TestAuctionResultsProvider;
22+
2323
use hotshot_orchestrator::{client::OrchestratorClient, config::NetworkConfig};
2424
use hotshot_query_service::Leaf;
2525
use hotshot_types::{
@@ -90,6 +90,7 @@ impl<N: ConnectedNetwork<PubKey>, P: SequencerPersistence, Ver: StaticVersionTyp
9090
public_api_url: Option<Url>,
9191
generic_builder_url: Url,
9292
_: Ver,
93+
marketplace_config: MarketplaceConfig<SeqTypes, Node<N, P>>,
9394
) -> anyhow::Result<Self> {
9495
let config = &network_config.config;
9596
let pub_key = config.my_own_validator_config.public_key;
@@ -151,10 +152,7 @@ impl<N: ConnectedNetwork<PubKey>, P: SequencerPersistence, Ver: StaticVersionTyp
151152
initializer,
152153
ConsensusMetricsValue::new(metrics),
153154
persistence.clone(),
154-
hotshot::MarketplaceConfig {
155-
auction_results_provider: Arc::new(TestAuctionResultsProvider::default()),
156-
generic_builder_url,
157-
},
155+
marketplace_config,
158156
)
159157
.await?
160158
.0;

sequencer/src/lib.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ use anyhow::Context;
1414
use async_std::sync::RwLock;
1515
use catchup::StatePeers;
1616
use context::SequencerContext;
17-
use espresso_types::{BackoffParams, L1Client, NodeState, PubKey, SeqTypes, ValidatedState};
17+
use espresso_types::{
18+
BackoffParams, L1Client, NodeState, PubKey, SeqTypes, SolverAuctionResultsProvider,
19+
ValidatedState,
20+
};
1821
use ethers::types::U256;
1922
#[cfg(feature = "libp2p")]
2023
use futures::FutureExt;
2124
use genesis::L1Finalized;
22-
use hotshot_example_types::auction_results_provider_types::TestAuctionResultsProvider;
2325
// Should move `STAKE_TABLE_CAPACITY` in the sequencer repo when we have variate stake table support
2426
use libp2p::Multiaddr;
2527
use network::libp2p::split_off_peer_id;
@@ -47,6 +49,7 @@ use hotshot::{
4749
WrappedSignatureKey,
4850
},
4951
types::SignatureKey,
52+
MarketplaceConfig,
5053
};
5154
use hotshot_orchestrator::{
5255
client::{OrchestratorClient, ValidatorArgs},
@@ -95,7 +98,7 @@ impl<N: ConnectedNetwork<PubKey>, P: SequencerPersistence> NodeImplementation<Se
9598
{
9699
type Network = N;
97100
type Storage = Arc<RwLock<P>>;
98-
type AuctionResultsProvider = TestAuctionResultsProvider<SeqTypes>;
101+
type AuctionResultsProvider = SolverAuctionResultsProvider;
99102
}
100103

101104
#[derive(Clone, Debug)]
@@ -136,6 +139,7 @@ pub async fn init_node<P: PersistenceOptions, Ver: StaticVersionType + 'static>(
136139
bind_version: Ver,
137140
is_da: bool,
138141
identity: Identity,
142+
marketplace_config: MarketplaceConfig<SeqTypes, Node<network::Production, P::Persistence>>,
139143
) -> anyhow::Result<SequencerContext<network::Production, P::Persistence, Ver>> {
140144
// Expose git information via status API.
141145
metrics
@@ -409,6 +413,7 @@ pub async fn init_node<P: PersistenceOptions, Ver: StaticVersionType + 'static>(
409413
network_params.public_api_url,
410414
Url::from_str("http://localhost").unwrap(),
411415
bind_version,
416+
marketplace_config,
412417
)
413418
.await?;
414419
if wait_for_orchestrator {
@@ -423,7 +428,7 @@ pub fn empty_builder_commitment() -> BuilderCommitment {
423428

424429
#[cfg(any(test, feature = "testing"))]
425430
pub mod testing {
426-
use std::{collections::HashMap, time::Duration};
431+
use std::{collections::HashMap, str::FromStr, time::Duration};
427432

428433
use committable::Committable;
429434
use espresso_types::{
@@ -758,6 +763,12 @@ pub mod testing {
758763
None, // The public API URL
759764
Url::from_str("http://localhost").unwrap(),
760765
bind_version,
766+
MarketplaceConfig::<SeqTypes, Node<network::Memory, P::Persistence>> {
767+
auction_results_provider: Arc::new(SolverAuctionResultsProvider(
768+
Url::from_str("https://some.solver").unwrap(),
769+
)),
770+
generic_builder_url: Url::from_str("https://some.builder").unwrap(),
771+
},
761772
)
762773
.await
763774
.unwrap()

sequencer/src/main.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
use std::net::ToSocketAddrs;
1+
use std::{net::ToSocketAddrs, sync::Arc};
22

33
use clap::Parser;
4-
use espresso_types::SeqTypes;
4+
use espresso_types::{SeqTypes, SolverAuctionResultsProvider};
55
use futures::future::FutureExt;
6+
use hotshot::MarketplaceConfig;
67
use hotshot_types::traits::{metrics::NoMetrics, node_implementation::NodeType};
78
use sequencer::{
89
api::{self, data_source::DataSourceOptions},
@@ -97,6 +98,13 @@ where
9798
catchup_backoff: opt.catchup_backoff,
9899
};
99100

101+
let marketplace_config = MarketplaceConfig {
102+
auction_results_provider: Arc::new(SolverAuctionResultsProvider(
103+
opt.auction_results_solver_url,
104+
)),
105+
generic_builder_url: opt.generic_builder_url,
106+
};
107+
100108
// Initialize HotShot. If the user requested the HTTP module, we must initialize the handle in
101109
// a special way, in order to populate the API with consensus metrics. Otherwise, we initialize
102110
// the handle directly, with no metrics.
@@ -129,6 +137,7 @@ where
129137
if let Some(config) = modules.config {
130138
http_opt = http_opt.config(config);
131139
}
140+
132141
http_opt
133142
.serve(
134143
move |metrics| {
@@ -142,6 +151,7 @@ where
142151
bind_version,
143152
opt.is_da,
144153
opt.identity,
154+
marketplace_config,
145155
)
146156
.await
147157
.unwrap()
@@ -162,6 +172,7 @@ where
162172
bind_version,
163173
opt.is_da,
164174
opt.identity,
175+
marketplace_config,
165176
)
166177
.await?
167178
}

sequencer/src/options.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,24 @@ pub struct Options {
104104
#[derivative(Debug(format_with = "Display::fmt"))]
105105
pub state_relay_server_url: Url,
106106

107+
/// URL of the Auction Results Solver
108+
#[clap(
109+
long,
110+
env = "ESPRESSO_AUCTION_RESULTS_SOLVER_URL",
111+
default_value = "http://localhost:25000"
112+
)]
113+
#[derivative(Debug(format_with = "Display::fmt"))]
114+
pub auction_results_solver_url: Url,
115+
116+
/// URL of generic builder
117+
#[clap(
118+
long,
119+
env = "ESPRESSO_GENERIC_BUILDER_URL",
120+
default_value = "http://localhost:31004"
121+
)]
122+
#[derivative(Debug(format_with = "Display::fmt"))]
123+
pub generic_builder_url: Url,
124+
107125
/// Path to TOML file containing genesis state.
108126
#[clap(
109127
long,

0 commit comments

Comments
 (0)