nautechsystems/nautilus_trader · error

Missing data in SetFeeProtocol event log

Error message

Missing data in SetFeeProtocol event log

What it means

In the Hypersync parse path, `log.data` is an `Option`; if it is `None` the parser has nothing to decode and bails with this message. Hypersync logs normally carry data for SetFeeProtocol events, so a missing data field indicates the log was fetched incompletely or is not the expected event.

Source

Thrown at crates/adapters/blockchain/src/exchanges/parsing/pancakeswap_v3/fee_protocol_update.rs:94

            log.address
                .clone()
                .expect("Contract address should be set in logs")
                .as_ref(),
        );
        let pool_identifier = PoolIdentifier::Address(Ustr::from(&pool_address.to_string()));

        Ok(FeeProtocolUpdateEvent::new(
            dex,
            pool_identifier,
            extract_block_number(log)?,
            extract_transaction_hash(log)?,
            extract_transaction_index(log)?,
            extract_log_index(log)?,
            decoded.fee_protocol0_new,
            decoded.fee_protocol1_new,
        ))
    } else {
        anyhow::bail!("Missing data in SetFeeProtocol event log");
    }
}

/// Parses a PancakeSwap V3 `SetFeeProtocol` event from an RPC log.
///
/// # Errors
///
/// Returns an error if the log parsing fails or if the event data is invalid.
pub fn parse_fee_protocol_update_event_rpc(
    dex: SharedDex,
    log: &RpcLog,
) -> anyhow::Result<FeeProtocolUpdateEvent> {
    rpc_log::validate_event_signature(
        log,
        FEE_PROTOCOL_UPDATE_EVENT_SIGNATURE_HASH,
        "SetFeeProtocol",
    )?;

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Ensure the Hypersync query requests the full log object including the data field.
  2. Treat data-less logs as ignorable: match on `Some(data)` and skip `None` cases with a debug log instead of erroring if your pipeline tolerates gaps.
  3. Filter strictly on the SetFeeProtocol topic0 so only events guaranteed to carry data are parsed.
  4. Verify the emitting contract's SetFeeProtocol event actually has non-indexed parameters (non-empty data).

Example fix

// before
} else {
    anyhow::bail!("Missing data in SetFeeProtocol event log");
}
// after
} else {
    tracing::debug!("SetFeeProtocol log {} has no data; skipping", log.transaction_hash);
    return Ok(None);
}
Defensive patterns

Strategy: validation

Validate before calling

// ensure the hypersync query selects full logs (including data), then guard:
if log.data.is_none() {
    tracing::debug!("SetFeeProtocol log without data; skipping");
    return Ok(None);
}

Type guard

fn has_event_data(log: &HyperSyncLog) -> bool {
    log.data.as_ref().map(|d| !d.as_ref().is_empty()).unwrap_or(false)
}

Try / catch

match parse_fee_protocol_update_event_hypersync(dex, &log) {
    Ok(ev) => store(ev),
    Err(e) if e.to_string().contains("Missing data") => {
        tracing::debug!("log had no data; ignoring");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling `parse_fee_protocol_update_event_hypersync` with a log where `log.data == None` — e.g. a Hypersync query that omitted the data column, a log matched by a topic filter but lacking a data payload, or an anonymous/sparse event from a non-standard contract.

Common situations: A misconfigured Hypersync field selection that drops the data column; manually constructed test logs without data; replaying logs from an exporter that strips empty payloads.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/a42ca7d55fd86d44. Report an issue: GitHub.