feat(fuel): enhance merkle proof logging with digest, encoded_data, and offset #2913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
accumulator_update.sw
before merkle proof extraction in the update loopmain.sw
for the price feed update pathHow has this been tested?
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.
Critical items for reviewer attention:
Production Impact: These are always-on log statements inside loops - consider if they should be:
Performance: Logging occurs inside
while
loops that process multiple price feed updates - verify acceptable performance impactData Types: Verify that
digest
,encoded_data.len()
, andoffset
log correctly and don't cause runtime errorsIntent Alignment: The original request mentioned enhancing an existing log statement, but I added new logging. Confirm this matches the intended approach.
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])