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

docs: Add documentation for debugging transactions #2774

Merged
merged 4 commits into from
Aug 7, 2024

Conversation

victor-yanev
Copy link
Contributor

@victor-yanev victor-yanev commented Jul 31, 2024

Description:

This PR adds a new file debugging-transactions.md to provide detailed guidance on debugging transactions using Remix IDE, the Truffle CLI and how to manually call the debug_traceTransaction method.

Changes:

  • Added debugging-transactions.md to the docs directory.
  • The new documentation includes:
    • An overview of debugging tools in Remix.
    • Steps to use the built-in debugger in Remix.
    • Examples of debugging a transaction using the built-in debugger.
    • Steps to use the debugging tool from Truffle
    • Examples of debugging a transaction with Truffle
    • Instructions for manually calling the debug_traceTransaction method.
    • Examples of using debug_traceTransaction with callTracer and opcodeLogger.

Motivation:
The addition of this documentation aims to help developers effectively debug their smart contracts by providing comprehensive instructions and examples.

Related issue(s):

Fixes #2432

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@victor-yanev victor-yanev added the documentation Improvements or additions to documentation label Jul 31, 2024
@victor-yanev victor-yanev added this to the 0.54.0 milestone Jul 31, 2024
@victor-yanev victor-yanev self-assigned this Jul 31, 2024
@victor-yanev victor-yanev requested a review from a team as a code owner July 31, 2024 14:39
Copy link

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled should execute "eth_getTransactionByHash with missing transaction". This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact
Cost: 40,659.4 ms

Heap Statistics (before vs after executing the test):

  • Total Heap Size: increased with 786.43 KB
  • Total Heap Size Executable: no changes
  • Total Physical Size: increased with 786.43 KB
  • Total Available Size: increased with 1.57 MB
  • Total Global Handles Size: no changes
  • Used Global Handles Size: decreased with 64.00 bytes
  • Used Heap Size: decreased with 2.55 MB
  • Heap Size Limit: no changes
  • Malloced Memory: no changes
  • External Memory: no changes
  • Peak Malloced Memory: no changes

Heap Space Statistics (before vs after executing the test):

  • Old Space:
    • Space Size: increased with 786.43 KB
    • Space Used Size: increased with 544.38 KB
    • Space Available Size: decreased with 467.14 KB
    • Physical Space Size: increased with 786.43 KB

Recommendations

Please investigate the memory allocations in this test, focusing on objects that are not being properly deallocated.

Copy link

github-actions bot commented Jul 31, 2024

Tests

    3 files  165 suites   14s ⏱️
885 tests 884 ✔️ 1 💤 0
898 runs  897 ✔️ 1 💤 0

Results for commit 884465e.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 31, 2024

Acceptance Tests

  19 files  222 suites   30m 14s ⏱️
613 tests 607 ✔️ 4 💤 2
648 runs  642 ✔️ 4 💤 2

Results for commit 884465e.

♻️ This comment has been updated with latest results.

@acuarica
Copy link
Contributor

Should we use docs: instead of chore: for the PR title?

Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

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

lg, left some comments we can iterate on

docs/debugging-transactions.md Outdated Show resolved Hide resolved
docs/debugging-transactions.md Show resolved Hide resolved
docs/debugging-transactions.md Outdated Show resolved Hide resolved
@victor-yanev victor-yanev changed the title chore: Add docs for debugging of transactions docs: Add documentation for debugging transactions Aug 6, 2024
@victor-yanev victor-yanev requested review from acuarica, georgi-l95 and a team August 6, 2024 17:32
Signed-off-by: Victor Yanev <[email protected]>
david-bakin-sl
david-bakin-sl previously approved these changes Aug 6, 2024
Copy link
Member

@david-bakin-sl david-bakin-sl left a comment

Choose a reason for hiding this comment

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

Very nice - and definitely needed! I feel like I could do it now.

LGTM but there are a couple of suggestions if you like.

docs/debugging-transactions.md Show resolved Hide resolved
docs/debugging-transactions.md Outdated Show resolved Hide resolved
docs/debugging-transactions.md Show resolved Hide resolved
docs/debugging-transactions.md Show resolved Hide resolved
@victor-yanev victor-yanev requested a review from a team August 6, 2024 17:56
Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

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

looking good

docs/debugging-transactions.md Show resolved Hide resolved
Signed-off-by: Victor Yanev <[email protected]>
Copy link

sonarcloud bot commented Aug 7, 2024

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.86%. Comparing base (265e137) to head (884465e).
Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2774      +/-   ##
==========================================
+ Coverage   77.06%   77.86%   +0.79%     
==========================================
  Files          40       43       +3     
  Lines        3266     3329      +63     
  Branches      683      706      +23     
==========================================
+ Hits         2517     2592      +75     
+ Misses        529      491      -38     
- Partials      220      246      +26     
Flag Coverage Δ
relay 78.95% <ø> (?)
server 74.61% <ø> (?)
ws-server 61.70% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 15 files with indirect coverage changes

Copy link
Member

@david-bakin-sl david-bakin-sl left a comment

Choose a reason for hiding this comment

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

LGTM!

@victor-yanev victor-yanev merged commit 06cf3ca into main Aug 7, 2024
36 of 37 checks passed
@victor-yanev victor-yanev deleted the 2432-add-docs-for-callTracer-usage branch August 7, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation for debugging transactions
3 participants