Skip to content

Design versioning and invariants for program code data (metadata, valid flag, valid codes) #5562

Description

@grishasobol

Problem

Program-code data has inconsistent versioning. instrumented_code is keyed by (runtime_id, code_id), but code_metadata, code_valid and valid_codes (ethexe/common/src/db.rs) are keyed only by code_id — even though they can be runtime/instrumentation-version specific (e.g. instrumentation status differs per CODES_INSTRUMENTATION_VERSION).

This forces hacks: the reinstrumentation-failure path in instrumented_code_and_metadata (ethexe/processor/src/handling/run/mod.rs) fabricates a CodeMetadata (reusing stale fields or defaults) solely to persist InstrumentationStatus::InstrumentationFailed.

Goal

Design proper versioning and invariants for program-code data:

  • decide which fields are runtime/instrumentation-version specific and key them accordingly (e.g. with runtime_id);
  • define the invariants between original_code, instrumented_code, code_metadata, code_valid, valid_codes;
  • represent failed-instrumentation state without fabricating fake metadata.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

scope: vara.ethVara Ethereum application layer (L2)type: refactorInternal improvements without changing behavior

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions