Skip to content

Commit f19dedb

Browse files
committed
fix(l2): normalize legacy reconstruction withdrawals
1 parent 008dff5 commit f19dedb

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

cmd/ethrex/l2/command.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,16 @@ impl Command {
431431
let mut buf = &blob[8..];
432432
let mut blocks = Vec::new();
433433
for _ in 0..blocks_count {
434-
let (item, rest) = Block::decode_unfinished(buf)?;
434+
let (mut item, rest) = Block::decode_unfinished(buf)?;
435+
436+
// TODO: Regenerate the legacy state-reconstruction fixture blobs with an
437+
// explicit empty withdrawals list, then remove this compatibility fix.
438+
// Older fixtures have a withdrawals root but omit withdrawals from the body.
439+
if item.header.withdrawals_root.is_some() && item.body.withdrawals.is_none()
440+
{
441+
item.body.withdrawals = Some(Vec::new());
442+
}
443+
435444
blocks.push(item);
436445
buf = rest;
437446
}

0 commit comments

Comments
 (0)