linera-io/linera-protocol · error

invalid block export configuration

Error message

invalid block export configuration

What it means

ServerContext builds its BlockExportConfig from the --block-export-* CLI options and immediately calls config.check().expect("invalid block export configuration"). check() enforces: certificate_upload_batch_size > 0, queue_size > 0, queue_bytes > 0, max_in_flight_per_destination > 0, max_in_flight_total >= max_in_flight_per_destination, max_catch_up_blocks > 0, idle_catch_up_interval > 0, retry_delay > 0, max_retry_delay > 0, and retry_delay <= max_retry_delay (linera-core/src/chain_worker/export.rs:241). Violating any constraint panics at startup.

Source

Thrown at linera-service/src/server.rs:859

                cross_chain_message_chunk_limit,
                cross_chain_batch_size_limit,
                allow_revert_confirm,
                reset_on_corrupted_chain_state_mins,
                recovery_whitelist: recovery_whitelist.map(HashSet::from_iter),
                block_export_config: export_blocks_to_committee.then(|| {
                    let config = BlockExportConfig {
                        certificate_upload_batch_size: block_export_batch_size,
                        queue_size: block_export_queue_size,
                        queue_bytes: block_export_queue_bytes,
                        max_in_flight_per_destination: block_export_max_in_flight,
                        max_in_flight_total: block_export_max_in_flight_total,
                        max_catch_up_blocks: block_export_max_catch_up_blocks,
                        idle_catch_up_interval: block_export_idle_interval,
                        retry_delay: block_export_retry_delay,
                        max_retry_delay: block_export_max_retry_delay,
                        converged_chain_retention: block_export_converged_retention,
                    };
                    config.check().expect("invalid block export configuration");
                    config
                }),
                block_export_transport,
                block_export_node_options: NodeOptions {
                    send_timeout: block_export_send_timeout,
                    recv_timeout: block_export_recv_timeout,
                    ..NodeOptions::default()
                },
                #[cfg(with_metrics)]
                enable_memory_profiling,
            };
            let wasm_runtime = wasm_runtime.with_wasm_default();
            let store_config = storage_config
                .add_common_storage_options(&common_storage_options)
                .unwrap();
            // Validators should not output contract logs.
            let allow_application_logs = false;
            let cache_sizes = common_storage_options.storage_cache_config();

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Set every --block-export-* numeric/duration option strictly positive (e.g. retry-delay 1s, max-retry-delay 60s)
  2. Ensure max-in-flight-total is at least max-in-flight-per-destination
  3. Ensure retry-delay does not exceed max-retry-delay
  4. Drop the tuning flags entirely to use built-in defaults rather than zeroing them

Example fix

# before (two violations: zero retry delay; total < per-destination)
linera server run ... \
  --block-export-retry-delay 0ms \
  --block-export-max-in-flight-per-destination 16 \
  --block-export-max-in-flight-total 8

# after
linera server run ... \
  --block-export-retry-delay 1s \
  --block-export-max-retry-delay 60s \
  --block-export-max-in-flight-per-destination 16 \
  --block-export-max-in-flight-total 64
Defensive patterns

Strategy: validation

Validate before calling

# Encode check()'s constraints in your launch script.
validate_block_export() {
  [ "$BATCH" -gt 0 ] && [ "$QUEUE_SIZE" -gt 0 ] && [ "$QUEUE_BYTES" -gt 0 ] \
    && [ "$PER_DEST" -gt 0 ] && [ "$TOTAL" -ge "$PER_DEST" ] \
    && [ "$CATCH_UP" -gt 0 ] || { echo 'block export config violates constraints' >&2; exit 1; }
}

Prevention

When it happens

Trigger: Running `linera server run` with block-export options set to zero (e.g. --block-export-retry-delay 0ms to 'retry fast'), or with --block-export-max-in-flight-total smaller than --block-export-max-in-flight-per-destination, or a retry delay exceeding the max retry delay.

Common situations: Tuning scripts that default unset numeric knobs to 0; operators zeroing delays to speed up local/test clusters; copying per-destination limits to the total budget without scaling; passing durations without units so parsing yields unexpected values.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/b3b3b24533c09d7f. Report an issue: GitHub.