Enable late re-org and re-org interactive tests #9405
Conversation
| .get_advanced_hot_state(head_block_root, slot, parent_state_root) | ||
| .map_err(BlockProductionError::FailedToLoadState)? | ||
| .ok_or(BlockProductionError::UnableToProduceAtSlot(slot))?; | ||
| //TODO(manas): deal with this weird shit here with the parent_payload_status |
There was a problem hiding this comment.
Should just be the head_payload_status as before, I think?
There was a problem hiding this comment.
Note: need to handle the fork boundary case (use empty if gloas is not enabled at parent_state.slot(), or equivalently !state.fork_name_unchecked().gloas_enabled()).
| let parent_payload_status = match self | ||
| .canonical_head | ||
| .fork_choice_read_lock() | ||
| .should_extend_payload(&re_org_parent_block) | ||
| { |
There was a problem hiding this comment.
I think we should experiment with choosing based on weight, because should_extend_payload is now firmly only for the previous slot. In the case we are doing a reorg, the parent is not the previous slot (it'll be N - 2 where N is the proposal slot)
Spec change:
There was a problem hiding this comment.
Oops, should_extend_payload does work at slots prior to previous, but I think it's still not quite the right choice because it prioritises the PTC rather than the attesters.
I think instead we should choose based on attestation weight. We could use:
self
.canonical_head
.fork_choice_read_lock()
.get_canonical_payload_status(&re_org_parent_block, &self.spec)?| // own execution block hash. We skip this when B will be re-orged, since the execution layer | ||
| // must never be told about a block that is about to be re-orged away. |
There was a problem hiding this comment.
Not true in general (it is OK for the EL to know)
| }) | ||
| } | ||
|
|
||
| // TODO(gloas): wrong for Gloas, needs an update |
There was a problem hiding this comment.
After Gloas we just shouldn't call this function (the ELs will handle the reorgs without this hack).
Issue Addressed
#8959
WIP still working on adding more re-org tests and refactoring existing.