diff --git a/processor/scanner/src/db.rs b/processor/scanner/src/db.rs index 20aa2999..6630c0a3 100644 --- a/processor/scanner/src/db.rs +++ b/processor/scanner/src/db.rs @@ -72,6 +72,8 @@ impl OutputWithInInstruction { create_db!( ScannerGlobal { + QueuedKey: (key: K) -> (), + ActiveKeys: () -> Vec>, RetireAt: (key: K) -> u64, @@ -120,7 +122,10 @@ impl ScannerGlobalDb { // Set the block which has a key activate as notable NotableBlock::set(txn, activation_block_number, &()); - // TODO: Panic if we've ever seen this key before + // Check this key has never been queued before + // This should only happen if a malicious supermajority collude, and breaks indexing by the key + assert!(QueuedKey::get(txn, EncodableG(key)).is_none(), "key being queued was prior queued"); + QueuedKey::set(txn, EncodableG(key), &()); // Fetch the existing keys let mut keys: Vec>>> =