From d832d7210dad8fbf0c39f1af80704e70b99cba31 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 24 Jan 2023 14:26:25 -0800 Subject: [PATCH 1/2] Fetch transactions below first inscription height --- src/index/updater.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index/updater.rs b/src/index/updater.rs index 4c202b2fe3..32640d5266 100644 --- a/src/index/updater.rs +++ b/src/index/updater.rs @@ -168,7 +168,8 @@ impl Updater { let client = Client::new(&index.rpc_url, index.auth.clone()).context("failed to connect to RPC URL")?; - let first_inscription_height = index.first_inscription_height; + // NB: We temporarily always fetch transactions, to avoid expensive cache misses. + let first_inscription_height = index.first_inscription_height.min(0); thread::spawn(move || loop { if let Some(height_limit) = height_limit { From 9e3a7a320c9f74f9bd69e4533952a5e5ed7f7f14 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 24 Jan 2023 14:31:42 -0800 Subject: [PATCH 2/2] Delete test --- src/index.rs | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/src/index.rs b/src/index.rs index 13b5eb9b4a..537377dbf6 100644 --- a/src/index.rs +++ b/src/index.rs @@ -911,58 +911,6 @@ mod tests { } } - #[test] - fn inscriptions_below_first_inscription_height_are_skipped() { - let inscription = inscription("text/plain", "hello"); - let template = TransactionTemplate { - inputs: &[(1, 0, 0)], - witness: inscription.to_witness(), - ..Default::default() - }; - - { - let context = Context::builder().build(); - context.mine_blocks(1); - let txid = context.rpc_server.broadcast_tx(template.clone()); - let inscription_id = InscriptionId::from(txid); - context.mine_blocks(1); - - assert_eq!( - context.index.get_inscription_by_id(inscription_id).unwrap(), - Some(inscription) - ); - - assert_eq!( - context - .index - .get_inscription_satpoint_by_id(inscription_id) - .unwrap(), - Some(SatPoint { - outpoint: OutPoint { txid, vout: 0 }, - offset: 0, - }) - ); - } - - { - let context = Context::builder() - .arg("--first-inscription-height=3") - .build(); - context.mine_blocks(1); - let txid = context.rpc_server.broadcast_tx(template); - let inscription_id = InscriptionId::from(txid); - context.mine_blocks(1); - - assert_eq!( - context - .index - .get_inscription_satpoint_by_id(inscription_id) - .unwrap(), - None, - ); - } - } - #[test] fn list_first_coinbase_transaction() { let context = Context::builder().arg("--index-sats").build();