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

feat: add max_decoding_message_size config #12

Merged
merged 3 commits into from
Sep 11, 2023
Merged

Conversation

GCdePaula
Copy link
Collaborator

@gligneul can you test with the node and check if this solves the message size issue?

@GCdePaula GCdePaula self-assigned this Sep 11, 2023
@gligneul
Copy link

I set the value to 104857600. (It can be confirmed in the logs.)

rollups-examples-state_server-1  | 2023-09-11T14:56:51.585386Z  INFO cartesi_rollups_state_server: starting state server config=StateServerConfig { state_fold: SFConfig { concurrent_events_fetch: 16, genesis_block: 1, query_limit_error_codes: [], safety_margin: 1 }, block_history: BHConfig { ws_endpoint: "ws://hardhat:8545", http_endpoint: "http://hardhat:8545", block_timeout: 8s, max_depth: 1000 }, server_address: 0.0.0.0:50051, max_decoding_message_size: 104857600 }

And the error still happens after the first input. Maybe we need to change the client side as well?

rollups-examples-dispatcher-1  | Error: StateServerError { source: TonicError { context: "`get_state` request", source: Status { code: OutOfRange, message: "Error, message length too large: found 5710040 bytes, the limit is: 4194304 bytes", metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Mon, 11 Sep 2023 14:58:11 GMT"} }, source: None } } }

@gligneul
Copy link

@GCdePaula I tested it with examples, and it worked!

gligneul
gligneul previously approved these changes Sep 11, 2023
@@ -15,12 +15,17 @@ pub struct SCEnvCLIConfig {
/// Default confirmations
#[arg(long, env)]
pub sc_default_confirmations: Option<usize>,

/// Maximum size of a decoded message
#[arg(long, env, default_value_t = 4 * 1024 * 1024)]
Copy link

@gligneul gligneul Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GCdePaula I thought again, and it might be better to set the default to 100 MB so we can avoid configuring these manually for the time being.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I broke the node with an input of 500Kb; with Guilherme's estimation, it is just ~$100. cartesi/rollups-contracts#77

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@GCdePaula GCdePaula merged commit 9ae672a into main Sep 11, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants