Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Better logging #1503

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion actors/builtin/miner/miner_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2211,6 +2211,7 @@ func processEarlyTerminations(rt Runtime, rewardSmoothed smoothing.FilterEstimat
}

// Burn penalty.
rt.Log(rtt.DEBUG, "storage provider %s penalized %s for sector termination", rt.Receiver(), penalty)
burnFunds(rt, penalty)

// Return pledge.
Expand Down Expand Up @@ -2262,6 +2263,7 @@ func handleProvingDeadline(rt Runtime,

err = st.ApplyPenalty(depositToBurn)
builtin.RequireNoErr(rt, err, exitcode.ErrIllegalState, "failed to apply penalty")
rt.Log(rtt.DEBUG, "storage provider %s penalized %s for expired pre commits", rt.Receiver(), depositToBurn)
}

// Record whether or not we _had_ early terminations in the queue before this method.
Expand All @@ -2285,6 +2287,7 @@ func handleProvingDeadline(rt Runtime,

err = st.ApplyPenalty(penaltyTarget)
builtin.RequireNoErr(rt, err, exitcode.ErrIllegalState, "failed to apply penalty")
rt.Log(rtt.DEBUG, "storage provider %s penalized %s for continued fault", rt.Receiver(), penaltyTarget)

penaltyFromVesting, penaltyFromBalance, err := st.RepayPartialDebtInPriorityOrder(store, currEpoch, rt.CurrentBalance())
builtin.RequireNoErr(rt, err, exitcode.ErrIllegalState, "failed to unlock penalty")
Expand Down Expand Up @@ -2660,7 +2663,7 @@ func resolveWorkerAddress(rt Runtime, raw addr.Address) addr.Address {

func burnFunds(rt Runtime, amt abi.TokenAmount) {
if amt.GreaterThan(big.Zero()) {
rt.Log(rtt.INFO, "burnFunds called with amt=%d attoFIL. receiver address %v", amt, rt.Receiver())
rt.Log(rtt.DEBUG, "storage provder %s burning %s", rt.Receiver(), amt)
code := rt.Send(builtin.BurntFundsActorAddr, builtin.MethodSend, nil, amt, &builtin.Discard{})
builtin.RequireSuccess(rt, code, "failed to burn funds")
}
Expand Down
9 changes: 4 additions & 5 deletions actors/builtin/power/power_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func (a Actor) processBatchProofVerifies(rt Runtime, rewret reward.ThisEpochRewa
rt.StateTransaction(&st, func() {
store := adt.AsStore(rt)
if st.ProofValidationBatch == nil {
rt.Log(rtt.WARN, "ProofValidationBatch was nil, quitting verification")
rt.Log(rtt.DEBUG, "ProofValidationBatch was nil, quitting verification")
return
}
mmap, err := adt.AsMultimap(store, *st.ProofValidationBatch, builtin.DefaultHamtBitwidth, ProofValidationBatchAmtBitwidth)
Expand Down Expand Up @@ -499,7 +499,7 @@ func (a Actor) processDeferredCronEvents(rt Runtime, rewret reward.ThisEpochRewa
err = events.RemoveAll(epochKey(epoch))
builtin.RequireNoErr(rt, err, exitcode.ErrIllegalState, "failed to clear cron events at %v", epoch)
} else {
rt.Log(rtt.INFO, "no epoch events were loaded")
rt.Log(rtt.DEBUG, "no epoch events were loaded")
}
}

Expand Down Expand Up @@ -527,10 +527,9 @@ func (a Actor) processDeferredCronEvents(rt Runtime, rewret reward.ThisEpochRewa
)
// If a callback fails, this actor continues to invoke other callbacks
// and persists state removing the failed event from the event queue. It won't be tried again.
// Failures are unexpected here but will result in removal of miner power
// A log message would really help here.
// Failures are unexpected here but will result in removal of miner power as a defensive measure.
if code != exitcode.Ok {
rt.Log(rtt.WARN, "OnDeferredCronEvent failed for miner %s: exitcode %d", event.MinerAddr, code)
rt.Log(rtt.ERROR, "OnDeferredCronEvent failed for miner %s: exitcode %d", event.MinerAddr, code)
failedMinerCrons = append(failedMinerCrons, event.MinerAddr)
}
}
Expand Down