lodestar icon indicating copy to clipboard operation
lodestar copied to clipboard

Optional randao verification when producing blocks

Open dapplion opened this issue 3 years ago • 9 comments

Implement

  • https://github.com/ethereum/beacon-APIs/pull/222

dapplion avatar Oct 04 '22 16:10 dapplion

This seems already part of this client. https://github.com/ChainSafe/lodestar/blob/011a0c4b89250b8fdc56a86f9b0a4698521554d0/packages/api/src/beacon/routes/validator.ts#L315

mkermani144 avatar May 21 '25 12:05 mkermani144

This seems already part of this client.

lodestar/packages/api/src/beacon/routes/validator.ts

Line 315 in 011a0c4

skip_randao_verification?: string;

it's there but we don't actually use it, meaning we never verify the randao right now

nflaig avatar May 21 '25 12:05 nflaig

it's there but we don't actually use it, meaning we never verify the randao right now

Should we verify the reveal against the proposer to implement this?

mkermani144 avatar May 21 '25 14:05 mkermani144

it's there but we don't actually use it, meaning we never verify the randao right now

Should we verify the reveal against the proposer to implement this?

you can read up on it here https://github.com/ethereum/beacon-APIs/pull/222

nflaig avatar May 21 '25 15:05 nflaig

@nflaig I investigated it a bit. Based on your comment, I thought the whole Randao verification is absent in Lodestar, but noticed that all the required code is already there: https://github.com/ChainSafe/lodestar/blob/2b5494153805e62342d612c56fb508282c16fa50/packages/state-transition/src/block/index.ts#L61 But skipRandaoVerification query param is not used through the passage from the route handler to the point above: https://github.com/ChainSafe/lodestar/blob/2b5494153805e62342d612c56fb508282c16fa50/packages/beacon-node/src/api/impl/validator/index.ts#L534-L535 The above parameter is not used at all.

So, can this issue be reduced to correctly using the above param, so that it causes processRandao to actually verify it?

mkermani144 avatar May 23 '25 09:05 mkermani144

So, can this issue be reduced to correctly using the above param, so that it causes processRandao to actually verify it?

yes I think as per spec we should verify the randao, haven't read up on it myself though

nflaig avatar May 23 '25 10:05 nflaig

I can work on this. Got a grasp of the requirements.

mkermani144 avatar May 24 '25 07:05 mkermani144

I can work on this. Got a grasp of the requirements.

Great thanks for looking into it, I have assigned you

nflaig avatar May 24 '25 08:05 nflaig

I opened a draft PR, so that you can confirm or comment on the overall implementation. After that, I can add some tests, etc. if needed.

mkermani144 avatar May 24 '25 11:05 mkermani144

We can keep the issue open but it feels unnecessary to implement skip_randao_verification flag as we don't even validate the randao by default right now, let's revisit this once we decide to do the validation by default

nflaig avatar Jul 18 '25 19:07 nflaig