Skip to content

Commit 8ff9ba2

Browse files
committed
rebase main
2 parents dd477ca + 9896039 commit 8ff9ba2

File tree

14 files changed

+141
-285
lines changed

14 files changed

+141
-285
lines changed

.github/workflows/release-dispatch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
- run: |
2727
VERSION=${{ inputs.version }}
2828
VERSION=${VERSION#v}
29-
cargo install cargo-release
29+
cargo install cargo-release --locked
3030
cargo release version $VERSION --execute --no-confirm && cargo release replace --execute --no-confirm
3131
3232
- id: version_info
3333
run: |
34-
cargo install cargo-get
34+
cargo install cargo-get --locked
3535
echo "version=$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT
3636
3737
- uses: peter-evans/create-pull-request@v7

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ edition = "2021"
2121
license = "Apache-2.0"
2222
license-file = "LICENSE"
2323
repository = "https://github.com/dojoengine/torii"
24-
version = "1.8.7"
24+
version = "1.8.8"
2525

2626
[profile.performance]
2727
codegen-units = 1

crates/broker/src/memory.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ where
6262
/// Publish an update message that all subscription streams can receive.
6363
pub fn publish(msg: Update<T>) {
6464
with_senders::<Update<T>, _, _>(|senders| {
65+
// Use unbounded_send instead of start_send for better performance
66+
// Unbounded channels never block or fail
6567
for (_, sender) in senders.0.iter_mut() {
66-
sender.start_send(msg.clone()).ok();
68+
let _ = sender.unbounded_send(msg.clone());
6769
}
6870
});
6971
}

crates/cli/src/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub const DEFAULT_RELAY_WEBRTC_PORT: u16 = 9091;
2626
pub const DEFAULT_RELAY_WEBSOCKET_PORT: u16 = 9092;
2727
pub const DEFAULT_GRPC_ADDR: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST);
2828
pub const DEFAULT_GRPC_PORT: u16 = 50051;
29-
pub const DEFAULT_GRPC_SUBSCRIPTION_BUFFER_SIZE: usize = 256;
29+
pub const DEFAULT_GRPC_SUBSCRIPTION_BUFFER_SIZE: usize = 16384;
3030
pub const DEFAULT_GRPC_TCP_KEEPALIVE_SECS: u64 = 60;
3131
pub const DEFAULT_GRPC_HTTP2_KEEPALIVE_INTERVAL_SECS: u64 = 30;
3232
pub const DEFAULT_GRPC_HTTP2_KEEPALIVE_TIMEOUT_SECS: u64 = 10;

crates/grpc/server/src/lib.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,48 +119,37 @@ impl<P: Provider + Sync> DojoWorld<P> {
119119
let achievement_progression_manager =
120120
Arc::new(AchievementProgressionManager::new(config.clone()));
121121

122-
// Spawn subscription services on the main runtime
123-
// They use try_send and non-blocking operations to avoid starving other tasks
122+
// Spawn subscription services - each polls its broker stream and dispatches to subscribers
124123
tokio::spawn(subscriptions::entity::Service::new(Arc::clone(
125124
&entity_manager,
126125
)));
127-
128126
tokio::spawn(subscriptions::event_message::Service::new(Arc::clone(
129127
&event_message_manager,
130128
)));
131-
132129
tokio::spawn(subscriptions::event::Service::new(Arc::clone(
133130
&event_manager,
134131
)));
135-
136132
tokio::spawn(subscriptions::contract::Service::new(Arc::clone(
137133
&contract_manager,
138134
)));
139-
140-
tokio::spawn(subscriptions::token_balance::Service::new(Arc::clone(
141-
&token_balance_manager,
142-
)));
143-
144135
tokio::spawn(subscriptions::token::Service::new(Arc::clone(
145136
&token_manager,
146137
)));
147-
138+
tokio::spawn(subscriptions::token_balance::Service::new(Arc::clone(
139+
&token_balance_manager,
140+
)));
148141
tokio::spawn(subscriptions::token_transfer::Service::new(Arc::clone(
149142
&token_transfer_manager,
150143
)));
151-
152144
tokio::spawn(subscriptions::transaction::Service::new(Arc::clone(
153145
&transaction_manager,
154146
)));
155-
156147
tokio::spawn(subscriptions::aggregation::Service::new(Arc::clone(
157148
&aggregation_manager,
158149
)));
159-
160150
tokio::spawn(subscriptions::activity::Service::new(Arc::clone(
161151
&activity_manager,
162152
)));
163-
164153
tokio::spawn(subscriptions::achievement::Service::new(Arc::clone(
165154
&achievement_progression_manager,
166155
)));
@@ -1298,8 +1287,9 @@ pub async fn new<P: Provider + Sync + Send + 'static>(
12981287
.tcp_keepalive(Some(tcp_keepalive))
12991288
.http2_keepalive_interval(Some(http2_keepalive_interval))
13001289
.http2_keepalive_timeout(Some(http2_keepalive_timeout))
1301-
.initial_stream_window_size(Some(1024 * 1024))
1302-
.initial_connection_window_size(Some(1024 * 1024 * 10))
1290+
// Enable adaptive flow control for optimal streaming performance
1291+
// This automatically adjusts window sizes based on throughput and prevents flow control bottlenecks
1292+
.http2_adaptive_window(Some(true))
13031293
// Should be enabled by default.
13041294
.tcp_nodelay(true)
13051295
.layer(

0 commit comments

Comments
 (0)