revm_interpreter/interpreter/
runtime_flags.rs

1use primitives::hardfork::SpecId;
2
3use super::RuntimeFlag;
4#[cfg(feature = "serde")]
5use serde::{Deserialize, Serialize};
6
7/// Runtime flags that control interpreter execution behavior.
8#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
9#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10pub struct RuntimeFlags {
11    /// Whether the current execution context is static (read-only).
12    pub is_static: bool,
13    /// The current EVM specification ID.
14    pub spec_id: SpecId,
15}
16
17impl RuntimeFlag for RuntimeFlags {
18    fn is_static(&self) -> bool {
19        self.is_static
20    }
21
22    fn spec_id(&self) -> SpecId {
23        self.spec_id
24    }
25}