Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🔒 Increase events queue size and make NewStorageRequests non-critical #388

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/actors-framework/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const MAX_PENDING_EVENTS: usize = 2000;
pub const MAX_TASKS_SPAWNED_PER_QUEUE: usize = 2000;
pub const MAX_PENDING_EVENTS: usize = 10000;
pub const MAX_TASKS_SPAWNED_PER_QUEUE: usize = 20000;

pub const DEFAULT_ACTOR_COMMAND_QUEUE_WARNING_SIZE: usize = 2000;
6 changes: 5 additions & 1 deletion node/src/services/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,14 @@ where
let user_sends_file_task = UserSendsFileTask::new(self.clone());

// Subscribing to NewStorageRequest event from the BlockchainService.
// NewStorageRequest event can be used by the user to spam, by spamming the network with new
// storage requests. To prevent this from affecting a BSP node, we make this event NOT
// critical. This means that if used to spam, some of those spam NewStorageRequest events
// will be dropped.
let new_storage_request_event_bus_listener: EventBusListener<NewStorageRequest, _> =
user_sends_file_task
.clone()
.subscribe_to(&self.task_spawner, &self.blockchain, true);
.subscribe_to(&self.task_spawner, &self.blockchain, false);
new_storage_request_event_bus_listener.start();

let accepted_bsp_volunteer_event_bus_listener: EventBusListener<AcceptedBspVolunteer, _> =
Expand Down
Loading