{"record":{"id":"289f8d8fff0ba5c1","repo":"nautechsystems/nautilus_trader","slug":"execution-payload-protection-is-not-active","errorCode":null,"errorMessage":"Execution payload protection is not active","messagePattern":"Execution payload protection is not active","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":4743,"sourceCode":"\n    /// Reserves one nonce use under the active payload key.\n    pub(crate) async fn reserve_execution_payload_seal(\n        &self,\n        keys: &PayloadKeySet,\n    ) -> anyhow::Result<()> {\n        let mut transaction = self\n            .pool\n            .begin()\n            .await\n            .context(\"failed to start payload seal reservation\")?;\n        let row = sqlx::query(\n            \"SELECT deployment_id, protocol_version, operation, active_key_id \\\n             FROM execution_payload_state WHERE component = 'signed_transactions' 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 protection is not active\"))?;\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\n        );\n        reserve_execution_payload_seal(&mut transaction, keys.active_key_id()).await?;\n        transaction\n            .commit()\n            .await\n            .context(\"failed to commit payload seal reservation\")?;\n        Ok(())\n    }\n\n    async fn execution_payload_marker(&self) -> anyhow::Result<Option<i16>> {\n        sqlx::query_scalar::<_, i16>(\n            \"SELECT version FROM execution_schema_version WHERE component = $1\",","sourceCodeStart":4725,"sourceCodeEnd":4761,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/database.rs#L4725-L4761","documentation":"reserve_execution_payload_seal consumes one seal nonce under the active payload key and requires the execution_payload_state row to exist with FOR SHARE locking. If the row is absent, payload protection was never activated (or was removed), so sealing cannot be accounted for and the call fails.","triggerScenarios":"Calling reserve_execution_payload_seal (part of the signing/sealing path) when execution_payload_state has no row for component 'signed_transactions' — i.e. protection never activated via the library's activation flow.","commonSituations":"Pointing a node at a fresh database without running payload activation; environment with Postgres execution enabled but protection bootstrap skipped; database restored without the state table contents.","solutions":["Run the payload storage activation path (require_execution_payload_storage_ready / activate_execution_payload_storage) before any signing","Verify protection is active: SELECT * FROM execution_payload_state WHERE component='signed_transactions' returns a row","Ensure the deployment uses the same database it was activated against (check DATABASE_URL / connection config)","Restore the state row from a consistent backup if it was lost"],"exampleFix":"// before\nlet lease = db.require_execution_payload_storage(&keys, policy, batch).await?;\n// after: guarantee activation first\ndb.require_execution_payload_storage_ready(&keys).await?;","handlingStrategy":"validation","validationCode":"let active: Option<i16> = sqlx::query_scalar(\n    \"SELECT version FROM execution_schema_version WHERE component = 'signed_transactions'\",\n).fetch_optional(&pool).await?;\nif active.is_none() {\n    anyhow::bail!(\"payload protection not activated; run require_execution_payload_storage_ready first\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = db.reserve_execution_payload_seal(&keys).await {\n    if e.to_string().contains(\"protection is not active\") {\n        db.require_execution_payload_storage_ready(&keys).await?; // activate then retry\n    } else { return Err(e); }\n}","preventionTips":["Call require_execution_payload_storage_ready at startup before any signing","Confirm DATABASE_URL points at the activated database in every environment","Version-check the schema marker on boot","Keep state-table rows backed up with the rest of the schema"],"tags":["database","postgres","activation"],"backgroundTag":"resource-not-found","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"}