Skip to content
Merged
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: 3 additions & 1 deletion canister/src/rpc_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ impl GetBlockRequest {
let params = params.into();
let consensus_strategy = config.response_consensus.unwrap_or_default();
let providers = Providers::new(rpc_sources, consensus_strategy.clone(), now)?;
let max_response_bytes = Self::response_size_estimate(&params);
let max_response_bytes = config
.response_size_estimate
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we had a test for this, that explicitly configured parameters will be taken into account. We should extend this one or add a new one if there is none.

Copy link
Contributor Author

@lpahlavi lpahlavi Sep 24, 2025

Choose a reason for hiding this comment

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

@gregorydemay No, currently we don't have such a test (hence this bug going unnoticed). This also made me think there is a test missing. The tricky thing is we need to do this for each endpoint individually...

I was generally thinking of adding integration tests to ensure the response_size_estimate field in the RPC config is respected (e.g. by checking how many retries are performed in case of max_response_bytes exceeded errors), and potentially for the response_consensus field as well (e.g. by comparing the response between equality and threshold consensus strategies).

For special RPC config fields (i.e. GetSlotRpcConfig#rounding_error, GetRecentPrioritizationFeesRpcConfig#max_slot_rounding_error and GetRecentPrioritizationFeesRpcConfig#max_length), we should already have tests.

Since adding the tests is a bit of effort though, I did it in a separate PR. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Separate PR sounds good!

.unwrap_or(Self::response_size_estimate(&params));

Ok(MultiRpcRequest::new(
providers,
Expand Down