pub struct FrameTransaction {
pub chain_id: u64,
pub nonce: u64,
pub sender: Address,
pub frames: Vec<Frame>,
pub signatures: Vec<FrameSignature>,
pub max_priority_fee_per_gas: u64,
pub max_fee_per_gas: u64,
pub max_fee_per_blob_gas: U256,
pub blob_versioned_hashes: Vec<H256>,
pub inner_hash: OnceCell<H256>,
pub cached_canonical: OnceCell<Vec<u8>>,
}Expand description
EIP-8141 Frame Transaction A transaction whose validity and gas payment are defined abstractly via frames. No ECDSA signature — sender is explicit. Authentication happens via APPROVE opcode.
Fields§
§chain_id: u64§nonce: u64§sender: Address§frames: Vec<Frame>§signatures: Vec<FrameSignature>EIP-8141 outer signature list (spec commit fe0940cae2). Validated before any frame executes; referenced by VERIFY frames and SIGPARAM.
max_priority_fee_per_gas: u64§max_fee_per_gas: u64§max_fee_per_blob_gas: U256§blob_versioned_hashes: Vec<H256>§inner_hash: OnceCell<H256>§cached_canonical: OnceCell<Vec<u8>>Implementations§
Source§impl FrameTransaction
impl FrameTransaction
Sourcepub fn compute_sig_hash(&self) -> H256
pub fn compute_sig_hash(&self) -> H256
Canonical signature hash (EIP-8141, spec commit fe0940cae2): the raw
signature bytes of every signature with empty msg are elided (a
signature over this hash cannot commit to its own bytes). Frame data is
NO LONGER elided — it is fully covered. Signatures with an explicit
32-byte msg keep their bytes (they sign that digest, not this hash).
Sourcepub fn signature_verification_cost(&self) -> u64
pub fn signature_verification_cost(&self) -> u64
Per EIP-8141 (spec commit fe0940cae2): 2800 gas per SECP256K1 signature, 6700 per P256. Unknown schemes are rejected by static validation, so they are treated as 0 here (validation runs first).
Sourcepub fn total_gas_limit(&self) -> u64
pub fn total_gas_limit(&self) -> u64
Compute total gas limit: intrinsic + calldata cost (frames + signatures)
- signature verification cost + sum of frame gas limits.
Sourcepub fn expiry_deadline(&self) -> Option<u64>
pub fn expiry_deadline(&self) -> Option<u64>
The expiry deadline (8-byte big-endian) of this transaction’s expiry verifier frame, if one exists with well-formed data.
Sourcepub fn validate_static_constraints(&self) -> Result<(), String>
pub fn validate_static_constraints(&self) -> Result<(), String>
Validate static constraints per EIP-8141 spec. Returns an error string if the transaction is invalid.
Sourcepub fn validation_prefix(
&self,
) -> Result<ValidationPrefix, FrameValidationError>
pub fn validation_prefix( &self, ) -> Result<ValidationPrefix, FrameValidationError>
Identify and return the validation prefix of this frame transaction.
The validation prefix is the minimal leading subsequence of frames (ignoring expiry-verifier frames) that establishes who pays for the transaction. Four shapes are recognized (per EIP-8141 §Mempool):
SelfVerify: one VERIFY frame targetingtx.senderwith scopeAPPROVE_EXECUTION_AND_PAYMENT.DeploySelfVerify: one DEFAULT frame (deploy) then one VERIFY frame as above.OnlyVerifyPay: one VERIFY frame (only_verify, scopeAPPROVE_EXECUTION) + one VERIFY frame (pay, scopeAPPROVE_PAYMENT).DeployOnlyVerifyPay: DEFAULT deploy frame + OnlyVerifyPay pair.
Expiry-verifier frames (see Frame::is_expiry_verifier) are transparent; they
are skipped during shape matching but their indices are NOT included in
frame_indices (which holds only the semantically meaningful prefix frames).
Sourcepub fn validate_prefix_structure(
&self,
prefix: &ValidationPrefix,
) -> Result<(), FrameValidationError>
pub fn validate_prefix_structure( &self, prefix: &ValidationPrefix, ) -> Result<(), FrameValidationError>
Validate structural rules for the identified validation prefix.
Checks:
- Deploy frame (if any) is at index 0 and uses DEFAULT execution mode.
- At most one deploy frame exists in the prefix.
- self_verify / only_verify / pay frames use VERIFY execution mode.
- Resolved target of each VERIFY frame matches
tx.sender(target == None means sender; a non-None target must equal sender). - Scope restriction matches the frame’s role:
self_verify →
APPROVE_EXECUTION_AND_PAYMENT, only_verify →APPROVE_EXECUTION, pay →APPROVE_PAYMENT. - No frame in the prefix has the atomic-batch flag set.
- Total gas budget: Σ(prefix frame gas_limits) + signature_verification_cost() ≤ MAX_VERIFY_GAS.
Trait Implementations§
Source§impl Archive for FrameTransactionwhere
u64: Archive,
H160Wrapper: ArchiveWith<Address>,
Vec<Frame>: Archive,
Vec<FrameSignature>: Archive,
U256Wrapper: ArchiveWith<U256>,
Map<H256Wrapper>: ArchiveWith<Vec<H256>>,
Skip: ArchiveWith<OnceCell<H256>> + ArchiveWith<OnceCell<Vec<u8>>>,
impl Archive for FrameTransactionwhere
u64: Archive,
H160Wrapper: ArchiveWith<Address>,
Vec<Frame>: Archive,
Vec<FrameSignature>: Archive,
U256Wrapper: ArchiveWith<U256>,
Map<H256Wrapper>: ArchiveWith<Vec<H256>>,
Skip: ArchiveWith<OnceCell<H256>> + ArchiveWith<OnceCell<Vec<u8>>>,
Source§type Archived = ArchivedFrameTransaction
type Archived = ArchivedFrameTransaction
Source§type Resolver = FrameTransactionResolver
type Resolver = FrameTransactionResolver
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize. Read moreSource§impl Clone for FrameTransaction
impl Clone for FrameTransaction
Source§fn clone(&self) -> FrameTransaction
fn clone(&self) -> FrameTransaction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FrameTransaction
impl Debug for FrameTransaction
Source§impl Default for FrameTransaction
impl Default for FrameTransaction
Source§fn default() -> FrameTransaction
fn default() -> FrameTransaction
Source§impl<__D: Fallible + ?Sized> Deserialize<FrameTransaction, __D> for Archived<FrameTransaction>where
u64: Archive,
<u64 as Archive>::Archived: Deserialize<u64, __D>,
H160Wrapper: ArchiveWith<Address> + DeserializeWith<<H160Wrapper as ArchiveWith<Address>>::Archived, Address, __D>,
Vec<Frame>: Archive,
<Vec<Frame> as Archive>::Archived: Deserialize<Vec<Frame>, __D>,
Vec<FrameSignature>: Archive,
<Vec<FrameSignature> as Archive>::Archived: Deserialize<Vec<FrameSignature>, __D>,
U256Wrapper: ArchiveWith<U256> + DeserializeWith<<U256Wrapper as ArchiveWith<U256>>::Archived, U256, __D>,
Map<H256Wrapper>: ArchiveWith<Vec<H256>> + DeserializeWith<<Map<H256Wrapper> as ArchiveWith<Vec<H256>>>::Archived, Vec<H256>, __D>,
Skip: ArchiveWith<OnceCell<H256>> + DeserializeWith<<Skip as ArchiveWith<OnceCell<H256>>>::Archived, OnceCell<H256>, __D> + ArchiveWith<OnceCell<Vec<u8>>> + DeserializeWith<<Skip as ArchiveWith<OnceCell<Vec<u8>>>>::Archived, OnceCell<Vec<u8>>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<FrameTransaction, __D> for Archived<FrameTransaction>where
u64: Archive,
<u64 as Archive>::Archived: Deserialize<u64, __D>,
H160Wrapper: ArchiveWith<Address> + DeserializeWith<<H160Wrapper as ArchiveWith<Address>>::Archived, Address, __D>,
Vec<Frame>: Archive,
<Vec<Frame> as Archive>::Archived: Deserialize<Vec<Frame>, __D>,
Vec<FrameSignature>: Archive,
<Vec<FrameSignature> as Archive>::Archived: Deserialize<Vec<FrameSignature>, __D>,
U256Wrapper: ArchiveWith<U256> + DeserializeWith<<U256Wrapper as ArchiveWith<U256>>::Archived, U256, __D>,
Map<H256Wrapper>: ArchiveWith<Vec<H256>> + DeserializeWith<<Map<H256Wrapper> as ArchiveWith<Vec<H256>>>::Archived, Vec<H256>, __D>,
Skip: ArchiveWith<OnceCell<H256>> + DeserializeWith<<Skip as ArchiveWith<OnceCell<H256>>>::Archived, OnceCell<H256>, __D> + ArchiveWith<OnceCell<Vec<u8>>> + DeserializeWith<<Skip as ArchiveWith<OnceCell<Vec<u8>>>>::Archived, OnceCell<Vec<u8>>, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<FrameTransaction, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<FrameTransaction, <__D as Fallible>::Error>
impl Eq for FrameTransaction
Source§impl From<FrameTransaction> for GenericTransaction
impl From<FrameTransaction> for GenericTransaction
Source§fn from(value: FrameTransaction) -> Self
fn from(value: FrameTransaction) -> Self
Source§impl PartialEq for FrameTransaction
impl PartialEq for FrameTransaction
Source§impl PayloadRLPEncode for FrameTransaction
impl PayloadRLPEncode for FrameTransaction
fn encode_payload(&self, buf: &mut dyn BufMut)
fn encode_payload_to_vec(&self) -> Vec<u8> ⓘ
Source§impl RLPDecode for FrameTransaction
impl RLPDecode for FrameTransaction
fn decode_unfinished( rlp: &[u8], ) -> Result<(FrameTransaction, &[u8]), RLPDecodeError>
fn decode(rlp: &[u8]) -> Result<Self, RLPDecodeError>
Source§impl RLPEncode for FrameTransaction
impl RLPEncode for FrameTransaction
Source§impl Serialize for FrameTransaction
impl Serialize for FrameTransaction
Source§impl<__S: Fallible + ?Sized> Serialize<__S> for FrameTransactionwhere
u64: Serialize<__S>,
H160Wrapper: SerializeWith<Address, __S>,
Vec<Frame>: Serialize<__S>,
Vec<FrameSignature>: Serialize<__S>,
U256Wrapper: SerializeWith<U256, __S>,
Map<H256Wrapper>: SerializeWith<Vec<H256>, __S>,
Skip: SerializeWith<OnceCell<H256>, __S> + SerializeWith<OnceCell<Vec<u8>>, __S>,
impl<__S: Fallible + ?Sized> Serialize<__S> for FrameTransactionwhere
u64: Serialize<__S>,
H160Wrapper: SerializeWith<Address, __S>,
Vec<Frame>: Serialize<__S>,
Vec<FrameSignature>: Serialize<__S>,
U256Wrapper: SerializeWith<U256, __S>,
Map<H256Wrapper>: SerializeWith<Vec<H256>, __S>,
Skip: SerializeWith<OnceCell<H256>, __S> + SerializeWith<OnceCell<Vec<u8>>, __S>,
impl StructuralPartialEq for FrameTransaction
Auto Trait Implementations§
impl !Freeze for FrameTransaction
impl RefUnwindSafe for FrameTransaction
impl Send for FrameTransaction
impl Sync for FrameTransaction
impl Unpin for FrameTransaction
impl UnsafeUnpin for FrameTransaction
impl UnwindSafe for FrameTransaction
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.