Skip to content

Commit e4370c1

Browse files
committed
minimize reverts in prefinalize
1 parent 2776bea commit e4370c1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/rbuilder/src/live_builder/block_output/unfinished_block_processing.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,13 @@ impl UnfinishedBuiltBlocksInput {
325325
let mut local_ctx = self.local_ctx();
326326
let mut block_building_helper = next_block.into_building_helper();
327327
if self.adjust_finalized_blocks {
328-
match block_building_helper.finalize_block(&mut local_ctx, U256::ZERO, None) {
328+
let value = if block_building_helper.true_block_value().unwrap_or_default().is_zero() {
329+
U256::ZERO
330+
} else {
331+
// set value to 1 so that some contracts do not revert
332+
U256::ONE
333+
};
334+
match block_building_helper.finalize_block(&mut local_ctx, value, None) {
329335
Ok(_) => {}
330336
Err(err) => {
331337
error!(?err, "Failed to prefinalize block");

0 commit comments

Comments
 (0)