implement transient storage

Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
xermicus
2024-06-05 17:34:17 +02:00
parent 9e9227d740
commit 39d78179d4
9 changed files with 112 additions and 30 deletions
@@ -742,12 +742,21 @@ where
.map(|_| None)
}
InstructionName::TLOAD => {
let _arguments = self.pop_arguments_llvm(context);
anyhow::bail!("The `TLOAD` instruction is not supported until zkVM v1.5.0");
let arguments = self.pop_arguments_llvm(context);
revive_llvm_context::polkavm_evm_storage::transient_load(
context,
arguments[0].into_int_value(),
)
.map(Some)
}
InstructionName::TSTORE => {
let _arguments = self.pop_arguments_llvm(context);
anyhow::bail!("The `TSTORE` instruction is not supported until zkVM v1.5.0");
let arguments = self.pop_arguments_llvm(context);
revive_llvm_context::polkavm_evm_storage::transient_store(
context,
arguments[0].into_int_value(),
arguments[1].into_int_value(),
)
.map(|_| None)
}
InstructionName::PUSHIMMUTABLE => {
let key = self