Skip to content

ethexe-malachite: audit follow-up — test gaps and stale insert comment #5482

Description

@grishasobol

Problem

Several small follow-ups from the May 2026 audit are tracked in design notes but not as code. Bundled here because each is too small to file separately:

  1. chain_head == None branch in validate_block_above is not unit-tested. Commit 6d302a7a0 added an instant-abstain when local chain_head is unset, but no test exercises it.

  2. TryFrom<RawProposedValue> bound check has no positive regression test. Commit 503a3d43d flipped silent From to fallible TryFrom, but the pinned-test that documented the bug was deleted along with the fix. A future refactor could re-introduce silent aliasing without breaking any test.

  3. InjectedTxMempool::insert doc comment lines 326-340 still describes the old retain policy. Commit d52c62e01 changed purge_expired to drop unresolved ref-block txs (symmetric with seen), but the inline comment in insert was not updated.

Proposed solution

A single PR with three small additions:

  1. validate_rejects_advance_when_chain_head_is_none() in service/src/externalities.rs tests module.
  2. raw_proposed_value_out_of_range_round_is_rejected() in core/src/codec.rs tests module — assert TryFrom returns Err on round = i64::MIN.
  3. Edit the doc comment in service/src/mempool.rs around the insert impl to reflect the post-commit-d52c62e01 drop policy.

Alternatives

File three separate issues — overkill for the scope of each fix.

Additional context

All three are audit follow-ups that surfaced while triaging issues already fixed (#7, #9, #10 in the audit tracker).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-friendlySuitable for AI-assisted implementation or reviewpriority: backlogLow priority, can be addressed laterscope: vara.ethVara Ethereum application layer (L2)size: SSmall task (hours)type: testAdding or improving tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions