Skip to content

Commit 655dff0

Browse files
authored
Builder request timeout (#3632)
builder request timeout
1 parent a6bdb96 commit 655dff0

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

crates/hotshot-builder/refactored/src/testing/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl TestServiceWrapper {
7777
let url: Url = format!("http://localhost:{port}").parse().unwrap();
7878
let app = Arc::clone(&global_state).into_app().unwrap();
7979
spawn(app.serve(url.clone(), StaticVersion::<0, 1> {}));
80-
let client = BuilderClient::new(url);
80+
let client = BuilderClient::new(url, Duration::from_secs(5));
8181
assert!(client.connect(Duration::from_secs(1)).await);
8282
Self {
8383
event_sender: event_stream_sender,

crates/hotshot/hotshot/src/tasks/task_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> CreateTaskState
211211
.builder_urls
212212
.iter()
213213
.cloned()
214-
.map(BuilderClient::new)
214+
.map(|url| BuilderClient::new(url, handle.builder_timeout()))
215215
.collect(),
216216
upgrade_lock: handle.hotshot.upgrade_lock.clone(),
217217
epoch_height: handle.epoch_height,

crates/hotshot/task-impls/src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ impl<TYPES: NodeType, Ver: StaticVersionType> BuilderClient<TYPES, Ver> {
7373
/// # Panics
7474
///
7575
/// If the URL is malformed.
76-
pub fn new(base_url: impl Into<Url>) -> Self {
76+
pub fn new(base_url: impl Into<Url>, request_timeout: Duration) -> Self {
7777
let url = base_url.into();
7878

7979
Self {
8080
client: Client::builder(url.clone())
81-
.set_timeout(Some(Duration::from_secs(2)))
81+
.set_timeout(Some(request_timeout))
8282
.build(),
8383
_marker: std::marker::PhantomData,
8484
}

crates/hotshot/testing/tests/tests_1/block_builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ async fn test_random_block_builder() {
5050

5151
let builder_started = Instant::now();
5252

53-
let client: BuilderClient<TestTypes, StaticVersion<0, 1>> = BuilderClient::new(api_url);
53+
let client: BuilderClient<TestTypes, StaticVersion<0, 1>> =
54+
BuilderClient::new(api_url, Duration::from_secs(5));
5455
assert!(client.connect(Duration::from_millis(100)).await);
5556

5657
let (pub_key, private_key) =

sequencer/api/public-env-vars.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ variables = [
7575
"ESPRESSO_SEQUENCER_L1_POLLING_INTERVAL",
7676
"ESPRESSO_SEQUENCER_L1_RATE_LIMIT_DELAY",
7777
"ESPRESSO_SEQUENCER_L1_STAKE_TABLE_UPDATE_INTERVAL",
78-
"ESPRESSO_SEQUENCER_L1_WS_PROVIDER",
7978
"ESPRESSO_SEQUENCER_L1_FINALIZED_SAFETY_MARGIN",
8079
"ESPRESSO_SEQUENCER_L1_RETRY_DELAY",
8180
"ESPRESSO_SEQUENCER_L1_SUBSCRIPTION_TIMEOUT",

0 commit comments

Comments
 (0)