Skip to content

[Bug] _from_v06 hardcodes tx_execution_result=0, hiding actual execution results on Bradbury #308

Open

Description

@zakaziko86

Description

In genlayer_py/types/transactions.py:437, the _from_v06 class method hardcodes tx_execution_result=0 instead of reading it from the transaction data.

Impact

  • Any code using from_transaction_data() will always show NOT_VOTED as execution result on Bradbury and Asimov testnets.
  • Users cannot distinguish between successful and failed contract executions via this field.
  • While get_transaction() overrides this via getTransactionAllData, the from_transaction_data() path remains broken.

Suggested Fix

Map tx_execution_result from the appropriate field in the decoded tuple. For V06, tx_data[9] is txExecutionHash and may contain the execution result.

Notes

  • tx_execution_result maps to: 0 = NOT_VOTED, 1 = SUCCESS, 2 = FAILURE
  • Affects all users of Bradbury/Asimov testnets using from_transaction_data()

Activity

  1. 2TheMoom commented on Sep 3, 2026

    @2TheMoom

    The code this references actually lives in genlayerlabs/genlayer-py (genlayer_py/types/transactions.py), not this repo — this repo doesn't have a genlayer_py/ package. Confirmed the bug is still live there on v0.18.

    One correction on the suggested fix: tx_data[9] in the v06 shape is txExecutionHash, a bytes32 hash — not a result code — per the existing comment two lines above it in _from_v06. There's no field in the light getTransaction ABI to remap; it structurally doesn't carry an execution result on either the v04 or v06 shape (only getTransactionAllData does).

    Opened genlayerlabs/genlayer-py#114 against v0.18: widens tx_execution_result to Optional[int] and returns None from the light decode instead of the misleading 0 (which aliases to the real NOT_VOTED status), with a regression test covering both ABI shapes plus the unaffected getTransactionAllData path.

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

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