@@ -37,7 +37,7 @@ use linera_base::{
3737 listen_for_shutdown_signals,
3838} ;
3939use linera_client:: config:: { CommitteeConfig , ValidatorConfig , ValidatorServerConfig } ;
40- use linera_core:: { worker:: WorkerState , JoinSetExt as _} ;
40+ use linera_core:: { worker:: WorkerState , JoinSetExt as _, CHAIN_INFO_MAX_RECEIVED_LOG_ENTRIES } ;
4141use linera_execution:: { WasmRuntime , WithWasmDefault } ;
4242#[ cfg( with_metrics) ]
4343use linera_metrics:: monitoring_server;
@@ -70,6 +70,7 @@ struct ServerContext {
7070 chain_worker_ttl : Duration ,
7171 block_cache_size : usize ,
7272 execution_state_cache_size : usize ,
73+ chain_info_max_received_log_entries : usize ,
7374}
7475
7576impl ServerContext {
@@ -98,7 +99,8 @@ impl ServerContext {
9899 . with_allow_inactive_chains ( false )
99100 . with_allow_messages_from_deprecated_epochs ( false )
100101 . with_grace_period ( self . grace_period )
101- . with_chain_worker_ttl ( self . chain_worker_ttl ) ;
102+ . with_chain_worker_ttl ( self . chain_worker_ttl )
103+ . with_chain_info_max_received_log_entries ( self . chain_info_max_received_log_entries ) ;
102104 ( state, shard_id, shard. clone ( ) )
103105 }
104106
@@ -396,6 +398,15 @@ enum ServerCommand {
396398 value_parser = util:: parse_millis
397399 ) ]
398400 chain_worker_ttl : Duration ,
401+
402+ /// Maximum size for received_log entries in chain info responses. This should
403+ /// generally only be increased from the default value.
404+ #[ arg(
405+ long,
406+ default_value_t = CHAIN_INFO_MAX_RECEIVED_LOG_ENTRIES ,
407+ env = "LINERA_SERVER_CHAIN_INFO_MAX_RECEIVED_LOG_ENTRIES" ,
408+ ) ]
409+ chain_info_max_received_log_entries : usize ,
399410 } ,
400411
401412 /// Act as a trusted third-party and generate all server configurations
@@ -508,6 +519,7 @@ async fn run(options: ServerOptions) {
508519 grace_period,
509520 wasm_runtime,
510521 chain_worker_ttl,
522+ chain_info_max_received_log_entries,
511523 } => {
512524 linera_version:: VERSION_INFO . log ( ) ;
513525
@@ -523,6 +535,7 @@ async fn run(options: ServerOptions) {
523535 chain_worker_ttl,
524536 block_cache_size : options. block_cache_size ,
525537 execution_state_cache_size : options. execution_state_cache_size ,
538+ chain_info_max_received_log_entries,
526539 } ;
527540 let wasm_runtime = wasm_runtime. with_wasm_default ( ) ;
528541 let store_config = storage_config
0 commit comments