{"record":{"id":"4df1194ce0128b73","repo":"nautechsystems/nautilus_trader","slug":"missing-timestamp","errorCode":null,"errorMessage":"Missing timestamp","messagePattern":"Missing timestamp","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/hypersync/transform.rs","lineNumber":51,"sourceCode":"        .ok_or_else(|| anyhow::anyhow!(\"Missing block number\"))?;\n    let gas_limit = from_str_hex_to_u64(\n        received_block\n            .gas_limit\n            .ok_or_else(|| anyhow::anyhow!(\"Missing gas limit\"))?\n            .encode_hex()\n            .as_str(),\n    )?;\n    let gas_used = from_str_hex_to_u64(\n        received_block\n            .gas_used\n            .ok_or_else(|| anyhow::anyhow!(\"Missing gas used\"))?\n            .encode_hex()\n            .as_str(),\n    )?;\n    let timestamp = from_str_hex_to_u64(\n        received_block\n            .timestamp\n            .ok_or_else(|| anyhow::anyhow!(\"Missing timestamp\"))?\n            .encode_hex()\n            .as_str(),\n    )?;\n\n    let mut block = Block::new(\n        received_block\n            .hash\n            .ok_or_else(|| anyhow::anyhow!(\"Missing hash\"))?\n            .to_string(),\n        received_block\n            .parent_hash\n            .ok_or_else(|| anyhow::anyhow!(\"Missing parent hash\"))?\n            .to_string(),\n        number,\n        Ustr::from(\n            received_block\n                .miner\n                .ok_or_else(|| anyhow::anyhow!(\"Missing miner\"))?","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/hypersync/transform.rs#L33-L69","documentation":"transform_hypersync_block requires the block timestamp to build the Block's UnixNanos time. When HyperSync returns a block without a timestamp (None), the transform fails with this error instead of producing a Block with an unknown time. Timestamps are mandatory because downstream event aggregation and ordering depend on them.","triggerScenarios":"pool_events_from_response receiving a HyperSync block where timestamp is None — typically because the query projection omitted the timestamp field or the provider returned an incomplete block record.","commonSituations":"Building HyperSync queries with selective column lists that forgot to include timestamp; chain integrations where timestamps are absent for early-genesis or pending blocks; stale hypersync-client schema mismatches.","solutions":["Include timestamp in the HyperSync query's selected fields so every block carries it.","Confirm the block record actually has a timestamp for the target chain (e.g. skip chains without block timestamps).","If a default is acceptable, fall back to 0 or the parent block's timestamp instead of erroring.","Check that the queried block range refers to finalized blocks, not pending ones lacking timestamps."],"exampleFix":"// before\nlet timestamp = from_str_hex_to_u64(\n    received_block.timestamp.ok_or_else(|| anyhow::anyhow!(\"Missing timestamp\"))?.encode_hex().as_str(),\n)?;\n// after (defaulting when absent)\nlet timestamp = received_block\n    .timestamp\n    .map(|t| from_str_hex_to_u64(t.encode_hex().as_str()))\n    .transpose()?\n    .unwrap_or(0);","handlingStrategy":"validation","validationCode":"fn block_has_timestamp(b: &hypersync_client::simple_types::Block) -> bool {\n    b.timestamp.is_some()\n}\n// skip or backfill blocks where this returns false","typeGuard":"fn has_timestamp(b: &hypersync_client::simple_types::Block) -> bool {\n    matches!(b.timestamp, Some(_))\n}","tryCatchPattern":"match transform_hypersync_block(chain, block) {\n    Ok(b) => process(b),\n    Err(e) if e.to_string().contains(\"Missing timestamp\") => {\n        tracing::warn!(block = ?block.number, \"block missing timestamp; requerying\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Include timestamp in every HyperSync query projection.","Only process finalized blocks, which always carry timestamps on EVM chains.","Handle the genesis block explicitly rather than through the generic transform."],"tags":["blockchain","hypersync","missing-field","timestamp"],"backgroundTag":"missing-required-argument","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"}