Skip to content

Commit

Permalink
Revert "Fix join error message (was inconsistent with: VM controller …
Browse files Browse the repository at this point in the history
…thread)" (#4756)
  • Loading branch information
sydhds authored Oct 2, 2024
1 parent cca6d89 commit 2664915
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion massa-execution-worker/src/active_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions massa-execution-worker/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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");
}
}
2 changes: 1 addition & 1 deletion massa-execution-worker/src/speculative_async_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion massa-execution-worker/src/speculative_executed_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions massa-execution-worker/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ pub fn start_execution_worker(
massa_metrics: MassaMetrics,
#[cfg(feature = "dump-block")] block_storage_backend: Arc<RwLock<dyn StorageBackend>>,
) -> (Box<dyn ExecutionManager>, Box<dyn ExecutionController>) {
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(),
Expand Down
11 changes: 3 additions & 8 deletions massa-ledger-exports/src/ledger_changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,21 +835,16 @@ 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
/// * `key`: optional datastore key
///
/// # Returns
/// * true if the address and, optionally the datastore key, exists in the ledger changes
pub fn has_writes(&self, addr: &Address, key: Option<Vec<u8>>) -> bool {
pub fn has_changes(&self, addr: &Address, key: Option<Vec<u8>>) -> 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:
Expand Down

0 comments on commit 2664915

Please sign in to comment.