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
4913b42a
Unverified
Commit
4913b42a
authored
Feb 15, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't log warnings when legacy block gossip validation fails
parent
7bafdba5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
gossip.go
op-node/p2p/gossip.go
+14
-6
No files found.
op-node/p2p/gossip.go
View file @
4913b42a
...
@@ -329,9 +329,9 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
...
@@ -329,9 +329,9 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
}
}
func
verifyBlockSignature
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
runCfg
GossipRuntimeConfig
,
id
peer
.
ID
,
signatureBytes
[]
byte
,
payloadBytes
[]
byte
)
pubsub
.
ValidationResult
{
func
verifyBlockSignature
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
runCfg
GossipRuntimeConfig
,
id
peer
.
ID
,
signatureBytes
[]
byte
,
payloadBytes
[]
byte
)
pubsub
.
ValidationResult
{
result
:=
verifyBlockSignatureWithHasher
(
log
,
cfg
,
runCfg
,
id
,
signatureBytes
,
payloadBytes
,
BlockSigningHash
)
result
:=
verifyBlockSignatureWithHasher
(
nil
,
cfg
,
runCfg
,
id
,
signatureBytes
,
payloadBytes
,
Legacy
BlockSigningHash
)
if
result
!=
pubsub
.
ValidationAccept
{
if
result
!=
pubsub
.
ValidationAccept
{
return
verifyBlockSignatureWithHasher
(
log
,
cfg
,
runCfg
,
id
,
signatureBytes
,
payloadBytes
,
Legacy
BlockSigningHash
)
return
verifyBlockSignatureWithHasher
(
log
,
cfg
,
runCfg
,
id
,
signatureBytes
,
payloadBytes
,
BlockSigningHash
)
}
}
return
result
return
result
}
}
...
@@ -339,13 +339,17 @@ func verifyBlockSignature(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
...
@@ -339,13 +339,17 @@ func verifyBlockSignature(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
func
verifyBlockSignatureWithHasher
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
runCfg
GossipRuntimeConfig
,
id
peer
.
ID
,
signatureBytes
[]
byte
,
payloadBytes
[]
byte
,
hasher
func
(
cfg
*
rollup
.
Config
,
payloadBytes
[]
byte
)
(
common
.
Hash
,
error
))
pubsub
.
ValidationResult
{
func
verifyBlockSignatureWithHasher
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
runCfg
GossipRuntimeConfig
,
id
peer
.
ID
,
signatureBytes
[]
byte
,
payloadBytes
[]
byte
,
hasher
func
(
cfg
*
rollup
.
Config
,
payloadBytes
[]
byte
)
(
common
.
Hash
,
error
))
pubsub
.
ValidationResult
{
signingHash
,
err
:=
hasher
(
cfg
,
payloadBytes
)
signingHash
,
err
:=
hasher
(
cfg
,
payloadBytes
)
if
err
!=
nil
{
if
err
!=
nil
{
if
log
!=
nil
{
log
.
Warn
(
"failed to compute block signing hash"
,
"err"
,
err
,
"peer"
,
id
)
log
.
Warn
(
"failed to compute block signing hash"
,
"err"
,
err
,
"peer"
,
id
)
}
return
pubsub
.
ValidationReject
return
pubsub
.
ValidationReject
}
}
pub
,
err
:=
crypto
.
SigToPub
(
signingHash
[
:
],
signatureBytes
)
pub
,
err
:=
crypto
.
SigToPub
(
signingHash
[
:
],
signatureBytes
)
if
err
!=
nil
{
if
err
!=
nil
{
if
log
!=
nil
{
log
.
Warn
(
"invalid block signature"
,
"err"
,
err
,
"peer"
,
id
)
log
.
Warn
(
"invalid block signature"
,
"err"
,
err
,
"peer"
,
id
)
}
return
pubsub
.
ValidationReject
return
pubsub
.
ValidationReject
}
}
addr
:=
crypto
.
PubkeyToAddress
(
*
pub
)
addr
:=
crypto
.
PubkeyToAddress
(
*
pub
)
...
@@ -356,10 +360,14 @@ func verifyBlockSignatureWithHasher(log log.Logger, cfg *rollup.Config, runCfg G
...
@@ -356,10 +360,14 @@ func verifyBlockSignatureWithHasher(log log.Logger, cfg *rollup.Config, runCfg G
// This means we may drop old payloads upon key rotation,
// This means we may drop old payloads upon key rotation,
// but this can be recovered from like any other missed unsafe payload.
// but this can be recovered from like any other missed unsafe payload.
if
expected
:=
runCfg
.
P2PSequencerAddress
();
expected
==
(
common
.
Address
{})
{
if
expected
:=
runCfg
.
P2PSequencerAddress
();
expected
==
(
common
.
Address
{})
{
if
log
!=
nil
{
log
.
Warn
(
"no configured p2p sequencer address, ignoring gossiped block"
,
"peer"
,
id
,
"addr"
,
addr
)
log
.
Warn
(
"no configured p2p sequencer address, ignoring gossiped block"
,
"peer"
,
id
,
"addr"
,
addr
)
}
return
pubsub
.
ValidationIgnore
return
pubsub
.
ValidationIgnore
}
else
if
addr
!=
expected
{
}
else
if
addr
!=
expected
{
if
log
!=
nil
{
log
.
Warn
(
"unexpected block author"
,
"err"
,
err
,
"peer"
,
id
,
"addr"
,
addr
,
"expected"
,
expected
)
log
.
Warn
(
"unexpected block author"
,
"err"
,
err
,
"peer"
,
id
,
"addr"
,
addr
,
"expected"
,
expected
)
}
return
pubsub
.
ValidationReject
return
pubsub
.
ValidationReject
}
}
return
pubsub
.
ValidationAccept
return
pubsub
.
ValidationAccept
...
...
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