From 95bd9fc52fd1a4f7ba278dbe6cfb8e021b9ae3f8 Mon Sep 17 00:00:00 2001 From: Diana Carvalho Date: Wed, 6 Aug 2025 18:06:23 +0100 Subject: [PATCH] fix: Remove removed pairs from the persistent states At the end of decoding, we are removing components from the persistent state, however we were removing them only from the components and not the states. Took 1 hour 9 minutes --- src/evm/decoder.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/evm/decoder.rs b/src/evm/decoder.rs index baa4acf47..1f414a63a 100644 --- a/src/evm/decoder.rs +++ b/src/evm/decoder.rs @@ -2,7 +2,6 @@ use std::{ collections::{hash_map::Entry, HashMap, HashSet}, future::Future, pin::Pin, - str::FromStr, sync::Arc, }; @@ -235,19 +234,7 @@ where let removed_components: Vec<(String, ProtocolComponent)> = protocol_msg .removed_components .iter() - .flat_map(|(id, comp)| match Bytes::from_str(id) { - Ok(addr) => Some(Ok((id, addr, comp))), - Err(e) => { - if self.skip_state_decode_failures { - None - } else { - Some(Err(StreamDecodeError::Fatal(e.to_string()))) - } - } - }) - .collect::, StreamDecodeError>>()? - .into_iter() - .flat_map(|(id, _, comp)| { + .flat_map(|(id, comp)| { let tokens = comp .tokens .iter() @@ -728,6 +715,7 @@ where // Remove components from persistent state for (id, _) in removed_pairs.iter() { state_guard.components.remove(id); + state_guard.states.remove(id); } for (key, values) in contracts_map {