From 50b23c6d9f5746acbddbbe93e3d1c02d7582a56a Mon Sep 17 00:00:00 2001 From: Ivan Boldyrev Date: Mon, 22 Jul 2024 17:14:24 +0200 Subject: [PATCH] fix(avm-server): remove unused AVM code (#848) It breaks compilation on newer rustc versions. --- avm/server/src/avm_runtime_limits.rs | 68 ---------------------------- avm/server/src/lib.rs | 1 - 2 files changed, 69 deletions(-) delete mode 100644 avm/server/src/avm_runtime_limits.rs diff --git a/avm/server/src/avm_runtime_limits.rs b/avm/server/src/avm_runtime_limits.rs deleted file mode 100644 index ced33b2e2..000000000 --- a/avm/server/src/avm_runtime_limits.rs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * AquaVM Workflow Engine - * - * Copyright (C) 2024 Fluence DAO - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -pub struct AquaVMRuntimeLimits { - /// AIR script size limit. - pub air_size_limit: u64, - /// Particle data size limit. - pub particle_size_limit: u64, - /// Service call result size limit. - pub call_result_size_limit: u64, - /// Knob to enable/disable RAM consumption hard limits in AquaVM. - pub hard_limit_enabled: bool, -} - -#[derive(Default)] -pub struct AVMRuntimeLimits { - pub air_size_limit: Option, - pub particle_size_limit: Option, - pub call_result_size_limit: Option, - pub hard_limit_enabled: bool, -} - -impl AquaVMRuntimeLimits { - pub fn new( - air_size_limit: u64, - particle_size_limit: u64, - call_result_size_limit: u64, - hard_limit_enabled: bool, - ) -> Self { - Self { - air_size_limit, - particle_size_limit, - call_result_size_limit, - hard_limit_enabled, - } - } -} - -impl From for AquaVMRuntimeLimits { - fn from(value: AVMRuntimeLimits) -> Self { - use air_interpreter_interface::MAX_AIR_SIZE; - use air_interpreter_interface::MAX_CALL_RESULT_SIZE; - use air_interpreter_interface::MAX_PARTICLE_SIZE; - - AquaVMRuntimeLimits::new( - value.air_size_limit.unwrap_or(MAX_AIR_SIZE), - value.particle_size_limit.unwrap_or(MAX_PARTICLE_SIZE), - value.call_result_size_limit.unwrap_or(MAX_CALL_RESULT_SIZE), - value.hard_limit_enabled, - ) - } -} diff --git a/avm/server/src/lib.rs b/avm/server/src/lib.rs index 201b775d9..d0c3cb367 100644 --- a/avm/server/src/lib.rs +++ b/avm/server/src/lib.rs @@ -28,7 +28,6 @@ )] mod avm; -mod avm_runtime_limits; mod config; mod errors; mod runner;