Library QedkConcrete.nativeinputs
Native transaction representations
From Stdlib Require Import List ZArith Lia.
Require Import RocqOfOCaml.RocqOfOCaml MonadVM.Chain.Ethereum
QedkConcrete.wordrange.
Local Open Scope Z_scope.
Import ListNotations.
Require Import RocqOfOCaml.RocqOfOCaml MonadVM.Chain.Ethereum
QedkConcrete.wordrange.
Local Open Scope Z_scope.
Import ListNotations.
Numeric and byte widths of the header fields used by the VM.
Definition headerWords (header : Chain.Ethereum.Block.Header.t) : Prop :=
wordRange (Support.UintN.to_z (Chain.Ethereum.Block.Header.t.base_fee_per_gas header)) ∧
Forall (fun n ⇒ 0 ≤ n < 2^64)
[Support.UintN.to_z (Chain.Ethereum.Block.Header.t.number header);
Chain.Ethereum.Block.Header.t.timestamp header;
Support.UintN.to_z (Chain.Ethereum.Block.Header.t.gas_limit header)] ∧
OCamlString.length (Chain.Ethereum.Block.Header.t.prev_randao header) ≤ 32.
wordRange (Support.UintN.to_z (Chain.Ethereum.Block.Header.t.base_fee_per_gas header)) ∧
Forall (fun n ⇒ 0 ≤ n < 2^64)
[Support.UintN.to_z (Chain.Ethereum.Block.Header.t.number header);
Chain.Ethereum.Block.Header.t.timestamp header;
Support.UintN.to_z (Chain.Ethereum.Block.Header.t.gas_limit header)] ∧
OCamlString.length (Chain.Ethereum.Block.Header.t.prev_randao header) ≤ 32.
tx is a decoded transaction. Its value is an unsigned 256-bit amount
and its calldata/initcode is representable by a native OCaml string.
This input-domain correction was approved on 2026-11-01.
Definition transactionValueAndDataBounds (tx : Chain.Ethereum.Transaction.t) : Prop :=
wordRange (Chain.Ethereum.Transaction.value tx) ∧
OCamlString.length (Chain.Ethereum.Transaction.data tx) ≤ 2^57 - 9.
Lemma transaction_data_counter_bound tx :
transactionValueAndDataBounds tx →
OCamlString.length (Chain.Ethereum.Transaction.data tx) < 2^60.
Proof. intros [_ Hlength]. lia. Qed.
wordRange (Chain.Ethereum.Transaction.value tx) ∧
OCamlString.length (Chain.Ethereum.Transaction.data tx) ≤ 2^57 - 9.
Lemma transaction_data_counter_bound tx :
transactionValueAndDataBounds tx →
OCamlString.length (Chain.Ethereum.Transaction.data tx) < 2^60.
Proof. intros [_ Hlength]. lia. Qed.