Skip to content

better logs for write report#21600

Open
fernandezlautaro wants to merge 2 commits intodevelopfrom
fixTxReceiptLogs
Open

better logs for write report#21600
fernandezlautaro wants to merge 2 commits intodevelopfrom
fixTxReceiptLogs

Conversation

@fernandezlautaro
Copy link
Contributor

Improve troubleshooting WriteReport errors. The retry.Do is swalloging internal error, making it hard to troubleshoot

Requires

Supports

@github-actions
Copy link
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

✅ No conflicts with other open PRs targeting develop

@fernandezlautaro fernandezlautaro marked this pull request as ready for review March 19, 2026 05:42
@fernandezlautaro fernandezlautaro requested review from a team as code owners March 19, 2026 05:42
Copilot AI review requested due to automatic review settings March 19, 2026 05:42
@fernandezlautaro fernandezlautaro requested a review from a team as a code owner March 19, 2026 05:42
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

Risk Rating: MEDIUM

Improves observability for EVM SubmitTransaction failures (especially around receipt retrieval) and fixes a formatting issue in remote capability request logging to make troubleshooting “write report” paths easier.

Changes:

  • Capture and log the last receipt-retrieval error from retry.Do in evmService.SubmitTransaction.
  • Return a more detailed error on receipt-retrieval failure (including both “last” and “retry” errors).
  • Fix a log call that previously used Warn with printf-style formatting by switching to Warnf.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/services/relay/evm/evm_service.go Adds logging and richer error propagation for failed receipt retrieval during SubmitTransaction.
core/capabilities/remote/executable/request/client_request.go Fixes incorrect logger method usage so formatted warning output is correct.

Areas needing scrupulous human review:

  • core/services/relay/evm/evm_service.go:288-305 — retry/error composition and whether returned error strings are relied upon by callers/tests; confirm behavior under context timeout/cancel.
  • core/services/relay/evm/evm_service.go:289-300 — confirm retry.Do semantics (e.g., whether the closure can be skipped on early context cancellation) match the new lastReceiptErr approach.

Reviewer recommendations (from CODEOWNERS):

  • For core/capabilities/...: @smartcontractkit/keystone, @smartcontractkit/capabilities-team
  • For overall/core ownership: @smartcontractkit/foundations, @smartcontractkit/core

if err != nil {
return nil, fmt.Errorf("failed getting transaction receipt. %w", err)
e.logger.Warnw("Failed getting transaction receipt", "txID", txID, "lastErr", lastReceiptErr, "retryErr", err)
return &evm.TransactionResult{TxStatus: evm.TxFatal, TxIdempotencyKey: txID}, fmt.Errorf("last err: %w retry err: %w", lastReceiptErr, err)
@cl-sonarqube-production
Copy link

@trunk-io
Copy link

trunk-io bot commented Mar 19, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
Test_CRE_V2_EVM_Write_LogTrigger/[v2]_EVM_LogTrigger_-_workflow-gateway-capabilities The test failed during the EVM LogTrigger workflow deployment, likely due to an issue with transaction mining or workflow execution. Logs ↗︎
Test_CRE_V2_EVM_Write_LogTrigger The test failed during execution of the LogTrigger write operation on the Ethereum client. Logs ↗︎

View Full Report ↗︎Docs

return &evm.TransactionResult{TxStatus: txStatus, TxIdempotencyKey: txID}, nil
}

var lastReceiptErr error
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems like an ad-hoc solution. Could you please update https://github.com/smartcontractkit/chainlink-common/blob/main/pkg/utils/retry/retry.go with error wrapping so that the latest error is also returned as the retry.Do resut?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice catch, will do.

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.

3 participants