Skip to content

Commit

Permalink
increase churner expiry (#481)
Browse files Browse the repository at this point in the history
Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
bxue-l2 and Ubuntu authored Apr 15, 2024
1 parent 66a9a6f commit 60d2812
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions operators/churner/churner.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

var (
bipMultiplier = big.NewInt(10000)
secondsTillExpiry = 90 * time.Second
secondsTillExpiry = 3600 * time.Second
)

type ChurnRequest struct {
Expand Down Expand Up @@ -285,7 +285,7 @@ func (c *churner) sign(ctx context.Context, operatorToRegisterAddress gethcommon
var salt [32]byte
copy(salt[:], saltKeccak256)

// set expiry to 90s in the future
// set expiry to 3600s in the future
expiry := big.NewInt(now.Add(secondsTillExpiry).Unix())

// sign and return signature
Expand Down
2 changes: 1 addition & 1 deletion operators/churner/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (s *Server) Churn(ctx context.Context, req *pb.ChurnRequest) (*pb.ChurnRepl
// Global rate limiting: check that we are after the previous approval's expiry
if now.Unix() < s.latestExpiry {
s.metrics.IncrementFailedRequestNum("Churn", FailReasonPrevApprovalNotExpired)
return nil, api.NewResourceExhaustedError(fmt.Sprintf("previous approval not expired, retry in %d", s.latestExpiry-now.Unix()))
return nil, api.NewResourceExhaustedError(fmt.Sprintf("previous approval not expired, retry in %d seconds", s.latestExpiry-now.Unix()))
}

request, err := createChurnRequest(req)
Expand Down
2 changes: 1 addition & 1 deletion operators/churner/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestChurn(t *testing.T) {
// retry prior to expiry should fail
_, err = s.Churn(ctx, request)
assert.NotNil(t, err)
assert.Equal(t, err.Error(), "rpc error: code = ResourceExhausted desc = previous approval not expired, retry in 90")
assert.Equal(t, err.Error(), "rpc error: code = ResourceExhausted desc = previous approval not expired, retry in 3600 seconds")
}

func TestChurnWithInvalidQuorum(t *testing.T) {
Expand Down

0 comments on commit 60d2812

Please sign in to comment.