-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add enableMemory parameter to debug_traceTransaction and debug_traceBlockByNumber #10169
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -85,4 +85,50 @@ public void nonOpcodeTracerShouldRespectExplicitDisableMemory() throws Exception | |||||||||||||||||||||||||||||
| .describedAs("explicit disableMemory=true should be respected") | ||||||||||||||||||||||||||||||
| .isFalse(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Test | ||||||||||||||||||||||||||||||
| public void enableMemoryTrueShouldEnableMemory() throws Exception { | ||||||||||||||||||||||||||||||
| final TransactionTraceParams params = | ||||||||||||||||||||||||||||||
| MAPPER.readValue("{\"enableMemory\": true}", TransactionTraceParams.class); | ||||||||||||||||||||||||||||||
| final OpCodeTracerConfig config = params.traceOptions().opCodeTracerConfig(); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| assertThat(config.traceMemory()) | ||||||||||||||||||||||||||||||
| .describedAs("enableMemory=true should enable memory tracing") | ||||||||||||||||||||||||||||||
| .isTrue(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Test | ||||||||||||||||||||||||||||||
| public void enableMemoryFalseShouldDisableMemory() throws Exception { | ||||||||||||||||||||||||||||||
| final TransactionTraceParams params = | ||||||||||||||||||||||||||||||
| MAPPER.readValue("{\"enableMemory\": false}", TransactionTraceParams.class); | ||||||||||||||||||||||||||||||
| final OpCodeTracerConfig config = params.traceOptions().opCodeTracerConfig(); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| assertThat(config.traceMemory()) | ||||||||||||||||||||||||||||||
| .describedAs("enableMemory=false should disable memory tracing") | ||||||||||||||||||||||||||||||
| .isFalse(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Test | ||||||||||||||||||||||||||||||
| public void enableMemoryShouldTakePrecedenceOverDisableMemory() throws Exception { | ||||||||||||||||||||||||||||||
| final TransactionTraceParams params = | ||||||||||||||||||||||||||||||
| MAPPER.readValue( | ||||||||||||||||||||||||||||||
| "{\"enableMemory\": true, \"disableMemory\": true}", TransactionTraceParams.class); | ||||||||||||||||||||||||||||||
| final OpCodeTracerConfig config = params.traceOptions().opCodeTracerConfig(); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| assertThat(config.traceMemory()) | ||||||||||||||||||||||||||||||
| .describedAs("enableMemory should take precedence over disableMemory") | ||||||||||||||||||||||||||||||
| .isTrue(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Test | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| @Test | |
| @Test | |
| public void enableMemoryFalseShouldTakePrecedenceOverDisableMemory() throws Exception { | |
| final TransactionTraceParams params = | |
| MAPPER.readValue( | |
| "{\"enableMemory\": false, \"disableMemory\": false}", TransactionTraceParams.class); | |
| final OpCodeTracerConfig config = params.traceOptions().opCodeTracerConfig(); | |
| assertThat(config.traceMemory()) | |
| .describedAs("enableMemory=false should take precedence over disableMemory=false") | |
| .isFalse(); | |
| } | |
| @Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog states memory is 'only included ... when explicitly enabled', but
TransactionTraceParams#traceOptions()still enables memory by default for non-opcode tracers (the existing fallback behavior). Consider clarifying this entry (e.g., specify the default applies to the opcode tracer path, and note non-opcode tracers may still capture memory unless explicitly disabled), or adjust the implementation if the intent is to make memory truly opt-in for all tracers.