ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.14k stars 278 forks source link

Improve block signature verification #6613

Open twoeths opened 5 months ago

twoeths commented 5 months ago

Problem description

When we receive an invalid signature block, we log something like:

1431597:Mar-28 17:05:14.470[network]          warn: Error receiving block slot=8735124, peer=16Uiu2HAmQMr7RYZPDb56G7LzuRPMaf7upo2r6keaYDsBQAEqhFA7, code=BLOCK_ERROR_INVALID_SIGNATURE, slot=8735123

while Prysm logs more specific error:

Mar 28 10:05:13 t beacon-chain[1075038]: time="2024-03-28 10:05:13" level=error msg="Could not handle p2p pubsub" error="failed to validate consensus state transition function: could not execute state transition: could not process block: process_sync_aggregate failed: could not verify sync committee signature: invalid sync committee signature" prefix=sync topic="/eth2/6a95a1a9/beacon_block/ssz_snappy

Solution description

we should be able to log which specific signatures of block are invalid. When a gossip block already fails signature verification, we should do a retry to know which signatures are invalid since timing is not important anymore

Additional context

No response

philknows commented 5 months ago

I would like see if we can prioritize this one only because this concerns an important part of block production. Please discuss if in disagreement. Prioritizing high on this one.

twoeths commented 5 months ago

I'd make this as medium as it's all about logging only, it does not change any functionalities. And we want it for all blocks we receive, not only the block produced by "this node" but it's really nice to have the expected log in order to ease any investigation when we receive an invalid signature block again