Library QedkConcrete.storagehost
Storage-map ordering through calls and rollback
From Stdlib Require Import ZArith.
Require Import RocqOfOCaml.RocqOfOCaml.
Require Import QedkConcrete.hoststoragewf QedkConcrete.hostframe
QedkConcrete.worldaccounts QedkConcrete.vmhostframe
QedkConcrete.reserveprecompile QedkConcrete.assemblychecked
QedkConcrete.precompilesframe QedkConcrete.contexthostinstance
QedkConcrete.stakingaccounting.
Set Default Goal Selector "!".
Module R := Reserve_balance_introspection.Make.
Section Precompile.
Context {F : R.FArgs}.
Context {UZ : Basics.Unreachable Z.t}.
Context {Uarr : Basics.Unreachable (OCamlIarray.t int)}.
Context {UN : Basics.Unreachable Support.UintN.t}.
Context {U64 : Basics.Unreachable Numeric.U64.t}.
Context {Urepr : Basics.Unreachable U.Repr.t}.
Context {U256 : Basics.Unreachable U.t}.
Context {Uaddr : Basics.Unreachable Addr.t}.
Context {Ubytes : Basics.Unreachable Byte_string.Bytes.t}.
Context {Uunit : Basics.Unreachable unit}.
Context {Ustr : Basics.Unreachable string}.
Context {Uint : Basics.Unreachable int}.
Context {Ubyte : Basics.Unreachable ascii}.
Context {Upair : Basics.Unreachable (int × int)}.
Context {U32 : Basics.Unreachable Byte_string.B32.(Byte_string.Fixed.Fixed_result.t)}.
Context {Useq : Basics.Unreachable (OCamlSeq.t (Addr.Map.key × A.t))}.
Context {Uint64 : Basics.Unreachable MonadVM.Int64.t}.
Context {Ugas : Basics.Unreachable Gas.t}.
Local Abbreviation precompile := (@R.precompile F).
Local Abbreviation introspection := (@R.introspection F).
Local Abbreviation setter := (@Reserve_balance.set_reserve_balance).
Local Abbreviation blockNumber := (fun s ⇒
Chain.Ethereum.Block.Header.t.number (Chain.Ethereum.Block.t.header (S.t.current_block s))).
Lemma reserve_precompile_preserves_storage_wf msg :
preservesCallback hostStorageWf (precompile msg).
Proof.
intros s Hwf. change (hostStorageWf (snd (precompile msg s))).
destruct (@precompile_world_effect F msg s)
as [Hsame|[value [world [Hwrite Hafter]]]].
- rewrite Hsame. exact Hwf.
- rewrite Hafter. exact (@setter_preserves_storage_wf _ _ _ _ _ Hwf Hwrite).
Qed.
End Precompile.
Section Host.
Context {F : Host.Instantiate.FArgs}.
Local Abbreviation preserves := (preservesCallback hostStorageWf).
#[local] Hint Extern 100 (Basics.Unreachable _) ⇒
(apply Opaque.legacy_witness; Opaque.opaque_inhabit 64%nat) : typeclass_instances.
Local Abbreviation HostF := (@Evmc.Instantiate.HostF S.t (@recursiveArgs F)).
Context (vm : Evmc.Vm.SIG (_fargs := Evmc.Vm.Build_FArgs
(@Evmc.Instantiate.T S.t (@recursiveArgs F)))).
Lemma staking_contract_preserves_storage_wf fb0 fb1 fb2 msg :
preserves (MonadVM.Staking.staking_contract fb0 fb1 fb2 msg).
Proof.
intros s Hwf.
exact (proj1 (proj2 (staking_contract_uframe fb0 fb1 fb2 msg s)) Hwf).
Qed.
Lemma staking_syscalls_preserves_storage_wf fb0 msg :
preserves (MonadVM.Staking.staking_syscalls fb0 msg).
Proof.
intros s Hwf.
destruct (staking_syscalls_uframe fb0 msg s) as [[_ [Hwf' _]] | [_ [Hwf' _]]].
- exact (Hwf' Hwf).
- apply Hwf'. exact (proj1 (proj2 (creditStakingAccount_fields _ s)) Hwf).
Qed.
Lemma native_preserves_storage_wf msg addr action :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
nativeDispatch vm msg addr = Some action → preserves action.
Proof.
intros Hrevision Hselected. unfold nativeDispatch, Precompiles.Make.try_precompile in Hselected.
match type of Hselected with context [@Chain.Ethereum.Address.Map.find_opt ?T addr ?entries] ⇒
destruct (@Chain.Ethereum.Address.Map.find_opt T addr entries) as [pure|] eqn:Hethereum in Hselected end.
- destruct (Evmc.Message.t.delegated msg) in Hselected; inversion Hselected; subst action;
apply storage_wf_return.
- unfold Precompiles.Make.monad_precompiles in Hselected.
change (@Precompiles.Make.Revision (@H.Precompiles_fargs
(H.Build_FArgs F.(Host.Instantiate.ChainParams) vm))).(Precompiles.Make_Revision_signature.revision)
with F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) in Hselected.
rewrite Hrevision in Hselected.
match type of Hselected with context [@Chain.Ethereum.Address.Map.find_opt ?T addr ?entries] ⇒
destruct (@Chain.Ethereum.Address.Map.find_opt T addr entries) as [native|] eqn:Hnative in Hselected end.
2: discriminate.
apply precompilesframe.find_pair_value in Hnative as [[_ ->] | [_ ->]];
match type of Hselected with context [if ?reject then _ else _] ⇒ destruct reject in Hselected end;
inversion Hselected; subst action.
+ apply storage_wf_return.
+ apply reserve_precompile_preserves_storage_wf.
+ apply storage_wf_return.
+ apply staking_contract_preserves_storage_wf.
Qed.
Local Abbreviation processCall := (@H.process_call (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm)).
Local Abbreviation processSyscall := (@H.process_syscall (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm)).
Local Abbreviation callImpl := (@H.call_impl (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm)).
Local Abbreviation hostCall := (@H.call (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm)).
Lemma process_syscall_preserves_storage_wf msg :
preserves (processSyscall msg).
Proof.
unfold H.process_syscall, H.M. cbn zeta.
match goal with |- preserves (match ?lookup with Some _ ⇒ _ | None ⇒ _ end) ⇒
destruct lookup as [endpoint|] eqn:Hfind end.
- unfold Precompiles.Make.syscall_endpoints in Hfind.
apply precompilesframe.find_singleton_value in Hfind as [_ ->].
apply staking_syscalls_preserves_storage_wf.
- apply storage_wf_return.
Qed.
Lemma process_call_preserves_storage_wf from_tx msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ code, preserves (vm.(Evmc.Vm.SIG.execute) msg code)) →
preserves (processCall from_tx msg).
Proof.
intros Hrevision Hvm. unfold H.process_call, H.M. cbn zeta.
apply storage_wf_bind.
- destruct (H.should_transfer msg); [intro; apply transfer_preserves_storage_wf|apply storage_wf_return].
- intros transfer_ok. destruct transfer_ok; [|apply storage_wf_return].
apply storage_wf_bind.
+ apply storage_wf_bind; [apply storage_wf_read|]. intro code.
destruct from_tx.
2: apply storage_wf_return.
match goal with |- context [match ?delegation with Some _ ⇒ _ | None ⇒ _ end] ⇒
destruct delegation end;
first [apply storage_wf_return|apply storage_wf_bind; [apply storage_wf_read|intro; apply storage_wf_return]].
+ intros [addr code].
match goal with |- preserves (match ?selection with Some _ ⇒ _ | None ⇒ _ end) ⇒
destruct selection as [action|] eqn:Hselected end.
× apply (native_preserves_storage_wf msg addr action Hrevision). exact Hselected.
× apply Hvm.
Qed.
Lemma call_impl_preserves_storage_wf kind msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ nested code, (0 ≤ Evmc.Message.t.gas nested < 2^63)%Z →
preservesCallback hostStorageWf (vm.(Evmc.Vm.SIG.execute) nested code)) →
(0 ≤ Evmc.Message.t.gas msg < 2^63)%Z →
preservesCallback hostStorageWf (callImpl kind msg).
Proof.
intros Hrevision Hvm Hgas s Hformat.
pose proof (fun from_tx ⇒ process_call_preserves_storage_wf from_tx msg Hrevision
(fun code ⇒ Hvm msg code Hgas)) as Hcall.
pose proof (process_syscall_preserves_storage_wf msg) as Hsyscall.
pose proof (@process_create_preserves_storage_wf (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm) (Opaque.legacy_witness 0%Z) msg Hvm Hgas) as Hcreate.
unfold H.call_impl.
Local Opaque H.process_call H.process_syscall H.process_create
Chain.Ethereum.Address.of_contract_creation Reserve_balance.dipped_into_reserve.
destruct (Evmc.Message.t.kind msg); destruct kind as [|tx|]; cbn.
all: match goal with
| |- context [Monad.Identity.Impl.op_gtgteq ?run _] ⇒
assert (Hcore : hostStorageWf (snd run)) by
(lazymatch run with ?f ?st ⇒
lazymatch f with
| context [H.process_call ?ft] ⇒ exact (Hcall ft st Hformat)
| context [H.process_syscall] ⇒ exact (Hsyscall st Hformat)
| context [H.process_create] ⇒ exact (Hcreate st Hformat)
end end);
destruct run as [result intermediate] eqn:Hrun
end.
all: destruct result as [status gasleft refund output address].
all: destruct status;
cbn; unfold Monad.Make_Monad.when_; cbn;
try exact Hcore; try exact Hformat.
all: match goal with
| |- context [Monad.Identity.Impl.op_gtgteq (Monad.Identity.Impl.op_gtgteq ?check _) _] ⇒
assert (Hcheck : snd check = intermediate) by reflexivity;
destruct check as [dipped checked]; cbn [snd] in Hcheck; subst checked
end.
all: destruct dipped; cbn; [exact Hformat|exact Hcore].
Qed.
Lemma call_preserves_storage_wf msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ nested code, (0 ≤ Evmc.Message.t.gas nested < 2^63)%Z →
preservesCallback hostStorageWf (vm.(Evmc.Vm.SIG.execute) nested code)) →
(0 ≤ Evmc.Message.t.gas msg < 2^63)%Z → preservesCallback hostStorageWf (hostCall msg).
Proof.
intros Hrevision Hvm Hgas. unfold H.call, H.M.
apply storage_wf_bind.
- match goal with |- preservesCallback hostStorageWf (if ?test then _ else _) ⇒ destruct test end.
+ unfold H.try_increment_nonce, H.M. solve_storage_wf.
+ apply storage_wf_return.
- intros noOverflow. destruct noOverflow; [|apply storage_wf_return].
apply call_impl_preserves_storage_wf; assumption.
Qed.
Lemma call_from_eoa_preserves_storage_wf tx msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ nested code, (0 ≤ Evmc.Message.t.gas nested < 2^63)%Z →
preserves (vm.(Evmc.Vm.SIG.execute) nested code)) →
(0 ≤ Evmc.Message.t.gas msg < 2^63)%Z → preserves (callImpl (H.Eoa_tx tx) msg).
Proof. apply call_impl_preserves_storage_wf. Qed.
Lemma call_from_monad_system_transaction_preserves_storage_wf msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ nested code, (0 ≤ Evmc.Message.t.gas nested < 2^63)%Z →
preserves (vm.(Evmc.Vm.SIG.execute) nested code)) →
(0 ≤ Evmc.Message.t.gas msg < 2^63)%Z → preserves (callImpl H.System_tx msg).
Proof. apply call_impl_preserves_storage_wf. Qed.
End Host.
Print Assumptions call_impl_preserves_storage_wf.
Require Import RocqOfOCaml.RocqOfOCaml.
Require Import QedkConcrete.hoststoragewf QedkConcrete.hostframe
QedkConcrete.worldaccounts QedkConcrete.vmhostframe
QedkConcrete.reserveprecompile QedkConcrete.assemblychecked
QedkConcrete.precompilesframe QedkConcrete.contexthostinstance
QedkConcrete.stakingaccounting.
Set Default Goal Selector "!".
Module R := Reserve_balance_introspection.Make.
Section Precompile.
Context {F : R.FArgs}.
Context {UZ : Basics.Unreachable Z.t}.
Context {Uarr : Basics.Unreachable (OCamlIarray.t int)}.
Context {UN : Basics.Unreachable Support.UintN.t}.
Context {U64 : Basics.Unreachable Numeric.U64.t}.
Context {Urepr : Basics.Unreachable U.Repr.t}.
Context {U256 : Basics.Unreachable U.t}.
Context {Uaddr : Basics.Unreachable Addr.t}.
Context {Ubytes : Basics.Unreachable Byte_string.Bytes.t}.
Context {Uunit : Basics.Unreachable unit}.
Context {Ustr : Basics.Unreachable string}.
Context {Uint : Basics.Unreachable int}.
Context {Ubyte : Basics.Unreachable ascii}.
Context {Upair : Basics.Unreachable (int × int)}.
Context {U32 : Basics.Unreachable Byte_string.B32.(Byte_string.Fixed.Fixed_result.t)}.
Context {Useq : Basics.Unreachable (OCamlSeq.t (Addr.Map.key × A.t))}.
Context {Uint64 : Basics.Unreachable MonadVM.Int64.t}.
Context {Ugas : Basics.Unreachable Gas.t}.
Local Abbreviation precompile := (@R.precompile F).
Local Abbreviation introspection := (@R.introspection F).
Local Abbreviation setter := (@Reserve_balance.set_reserve_balance).
Local Abbreviation blockNumber := (fun s ⇒
Chain.Ethereum.Block.Header.t.number (Chain.Ethereum.Block.t.header (S.t.current_block s))).
Lemma reserve_precompile_preserves_storage_wf msg :
preservesCallback hostStorageWf (precompile msg).
Proof.
intros s Hwf. change (hostStorageWf (snd (precompile msg s))).
destruct (@precompile_world_effect F msg s)
as [Hsame|[value [world [Hwrite Hafter]]]].
- rewrite Hsame. exact Hwf.
- rewrite Hafter. exact (@setter_preserves_storage_wf _ _ _ _ _ Hwf Hwrite).
Qed.
End Precompile.
Section Host.
Context {F : Host.Instantiate.FArgs}.
Local Abbreviation preserves := (preservesCallback hostStorageWf).
#[local] Hint Extern 100 (Basics.Unreachable _) ⇒
(apply Opaque.legacy_witness; Opaque.opaque_inhabit 64%nat) : typeclass_instances.
Local Abbreviation HostF := (@Evmc.Instantiate.HostF S.t (@recursiveArgs F)).
Context (vm : Evmc.Vm.SIG (_fargs := Evmc.Vm.Build_FArgs
(@Evmc.Instantiate.T S.t (@recursiveArgs F)))).
Lemma staking_contract_preserves_storage_wf fb0 fb1 fb2 msg :
preserves (MonadVM.Staking.staking_contract fb0 fb1 fb2 msg).
Proof.
intros s Hwf.
exact (proj1 (proj2 (staking_contract_uframe fb0 fb1 fb2 msg s)) Hwf).
Qed.
Lemma staking_syscalls_preserves_storage_wf fb0 msg :
preserves (MonadVM.Staking.staking_syscalls fb0 msg).
Proof.
intros s Hwf.
destruct (staking_syscalls_uframe fb0 msg s) as [[_ [Hwf' _]] | [_ [Hwf' _]]].
- exact (Hwf' Hwf).
- apply Hwf'. exact (proj1 (proj2 (creditStakingAccount_fields _ s)) Hwf).
Qed.
Lemma native_preserves_storage_wf msg addr action :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
nativeDispatch vm msg addr = Some action → preserves action.
Proof.
intros Hrevision Hselected. unfold nativeDispatch, Precompiles.Make.try_precompile in Hselected.
match type of Hselected with context [@Chain.Ethereum.Address.Map.find_opt ?T addr ?entries] ⇒
destruct (@Chain.Ethereum.Address.Map.find_opt T addr entries) as [pure|] eqn:Hethereum in Hselected end.
- destruct (Evmc.Message.t.delegated msg) in Hselected; inversion Hselected; subst action;
apply storage_wf_return.
- unfold Precompiles.Make.monad_precompiles in Hselected.
change (@Precompiles.Make.Revision (@H.Precompiles_fargs
(H.Build_FArgs F.(Host.Instantiate.ChainParams) vm))).(Precompiles.Make_Revision_signature.revision)
with F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) in Hselected.
rewrite Hrevision in Hselected.
match type of Hselected with context [@Chain.Ethereum.Address.Map.find_opt ?T addr ?entries] ⇒
destruct (@Chain.Ethereum.Address.Map.find_opt T addr entries) as [native|] eqn:Hnative in Hselected end.
2: discriminate.
apply precompilesframe.find_pair_value in Hnative as [[_ ->] | [_ ->]];
match type of Hselected with context [if ?reject then _ else _] ⇒ destruct reject in Hselected end;
inversion Hselected; subst action.
+ apply storage_wf_return.
+ apply reserve_precompile_preserves_storage_wf.
+ apply storage_wf_return.
+ apply staking_contract_preserves_storage_wf.
Qed.
Local Abbreviation processCall := (@H.process_call (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm)).
Local Abbreviation processSyscall := (@H.process_syscall (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm)).
Local Abbreviation callImpl := (@H.call_impl (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm)).
Local Abbreviation hostCall := (@H.call (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm)).
Lemma process_syscall_preserves_storage_wf msg :
preserves (processSyscall msg).
Proof.
unfold H.process_syscall, H.M. cbn zeta.
match goal with |- preserves (match ?lookup with Some _ ⇒ _ | None ⇒ _ end) ⇒
destruct lookup as [endpoint|] eqn:Hfind end.
- unfold Precompiles.Make.syscall_endpoints in Hfind.
apply precompilesframe.find_singleton_value in Hfind as [_ ->].
apply staking_syscalls_preserves_storage_wf.
- apply storage_wf_return.
Qed.
Lemma process_call_preserves_storage_wf from_tx msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ code, preserves (vm.(Evmc.Vm.SIG.execute) msg code)) →
preserves (processCall from_tx msg).
Proof.
intros Hrevision Hvm. unfold H.process_call, H.M. cbn zeta.
apply storage_wf_bind.
- destruct (H.should_transfer msg); [intro; apply transfer_preserves_storage_wf|apply storage_wf_return].
- intros transfer_ok. destruct transfer_ok; [|apply storage_wf_return].
apply storage_wf_bind.
+ apply storage_wf_bind; [apply storage_wf_read|]. intro code.
destruct from_tx.
2: apply storage_wf_return.
match goal with |- context [match ?delegation with Some _ ⇒ _ | None ⇒ _ end] ⇒
destruct delegation end;
first [apply storage_wf_return|apply storage_wf_bind; [apply storage_wf_read|intro; apply storage_wf_return]].
+ intros [addr code].
match goal with |- preserves (match ?selection with Some _ ⇒ _ | None ⇒ _ end) ⇒
destruct selection as [action|] eqn:Hselected end.
× apply (native_preserves_storage_wf msg addr action Hrevision). exact Hselected.
× apply Hvm.
Qed.
Lemma call_impl_preserves_storage_wf kind msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ nested code, (0 ≤ Evmc.Message.t.gas nested < 2^63)%Z →
preservesCallback hostStorageWf (vm.(Evmc.Vm.SIG.execute) nested code)) →
(0 ≤ Evmc.Message.t.gas msg < 2^63)%Z →
preservesCallback hostStorageWf (callImpl kind msg).
Proof.
intros Hrevision Hvm Hgas s Hformat.
pose proof (fun from_tx ⇒ process_call_preserves_storage_wf from_tx msg Hrevision
(fun code ⇒ Hvm msg code Hgas)) as Hcall.
pose proof (process_syscall_preserves_storage_wf msg) as Hsyscall.
pose proof (@process_create_preserves_storage_wf (H.Build_FArgs F.(Host.Instantiate.ChainParams) vm) (Opaque.legacy_witness 0%Z) msg Hvm Hgas) as Hcreate.
unfold H.call_impl.
Local Opaque H.process_call H.process_syscall H.process_create
Chain.Ethereum.Address.of_contract_creation Reserve_balance.dipped_into_reserve.
destruct (Evmc.Message.t.kind msg); destruct kind as [|tx|]; cbn.
all: match goal with
| |- context [Monad.Identity.Impl.op_gtgteq ?run _] ⇒
assert (Hcore : hostStorageWf (snd run)) by
(lazymatch run with ?f ?st ⇒
lazymatch f with
| context [H.process_call ?ft] ⇒ exact (Hcall ft st Hformat)
| context [H.process_syscall] ⇒ exact (Hsyscall st Hformat)
| context [H.process_create] ⇒ exact (Hcreate st Hformat)
end end);
destruct run as [result intermediate] eqn:Hrun
end.
all: destruct result as [status gasleft refund output address].
all: destruct status;
cbn; unfold Monad.Make_Monad.when_; cbn;
try exact Hcore; try exact Hformat.
all: match goal with
| |- context [Monad.Identity.Impl.op_gtgteq (Monad.Identity.Impl.op_gtgteq ?check _) _] ⇒
assert (Hcheck : snd check = intermediate) by reflexivity;
destruct check as [dipped checked]; cbn [snd] in Hcheck; subst checked
end.
all: destruct dipped; cbn; [exact Hformat|exact Hcore].
Qed.
Lemma call_preserves_storage_wf msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ nested code, (0 ≤ Evmc.Message.t.gas nested < 2^63)%Z →
preservesCallback hostStorageWf (vm.(Evmc.Vm.SIG.execute) nested code)) →
(0 ≤ Evmc.Message.t.gas msg < 2^63)%Z → preservesCallback hostStorageWf (hostCall msg).
Proof.
intros Hrevision Hvm Hgas. unfold H.call, H.M.
apply storage_wf_bind.
- match goal with |- preservesCallback hostStorageWf (if ?test then _ else _) ⇒ destruct test end.
+ unfold H.try_increment_nonce, H.M. solve_storage_wf.
+ apply storage_wf_return.
- intros noOverflow. destruct noOverflow; [|apply storage_wf_return].
apply call_impl_preserves_storage_wf; assumption.
Qed.
Lemma call_from_eoa_preserves_storage_wf tx msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ nested code, (0 ≤ Evmc.Message.t.gas nested < 2^63)%Z →
preserves (vm.(Evmc.Vm.SIG.execute) nested code)) →
(0 ≤ Evmc.Message.t.gas msg < 2^63)%Z → preserves (callImpl (H.Eoa_tx tx) msg).
Proof. apply call_impl_preserves_storage_wf. Qed.
Lemma call_from_monad_system_transaction_preserves_storage_wf msg :
F.(Host.Instantiate.ChainParams).(Chain.Monad.PARAMS.revision) = Support.Variants.Revision.Eleven →
(∀ nested code, (0 ≤ Evmc.Message.t.gas nested < 2^63)%Z →
preserves (vm.(Evmc.Vm.SIG.execute) nested code)) →
(0 ≤ Evmc.Message.t.gas msg < 2^63)%Z → preserves (callImpl H.System_tx msg).
Proof. apply call_impl_preserves_storage_wf. Qed.
End Host.
Print Assumptions call_impl_preserves_storage_wf.