From 2472ec7ba8937077e9c20ef2d49634b3151f565a Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Sat, 2 Sep 2023 17:18:04 -0400 Subject: [PATCH] Don't attempt parsing truncated InInstructions --- processor/src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/processor/src/main.rs b/processor/src/main.rs index e254c2fa..f364b2aa 100644 --- a/processor/src/main.rs +++ b/processor/src/main.rs @@ -685,16 +685,14 @@ async fn run(mut raw_db: D, network: N, mut let mut data = output.data(); let max_data_len = usize::try_from(MAX_DATA_LEN).unwrap(); - // TODO: Should we drop this, instead of truncating? - // A truncating message likely doesn't have value yet has increased data load and is - // corrupt vs a NOP. The former seems more likely to cause problems + // TODO: Refund if we hit one of the following continues if data.len() > max_data_len { error!( - "data in output {} exceeded MAX_DATA_LEN ({MAX_DATA_LEN}): {}. truncating", + "data in output {} exceeded MAX_DATA_LEN ({MAX_DATA_LEN}): {}. skipping", hex::encode(output.id()), data.len(), ); - data = &data[.. max_data_len]; + continue; } let Ok(shorthand) = Shorthand::decode(&mut data) else { continue };