{"record":{"id":"94228e7d2bb99716","repo":"datahaven-xyz/datahaven","slug":"invalidupdateslot","errorCode":"InvalidUpdateSlot","errorMessage":"InvalidUpdateSlot","messagePattern":"InvalidUpdateSlot","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"operator/pallets/ethereum-client/src/lib.rs","lineNumber":325,"sourceCode":"        }\n\n        pub(crate) fn process_update(update: &Update) -> DispatchResultWithPostInfo {\n            Self::verify_update(update)?;\n            Self::apply_update(update)\n        }\n\n        /// References and strictly follows <https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/light-client/sync-protocol.md#validate_light_client_update>\n        /// Verifies that provided next sync committee is valid through a series of checks\n        /// (including checking that a sync committee period isn't skipped and that the header is\n        /// signed by the current sync committee.\n        fn verify_update(update: &Update) -> DispatchResult {\n            // Verify sync committee has sufficient participants.\n            let participation =\n                decompress_sync_committee_bits(update.sync_aggregate.sync_committee_bits);\n            Self::sync_committee_participation_is_supermajority(&participation)?;\n\n            // Verify update does not skip a sync committee period.\n            ensure!(\n                update.signature_slot > update.attested_header.slot\n                    && update.attested_header.slot >= update.finalized_header.slot,\n                Error::<T>::InvalidUpdateSlot\n            );\n            // Retrieve latest finalized state.\n            let latest_finalized_state =\n                FinalizedBeaconState::<T>::get(LatestFinalizedBlockRoot::<T>::get())\n                    .ok_or(Error::<T>::NotBootstrapped)?;\n            let store_period = compute_period(latest_finalized_state.slot);\n            let signature_period = compute_period(update.signature_slot);\n            if <NextSyncCommittee<T>>::exists() {\n                ensure!(\n                    (store_period..=store_period + 1).contains(&signature_period),\n                    Error::<T>::SkippedSyncCommitteePeriod\n                )\n            } else {\n                ensure!(\n                    signature_period == store_period,","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/datahaven-xyz/datahaven/blob/edcb13dbbcd3c29489eaa2480a6f60ee4cb1f3ec/operator/pallets/ethereum-client/src/lib.rs#L307-L343","documentation":"The update's slot ordering is invalid: the signature slot must be strictly after the attested header slot, and the attested header slot must be at or after the finalized header slot. `verify_update` enforces this temporal invariant before using the update, rejecting updates that would move the light client backwards or skip sync committee periods.","triggerScenarios":"Submitting an `Update` where `update.signature_slot <= update.attested_header.slot` or `update.attested_header.slot < update.finalized_header.slot` — e.g. a hand-crafted update or one assembled from mixed snapshots.","commonSituations":"Relayer built an update from a beacon node that returned an older attested header than the finalized checkpoint; custom aggregation code used the wrong slot for the sync aggregate; replaying an out-of-order update after a fresher one.","solutions":["Fetch a fresh, well-formed update from a consensus client (`/eth/v1/beacon/light_client/updates`) rather than assembling it manually.","Ensure attested_header slot >= finalized_header slot and signature_slot > attested_header slot before submitting.","Discard updates older than the client's latest finalized state — they are also rejected as irrelevant.","Check the relayer for clock/ordering bugs when batching updates."],"exampleFix":"// before\n submit_update(attested, finalized, sig_slot); // sig_slot computed from latest block\n// after\n assert!(sig_slot > attested.slot && attested.slot >= finalized.slot);\n submit_update(attested, finalized, sig_slot);","handlingStrategy":"validation","validationCode":"if (!(update.signatureSlot > update.attestedHeader.slot && update.attestedHeader.slot >= update.finalizedHeader.slot)) throw new Error('InvalidUpdateSlot');","typeGuard":null,"tryCatchPattern":"try { await submit(update); } catch (e) { if (e.includes('InvalidUpdateSlot')) { dropUpdate(update); } else throw e; }","preventionTips":["Use standard light-client update endpoints instead of hand-assembling","Assert slot ordering before submission","Never reorder or edit fields of fetched updates"],"tags":["substrate","beacon-consensus","slot-ordering","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"edcb13dbbcd3c29489eaa2480a6f60ee4cb1f3ec","analyzedAt":"2026-09-13T19:19:32.206Z","contentChangedAt":"2026-09-13T19:19:32.206Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}