{"record":{"id":"f05e9e72a273f56f","repo":"nautechsystems/nautilus_trader","slug":"missing-hash","errorCode":null,"errorMessage":"Missing hash","messagePattern":"Missing hash","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/hypersync/transform.rs","lineNumber":59,"sourceCode":"    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\"))?\n                .to_string()\n                .as_str(),\n        ),\n        gas_limit,\n        gas_used,\n        UnixNanos::new(timestamp * NANOSECONDS_IN_SECOND),\n        Some(chain),\n    );","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/hypersync/transform.rs#L41-L77","documentation":"transform_hypersync_block requires the block hash to construct the internal Block, since hash is the block's unique identifier. HyperSync returns hash as an optional hex value; when it is None the transform aborts with this error rather than creating an unidentifiable Block.","triggerScenarios":"Calling pool_events_from_response where a HyperSync block in the response has hash == None — usually because the query did not project the hash field or the provider omitted it for the block.","commonSituations":"HyperSync queries with a narrowed column selection excluding hash; placeholder block records for ranges not yet indexed; manually constructed test fixtures missing the field.","solutions":["Add hash to the HyperSync query's selected block fields.","Verify the requested block range is fully indexed by HyperSync (pending blocks may lack hashes).","For synthetic/internal blocks only, synthesize a deterministic hash before transforming.","Upgrade hypersync-client if the schema no longer populates hash for your dataset version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn block_is_identifiable(b: &hypersync_client::simple_types::Block) -> bool {\n    b.hash.is_some() && b.number.is_some()\n}\n// only transform blocks passing this check","typeGuard":"fn has_hash(b: &hypersync_client::simple_types::Block) -> bool {\n    matches!(b.hash, Some(_))\n}","tryCatchPattern":"match transform_hypersync_block(chain, block) {\n    Ok(b) => process(b),\n    Err(e) if e.to_string().contains(\"Missing hash\") => {\n        tracing::warn!(block = ?block.number, \"block missing hash; skipping\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Never narrow the HyperSync field projection below hash, number, parent_hash, timestamp, miner, gas_limit, gas_used.","Check indexing completeness before processing a block range.","Deduplicate blocks by hash downstream so re-transforms are visible."],"tags":["blockchain","hypersync","missing-field","block-hash"],"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"}