Description
In genlayer_py/contracts/actions.py:375-376, the function detects whether to include valid_until by checking if the ABI has 6 or more arguments:
if len(contract_fn.argument_types) >= 6:
add_transaction_args.append(valid_until)
Impact
- If
addTransaction ABI is updated to 7+ arguments, only 6 will be supplied, causing TypeError: Mismatched argument count.
- The consensus contract ABI is fetched dynamically from RPC and could change without a library update.
- Current code works accidentally — Bradbury has exactly 6 args and Asimov has 5.
Suggested Fix
# Option A: Exact match
if len(contract_fn.argument_types) == 6:
add_transaction_args.append(valid_until)
# Option B: Named parameter check
if "valid_until" in [inp["name"] for inp in contract_fn.abi["inputs"]]:
add_transaction_args.append(valid_until)
Notes
- Current
>= 6 check is accidental correctness.
- A future protocol upgrade adding a 7th argument will silently break transaction encoding.
Description
In
genlayer_py/contracts/actions.py:375-376, the function detects whether to includevalid_untilby checking if the ABI has 6 or more arguments:Impact
addTransactionABI is updated to 7+ arguments, only 6 will be supplied, causingTypeError: Mismatched argument count.Suggested Fix
Notes
>= 6check is accidental correctness.