Skip to content

Commit

Permalink
Asc message execution - requery message bytecode after each message e…
Browse files Browse the repository at this point in the history
…xecution (#4710)

* Requery bytecode

* cargo fmt
  • Loading branch information
Leo-Besancon committed Jun 18, 2024
1 parent 721f4ce commit 93b2b3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions massa-execution-worker/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,12 @@ impl ExecutionContext {
&mut self,
max_gas: u64,
async_msg_cst_gas_cost: u64,
) -> Vec<(Option<Bytecode>, AsyncMessage)> {
self.speculative_async_pool
.take_batch_to_execute(self.slot, max_gas, async_msg_cst_gas_cost)
.into_iter()
.map(|(_id, msg)| (self.get_bytecode(&msg.destination), msg))
.collect()
) -> Vec<(AsyncMessageId, AsyncMessage)> {
self.speculative_async_pool.take_batch_to_execute(
self.slot,
max_gas,
async_msg_cst_gas_cost,
)
}

/// Create a new `ExecutionContext` for executing an active slot.
Expand Down
4 changes: 3 additions & 1 deletion massa-execution-worker/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,9 @@ impl ExecutionState {

// Try executing asynchronous messages.
// Effects are cancelled on failure and the sender is reimbursed.
for (opt_bytecode, message) in messages {
for (_message_id, message) in messages {
let opt_bytecode = context_guard!(self).get_bytecode(&message.destination);

match self.execute_async_message(message, opt_bytecode) {
Ok(_message_return) => {
cfg_if::cfg_if! {
Expand Down

0 comments on commit 93b2b3b

Please sign in to comment.