Commit df80b5d3 authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

op-dispute-mon: Include the output root block number in unexpected game result error logs. (#9615)

parent ca7b022f
......@@ -76,7 +76,10 @@ func (d *detector) checkAgreement(ctx context.Context, addr common.Address, bloc
expectedResult = types.GameStatusChallengerWon
}
if status != expectedResult {
d.logger.Error("Unexpected game result", "gameAddr", addr, "expectedResult", expectedResult, "actualResult", status, "rootClaim", rootClaim, "correctClaim", expectedClaim)
d.logger.Error("Unexpected game result",
"gameAddr", addr, "blockNum", blockNum,
"expectedResult", expectedResult, "actualResult", status,
"rootClaim", rootClaim, "correctClaim", expectedClaim)
}
}
return batch, nil
......
......@@ -77,19 +77,27 @@ func (f *forecast) forecastGame(ctx context.Context, game monTypes.EnrichedGameD
// If we agree with the output root proposal, the Defender should win, defending that claim.
if status == types.GameStatusChallengerWon {
metrics.AgreeChallengerAhead++
f.logger.Warn("Forecasting unexpected game result", "status", status, "game", game.Proxy, "rootClaim", game.RootClaim, "expected", expected)
f.logger.Warn("Forecasting unexpected game result", "status", status,
"game", game.Proxy, "blockNum", game.L2BlockNumber,
"rootClaim", game.RootClaim, "expected", expected)
} else {
metrics.AgreeDefenderAhead++
f.logger.Debug("Forecasting expected game result", "status", status, "game", game.Proxy, "rootClaim", game.RootClaim, "expected", expected)
f.logger.Debug("Forecasting expected game result", "status", status,
"game", game.Proxy, "blockNum", game.L2BlockNumber,
"rootClaim", game.RootClaim, "expected", expected)
}
} else {
// If we disagree with the output root proposal, the Challenger should win, challenging that claim.
if status == types.GameStatusDefenderWon {
metrics.DisagreeDefenderAhead++
f.logger.Warn("Forecasting unexpected game result", "status", status, "game", game.Proxy, "rootClaim", game.RootClaim, "expected", expected)
f.logger.Warn("Forecasting unexpected game result", "status", status,
"game", game.Proxy, "blockNum", game.L2BlockNumber,
"rootClaim", game.RootClaim, "expected", expected)
} else {
metrics.DisagreeChallengerAhead++
f.logger.Debug("Forecasting expected game result", "status", status, "game", game.Proxy, "rootClaim", game.RootClaim, "expected", expected)
f.logger.Debug("Forecasting expected game result", "status", status,
"game", game.Proxy, "blockNum", game.L2BlockNumber,
"rootClaim", game.RootClaim, "expected", expected)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment