diff --git a/crates/evm/execution-types/src/chain.rs b/crates/evm/execution-types/src/chain.rs index 1146b1c654..2bdd6e145f 100644 --- a/crates/evm/execution-types/src/chain.rs +++ b/crates/evm/execution-types/src/chain.rs @@ -34,6 +34,12 @@ pub struct Chain { /// /// Additionally, it includes the individual state changes that led to the current state. execution_outcome: ExecutionOutcome, + /// Deprecated: Legacy field for backwards compatibility. + /// + /// This field is no longer populated and exists only to maintain serialization compatibility + /// with older versions. Use [`Chain::trie_updates`] instead. + #[deprecated(note = "Left to support deserialization, use `trie_updates` map instead")] + trie_updates_legacy: Option>, /// State trie updates for each block in the chain, keyed by block number. trie_updates: BTreeMap>, } @@ -43,6 +49,8 @@ impl Default for Chain { Self { blocks: Default::default(), execution_outcome: Default::default(), + #[allow(deprecated)] + trie_updates_legacy: None, trie_updates: Default::default(), } } @@ -63,7 +71,13 @@ impl Chain { blocks.into_iter().map(|b| (b.header().number(), b)).collect::>(); debug_assert!(!blocks.is_empty(), "Chain should have at least one block"); - Self { blocks, execution_outcome, trie_updates } + Self { + blocks, + execution_outcome, + #[allow(deprecated)] + trie_updates_legacy: None, + trie_updates, + } } /// Create new Chain from a single block and its state. @@ -457,6 +471,7 @@ pub(super) mod serde_bincode_compat { { blocks: RecoveredBlocks<'a, N::Block>, execution_outcome: serde_bincode_compat::ExecutionOutcome<'a, N::Receipt>, + trie_updates_legacy: Option>, trie_updates: BTreeMap>, } @@ -510,6 +525,8 @@ pub(super) mod serde_bincode_compat { Self { blocks: RecoveredBlocks(Cow::Borrowed(&value.blocks)), execution_outcome: value.execution_outcome.as_repr(), + #[allow(deprecated)] + trie_updates_legacy: None, trie_updates: value .trie_updates .iter() @@ -529,6 +546,8 @@ pub(super) mod serde_bincode_compat { Self { blocks: value.blocks.0.into_owned(), execution_outcome: ExecutionOutcome::from_repr(value.execution_outcome), + #[allow(deprecated)] + trie_updates_legacy: None, trie_updates: value .trie_updates .into_iter()