nautechsystems/nautilus_trader · error
Missing data in flash event log
Error message
Missing data in flash event log
What it means
Thrown by parse_flash_event_hypersync when the hypersync log's data field is None. A Flash event always carries four non-indexed parameters in data, so a log without data cannot be parsed and the parser bails instead of decoding.
Source
Thrown at crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/flash.rs:102
);
let pool_identifier = PoolIdentifier::Address(Ustr::from(&pool_address.to_string()));
Ok(FlashEvent::new(
dex,
pool_identifier,
extract_block_number(log)?,
extract_transaction_hash(log)?,
extract_transaction_index(log)?,
extract_log_index(log)?,
sender,
recipient,
decoded.amount0,
decoded.amount1,
decoded.paid0,
decoded.paid1,
))
} else {
anyhow::bail!("Missing data in flash event log");
}
}
/// Parses a flash event from an RPC log.
///
/// # Errors
///
/// Returns an error if the log parsing fails or if the event data is invalid.
pub fn parse_flash_event_rpc(dex: SharedDex, log: &RpcLog) -> anyhow::Result<FlashEvent> {
rpc_log::validate_event_signature(log, FLASH_EVENT_SIGNATURE_HASH, "Flash")?;
let sender = rpc_log::extract_address_from_topic(log, 1, "sender")?;
let recipient = rpc_log::extract_address_from_topic(log, 2, "recipient")?;
let data_bytes = rpc_log::extract_data_bytes(log)?;
// Validate if data contains 4 parameters of 32 bytes each
if data_bytes.len() < 4 * 32 {View on GitHub (pinned to 18893faf8b)
Solutions
- Include the data field in the hypersync log query selection.
- Filter by the Flash topic0 so only events that must carry data are parsed.
- Skip logs with log.data.is_none() before invoking the parser.
- Update fixtures to include 128 bytes of data.
Example fix
// before
parse_flash_event_hypersync(dex, log)?;
// after
if log.data.is_none() {
continue; // skip dataless logs
}
parse_flash_event_hypersync(dex, log)?; Defensive patterns
Strategy: type-guard
Validate before calling
if log.data.is_none() {
return Ok(None); // skip dataless logs
} Type guard
fn has_data(log: &HypersyncLog) -> bool {
log.data.as_ref().map(|d| !d.is_empty()).unwrap_or(false)
} Try / catch
match parse_flash_event_hypersync(dex, &log) {
Ok(event) => handle(event),
Err(e) if e.to_string().contains("Missing data in flash event log") => Ok(None),
Err(e) => return Err(e),
} Prevention
- Request the data field in every hypersync log query
- Filter by the Flash topic0 — Flash events always carry data
- Drop dataless logs at ingestion before parsing
- Include data payloads in test fixtures
When it happens
Trigger: log.data is None when the parser reaches the else branch — the hypersync query omitted the data field, or the log matched only on address/topics.
Common situations: Hypersync query field selection missing log.data; events from the same pool address that are not Flash; fixtures without data in test_parse_flash_event_hypersync.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Missing data in SetFeeProtocol event log
- Missing tickLower in topic2 when parsing burn event
- Missing data in CollectProtocol event log
- SetFeeProtocol event data is too short
- Failed to decode SetFeeProtocol event data: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/16f86b886749120e.
Report an issue: GitHub.