Skip to content

Commit

Permalink
chore: comment on why we slice the addr
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Feb 16, 2024
1 parent 9ad8fee commit aaeafbd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions node/impl/full/eth_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ func buildTraces(env *environment, addr []int, et *types.ExecutionTrace) error {
isEVM: builtinactors.IsEvmActor(recurseInto.InvokedActor.State.Code),
traces: env.traces,
}
// Set capacity to the length so each `append` below creates a new slice. Otherwise, we'll
// end up repeatedly mutating previous paths.
addr = addr[:len(addr):len(addr)]
for i := range recurseInto.Subcalls {
err := buildTraces(subEnv, append(addr, subEnv.subtraceCount), &recurseInto.Subcalls[i])
Expand Down

0 comments on commit aaeafbd

Please sign in to comment.