{"record":{"id":"c2aec9bb8a3b6a64","repo":"nautechsystems/nautilus_trader","slug":"persisted-transaction-row-chain-id-does-not-mat-c2aec9","errorCode":null,"errorMessage":"Persisted transaction row chain ID {} does not match configured chain ID {}","messagePattern":"Persisted transaction row 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":269,"sourceCode":"    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    );\n    anyhow::ensure!(\n        tx.nonce == intent.nonce,\n        \"Signed transaction nonce {} does not match persisted nonce {}\",\n        tx.nonce,\n        intent.nonce\n    );","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/transaction.rs#L251-L287","documentation":"`validate_signed_transaction` also verifies that the chain ID stored on the persisted transaction row (`intent.row_chain_id`) matches the configured chain ID. This is a third-way consistency check: the intent body, the durable row metadata, and the adapter configuration must all agree on the target network, catching partially-updated or corrupted persisted state even before touching the signed bytes.","triggerScenarios":"Calling `authenticate_payload_identity_with_signer` / `validate_signed_transaction` with an intent where `intent.row_chain_id != intent.chain_id`, i.e. the database row's chain ID column disagrees with the configured network.","commonSituations":"A partial migration or bug during intent persistence wrote the wrong chain ID into the row; rows copied from another environment/database; a schema change or backfill that left row_chain_id stale after the configured chain changed; manual DB edits.","solutions":["Inspect the failing row's chain_id column and the adapter config; determine which is authoritative","Re-persist the transaction/intent through the normal write path so row_chain_id is written from the current configuration","Fix the persistence/migration code that wrote the wrong row_chain_id, then regenerate the affected rows","Purge rows imported from a different chain environment instead of replaying them"],"exampleFix":"// before: row written with stale chain id\n// row: row_chain_id = 5 (Goerli), config: chain_id = 1\nvalidate_signed_transaction(&raw, &intent)?; // ensure! fails\n// after: re-persist the row under the current configuration\nlet row = persist_intent(&intent, configured_chain_id); // row_chain_id = 1\nvalidate_signed_transaction(&raw, &intent)?;","handlingStrategy":"validation","validationCode":"if intent.row_chain_id != intent.chain_id {\n    return Err(anyhow::anyhow!(\n        \"row chain {} != configured chain {}\",\n        intent.row_chain_id, intent.chain_id\n    ));\n}","typeGuard":"fn row_matches_configured_chain(intent: &SignedTransactionIntent) -> bool {\n    intent.row_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(\"row chain ID\") => {\n        // persisted row corruption/partial migration: quarantine and re-persist the row\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Write row_chain_id from the same code path that writes intent_chain_id so they cannot diverge","Use DB constraints or a write-side check that row_chain_id equals the configured chain","Audit migrations for columns that backfill chain metadata","Alert on any row whose stored chain ID differs from the environment's chain"],"tags":["blockchain","chain-id","database","consistency"],"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-14T00:17:10.932Z"}