{"record":{"id":"cdba5c29ef13c696","repo":"nautechsystems/nautilus_trader","slug":"missing-data-in-setfeeprotocol-event-log-cdba5c","errorCode":null,"errorMessage":"Missing data in SetFeeProtocol event log","messagePattern":"Missing data in SetFeeProtocol event log","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/fee_protocol_update.rs","lineNumber":98,"sourceCode":"            log.address\n                .clone()\n                .expect(\"Contract address should be set in logs\")\n                .as_ref(),\n        );\n        let pool_identifier = PoolIdentifier::Address(Ustr::from(&pool_address.to_string()));\n\n        Ok(FeeProtocolUpdateEvent::new(\n            dex,\n            pool_identifier,\n            extract_block_number(log)?,\n            extract_transaction_hash(log)?,\n            extract_transaction_index(log)?,\n            extract_log_index(log)?,\n            u32::from(decoded.fee_protocol0_new),\n            u32::from(decoded.fee_protocol1_new),\n        ))\n    } else {\n        anyhow::bail!(\"Missing data in SetFeeProtocol event log\");\n    }\n}\n\n/// Parses a `SetFeeProtocol` event from an RPC log.\n///\n/// # Errors\n///\n/// Returns an error if the log parsing fails or if the event data is invalid.\npub fn parse_fee_protocol_update_event_rpc(\n    dex: SharedDex,\n    log: &RpcLog,\n) -> anyhow::Result<FeeProtocolUpdateEvent> {\n    rpc_log::validate_event_signature(\n        log,\n        FEE_PROTOCOL_UPDATE_EVENT_SIGNATURE_HASH,\n        \"SetFeeProtocol\",\n    )?;\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/fee_protocol_update.rs#L80-L116","documentation":"Thrown by parse_fee_protocol_update_event_hypersync when the hypersync log has no data field (log.data is None). A SetFeeProtocol event always carries four non-indexed parameters in data, so a dataless log cannot be a valid SetFeeProtocol event and is rejected.","triggerScenarios":"A hypersync log where the Option<data> is None reaches the else branch — e.g. the query did not request the data field, or the log matched only on topics/address.","commonSituations":"Hypersync queries constructed without selecting log.data; events that share the address but only have indexed topics; tests feeding a log fixture lacking data (test_parse_fee_protocol_update_event_hypersync).","solutions":["Ensure the hypersync query includes the data field in its log selection.","Filter logs by the SetFeeProtocol topic0 so only events that necessarily carry data are parsed.","Before calling the parser, skip logs where log.data.is_none().","Fix test fixtures to include a data field with 128 bytes of payload."],"exampleFix":"// before\nparse_fee_protocol_update_event_hypersync(dex, log)?;\n// after\nif log.data.is_none() {\n    continue; // skip dataless logs before parsing\n}\nparse_fee_protocol_update_event_hypersync(dex, log)?;","handlingStrategy":"type-guard","validationCode":"if log.data.is_none() {\n    // skip before calling the parser\n    return Ok(None);\n}","typeGuard":"fn has_data(log: &HypersyncLog) -> bool {\n    log.data.as_ref().map(|d| !d.is_empty()).unwrap_or(false)\n}","tryCatchPattern":"match parse_fee_protocol_update_event_hypersync(dex, &log) {\n    Ok(event) => handle(event),\n    Err(e) if e.to_string().contains(\"Missing data in SetFeeProtocol\") => Ok(None),\n    Err(e) => return Err(e),\n}","preventionTips":["Include data in the hypersync field selection for log queries","Filter by SetFeeProtocol topic0 — such events always carry data","Skip dataless logs at the ingestion layer before parsing","Ensure test fixtures include a data payload"],"tags":["blockchain","uniswap-v3","hypersync","missing-data"],"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"}