Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase churner expiry #481

Merged
merged 3 commits into from
Apr 15, 2024
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
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
Loading