Skip to content

feat: support libevm debug handler RPCs#124

Open
JonathanOppenheimer wants to merge 12 commits intomainfrom
JonathanOppenheimer/support-debug-handler
Open

feat: support libevm debug handler RPCs#124
JonathanOppenheimer wants to merge 12 commits intomainfrom
JonathanOppenheimer/support-debug-handler

Conversation

@JonathanOppenheimer
Copy link
Member

@JonathanOppenheimer JonathanOppenheimer commented Jan 29, 2026

Add support for {"debug", debug.Handler}, and add simple tests to verify that the RPC doesn't explode when called.

Stephen probably won't read this.

@JonathanOppenheimer JonathanOppenheimer self-assigned this Jan 29, 2026
@JonathanOppenheimer JonathanOppenheimer added the testing Related to testing efforts label Jan 29, 2026
ARR4N
ARR4N previously requested changes Jan 30, 2026
JonathanOppenheimer and others added 2 commits January 30, 2026 11:58
Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
Signed-off-by: Jonathan Oppenheimer <147infiniti@gmail.com>
sae/rpc_test.go Outdated
Comment on lines 573 to 595
// Reference: https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug
// Every method is listed below:
//
// - debug_blockProfile
// - debug_cpuProfile
// - debug_freeOSMemory
// - debug_gcStats
// - debug_goTrace
// - debug_memStats
// - debug_mutexProfile
// - debug_setBlockProfileRate
// - debug_setGCPercent
// - debug_setMutexProfileFraction
// - debug_stacks
// - debug_startCPUProfile
// - debug_startGoTrace
// - debug_stopCPUProfile
// - debug_stopGoTrace
// - debug_verbosity
// - debug_vmodule
// - debug_writeBlockProfile
// - debug_writeMemProfile
// - debug_writeMutexProfile
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does someone reading the test code need to know this?

Copy link
Member Author

@JonathanOppenheimer JonathanOppenheimer Feb 2, 2026

Choose a reason for hiding this comment

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

A reader does not -- I personally wanted all fully "supported" RPCs to 'Command-F-able' in rpc_test.go. I take it this is not worth it to you?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Comments should generally explain why* something is being done. This one explains what some tangential piece of code does, which is redundant and can also become out of date. We also already have the searchable list at the point of registration.

FWIW the list at the point of registration is only necessary because the upstream rpc package is "magical" and doesn't require explicit registration of methods (like, for example, gRPC and proto). IMO it's an anti-pattern, and the fact that we need to document it like that is evidence of that.

*Not relevant here, but useful knowledge: the problem with "what" and "how" comments is that they're a crutch for the code being difficult to understand. They generally suggest that a refactoring is required, whereas "why" comments can't be communicated with code alone.

Copy link
Member Author

@JonathanOppenheimer JonathanOppenheimer Feb 4, 2026

Choose a reason for hiding this comment

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

Yup totally fair -- I was more referring to enumerating which RPCs are tested (as it's no longer explicitly clear now that we are only testing two of the RPCs, rather than all of them like in the first iteration), for visibility (following every RPC needs to be explicitly tested). As you said, the list is necessary in rpc.go because it's "magical" -- I was thinking the same here for what's tested. I'll remove!

@ARR4N ARR4N mentioned this pull request Feb 2, 2026
JonathanOppenheimer and others added 3 commits February 5, 2026 00:06
Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
Signed-off-by: Jonathan Oppenheimer <147infiniti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants