Skip to content

Deduplicate Engine API validations in Miner.prepareWork #688

@sebastianst

Description

@sebastianst

We duplicate quite a few validation checks of the payload attributes in Miner.prepareWork that are also already done as part of the Engine API validation checks in eth/catalyst/api_optimism.go. And we keep adding new checks for new features.

We also keep bloating up the tests in miner/payload_building_test.go to cover all those new checks.

We should consider dropping all such validations and the tests and just assume that the payload attributes are valid when Miner.generateWork is called, because the only external entry point to the miner is via the Engine API engine_forkchoiceUpdated. This would save code and headache while not making the overall software less secure. I'm not aware how invalid payload attributes should reach the miner if all invalid attributes are already caught early during FCU call attributes validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions