Skip to content

Commit cbf97c9

Browse files
committed
fix: dont filter out created+selfdestruct in pre
1 parent 036116c commit cbf97c9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tracing/builder/geth.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,15 @@ impl<'a> GethTraceBuilder<'a> {
319319

320320
// determine the change type
321321
let pre_change = if changed_acc.is_created() {
322-
AccountChangeKind::Create
322+
// if the account was created _and_ selfdestructed we need to treat it as modified,
323+
// so that it is retained later in `diff_traces`
324+
// See <https://etherscan.io/tx/0x391f4b6a382d3bcc3120adc2ea8c62003e604e487d97281129156fd284a1a89d>
325+
// <https://github.com/paradigmxyz/reth/issues/19703#issuecomment-3527067849>
326+
if changed_acc.is_selfdestructed() {
327+
AccountChangeKind::Modify
328+
} else {
329+
AccountChangeKind::Create
330+
}
323331
} else {
324332
AccountChangeKind::Modify
325333
};

0 commit comments

Comments
 (0)