Skip to content

Fix nil txReceipt handling in SetOutputVarForStep #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2025

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fix nil txReceipt handling in SetOutputVarForStep

Description

This PR fixes the test failure in PR #215 by properly handling nil txReceipt in the ContractWriteProcessor's SetOutputVarForStep method. The issue was that the code was trying to include txReceipt in output variables without checking if it was nil first, which could cause a nil pointer dereference.

Changes

  • Updated SetOutputVarForStep to only include txReceipt in output variables if it's not nil

Testing

The fix addresses the failing test TestContractWriteSimpleReturn in the core/taskengine package.

Related Issues

Fixes the test failure in PR #215: https://github.com/AvaProtocol/EigenLayer-AVS/actions/runs/14543855857/job/40806468997?pr=215

Link to Devin run

https://app.devin.ai/sessions/8fedac6730214293bcba154bf20912c2

Requested by: Chris Li (chris@avaprotocol.org)

Co-Authored-By: Chris Li <chris.li.2046@gmail.com>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor

@Copilot 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 fixes an issue in the ContractWriteProcessor by ensuring that txReceipt is only added to the output variables if it is not nil, preventing a potential nil pointer dereference.

  • Introduces a local map (outputVars) to construct output variables.
  • Conditionally adds txReceipt to outputVars based on a nil check.
  • Updates the call to SetOutputVarForStep with the refined outputVars.
Comments suppressed due to low confidence (1)

core/taskengine/vm_runner_contract_write.go:181

  • The variable 'txReceipt' is not defined in this scope; it appears you intended to check 'outputData.ContractWrite.TxReceipt'.
if txReceipt != nil {

@chrisli30 chrisli30 merged commit a1ff6af into staging May 10, 2025
13 checks passed
@chrisli30 chrisli30 deleted the devin/1746837853-fix-nil-txreceipt-only branch May 10, 2025 17:37
chrisli30 added a commit that referenced this pull request May 14, 2025
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Chris Li <chris.li.2046@gmail.com>
chrisli30 added a commit that referenced this pull request May 21, 2025
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Chris Li <chris.li.2046@gmail.com>
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