Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
df0b6749
Unverified
Commit
df0b6749
authored
Dec 18, 2023
by
felipe
Committed by
GitHub
Dec 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(proxyd): impl proxyd_healthz method (#8658)
parent
82d9f11e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
backend.go
proxyd/backend.go
+3
-2
server.go
proxyd/server.go
+10
-0
No files found.
proxyd/backend.go
View file @
df0b6749
...
@@ -17,6 +17,7 @@ import (
...
@@ -17,6 +17,7 @@ import (
"sync"
"sync"
"time"
"time"
sw
"github.com/ethereum-optimism/optimism/proxyd/pkg/avg-sliding-window"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc"
...
@@ -24,8 +25,6 @@ import (
...
@@ -24,8 +25,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus"
"github.com/xaionaro-go/weightedshuffle"
"github.com/xaionaro-go/weightedshuffle"
"golang.org/x/sync/semaphore"
"golang.org/x/sync/semaphore"
sw
"github.com/ethereum-optimism/optimism/proxyd/pkg/avg-sliding-window"
)
)
const
(
const
(
...
@@ -285,6 +284,8 @@ type indexedReqRes struct {
...
@@ -285,6 +284,8 @@ type indexedReqRes struct {
res
*
RPCRes
res
*
RPCRes
}
}
const
proxydHealthzMethod
=
"proxyd_healthz"
const
ConsensusGetReceiptsMethod
=
"consensus_getReceipts"
const
ConsensusGetReceiptsMethod
=
"consensus_getReceipts"
const
ReceiptsTargetDebugGetRawReceipts
=
"debug_getRawReceipts"
const
ReceiptsTargetDebugGetRawReceipts
=
"debug_getRawReceipts"
...
...
proxyd/server.go
View file @
df0b6749
...
@@ -435,6 +435,16 @@ func (s *Server) handleBatchRPC(ctx context.Context, reqs []json.RawMessage, isL
...
@@ -435,6 +435,16 @@ func (s *Server) handleBatchRPC(ctx context.Context, reqs []json.RawMessage, isL
continue
continue
}
}
// Simple health check
if
len
(
reqs
)
==
1
&&
parsedReq
.
Method
==
proxydHealthzMethod
{
res
:=
&
RPCRes
{
ID
:
parsedReq
.
ID
,
JSONRPC
:
JSONRPCVersion
,
Result
:
"OK"
,
}
return
[]
*
RPCRes
{
res
},
false
,
""
,
nil
}
if
err
:=
ValidateRPCReq
(
parsedReq
);
err
!=
nil
{
if
err
:=
ValidateRPCReq
(
parsedReq
);
err
!=
nil
{
RecordRPCError
(
ctx
,
BackendProxyd
,
MethodUnknown
,
err
)
RecordRPCError
(
ctx
,
BackendProxyd
,
MethodUnknown
,
err
)
responses
[
i
]
=
NewRPCErrorRes
(
nil
,
err
)
responses
[
i
]
=
NewRPCErrorRes
(
nil
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment