From 2932156f111c9e71dc0e0e7ff6989a998f8f0e6a Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Sun, 17 Dec 2023 22:09:14 +0100 Subject: [PATCH] Fix cleanup_create order and release v0.41.1 --- Cargo.toml | 2 +- src/executor/stack/executor.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c867e3f21..478598c38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "evm" -version = "0.41.0" +version = "0.41.1" license = "Apache-2.0" authors = ["Wei Tang ", "Parity Technologies "] description = "SputnikVM - a Portable Blockchain Virtual Machine" diff --git a/src/executor/stack/executor.rs b/src/executor/stack/executor.rs index e35bae13b..95b3e175b 100644 --- a/src/executor/stack/executor.rs +++ b/src/executor/stack/executor.rs @@ -1009,12 +1009,14 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> .record_deposit(out.len()) { Ok(()) => { - let exit_result = self.exit_substate(StackExitKind::Succeeded); if let Err(e) = self.record_external_operation( crate::ExternalOperation::Write(U256::from(out.len())), ) { + self.state.metadata_mut().gasometer.fail(); + let _ = self.exit_substate(StackExitKind::Failed); return (e.into(), None, Vec::new()); } + let exit_result = self.exit_substate(StackExitKind::Succeeded); self.state.set_code(address, out); if let Err(e) = exit_result { return (e.into(), None, Vec::new());