{"record":{"id":"cbb5890eac6c1c43","repo":"nautechsystems/nautilus_trader","slug":"unexpected-event-signature-event-signature-for-l","errorCode":null,"errorMessage":"unexpected event signature {event_signature} for log {log:?}","messagePattern":"unexpected event signature (.+?) for log (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/data/core.rs","lineNumber":770,"sourceCode":"                            fee_protocol_collect_event.block_number\n                        )\n                    })?;\n                protocol_collect_batch.push(collect);\n            } else if flash_sig_bytes.as_ref().is_some_and(|sig| sig.as_slice() == event_sig_bytes) {\n                let parse_fn = dex_extended\n                    .parse_flash_event_hypersync_fn\n                    .context(\"missing flash event parser\")?;\n                let flash_event = parse_fn(dex_extended.dex.clone(), &log)\n                    .context(\"failed to parse flash event\")?;\n                let flash = self\n                    .process_pool_flash_event(&flash_event, &pool)\n                    .with_context(|| {\n                        format!(\"failed to process flash event at block {}\", flash_event.block_number)\n                    })?;\n                flash_batch.push(flash);\n            } else {\n                let event_signature = hex::encode(event_sig_bytes);\n                anyhow::bail!(\"unexpected event signature {event_signature} for log {log:?}\");\n            }\n\n            // Check if we've moved beyond stale data (transition point for strategy change)\n            if !beyond_stale_data\n                && last_block_across_pool_events_table\n                    .is_some_and(|table_max| block_number > table_max)\n            {\n                log::debug!(\n                    \"Crossed beyond stale data at block {block_number} - flushing current batches with ON CONFLICT, then switching to COPY\"\n                );\n\n                // Flush all batches with ON CONFLICT to handle any remaining duplicates\n                self.flush_event_batches(\n                    EVENT_BATCH_SIZE,\n                    &mut block_batch,\n                    &mut swap_batch,\n                    &mut liquidity_batch,\n                    &mut collect_batch,","sourceCodeStart":752,"sourceCodeEnd":788,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/data/core.rs#L752-L788","documentation":"While syncing pool event logs (swap/mint/burn/flash events) from HyperSync, a log's decoded event signature matched none of the registered signatures for that DEX/pool. Since the client only expects known pool event signatures, any other signature is treated as unexpected data and the sync fails with the hex signature and the offending log.","triggerScenarios":"sync_pool_events (also via bootstrap_latest_pool_profiler) encounters a log on the pool address whose topic0 is not one of the DEX's registered event signatures — e.g. a non-standard pool contract, a fork with extra events, or a newly deployed DEX version with different event hashes.","commonSituations":"Indexing a pool on a DEX fork or newer version whose event topics differ; unregistered custom pool; a DEX upgrade changing event signatures without updating the adapter; logs from unrelated contracts sharing the pool address.","solutions":["Verify the DEX type and version for this pool matches a supported implementation","Register the missing event signature for the DEX if it is a supported variant","Filter/skip unknown logs if your pool contract emits additional events","Update the adapter/library to a version supporting the new event signatures"],"exampleFix":"// before\nregister_dex(DexType::UnknownFork) // signatures don't match pool logs\n// after\nregister_dex(DexType::UniswapV3)   // correct DEX with matching event signatures","handlingStrategy":"try-catch","validationCode":"// before syncing, confirm the pool's contract emits the DEX's expected event signatures\nlet known: [[u8;32];4] = dex.event_signatures();\nif !known.contains(&log.topics()[0]) { skip_or_register(log); }","typeGuard":null,"tryCatchPattern":"match core.sync_pool_events(pool, from, to).await {\n    Err(e) if e.to_string().contains(\"unexpected event signature\") => {\n        log::warn!(\"skipping pool with unknown events: {e}\");\n    }\n    r => r?,\n}","preventionTips":["Only register DEXes/pools supported by the adapter version","After a DEX upgrade, re-verify event signature support before resync","Pin and review DEX version metadata when adding new pools"],"tags":["hypersync","events","sync","unexpected-signature"],"backgroundTag":"unexpected-api-response-shape","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"}