Skip to content

Comments

wave 1 error improvements#357

Open
wentzeld wants to merge 2 commits intodevelopfrom
error-messages-wave1
Open

wave 1 error improvements#357
wentzeld wants to merge 2 commits intodevelopfrom
error-messages-wave1

Conversation

@wentzeld
Copy link
Contributor

Changes: RPC client errors, simulated backend, tx store, attempts, finalizer, transmitchecker, stuck_tx_detector, contract read errors (13 files total)
Dependencies: None

See CRE Error Improvements

@wentzeld wentzeld requested a review from a team as a code owner February 15, 2026 17:32
Copilot AI review requested due to automatic review settings February 15, 2026 17:32
@github-actions
Copy link
Contributor

👋 wentzeld, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2026

⚠️ API Diff Results - Breaking changes detected

📦 Module: github-com-smartcontractkit-chainlink-evm

🔴 Breaking Changes (1)

pkg/client (1)
  • TerminallyStuckMsg — Value changed from "transaction terminally stuck" to "transaction is terminally stuck in the mempool and cannot be include...

📄 View full apidiff report

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is focused on improving the clarity and actionability of error messages across the EVM RPC client, tx manager components, simulated backend, and contract read layer.

Changes:

  • Makes RPC client and txmgr errors more descriptive (configuration hints, operational guidance, unsupported-chain messaging).
  • Refines contract read / logpoller error strings to better identify failure source and context.
  • Updates RPC client tests to assert on the new error messages.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/txmgr/transmitchecker.go Improves VRF transmit-checker configuration and “already fulfilled” error messages.
pkg/txmgr/stuck_tx_detector.go Expands missing-config error for stuck-tx heuristic.
pkg/txmgr/finalizer.go Replaces the “could not get receipt” saved error string with a more detailed operator-facing message.
pkg/txmgr/evm_tx_store.go Adds more context to tx attempt/tx state transition errors.
pkg/txmgr/attempts.go Improves errors for force-rebroadcast attempt creation and EIP-1559 fee validation failures.
pkg/read/errors.go Clarifies contract read, batch read, configuration, filter, and “no contract at address” error messages.
pkg/client/simulated_backend_client.go Makes simulated-backend argument validation errors more descriptive.
pkg/client/rpc_client_test.go Updates expectations for new RPC client error strings.
pkg/client/rpc_client_internal_test.go Updates expected doWithConfidence error string.
pkg/client/rpc_client.go Improves dial/subscription/unsupported-chain error messages and Astar batch-call handling errors.
pkg/client/limited_transport.go Expands “response too large” error text with remediation guidance.
pkg/client/errors.go Expands terminally-stuck message and RPC error extraction error messages.
pkg/client/compatibility_helper.go Improves invalid filter-query error message when BlockHash and range are both set.
Comments suppressed due to low confidence (1)

pkg/client/errors.go:314

  • TerminallyStuckMsg is used both as the stored Tx.Error string and as the regex pattern (regexp.MustCompile(TerminallyStuckMsg)). Changing the constant will stop matching previously persisted rows that used the old value, potentially changing how older transactions are classified on upgrade. Consider decoupling the stored message from the matching pattern (e.g., use a regex that matches both old and new forms) to preserve backward compatibility.
const TerminallyStuckMsg = "transaction is terminally stuck in the mempool and cannot be included in a block: this transaction will not be retried and must be investigated manually"

// Tx.Error messages that are set internally so they are not chain or client specific
var internal = ClientErrors{
	TerminallyStuck: regexp.MustCompile(TerminallyStuckMsg),

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 966 to 969
case *big.Int:
if v.Uint64() > 0 || len(v.Bytes()) > 20 {
return common.Address{}, errors.New("invalid *big.Int; value must be larger than 0 with a byte length <= 20")
return common.Address{}, errors.New("invalid *big.Int for address conversion: value must be greater than 0 with a byte length of 20 or fewer bytes to represent a valid EVM address")
}
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the *big.Int address conversion branch, the validation condition v.Uint64() > 0 || len(v.Bytes()) > 20 rejects every positive value, making virtually all non-zero addresses invalid. This looks inverted; it should reject negative values (and/or values whose byte length exceeds 20), not values greater than 0.

Copilot uses AI. Check for mistakes.

if fee.GasPrice == nil {
return attempt, pkgerrors.New("NewEmptyTranscation: gas price cannot be nil")
return attempt, pkgerrors.New("NewEmptyTransaction failed: gas price cannot be nil. A valid gas price is required to create a transaction for force rebroadcast")
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message returned from NewEmptyTxAttempt says "NewEmptyTransaction failed" which doesn’t match the actual function name. This can make debugging/searching logs harder; consider using the correct function name (or a consistent component prefix) in the message.

Suggested change
return attempt, pkgerrors.New("NewEmptyTransaction failed: gas price cannot be nil. A valid gas price is required to create a transaction for force rebroadcast")
return attempt, pkgerrors.New("NewEmptyTxAttempt failed: gas price cannot be nil. A valid gas price is required to create a transaction for force rebroadcast")

Copilot uses AI. Check for mistakes.
Comment on lines 215 to 219
if gasFeeCap.ToInt().Cmp(Max256BitUInt) > 0 {
return pkgerrors.New("impossibly large fee cap")
return pkgerrors.New("gas fee cap validation failed: fee cap exceeds the maximum 256-bit unsigned integer value (2^256). This likely indicates a configuration error in gas price settings")
}
if gasTipCap.ToInt().Cmp(Max256BitUInt) > 0 {
return pkgerrors.New("impossibly large tip cap")
return pkgerrors.New("gas tip cap validation failed: tip cap exceeds the maximum 256-bit unsigned integer value (2^256). This likely indicates a configuration error in gas price settings")
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uint256 upper-bound check appears off by one: Max256BitUInt is defined as 2^256, and the code only errors when feeCap > Max256BitUInt, allowing exactly 2^256. Since uint256 max is 2^256-1, this should reject values >= 2^256 (or redefine the max constant to 2^256-1) to avoid constructing an invalid EIP-1559 tx.

Copilot uses AI. Check for mistakes.
@jmank88 jmank88 requested a review from a team February 18, 2026 13:27
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.

1 participant