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
dd604bd9
Commit
dd604bd9
authored
Sep 24, 2023
by
dhanu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup-logging-service-utils add admin_setLogLevel
parent
4e8c6222
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
2 deletions
+50
-2
l2_verifier.go
op-e2e/actions/l2_verifier.go
+4
-0
api.go
op-node/node/api.go
+7
-0
server_test.go
op-node/node/server_test.go
+4
-0
state.go
op-node/rollup/driver/state.go
+34
-0
rollupclient.go
op-node/sources/rollupclient.go
+1
-2
No files found.
op-e2e/actions/l2_verifier.go
View file @
dd604bd9
...
@@ -127,6 +127,10 @@ func (s *l2VerifierBackend) SequencerActive(ctx context.Context) (bool, error) {
...
@@ -127,6 +127,10 @@ func (s *l2VerifierBackend) SequencerActive(ctx context.Context) (bool, error) {
return
false
,
nil
return
false
,
nil
}
}
func
(
s
*
l2VerifierBackend
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
string
)
error
{
return
nil
}
func
(
s
*
L2Verifier
)
L2Finalized
()
eth
.
L2BlockRef
{
func
(
s
*
L2Verifier
)
L2Finalized
()
eth
.
L2BlockRef
{
return
s
.
derivation
.
Finalized
()
return
s
.
derivation
.
Finalized
()
}
}
...
...
op-node/node/api.go
View file @
dd604bd9
...
@@ -28,6 +28,7 @@ type driverClient interface {
...
@@ -28,6 +28,7 @@ type driverClient interface {
StartSequencer
(
ctx
context
.
Context
,
blockHash
common
.
Hash
)
error
StartSequencer
(
ctx
context
.
Context
,
blockHash
common
.
Hash
)
error
StopSequencer
(
context
.
Context
)
(
common
.
Hash
,
error
)
StopSequencer
(
context
.
Context
)
(
common
.
Hash
,
error
)
SequencerActive
(
context
.
Context
)
(
bool
,
error
)
SequencerActive
(
context
.
Context
)
(
bool
,
error
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
string
)
error
}
}
type
rpcMetrics
interface
{
type
rpcMetrics
interface
{
...
@@ -71,6 +72,12 @@ func (n *adminAPI) SequencerActive(ctx context.Context) (bool, error) {
...
@@ -71,6 +72,12 @@ func (n *adminAPI) SequencerActive(ctx context.Context) (bool, error) {
return
n
.
dr
.
SequencerActive
(
ctx
)
return
n
.
dr
.
SequencerActive
(
ctx
)
}
}
func
(
n
*
adminAPI
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
string
)
error
{
recordDur
:=
n
.
m
.
RecordRPCServerRequest
(
"admin_setLogLevel"
)
defer
recordDur
()
return
n
.
dr
.
SetLogLevel
(
ctx
,
lvl
)
}
type
nodeAPI
struct
{
type
nodeAPI
struct
{
config
*
rollup
.
Config
config
*
rollup
.
Config
client
l2EthClient
client
l2EthClient
...
...
op-node/node/server_test.go
View file @
dd604bd9
...
@@ -224,3 +224,7 @@ func (c *mockDriverClient) StopSequencer(ctx context.Context) (common.Hash, erro
...
@@ -224,3 +224,7 @@ func (c *mockDriverClient) StopSequencer(ctx context.Context) (common.Hash, erro
func
(
c
*
mockDriverClient
)
SequencerActive
(
ctx
context
.
Context
)
(
bool
,
error
)
{
func
(
c
*
mockDriverClient
)
SequencerActive
(
ctx
context
.
Context
)
(
bool
,
error
)
{
return
c
.
Mock
.
MethodCalled
(
"SequencerActive"
)
.
Get
(
0
)
.
(
bool
),
nil
return
c
.
Mock
.
MethodCalled
(
"SequencerActive"
)
.
Get
(
0
)
.
(
bool
),
nil
}
}
func
(
c
*
mockDriverClient
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
string
)
error
{
return
c
.
Mock
.
MethodCalled
(
"SetLogLevel"
)
.
Get
(
0
)
.
(
error
)
}
op-node/rollup/driver/state.go
View file @
dd604bd9
...
@@ -52,6 +52,9 @@ type Driver struct {
...
@@ -52,6 +52,9 @@ type Driver struct {
// true when the sequencer is active, false when it is not.
// true when the sequencer is active, false when it is not.
sequencerActive
chan
chan
bool
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 is notified when the sequencer is started or stopped
sequencerNotifs
SequencerStateListener
sequencerNotifs
SequencerStateListener
...
@@ -388,6 +391,16 @@ func (s *Driver) eventLoop() {
...
@@ -388,6 +391,16 @@ func (s *Driver) eventLoop() {
}
}
case
respCh
:=
<-
s
.
sequencerActive
:
case
respCh
:=
<-
s
.
sequencerActive
:
respCh
<-
!
s
.
driverConfig
.
SequencerStopped
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
:
case
<-
s
.
done
:
return
return
}
}
...
@@ -469,6 +482,22 @@ func (s *Driver) SequencerActive(ctx context.Context) (bool, error) {
...
@@ -469,6 +482,22 @@ 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
()
}
}
}
// syncStatus returns the current sync status, and should only be called synchronously with
// syncStatus returns the current sync status, and should only be called synchronously with
// the driver event loop to avoid retrieval of an inconsistent status.
// the driver event loop to avoid retrieval of an inconsistent status.
func
(
s
*
Driver
)
syncStatus
()
*
eth
.
SyncStatus
{
func
(
s
*
Driver
)
syncStatus
()
*
eth
.
SyncStatus
{
...
@@ -546,6 +575,11 @@ type hashAndErrorChannel struct {
...
@@ -546,6 +575,11 @@ type hashAndErrorChannel struct {
err
chan
error
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.
// 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.
// WARNING: This is only an outgoing signal, the blocks are not guaranteed to be retrieved.
// Results are received through OnUnsafeL2Payload.
// Results are received through OnUnsafeL2Payload.
...
...
op-node/sources/rollupclient.go
View file @
dd604bd9
...
@@ -5,7 +5,6 @@ import (
...
@@ -5,7 +5,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
...
@@ -60,6 +59,6 @@ func (r *RollupClient) SequencerActive(ctx context.Context) (bool, error) {
...
@@ -60,6 +59,6 @@ func (r *RollupClient) SequencerActive(ctx context.Context) (bool, error) {
return
result
,
err
return
result
,
err
}
}
func
(
r
*
RollupClient
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
log
.
Lvl
)
error
{
func
(
r
*
RollupClient
)
SetLogLevel
(
ctx
context
.
Context
,
lvl
string
)
error
{
return
r
.
rpc
.
CallContext
(
ctx
,
nil
,
"admin_setLogLevel"
,
lvl
)
return
r
.
rpc
.
CallContext
(
ctx
,
nil
,
"admin_setLogLevel"
,
lvl
)
}
}
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