Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ are provided with different values, using input as per the execution-apis spec i

### Additions and Improvements
- Add `transactionReceipts` subscription type to `eth_subscribe` that pushes all transaction receipts when a new block is added, with optional `transactionHashes` filter to receive receipts for specific transactions only [#10190](https://github.com/besu-eth/besu/pull/10190)
- Add `enableMemory` parameter to `debug_traceTransaction` and `debug_traceBlockByNumber`. Defaults to `false`; memory is only included in trace output when explicitly enabled. The existing `disableMemory` parameter continues to work for backwards compatibility [#10169](https://github.com/besu-eth/besu/pull/10169)
Copy link

Copilot AI Apr 13, 2026

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.

Copilot uses AI. Check for mistakes.
- `--net-restrict` now supports IPv6 CIDR notation (e.g. `fd00::/64`) in addition to IPv4, enabling subnet-based peer filtering in IPv6 and dual-stack deployments [#10028](https://github.com/besu-eth/besu/pull/10028)
- Stop EngineQosTimer as part of shutdown [#9903](https://github.com/hyperledger/besu/pull/9903)
- Add `--max-blobs-per-transaction` CLI option to configure the maximum number of blobs per transaction [#9912](https://github.com/hyperledger/besu/pull/9912)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ default boolean disableMemory() {
return Boolean.TRUE.equals(disableMemoryNullable());
}

@JsonProperty(value = "enableMemory")
@Nullable Boolean enableMemoryNullable();

default boolean enableMemory() {
return Boolean.TRUE.equals(enableMemoryNullable());
}

@JsonProperty(value = "disableStack")
@Nullable Boolean disableStackNullable();

Expand Down Expand Up @@ -103,7 +110,9 @@ default TraceOptions traceOptions() {
if (disableStorageNullable() != null) {
builder.traceStorage(!disableStorage());
}
if (disableMemoryNullable() != null) {
if (enableMemoryNullable() != null) {
builder.traceMemory(enableMemory());
} else if (disableMemoryNullable() != null) {
builder.traceMemory(!disableMemory());
} else if (tracerType != TracerType.OPCODE_TRACER) {
// Non-opcode tracers (e.g. callTracer) need memory capture enabled for internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

The precedence rule is only asserted for the enableMemory=true case. Add a complementary test where enableMemory=false conflicts with disableMemory=false (or disableMemory=true) to ensure enableMemory consistently wins in both directions (i.e., enableMemory=false forces memory off regardless of disableMemory).

Suggested change
@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

Copilot uses AI. Check for mistakes.
public void nonOpcodeTracerShouldRespectExplicitEnableMemoryFalse() throws Exception {
final TransactionTraceParams params =
MAPPER.readValue(
"{\"tracer\": \"callTracer\", \"enableMemory\": false}", TransactionTraceParams.class);
final OpCodeTracerConfig config = params.traceOptions().opCodeTracerConfig();

assertThat(config.traceMemory())
.describedAs("explicit enableMemory=false should be respected for callTracer")
.isFalse();
}
}
Loading