{"record":{"id":"4fa009bde96ef821","repo":"nautechsystems/nautilus_trader","slug":"persisted-intent-chain-id-does-not-match-config","errorCode":null,"errorMessage":"Persisted intent chain ID {} does not match configured chain ID {}","messagePattern":"Persisted intent chain ID (.+?) does not match configured chain ID (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/transaction.rs","lineNumber":263,"sourceCode":"    anyhow::ensure!(\n        tx.hash == intent.hash,\n        \"Persisted transaction hash {} does not match signed transaction hash {}\",\n        intent.hash,\n        tx.hash\n    );\n    anyhow::ensure!(\n        intent.durable_signer == intent.signer,\n        \"Persisted transaction signer {} does not match configured wallet {}\",\n        intent.durable_signer,\n        intent.signer\n    );\n    anyhow::ensure!(\n        tx.signer == intent.signer,\n        \"Signed transaction signer {} does not match configured wallet {}\",\n        tx.signer,\n        intent.signer\n    );\n    anyhow::ensure!(\n        intent.intent_chain_id == intent.chain_id,\n        \"Persisted intent chain ID {} does not match configured chain ID {}\",\n        intent.intent_chain_id,\n        intent.chain_id\n    );\n    anyhow::ensure!(\n        intent.row_chain_id == intent.chain_id,\n        \"Persisted transaction row chain ID {} does not match configured chain ID {}\",\n        intent.row_chain_id,\n        intent.chain_id\n    );\n\n    anyhow::ensure!(\n        tx.chain_id == u64::from(intent.chain_id),\n        \"Signed transaction chain ID {} does not match configured chain ID {}\",\n        tx.chain_id,\n        intent.chain_id\n    );","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/transaction.rs#L245-L281","documentation":"`validate_signed_transaction` checks that the chain ID persisted inside the intent (`intent_chain_id`) equals the chain ID the wallet/adapter was configured for (`intent.chain_id`). The library throws this when the durable intent was recorded for a different network than the one the adapter currently targets, preventing transactions intended for one chain from being replayed on another.","triggerScenarios":"Calling `authenticate_payload_identity_with_signer` / `validate_signed_transaction` with an intent where `intent.intent_chain_id != intent.chain_id`. This is a pre-signature check on the persisted intent itself — no transaction bytes need to be malformed.","commonSituations":"Pointing the adapter at a different network (e.g. mainnet vs Sepolia vs an L2 like Arbitrum) after intents were persisted against the old chain; a config/env change of the chain ID while old database rows remain; copying database state between environments with different chain configurations.","solutions":["Align the adapter's configured chain_id with the chain the intents were persisted for, or vice versa","Re-create the intents under the current chain configuration (do not hand-edit persisted rows)","Check the chain ID in your config/env (RPC endpoint and chain_id setting must agree) before processing persisted transactions","If rows were copied from another environment, purge or migrate them explicitly rather than replaying"],"exampleFix":"// before (config drifted from persisted intent)\n// config: chain_id = 42161 (Arbitrum), row: intent_chain_id = 1 (mainnet)\nvalidate_signed_transaction(&raw, &intent)?; // ensure! fails\n// after: run the adapter against the chain the intent was created for\n// config: chain_id = 1, row: intent_chain_id = 1\nvalidate_signed_transaction(&raw, &intent)?;","handlingStrategy":"validation","validationCode":"if intent.intent_chain_id != intent.chain_id {\n    return Err(anyhow::anyhow!(\n        \"intent chain {} != configured chain {}\",\n        intent.intent_chain_id, intent.chain_id\n    ));\n}","typeGuard":"fn intent_targets_configured_chain(intent: &SignedTransactionIntent) -> bool {\n    intent.intent_chain_id == intent.chain_id\n}","tryCatchPattern":"match authenticate_payload_identity_with_signer(&raw, &intent) {\n    Ok(()) => { /* proceed */ }\n    Err(e) if e.to_string().contains(\"Persisted intent chain ID\") => {\n        // chain config drifted: halt replay and re-create intents for the current chain\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Stamp intents with the chain ID from a single authoritative config source","Fail fast at startup if the RPC endpoint's chain_id differs from the configured chain_id","Purge or explicitly migrate intents when switching networks; never replay rows across chains","Tag persisted rows with environment/chain metadata and verify on load"],"tags":["blockchain","chain-id","configuration","transaction-signing"],"backgroundTag":"invalid-config-value","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"}