From 4087510c2e364c218d34d85c0b1a3bb60d919a69 Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Tue, 21 Mar 2023 10:38:06 +0100 Subject: [PATCH] Total difficulty can be huge on Gnosis (#7149) This fixes the following issue observed on gnosis_withdrawals_devnet_2: ``` [DBUG] [03-21|09:24:15.060] Handling incoming message stream=RecvMessage err="newBlock66: too large block TD: bitlen 144" ``` --- eth/protocols/eth/protocol.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/eth/protocols/eth/protocol.go b/eth/protocols/eth/protocol.go index efed712ed..a947d309a 100644 --- a/eth/protocols/eth/protocol.go +++ b/eth/protocols/eth/protocol.go @@ -394,15 +394,7 @@ func (nbp *NewBlockPacket) DecodeRLP(s *rlp.Stream) error { // SanityCheck verifies that the values are reasonable, as a DoS protection func (request *NewBlockPacket) SanityCheck() error { - if err := request.Block.SanityCheck(); err != nil { - return err - } - //TD at mainnet block #7753254 is 76 bits. If it becomes 100 million times - // larger, it will still fit within 100 bits - if tdLen := request.TD.BitLen(); tdLen > 100 { - return fmt.Errorf("too large block TD: bitlen %d", tdLen) - } - return nil + return request.Block.SanityCheck() } // GetBlockBodiesPacket represents a block body query.