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

Refactor the remote debugger and add support for using the execution data API #6929

Merged
merged 6 commits into from
Jan 28, 2025

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented Jan 23, 2025

  • Refactor and improve the code of the remote debugger
  • Add a new storage snapshot backed by the execution data / state streaming API implemented by access nodes
  • Enable EVM
  • Add support for getCurrentBlock() calls
  • Add a flag that dumps all read and written registers
  • Add support for running "mid-block" transaction: Also run all transactions preceding the TX in question

@turbolent turbolent requested a review from a team January 23, 2025 23:33
@turbolent turbolent requested a review from a team as a code owner January 23, 2025 23:33
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 325 lines in your changes missing coverage. Please review.

Project coverage is 41.06%. Comparing base (92d5d24) to head (15f26d2).
Report is 41 commits behind head on master.

Files with missing lines Patch % Lines
cmd/util/cmd/debug-tx/cmd.go 0.00% 153 Missing ⚠️
cmd/util/cmd/debug-script/cmd.go 0.00% 63 Missing ⚠️
utils/debug/remoteView.go 0.00% 51 Missing ⚠️
utils/debug/api.go 0.00% 30 Missing ⚠️
utils/debug/remoteDebugger.go 0.00% 14 Missing ⚠️
utils/debug/registerCache.go 0.00% 10 Missing ⚠️
fvm/environment/block_info.go 0.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6929      +/-   ##
==========================================
- Coverage   41.08%   41.06%   -0.03%     
==========================================
  Files        2119     2120       +1     
  Lines      185893   186100     +207     
==========================================
+ Hits        76383    76426      +43     
- Misses     103105   103261     +156     
- Partials     6405     6413       +8     
Flag Coverage Δ
unittests 41.06% <0.00%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +144 to +148
if info.blocks == nil {
return runtime.Block{}, false, errors.NewOperationNotSupportedError(
"GetBlockAtHeight")
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Move this check after the use of info.blockHeader, which is set in the remote debugger

Copy link
Contributor

@janezpodhostnik janezpodhostnik left a comment

Choose a reason for hiding this comment

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

Thank you for the new feature and the cleanup!

}
}

func sortRegisters(registerIDs []flow.RegisterID) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note (for future expansion): I actually often find it most useful to have the registers sorted in read order for debugging. However currently that ordering is lost because we put the reads in a map.

@turbolent
Copy link
Member Author

turbolent commented Jan 28, 2025

@janezpodhostnik Added support for running "mid-block" transactions in 15f26d2. Can you please take another look and let me know if that looks right? Thanks!

@turbolent turbolent added this pull request to the merge queue Jan 28, 2025
Merged via the queue into master with commit c8240d3 Jan 28, 2025
56 checks passed
@turbolent turbolent deleted the bastian/improve-remote-debugger branch January 28, 2025 23:56
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.

4 participants