{"record":{"id":"94aef0097d1c6efc","repo":"nautechsystems/nautilus_trader","slug":"mint-event-data-is-too-short","errorCode":null,"errorMessage":"Mint event data is too short","messagePattern":"Mint event data is too short","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/mint.rs","lineNumber":84,"sourceCode":"        }\n        None => anyhow::bail!(\"Missing tickLower in topic2 when parsing mint event\"),\n    };\n\n    // Extract int24 tickUpper from topic3 (stored as a 32-byte padded value)\n    let tick_upper = match log.topics.get(3).and_then(|t| t.as_ref()) {\n        Some(topic) => {\n            let tick_upper_bytes: [u8; 32] = topic.as_ref().try_into()?;\n            i32::from_be_bytes(tick_upper_bytes[28..32].try_into()?)\n        }\n        None => anyhow::bail!(\"Missing tickUpper in topic3 when parsing mint event\"),\n    };\n\n    if let Some(data) = &log.data {\n        let data_bytes = data.as_ref();\n\n        // Validate if data contains 4 parameters of 32 bytes each\n        if data_bytes.len() < 4 * 32 {\n            anyhow::bail!(\"Mint event data is too short\");\n        }\n\n        // Decode the data using the MintEventData struct\n        let decoded = match <MintEventData as SolType>::abi_decode(data_bytes) {\n            Ok(decoded) => decoded,\n            Err(e) => anyhow::bail!(\"Failed to decode mint event data: {e}\"),\n        };\n\n        let pool_address = Address::from_slice(\n            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        Ok(MintEvent::new(\n            dex,\n            pool_identifier,","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/parsing/uniswap_v3/mint.rs#L66-L102","documentation":"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.","triggerScenarios":"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.","commonSituations":"Forgetting to select log data in the Hypersync query, indexing a forked Mint event with fewer data parameters, malformed test logs.","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."],"exampleFix":"// before: empty data fixture\ndata: None\n// after\nlet mut data = vec![0u8; 128];\nU256::from(1_000_000u64).to_big_endian(&mut data[..32]); // amount0\nLog { data: Some(data.into()), .. }","handlingStrategy":"validation","validationCode":"// Before calling parse_mint_event_hypersync\nfn has_mint_data(log: &HypersyncLog) -> bool {\n    log.data.as_ref().map(|d| d.len() >= 4 * 32).unwrap_or(false)\n}\nif !has_mint_data(&log) { skip(&log); }","typeGuard":"fn has_128_byte_data(log: &HypersyncLog) -> bool {\n    matches!(log.data, Some(ref d) if d.len() >= 128)\n}","tryCatchPattern":"match parse_mint_event_hypersync(log, dex) {\n    Ok(event) => process(event),\n    Err(e) if e.to_string().contains(\"Mint event data is too short\") => {\n        log::debug!(\"mint log missing data (check hypersync field_selection): {e}\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["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"],"tags":["abi-decode","uniswap-v3","hypersync","events"],"backgroundTag":"schema-validation-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}