{"record":{"id":"4256b2fa3cd3bf93","repo":"nautechsystems/nautilus_trader","slug":"unsupported-execution-payload-protection-version","errorCode":null,"errorMessage":"Unsupported execution payload protection version {version}","messagePattern":"Unsupported execution payload protection version (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":4700,"sourceCode":"        keys: &PayloadKeySet,\n    ) -> anyhow::Result<ExecutionPayloadLease> {\n        let mut transaction = self\n            .pool\n            .begin()\n            .await\n            .context(\"failed to start execution payload action lease\")?;\n        let marker = sqlx::query_scalar::<_, i16>(\n            \"SELECT version FROM execution_schema_version WHERE component = $1\",\n        )\n        .bind(EXECUTION_PAYLOAD_COMPONENT)\n        .fetch_optional(&mut *transaction)\n        .await\n        .context(\"failed to read execution payload marker\")?;\n\n        let version = marker.ok_or_else(|| {\n            anyhow::anyhow!(\"Postgres execution requires protected payload storage\")\n        })?;\n        anyhow::ensure!(\n            version == EXECUTION_PAYLOAD_PROTOCOL_VERSION,\n            \"Unsupported execution payload protection version {version}\"\n        );\n        let row = sqlx::query(\n            \"SELECT deployment_id, protocol_version, operation, active_key_id \\\n             FROM execution_payload_state WHERE component = 'signed_transactions' \\\n             FOR SHARE\",\n        )\n        .fetch_optional(&mut *transaction)\n        .await\n        .context(\"failed to lock execution payload state\")?\n        .ok_or_else(|| anyhow::anyhow!(\"Execution payload marker exists without state\"))?;\n        let state = execution_payload_state_from_row(&row)?;\n        validate_execution_payload_state(&state, keys)?;\n        anyhow::ensure!(\n            state.operation == \"ready\",\n            \"Execution payload storage is in {} maintenance\",\n            state.operation","sourceCodeStart":4682,"sourceCodeEnd":4718,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/database.rs#L4682-L4718","documentation":"In `acquire_execution_payload_lease`, once the protection marker is found, its version must equal EXECUTION_PAYLOAD_PROTOCOL_VERSION. A differing stored version means the database's payload protection protocol does not match this binary's protocol, so the lease is refused to prevent incompatible reads/writes of protected signed transactions.","triggerScenarios":"Calling `acquire_execution_payload_lease` (any signing/broadcast action) when the stored version differs — typically a database upgraded by a newer release (or theoretically an older one) while this process runs a binary compiled against a different EXECUTION_PAYLOAD_PROTOCOL_VERSION.","commonSituations":"Version skew between rolling-updated nodes and a database already migrated by newer code; accidentally launching an old container image against a migrated database; separate deployments sharing one database with different protocol versions.","solutions":["Deploy a binary whose protocol version matches the stored marker (usually the newest release)","Query the stored version to confirm: SELECT version FROM execution_schema_version WHERE component = '<payload component>'","If mixed versions must run, isolate them per database — one protocol version per database","Never hand-edit the stored version to force a match; that bypasses data-compatibility protection"],"exampleFix":"// before: old node leasing against migrated DB\nlet lease = db.acquire_execution_payload_lease(&keys).await?; // error: unsupported version\n// after: match deployment to DB protocol version\nlet v: i16 = sqlx::query_scalar(\n    \"SELECT version FROM execution_schema_version WHERE component = $1\")\n    .bind(EXECUTION_PAYLOAD_COMPONENT).fetch_one(&pool).await?;\nif v != EXECUTION_PAYLOAD_PROTOCOL_VERSION { return Err(update_binary); }","handlingStrategy":"validation","validationCode":"let v: Option<i16> = sqlx::query_scalar(\n    \"SELECT version FROM execution_schema_version WHERE component = $1\")\n    .bind(EXECUTION_PAYLOAD_COMPONENT).fetch_optional(&pool).await?;\nmatch v {\n    None => return Err(anyhow::anyhow!(\"storage not activated\")),\n    Some(v) if v != EXECUTION_PAYLOAD_PROTOCOL_VERSION => {\n        return Err(anyhow::anyhow!(\"binary/DB protocol mismatch: DB={} binary={}; deploy matching node version\", v, EXECUTION_PAYLOAD_PROTOCOL_VERSION));\n    }\n    _ => {}\n}","typeGuard":"fn protocol_matches(stored: i16, supported: i16) -> bool { stored == supported }","tryCatchPattern":"match db.acquire_execution_payload_lease(&keys).await {\n    Err(e) if e.to_string().contains(\"Unsupported execution payload protection version\") => {\n        eprintln!(\"halting: deploy the node release matching the database protocol version\");\n        return Err(e);\n    }\n    other => other?,\n}","preventionTips":["Rolling upgrades: update all nodes before/with the database protocol migration","Read the stored version in deployment pre-flight and abort mismatches","Never hand-edit the stored version to bypass the check","Keep one database per protocol version during migrations"],"tags":["version-mismatch","protocol","payload-protection"],"backgroundTag":"incompatible-source-type","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"}