Skip to content
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

✨ Feature Request: Enhance sendUserOperation with Advanced Debugging Features #126

Closed
1 task done
joepegler opened this issue Nov 24, 2024 · 0 comments
Closed
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@joepegler
Copy link
Collaborator

Feature or Improvement Description

Enhance the sendUserOperation function with advanced debugging features: 1. Log formatted UserOperation parameters using the Logger utility 2. Pack and format UserOperation data before logging using viem's helpers 3. Generate and log a Tenderly simulation link for the UserOperation

Benefits & Outcomes

  • Improved Debugging: Make it easier to debug UserOperation issues by providing detailed logs
  • Better Developer Experience: Allow developers to simulate transactions before they're sent
  • Enhanced Visibility: Provide clear insights into UserOperation parameters
  • Easier Troubleshooting: Enable quick identification of issues through Tenderly simulation
  • Consistent Logging: Utilize the existing Logger utility for standardized debug output

Implementation Ideas

  1. Add UserOperation Logging

    • Import the Logger utility
    • Add logging before the UserOperation is sent
    • Format the parameters for better readability
    • Include all relevant UserOperation fields
  2. Implement Viem Packing

    • Use viem's packUserOperation helper
    • Log both raw and packed versions of the UserOperation
    • Include gas estimates and other relevant data
  3. Add Tenderly Integration

    • Generate Tenderly simulation link
    • Include network information
    • Add relevant UserOperation parameters
    • Log the link for easy access
  4. Update Error Handling

    • Log additional debug information on errors
    • Include Tenderly link in error context
    • Maintain existing error throwing behavior
  5. Documentation

    • Document new debugging features
    • Provide examples of debug output
    • Include information about Tenderly integration

Technical Implementation Notes

  1. Import required utilities at the top of the file
  2. Add logging before the client.request call in sendUserOperation
  3. Create helper function for Tenderly link generation
  4. Enhance error handling with additional logging
  5. Consider adding debug mode toggle for verbose logging

References

Any References?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@joepegler joepegler added the enhancement New feature or request label Nov 24, 2024
@joepegler joepegler self-assigned this Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant