Closed advaita-saha closed 1 month ago
A probable fix to this might be to use the state, @jangko can comment further if it's viable or not https://github.com/status-im/nimbus-eth1/blob/ea74e035ab019619fc00b46ab97496b502a188dd/nimbus/beacon/api_handler/api_forkchoice.nim#L159
This can be changed to
if db.getSavedStateBlockNumber() >= header.number :
notice "Ignoring beacon update to old head",
blockHash=blockHash.short,
blockNumber=header.number
return validFCU(Opt.none(PayloadID), blockHash)
When a payload is sent to eth1, it processes and validates fine but then
fcu
is called, and says it isupdating to the old head
and thus ignoring the requestShouldn't behave like that, but it is because of the payload processing In the
new_payload
, we are also persisting the header to the db https://github.com/status-im/nimbus-eth1/blob/ea74e035ab019619fc00b46ab97496b502a188dd/nimbus/core/chain/forked_chain.nim#L88-L95Then when the fcu call takes place, it checks if the header is there in the db, and it is thus ignoring the fcu call https://github.com/status-im/nimbus-eth1/blob/ea74e035ab019619fc00b46ab97496b502a188dd/nimbus/beacon/api_handler/api_forkchoice.nim#L158-L163
A similar issue arising from the same persistence of header #2588