erigon icon indicating copy to clipboard operation
erigon copied to clipboard

Bad BlockBodies RLP message on Sepolia

Open battlmonstr opened this issue 1 year ago • 1 comments

System information

Erigon version: ./erigon --version

client_id=erigon/v2.57.1-9f1cd651/linux-amd64/go1.20.12 enode_url=enode://11c69ca1b5418a5330e7c9e5239e34cd40ae492c740da0577c452ba753d0230350dce148b157ede58841b82a2c576ddf44f2c9a2ebed0182a8aa8c6046e7d408@207.188.6.55:30303

OS & Version: Windows/Linux/OSX

Linux

Commit hash:

v2.57.1

Erigon Command (with flags/config):

?

Consensus Layer:

?

Chain/Network:

Sepolia

Expected behaviour

Erigon must not send malformed messages.

Actual behaviour

Some erigon peers on Sepolia reply to GetBlockBodies with a bad BlockBodies RLP message. The message data (binary RLP of the BlockRawBodiesPacket66) is attached: msg2.log (note: it is a binary file)

This message starts with block 5187066: https://sepolia.etherscan.io/block/5187066

This code produces an error trying to decode it:

//go:embed msg2.log
var data1 []byte

func Test1(t *testing.T) {
	var request BlockRawBodiesPacket66
	if err := rlp.DecodeBytes(data1, &request); err != nil {
		t.Error(err.Error())
	}
}

Error:

rlp: element is larger than containing list

The reason is that the RawBody.Transactions RLP list payload size (156100) is smaller than the expected sum of individual transaction RLPs.

Steps to reproduce the behaviour

Start a fresh silkworm Sepolia node and wait for some erigon peers.

When a bad message arrives, it logs these warnings:

received and ignored a malformed message peer=... msg=22 error=Decoding error : kInputTooShort

Questions

  • is it a known issue?
  • was it fixed in v2.58 or v2.59?
  • could it be related to RawBody.Withdrawals? (this block has 16 withdrawals)
  • could it be related to blob transactions?

battlmonstr avatar Mar 22 '24 15:03 battlmonstr

CC @canepat

battlmonstr avatar Mar 22 '24 15:03 battlmonstr

seems fix in #9691 code: https://github.com/ledgerwatch/erigon/pull/9691/files#diff-6faf86a703842ab87bfecfe7039cfd72612186c3198e5b7ffbe7a57390b5423eR135 but this codes are not at the last version yet.

marshalys avatar Apr 22 '24 15:04 marshalys

@racytech , could you confirm if this is fixed by your PR?

battlmonstr avatar Apr 23 '24 15:04 battlmonstr

Sorry, @battlmonstr couldn't see this earlier and I can't confirm it yet. But I think https://github.com/ledgerwatch/erigon/pull/9691 created this error, I'll check it asap

racytech avatar Apr 28 '24 00:04 racytech