{"record":{"id":"947964bd2b0b3ee6","repo":"nautechsystems/nautilus_trader","slug":"invalid-config-type-for-blockchainexecutionclientf","errorCode":null,"errorMessage":"Invalid config type for BlockchainExecutionClientFactory. Expected `BlockchainExecutionClientConfig`, was {config:?}","messagePattern":"Invalid config type for BlockchainExecutionClientFactory\\. Expected `BlockchainExecutionClientConfig`, was (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/factories.rs","lineNumber":139,"sourceCode":"impl Default for BlockchainExecutionClientFactory {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\nimpl ExecutionClientFactory for BlockchainExecutionClientFactory {\n    fn create(\n        &self,\n        trader_id: TraderId,\n        name: &str,\n        config: &dyn ClientConfig,\n        cache: CacheView,\n    ) -> anyhow::Result<Box<dyn ExecutionClient>> {\n        let blockchain_execution_config = config\n            .as_any()\n            .downcast_ref::<BlockchainExecutionClientConfig>()\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"Invalid config type for BlockchainExecutionClientFactory. Expected `BlockchainExecutionClientConfig`, was {config:?}\"\n                )\n            })?;\n\n        let core_execution_client = ExecutionClientCore::new(\n            trader_id,\n            ClientId::from(name),\n            *BLOCKCHAIN_VENUE,\n            OmsType::Netting,\n            blockchain_execution_config.client_id,\n            AccountType::Wallet,\n            None,\n            cache,\n        );\n\n        let client = BlockchainExecutionClient::new(\n            core_execution_client,\n            blockchain_execution_config.clone(),","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/factories.rs#L121-L157","documentation":"BlockchainExecutionClientFactory.create downcasts the passed config to BlockchainExecutionClientConfig. This error fires when the supplied config object is a different type, so the downcast fails and the factory cannot build the execution client.","triggerScenarios":"Calling BlockchainExecutionClientFactory.create with a config that is not BlockchainExecutionClientConfig (e.g. a BlockchainDataClientConfig or another adapter's config).","commonSituations":"Mismatched factory/config pairing in node setup; swapped factories (data factory given the execution config or vice versa); config deserialized into the wrong concrete struct.","solutions":["Pass a BlockchainExecutionClientConfig to the execution client factory","Verify the factory-to-config pairing in the node registration code (data vs execution not swapped)","Inspect the config's concrete type via its Debug output and correct it"],"exampleFix":"// before\nlet cfg = BlockchainDataClientConfig { .. };\nexecution_factory.create(trader_id, &cfg, ...)\n// after\nlet cfg = BlockchainExecutionClientConfig { .. };\nexecution_factory.create(trader_id, &cfg, ...)","handlingStrategy":"type-guard","validationCode":"if config.as_any().downcast_ref::<BlockchainExecutionClientConfig>().is_none() {\n    panic!(\"execution client factory requires BlockchainExecutionClientConfig, got {:?}\", config);\n}","typeGuard":"fn is_execution_client_config(config: &dyn ClientConfig) -> bool {\n    config.as_any().downcast_ref::<BlockchainExecutionClientConfig>().is_some()\n}","tryCatchPattern":"let client = execution_factory.create(trader_id, &config, ...)\n    .map_err(|e| anyhow::anyhow!(\"execution client factory rejected config: {e:#}\"))?;","preventionTips":["Do not share one config struct between data and execution factories","Verify factory/config pairing whenever wiring a new node configuration","Use distinct config type names to avoid copy-paste confusion"],"tags":["factory","downcast","config","rust"],"backgroundTag":"config-type-mismatch","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}