diff --git a/massa-execution-worker/src/active_history.rs b/massa-execution-worker/src/active_history.rs index c632a2405be..7cf4cd737ab 100644 --- a/massa-execution-worker/src/active_history.rs +++ b/massa-execution-worker/src/active_history.rs @@ -250,7 +250,7 @@ impl ActiveHistory { return SlotIndexPosition::Past; // too old } let index: usize = match slot.slots_since(first_slot, thread_count) { - Err(_) => return SlotIndexPosition::Past, // overflow + Err(_) => return SlotIndexPosition::Future, // overflow Ok(d) => { match d.try_into() { Ok(d) => d, diff --git a/massa-execution-worker/src/controller.rs b/massa-execution-worker/src/controller.rs index 6869082b025..02d017b5c08 100644 --- a/massa-execution-worker/src/controller.rs +++ b/massa-execution-worker/src/controller.rs @@ -535,7 +535,7 @@ pub struct ExecutionManagerImpl { impl ExecutionManager for ExecutionManagerImpl { /// stops the worker fn stop(&mut self) { - info!("Stopping Execution controller..."); + info!("stopping Execution controller..."); // notify the worker thread to stop { let mut input_wlock = self.input_data.1.lock(); @@ -544,10 +544,8 @@ impl ExecutionManager for ExecutionManagerImpl { } // join the execution thread if let Some(join_handle) = self.thread_handle.take() { - join_handle - .join() - .expect("Execution controller thread panicked"); + join_handle.join().expect("VM controller thread panicked"); } - info!("Execution controller stopped"); + info!("execution controller stopped"); } } diff --git a/massa-execution-worker/src/speculative_async_pool.rs b/massa-execution-worker/src/speculative_async_pool.rs index 082ed2fb362..3a5c654d7a8 100644 --- a/massa-execution-worker/src/speculative_async_pool.rs +++ b/massa-execution-worker/src/speculative_async_pool.rs @@ -340,7 +340,7 @@ impl SpeculativeAsyncPool { /// Check in the ledger changes if a message trigger has been triggered fn is_triggered(filter: &AsyncMessageTrigger, ledger_changes: &LedgerChanges) -> bool { - ledger_changes.has_writes(&filter.address, filter.datastore_key.clone()) + ledger_changes.has_changes(&filter.address, filter.datastore_key.clone()) } #[cfg(test)] diff --git a/massa-execution-worker/src/speculative_executed_denunciations.rs b/massa-execution-worker/src/speculative_executed_denunciations.rs index 1c8f9bb2c13..8c7466bc844 100644 --- a/massa-execution-worker/src/speculative_executed_denunciations.rs +++ b/massa-execution-worker/src/speculative_executed_denunciations.rs @@ -73,8 +73,10 @@ impl SpeculativeExecutedDenunciations { HistorySearchResult::Present(_) => { return true; } + HistorySearchResult::Absent => { + return false; + } HistorySearchResult::NoInfo => {} - HistorySearchResult::Absent => unreachable!(), // fetch_executed_denunciation does not return Absent } // check in the final state diff --git a/massa-execution-worker/src/speculative_executed_ops.rs b/massa-execution-worker/src/speculative_executed_ops.rs index d3d0d81c0e1..1c3d1037678 100644 --- a/massa-execution-worker/src/speculative_executed_ops.rs +++ b/massa-execution-worker/src/speculative_executed_ops.rs @@ -67,8 +67,10 @@ impl SpeculativeExecutedOps { HistorySearchResult::Present(_) => { return true; } + HistorySearchResult::Absent => { + return false; + } HistorySearchResult::NoInfo => {} - HistorySearchResult::Absent => unreachable!(), // fetch_executed_op does not return Absent } // check in the final state diff --git a/massa-execution-worker/src/worker.rs b/massa-execution-worker/src/worker.rs index 5fee6e65eac..332ac92f25e 100644 --- a/massa-execution-worker/src/worker.rs +++ b/massa-execution-worker/src/worker.rs @@ -260,10 +260,6 @@ pub fn start_execution_worker( massa_metrics: MassaMetrics, #[cfg(feature = "dump-block")] block_storage_backend: Arc>, ) -> (Box, Box) { - if config.hd_cache_size < config.snip_amount { - panic!("In config.toml, hd_cache_size must be greater than snip_amount"); - } - // create an execution state let execution_state = Arc::new(RwLock::new(ExecutionState::new( config.clone(), diff --git a/massa-ledger-exports/src/ledger_changes.rs b/massa-ledger-exports/src/ledger_changes.rs index 5c4e1eb5839..02551f0b096 100644 --- a/massa-ledger-exports/src/ledger_changes.rs +++ b/massa-ledger-exports/src/ledger_changes.rs @@ -835,13 +835,8 @@ impl LedgerChanges { } } - /// Tries to return whether the ledger changes contain a write for the given address - /// and optionally if a datastore key write also exists in the address's datastore. - /// Notes: - /// - A ledger entry could be written to without any changes on the values associated, - /// for example if the value was changed multiple times in the same slot. - /// - This code assumes Delete cannot be shadowed by Set operations in the same slot, which may not be the case - /// when / if we allow full entry Delete given the current LedgerChanges::Delete handling. In that case, a rework may be necessary. + /// Tries to return whether there is a change on a given address in the ledger changes + /// and optionally if a datastore key modification also exists in the address's datastore. /// /// # Arguments /// * `addr`: target address @@ -849,7 +844,7 @@ impl LedgerChanges { /// /// # Returns /// * true if the address and, optionally the datastore key, exists in the ledger changes - pub fn has_writes(&self, addr: &Address, key: Option>) -> bool { + pub fn has_changes(&self, addr: &Address, key: Option>) -> bool { // Get the current changes being applied to the ledger entry associated to that address match self.0.get(addr) { // This ledger entry is being replaced by a new one: