Skip to content

Commit c5b1dd5

Browse files
authored
Increase the max builder message size (#3599)
* increase the max builder message size * do the same with the generator * add the correct imports
1 parent 979036e commit c5b1dd5

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

crates/hotshot-builder/shared/src/utils/event_service_wrapper.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use futures::{stream::unfold, Stream, StreamExt};
66
use hotshot::types::Event;
77
use hotshot_events_service::events::Error as EventStreamError;
88
use hotshot_types::traits::node_implementation::NodeType;
9-
use surf_disco::{client::HealthStatus, Client};
9+
use surf_disco::{client::HealthStatus, reexports::WebSocketConfig, Client};
1010
use tokio::time::{sleep, timeout};
1111
use tracing::{error, warn};
1212
use url::Url;
@@ -64,8 +64,16 @@ impl<Types: NodeType, ApiVer: StaticVersionType + 'static> EventServiceStream<Ty
6464

6565
tracing::info!("Builder client connected to the hotshot events API");
6666

67+
// Create a new [`WebSocketConfig`]. We trust the events service on our nodes to not
68+
// send us malicious messages.
69+
let websocket_config = WebSocketConfig {
70+
max_message_size: None,
71+
max_frame_size: None,
72+
..Default::default()
73+
};
74+
6775
Ok(client
68-
.socket("hotshot-events/events")
76+
.socket_with_config("hotshot-events/events", websocket_config)
6977
.subscribe::<Event<Types>>()
7078
.await?)
7179
}

hotshot-events-service/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ vbs = { workspace = true }
2828
[dev-dependencies]
2929
hotshot-example-types = { workspace = true }
3030
portpicker = "0.1.1"
31-
surf-disco = "0.9"
31+
surf-disco = { workspace = true }
3232

3333
[lints]
3434
workspace = true

sequencer/src/bin/submit-transactions.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use rand_chacha::ChaChaRng;
2525
use rand_distr::Distribution;
2626
use sequencer::SequencerApiVersion;
2727
use sequencer_utils::logging;
28-
use surf_disco::{Client, Url};
28+
use surf_disco::{reexports::WebSocketConfig, Client, Url};
2929
use tide_disco::{error::ServerError, App};
3030
use tokio::{task::spawn, time::sleep};
3131
use vbs::version::StaticVersionType;
@@ -192,8 +192,20 @@ async fn main() {
192192
// Subscribe to block stream so we can check that our transactions are getting sequenced.
193193
let client = Client::<Error, SequencerApiVersion>::new(opt.urls[0].clone());
194194
let block_height: usize = client.get("status/block-height").send().await.unwrap();
195+
196+
// Create a new [`WebSocketConfig`]. We trust the events service on our nodes to not
197+
// send us malicious messages.
198+
let websocket_config = WebSocketConfig {
199+
max_message_size: None,
200+
max_frame_size: None,
201+
..Default::default()
202+
};
203+
195204
let mut blocks = client
196-
.socket(&format!("availability/stream/blocks/{}", block_height - 1))
205+
.socket_with_config(
206+
&format!("availability/stream/blocks/{}", block_height - 1),
207+
websocket_config,
208+
)
197209
.subscribe()
198210
.await
199211
.unwrap();

0 commit comments

Comments
 (0)