diff --git a/vm/actor/src/builtin/miner/mod.rs b/vm/actor/src/builtin/miner/mod.rs index 4847f1e04b5f..25a0c49f38c1 100644 --- a/vm/actor/src/builtin/miner/mod.rs +++ b/vm/actor/src/builtin/miner/mod.rs @@ -2696,7 +2696,7 @@ impl Actor { let mut pledge_delta = TokenAmount::from(0); - let (burn_amount, reward_amount, state) = rt.transaction(|st: &mut State, rt| { + let (burn_amount, reward_amount) = rt.transaction(|st: &mut State, rt| { let mut info = get_miner_info(rt.store(), &st)?; // Verify miner hasn't already been faulted @@ -2735,7 +2735,7 @@ impl Actor { e.downcast_default(ExitCode::ErrSerialization, "failed to save miner info") })?; - Ok((burn_amount, reward_amount, st.clone())) + Ok((burn_amount, reward_amount)) })?; if let Err(e) = rt.send(reporter, METHOD_SEND, Serialized::default(), reward_amount) { @@ -2745,6 +2745,7 @@ impl Actor { burn_funds(rt, burn_amount)?; notify_pledge_changed(rt, &pledge_delta)?; + let state: State = rt.state()?; state .check_balance_invariants(&rt.current_balance()?) .map_err(|e| { @@ -2753,7 +2754,6 @@ impl Actor { format!("balance invariants broken: {}", e), ) })?; - Ok(()) } diff --git a/vm/interpreter/src/default_runtime.rs b/vm/interpreter/src/default_runtime.rs index 15f27904da97..d99251f849a0 100644 --- a/vm/interpreter/src/default_runtime.rs +++ b/vm/interpreter/src/default_runtime.rs @@ -325,7 +325,6 @@ where let prev_val = self.caller_validated; let prev_depth = self.depth; let prev_msg = self.vm_msg.clone(); - let res = self.execute_send(msg, gas_cost); // Reset values back to their values before the call @@ -520,9 +519,9 @@ where .get_actor(self.vm_msg.receiver())? .ok_or_else(|| format!("actor not found {:?}", self.vm_msg.receiver()))?; - let ms = actor::miner::State::load(self.store(), &actor)?; + let ms = actor::miner::State::load(&self.store, &actor)?; - let worker = ms.info(self.store())?.worker; + let worker = ms.info(&self.store)?.worker; resolve_to_key_addr(&self.state, &self.store, &worker) } @@ -884,7 +883,6 @@ where self.gas_tracker .borrow_mut() .charge_gas(self.price_list.on_verify_consensus_fault())?; - // Note that block syntax is not validated. Any validly signed block will be accepted pursuant to the below conditions. // Whether or not it could ever have been accepted in a chain is not checked/does not matter here. // for that reason when checking block parent relationships, rather than instantiating a Tipset to do so diff --git a/vm/interpreter/src/vm.rs b/vm/interpreter/src/vm.rs index b2845e186cc9..433fc6b5d4ab 100644 --- a/vm/interpreter/src/vm.rs +++ b/vm/interpreter/src/vm.rs @@ -224,6 +224,7 @@ where return Ok(()); } let ret = self.apply_message(msg)?; + if let Some(cb) = &mut callback { cb(&cid, msg, &ret)?; }