Skip to content

feat(fuel): enhance merkle proof logging with digest, encoded_data, and offset #2913

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Summary

Enhanced debug logging for merkle proof extraction in Fuel smart contracts by adding comprehensive logging statements before PriceFeed::extract_from_merkle_proof calls. The logging includes digest values, encoded data length, and offset positions to aid in debugging merkle proof extraction issues.

Rationale

This change was requested to improve debugging capabilities when troubleshooting merkle proof extraction failures. The enhanced logging provides visibility into the exact values being passed to the merkle proof extraction function, helping identify issues with data corruption, incorrect offsets, or malformed digests.

Changes made:

  • Added debug logging in accumulator_update.sw before merkle proof extraction in the update loop
  • Added identical logging in main.sw for the price feed update path
  • Logs include: descriptive message, digest bytes, encoded data length, and current offset

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

Testing Status: These changes could not be tested locally due to environment setup constraints. The changes are purely additive debug logging statements that should not affect core functionality.

⚠️ Review Checklist

Critical items for reviewer attention:

  1. Production Impact: These are always-on log statements inside loops - consider if they should be:

    • Conditional based on debug flags
    • Removed before production deployment
    • Rate-limited to prevent log flooding
  2. Performance: Logging occurs inside while loops that process multiple price feed updates - verify acceptable performance impact

  3. Data Types: Verify that digest, encoded_data.len(), and offset log correctly and don't cause runtime errors

  4. Intent Alignment: The original request mentioned enhancing an existing log statement, but I added new logging. Confirm this matches the intended approach.

  5. Log Format: Consider if the current multi-line logging format is optimal or if structured logging would be better


Link to Devin run: https://app.devin.ai/sessions/ed53f83d3fdd4064961d619aa9895217
Requested by: @ayushboss ([email protected])

…nd offset

- Add comprehensive debug logging before PriceFeed::extract_from_merkle_proof calls
- Include digest, encoded_data length, and offset values for better debugging
- Applied to both accumulator_update.sw and main.sw locations
- Helps troubleshoot merkle proof extraction issues

Co-Authored-By: [email protected] <[email protected]>
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

vercel bot commented Jul 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:23pm
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:23pm
developer-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:23pm
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:23pm
entropy-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:23pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:23pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:23pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:23pm

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.

0 participants