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
e3ecfc47
Commit
e3ecfc47
authored
Sep 26, 2023
by
dhanu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup-logging-service-utils - move driver changes to adminAPI
parent
dd604bd9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
40 deletions
+22
-40
l2_verifier.go
op-e2e/actions/l2_verifier.go
+1
-1
api.go
op-node/node/api.go
+19
-7
node.go
op-node/node/node.go
+1
-1
state.go
op-node/rollup/driver/state.go
+1
-31
No files found.
op-e2e/actions/l2_verifier.go
View file @
e3ecfc47
...
...
@@ -88,7 +88,7 @@ func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, eng L2API, cf
{
Namespace
:
"admin"
,
Version
:
""
,
Service
:
node
.
NewAdminAPI
(
backend
,
m
),
Service
:
node
.
NewAdminAPI
(
backend
,
m
,
log
),
Public
:
true
,
// TODO: this field is deprecated. Do we even need this anymore?
Authenticated
:
false
,
},
...
...
op-node/node/api.go
View file @
e3ecfc47
...
...
@@ -37,14 +37,16 @@ type rpcMetrics interface {
}
type
adminAPI
struct
{
dr
driverClient
m
rpcMetrics
dr
driverClient
m
rpcMetrics
log
log
.
Logger
}
func
NewAdminAPI
(
dr
driverClient
,
m
rpcMetrics
)
*
adminAPI
{
func
NewAdminAPI
(
dr
driverClient
,
m
rpcMetrics
,
log
log
.
Logger
)
*
adminAPI
{
return
&
adminAPI
{
dr
:
dr
,
m
:
m
,
dr
:
dr
,
m
:
m
,
log
:
log
,
}
}
...
...
@@ -72,10 +74,20 @@ func (n *adminAPI) SequencerActive(ctx context.Context) (bool, error) {
return
n
.
dr
.
SequencerActive
(
ctx
)
}
func
(
n
*
adminAPI
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
string
)
error
{
func
(
n
*
adminAPI
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
Str
string
)
error
{
recordDur
:=
n
.
m
.
RecordRPCServerRequest
(
"admin_setLogLevel"
)
defer
recordDur
()
return
n
.
dr
.
SetLogLevel
(
ctx
,
lvl
)
h
:=
n
.
log
.
GetHandler
()
lvl
,
err
:=
log
.
LvlFromString
(
lvlStr
)
if
err
!=
nil
{
return
err
}
h
=
log
.
LvlFilterHandler
(
lvl
,
h
)
n
.
log
.
SetHandler
(
h
)
return
nil
}
type
nodeAPI
struct
{
...
...
op-node/node/node.go
View file @
e3ecfc47
...
...
@@ -301,7 +301,7 @@ func (n *OpNode) initRPCServer(ctx context.Context, cfg *Config) error {
server
.
EnableP2P
(
p2p
.
NewP2PAPIBackend
(
n
.
p2pNode
,
n
.
log
,
n
.
metrics
))
}
if
cfg
.
RPC
.
EnableAdmin
{
server
.
EnableAdminAPI
(
NewAdminAPI
(
n
.
l2Driver
,
n
.
metrics
))
server
.
EnableAdminAPI
(
NewAdminAPI
(
n
.
l2Driver
,
n
.
metrics
,
n
.
log
))
n
.
log
.
Info
(
"Admin RPC enabled"
)
}
n
.
log
.
Info
(
"Starting JSON-RPC server"
)
...
...
op-node/rollup/driver/state.go
View file @
e3ecfc47
...
...
@@ -52,9 +52,6 @@ type Driver struct {
// true when the sequencer is active, false when it is not.
sequencerActive
chan
chan
bool
// Upon receiving a channel in this channel, set the log level.
seLogLevel
chan
stringAndErrorChannel
// sequencerNotifs is notified when the sequencer is started or stopped
sequencerNotifs
SequencerStateListener
...
...
@@ -391,16 +388,6 @@ func (s *Driver) eventLoop() {
}
case
respCh
:=
<-
s
.
sequencerActive
:
respCh
<-
!
s
.
driverConfig
.
SequencerStopped
case
respCh
:=
<-
s
.
seLogLevel
:
lvlStr
:=
respCh
.
str
h
:=
s
.
log
.
GetHandler
()
lvl
,
err
:=
log
.
LvlFromString
(
lvlStr
)
if
err
!=
nil
{
respCh
.
err
<-
err
continue
}
h
=
log
.
LvlFilterHandler
(
lvl
,
h
)
s
.
log
.
SetHandler
(
h
)
case
<-
s
.
done
:
return
}
...
...
@@ -483,19 +470,7 @@ func (s *Driver) SequencerActive(ctx context.Context) (bool, error) {
}
func
(
s
*
Driver
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
string
)
error
{
sCh
:=
stringAndErrorChannel
{
str
:
lvl
,
err
:
make
(
chan
error
,
1
),
}
select
{
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
case
s
.
seLogLevel
<-
sCh
:
select
{
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
}
}
return
nil
}
// syncStatus returns the current sync status, and should only be called synchronously with
...
...
@@ -575,11 +550,6 @@ type hashAndErrorChannel struct {
err
chan
error
}
type
stringAndErrorChannel
struct
{
str
string
err
chan
error
}
// checkForGapInUnsafeQueue checks if there is a gap in the unsafe queue and attempts to retrieve the missing payloads from an alt-sync method.
// WARNING: This is only an outgoing signal, the blocks are not guaranteed to be retrieved.
// Results are received through OnUnsafeL2Payload.
...
...
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