Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
add proposerIP to the log
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Sep 25, 2023
1 parent a657400 commit 33e39ee
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions prover/server/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,25 @@ func (srv *ProverServer) CreateAssignment(c echo.Context) error {
}

if req.Fee.Cmp(srv.minProofFee) < 0 {
log.Warn("Proof fee too low", "reqFee", req.Fee.String(), "srvMinProofFee", srv.minProofFee.String())
log.Warn("Proof fee too low",
"reqFee", req.Fee.String(),
"srvMinProofFee", srv.minProofFee.String(),
"proposerIP", c.RealIP(),
)
return echo.NewHTTPError(http.StatusUnprocessableEntity, "proof fee too low")
}

if req.Expiry > uint64(time.Now().Add(srv.maxExpiry).Unix()) {
log.Warn("Expiry too long", "requestExpiry", req.Expiry, "srvMaxExpiry", srv.maxExpiry)
log.Warn("Expiry too long",
"requestExpiry", req.Expiry,
"srvMaxExpiry", srv.maxExpiry,
"proposerIP", c.RealIP(),
)
return echo.NewHTTPError(http.StatusUnprocessableEntity, "expiry too long")
}

if srv.capacityManager.ReadCapacity() == 0 {
log.Warn("Prover does not have capacity")
log.Warn("Prover does not have capacity", "proposerIP", c.RealIP())
return echo.NewHTTPError(http.StatusUnprocessableEntity, "prover does not have capacity")
}

Expand Down

0 comments on commit 33e39ee

Please sign in to comment.