From e4c88ee3bc0148147190cbb7c28b60e7a72e0d45 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 13 Apr 2024 19:22:52 +0000 Subject: [PATCH 1/3] increase churner expiry --- operators/churner/churner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/operators/churner/churner.go b/operators/churner/churner.go index 6dba72dac4..c83e39370f 100644 --- a/operators/churner/churner.go +++ b/operators/churner/churner.go @@ -21,7 +21,7 @@ import ( var ( bipMultiplier = big.NewInt(10000) - secondsTillExpiry = 90 * time.Second + secondsTillExpiry = 3600 * time.Second ) type ChurnRequest struct { @@ -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 From ffb6041c6c3a81ef1bacabc9738d42ce17a529b2 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 13 Apr 2024 23:16:45 +0000 Subject: [PATCH 2/3] fix test --- operators/churner/server_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operators/churner/server_test.go b/operators/churner/server_test.go index 0c70108f49..6db60ad964 100644 --- a/operators/churner/server_test.go +++ b/operators/churner/server_test.go @@ -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") } func TestChurnWithInvalidQuorum(t *testing.T) { From 39c316ab95f640c170bc707cc68cb5da6a2555f8 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 14 Apr 2024 23:01:40 +0000 Subject: [PATCH 3/3] add time unit --- operators/churner/server.go | 2 +- operators/churner/server_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/operators/churner/server.go b/operators/churner/server.go index 73820eef1a..dc8e26fc90 100644 --- a/operators/churner/server.go +++ b/operators/churner/server.go @@ -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) diff --git a/operators/churner/server_test.go b/operators/churner/server_test.go index 6db60ad964..00fb2ad851 100644 --- a/operators/churner/server_test.go +++ b/operators/churner/server_test.go @@ -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 3600") + assert.Equal(t, err.Error(), "rpc error: code = ResourceExhausted desc = previous approval not expired, retry in 3600 seconds") } func TestChurnWithInvalidQuorum(t *testing.T) {