Engine API: respond with error if payload attributes are invalid#211
Conversation
|
As I already wrote in the previous thread, I prefer this approach as it makes the code more modular and we don't interleave the two different semantics of fcu |
djrtwo
left a comment
There was a problem hiding this comment.
I'm generally fine with this error code.
So there are other things that could make payloadAttributes invalid wrt CL (e.g. not being the correct 12s offset, having a bad prevrandao) but is the point here that the only thing that can be invalid wrt EL is the timestamp?
After looking at the current values there, I agree. just wanted to make sure.
Yes, it seems that EL can do the |
Enforces the following validity condition before starting a build process:
payloadAttributes.timestamp > headBlock.timestamp. If this condition isn't met responds with error but does not rolls back fork choice updated. EntireforkchoiceUpdatedprocessing flow looks as follows after this change:headBlockis known and there is no missing data. If there are missing data respond withSYNCINGheadBlockisVALID. If it's not respond withINVALIDforkchoiceStatepayloadAttributes.timestamp. If it's invalid respond with error:-32002: Invalid payload attributesVALIDThis might seem a bit ugly but this is a cost of double semantics of
forkchoiceUpdatedcall. An alternative would be to checkpayloadAttributesat the beginning and stop processing a call if attributes are invalid, i.e. do not apply fork choice state ifpayloadAttributesare invalid. Though, this check may not always be performed at the very beginning (imagine the case whenheadBlockis missing and EL has to respond withSYNCING). Also, having forkchoice state applied disregarding a build process state is valuable.cc @djrtwo @MariusVanDerWijden @MarekM25