Skip to content

Enable definition of client exception mappers via "external" file #2631

@danceratopz

Description

@danceratopz

Currently, client exception verification depends on exception mappers defined as Python source within execution-specs, for example:

class EthrexExceptionMapper(ExceptionMapper):
"""Ethrex exception mapper."""
mapping_substring = {
BlockException.INVALID_GASLIMIT: (
"Gas limit changed more than allowed from the parent"
),
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
"Exceeded MAX_BLOB_GAS_PER_BLOCK"
),

This creates friction for client teams and STEEL as any change in exception message strings requires a PR to execution-specs. This friction could be eliminated if we allow clients to define exception mappers in their own repo (as one of toml/yaml/json) and enable import of these files to populate our exception mappers.

Additionally,m #2622 enables exception mapping for state, blockchain and blockchain engine test fixtures. Imo, now is the time to move the primary test approach from hive (system) to module testing. In which case, clients can run these tests on every push in CI. This means, if we keep the status quo, client teams would need to PR to execution-specs in order to fix exceptions, which is clearly unacceptable. Allowing clients to enable their own exception mappers would greatly simplify this process.

h/t @edg-l who originally made this suggestion!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-test-client-clisArea: execution_testing.client_clisA-test-consumeArea: execution_testing.cli.pytest_commands.plugins.consumeA-test-exceptionsArea: execution_testing.exceptionsC-featCategory: an improvement or new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions