Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
feat(advance-runner): add max_decoding_message_size config
Browse files Browse the repository at this point in the history
  • Loading branch information
gligneul committed Sep 12, 2023
1 parent 183322d commit 5acb600
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Updated state-fold libraries to version 0.8
- Added `SS_MAX_DECODING_MESSAGE_SIZE` to state-server and dispatcher with 100MB default
- Added `MAX_DECODING_MESSAGE_SIZE` to advance runner with 100MB default

### Fixed

Expand Down
6 changes: 6 additions & 0 deletions offchain/advance-runner/src/server_manager/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use grpc_interfaces::cartesi_server_manager::{CyclesConfig, DeadlineConfig};
#[derive(Debug, Clone)]
pub struct ServerManagerConfig {
pub server_manager_endpoint: String,
pub max_decoding_message_size: usize,
pub session_id: String,
pub pending_inputs_sleep_duration: u64,
pub pending_inputs_max_retries: u64,
Expand Down Expand Up @@ -52,6 +53,7 @@ impl ServerManagerConfig {

Self {
server_manager_endpoint: cli_config.server_manager_endpoint,
max_decoding_message_size: cli_config.max_decoding_message_size,
session_id: cli_config.session_id,
pending_inputs_sleep_duration: cli_config
.sm_pending_inputs_sleep_duration,
Expand All @@ -71,6 +73,10 @@ pub struct ServerManagerCLIConfig {
#[arg(long, env, default_value = "http://127.0.0.1:5001")]
pub server_manager_endpoint: String,

/// Maximum size of a decoded message
#[arg(long, env, default_value_t = 100 * 1024 * 1024)]
pub max_decoding_message_size: usize,

/// Server-manager session id
#[arg(long, env, default_value = "default_rollups_id")]
pub session_id: String,
Expand Down
1 change: 1 addition & 0 deletions offchain/advance-runner/tests/fixtures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl AdvanceRunnerFixture {

let server_manager_config = ServerManagerConfig {
server_manager_endpoint,
max_decoding_message_size: 100 * 1024 * 1024,
session_id,
pending_inputs_sleep_duration: 1000,
pending_inputs_max_retries: 10,
Expand Down

0 comments on commit 5acb600

Please sign in to comment.