Skip to content

Commit

Permalink
fix(payload): set withdrawals none pre shanghai (paradigmxyz#2283)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Apr 17, 2023
1 parent a38bbbf commit e5d4767
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/payload/basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ fn build_payload<Pool, Client>(
}

let mut withdrawals_root = None;
let mut withdrawals = None;

// get balance changes from withdrawals
if initialized_cfg.spec_id >= SpecId::SHANGHAI {
Expand All @@ -526,6 +527,9 @@ fn build_payload<Pool, Client>(
// calculate withdrawals root
withdrawals_root =
Some(proofs::calculate_withdrawals_root(attributes.withdrawals.iter()));

// set withdrawals
withdrawals = Some(attributes.withdrawals);
}

// create the block header
Expand Down Expand Up @@ -556,12 +560,7 @@ fn build_payload<Pool, Client>(
};

// seal the block
let block = Block {
header,
body: executed_txs,
ommers: vec![],
withdrawals: Some(attributes.withdrawals),
};
let block = Block { header, body: executed_txs, ommers: vec![], withdrawals };

let sealed_block = block.seal_slow();
Ok(BuildOutcome::Better(BuiltPayload::new(attributes.id, sealed_block, total_fees)))
Expand Down

0 comments on commit e5d4767

Please sign in to comment.