mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix(payload): set withdrawals none pre shanghai (#2283)
This commit is contained in:
@ -511,6 +511,7 @@ fn build_payload<Pool, Client>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut withdrawals_root = None;
|
let mut withdrawals_root = None;
|
||||||
|
let mut withdrawals = None;
|
||||||
|
|
||||||
// get balance changes from withdrawals
|
// get balance changes from withdrawals
|
||||||
if initialized_cfg.spec_id >= SpecId::SHANGHAI {
|
if initialized_cfg.spec_id >= SpecId::SHANGHAI {
|
||||||
@ -526,6 +527,9 @@ fn build_payload<Pool, Client>(
|
|||||||
// calculate withdrawals root
|
// calculate withdrawals root
|
||||||
withdrawals_root =
|
withdrawals_root =
|
||||||
Some(proofs::calculate_withdrawals_root(attributes.withdrawals.iter()));
|
Some(proofs::calculate_withdrawals_root(attributes.withdrawals.iter()));
|
||||||
|
|
||||||
|
// set withdrawals
|
||||||
|
withdrawals = Some(attributes.withdrawals);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the block header
|
// create the block header
|
||||||
@ -556,12 +560,7 @@ fn build_payload<Pool, Client>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// seal the block
|
// seal the block
|
||||||
let block = Block {
|
let block = Block { header, body: executed_txs, ommers: vec![], withdrawals };
|
||||||
header,
|
|
||||||
body: executed_txs,
|
|
||||||
ommers: vec![],
|
|
||||||
withdrawals: Some(attributes.withdrawals),
|
|
||||||
};
|
|
||||||
|
|
||||||
let sealed_block = block.seal_slow();
|
let sealed_block = block.seal_slow();
|
||||||
Ok(BuildOutcome::Better(BuiltPayload::new(attributes.id, sealed_block, total_fees)))
|
Ok(BuildOutcome::Better(BuiltPayload::new(attributes.id, sealed_block, total_fees)))
|
||||||
|
|||||||
Reference in New Issue
Block a user