Skip to content

Commit 5019c60

Browse files
committed
dbft: skip extensible verification if node is syncing
Nodes (both miners and seeds) can't properly validate consensus payloads if they are syncing. This check prevents both type of nodes from consensus payloads validation if the node is in the process of the initial sync. Next possible Downloader activity is not taken into account. Close #296. Signed-off-by: Anna Shaleva <[email protected]>
1 parent 7280ac6 commit 5019c60

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

consensus/dbft/dbft.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,10 @@ func (c *DBFT) validatePayload(p *Payload) error {
15181518
// IsExtensibleAllowed determines if address is allowed to send extensible payloads
15191519
// (only consensus payloads for now) at the specified height.
15201520
func (c *DBFT) IsExtensibleAllowed(h uint64, u common.Address) bool {
1521+
// Can't verify extensible sender if the node has an outdated state.
1522+
if c.syncing.Load() {
1523+
return true
1524+
}
15211525
// Only validators are included into extensible whitelist for now.
15221526
validators, err := c.getValidators(&h, nil, nil)
15231527
if err != nil {

0 commit comments

Comments
 (0)