nautechsystems/nautilus_trader · error
Mint event data is too short
Error message
Mint event data is too short
What it means
Thrown by parse_mint_event_hypersync when the log's data payload is shorter than the 128 bytes needed for the Mint event's four static words (amount0, amount1, amount, and the third indexed-less parameter set: actually amount0, amount1, amount, plus sender semantics vary — the struct expects four 32-byte values). It is a pre-decode length guard.
Source
Thrown at crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/mint.rs:84
}
None => anyhow::bail!("Missing tickLower in topic2 when parsing mint event"),
};
// Extract int24 tickUpper from topic3 (stored as a 32-byte padded value)
let tick_upper = match log.topics.get(3).and_then(|t| t.as_ref()) {
Some(topic) => {
let tick_upper_bytes: [u8; 32] = topic.as_ref().try_into()?;
i32::from_be_bytes(tick_upper_bytes[28..32].try_into()?)
}
None => anyhow::bail!("Missing tickUpper in topic3 when parsing mint event"),
};
if let Some(data) = &log.data {
let data_bytes = data.as_ref();
// Validate if data contains 4 parameters of 32 bytes each
if data_bytes.len() < 4 * 32 {
anyhow::bail!("Mint event data is too short");
}
// Decode the data using the MintEventData struct
let decoded = match <MintEventData as SolType>::abi_decode(data_bytes) {
Ok(decoded) => decoded,
Err(e) => anyhow::bail!("Failed to decode mint event data: {e}"),
};
let pool_address = Address::from_slice(
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(MintEvent::new(
dex,
pool_identifier,View on GitHub (pinned to 18893faf8b)
Solutions
- Include the data field in the Hypersync log selection so data_bytes is populated.
- Verify data_bytes.len() >= 128 (4 * 32) before calling the parser.
- Confirm the emitting contract is a canonical Uniswap V3 pool.
- Populate test fixtures with four 32-byte words of data.
Example fix
// before: empty data fixture
data: None
// after
let mut data = vec![0u8; 128];
U256::from(1_000_000u64).to_big_endian(&mut data[..32]); // amount0
Log { data: Some(data.into()), .. } Defensive patterns
Strategy: validation
Validate before calling
// Before calling parse_mint_event_hypersync
fn has_mint_data(log: &HypersyncLog) -> bool {
log.data.as_ref().map(|d| d.len() >= 4 * 32).unwrap_or(false)
}
if !has_mint_data(&log) { skip(&log); } Type guard
fn has_128_byte_data(log: &HypersyncLog) -> bool {
matches!(log.data, Some(ref d) if d.len() >= 128)
} Try / catch
match parse_mint_event_hypersync(log, dex) {
Ok(event) => process(event),
Err(e) if e.to_string().contains("Mint event data is too short") => {
log::debug!("mint log missing data (check hypersync field_selection): {e}");
}
Err(e) => return Err(e),
} Prevention
- Include the data field in the Hypersync log selection
- Pre-check data length >= 128 bytes before parsing
- Route only logs from canonical V3 pools to the Mint parser
- Build test fixtures with four full data words
When it happens
Trigger: A Hypersync Mint log with missing, empty, or < 128-byte data — e.g. data column not requested in the query, or a fixture with a short data blob.
Common situations: Forgetting to select log data in the Hypersync query, indexing a forked Mint event with fewer data parameters, malformed test logs.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Initialize event data is too short
- Failed to decode initialize event data: {e}
- Missing tickLower in topic2 when parsing mint event
- Missing tickUpper in topic3 when parsing mint event
- Failed to decode mint event data: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/94aef0097d1c6efc.
Report an issue: GitHub.