Skip to content

Unify transaction error handling and receipt checks - #819

Merged
cyc60 merged 5 commits into
masterfrom
unify-transact-error-handling
Aug 20, 2026
Merged

Unify transaction error handling and receipt checks#819
cyc60 merged 5 commits into
masterfrom
unify-transact-error-handling

Conversation

@cyc60

@cyc60 cyc60 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Description

All tx_manager.transact() call sites hand-rolled the same wrapper: try/except ContractCustomError with decode_custom_error, a generic except Exception with format_error, and an if tx_receipt is None check — with inconsistent log levels, inconsistent verbose dumps, and two sites with partial or no handling.

This adds a shared transact_checked() helper in src/common/transaction.py that normalizes reverts, RPC errors, and unconfirmed receipts into a logged None, and converts all 9 call sites to use it:

  • Failure logging is now uniform: logger.error plus a settings.verbose exception dump everywhere (consolidate/withdrawals previously logged failures at info level).
  • submit_harvest_transaction gains generic-exception handling it previously lacked.
  • MulticallContract now includes ErrorMixin, so tx_aggregate reverts are decoded and logged instead of propagating undecoded.
  • The reward splitter raises RuntimeError on a revert instead of re-raising ContractCustomError; the loop aborts either way.
  • The raising flows (reward splitter, meta vault deposit/state update) keep their raise-on-failure semantics; the hash-returning flows keep returning HexStr | None.

Comment thread src/harvest/execution.py
@cyc60
cyc60 merged commit eb2e746 into master Aug 20, 2026
10 checks passed
@cyc60
cyc60 deleted the unify-transact-error-handling branch August 20, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants