Skip to content

Commit 196237b

Browse files
avaloncheSozinM
andauthored
Add blob gas used to flashblocks diff (#440)
* Add blob gas used to flashblocks diff * update to option * Add quantity * fix test --------- Co-authored-by: Solar Mithril <[email protected]>
1 parent 501ae74 commit 196237b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

crates/flashblocks-rpc/src/tests/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ mod tests {
189189
withdrawals: Vec::new(),
190190
logs_bloom: Default::default(),
191191
withdrawals_root: Default::default(),
192+
blob_gas_used: Default::default(),
192193
},
193194
metadata: serde_json::to_value(Metadata {
194195
block_number: 1,

crates/rollup-boost/src/flashblocks/primitives.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ pub struct ExecutionPayloadFlashblockDeltaV1 {
2828
pub withdrawals: Vec<Withdrawal>,
2929
/// The withdrawals root of the block.
3030
pub withdrawals_root: B256,
31+
/// The blob gas used
32+
#[serde(
33+
default,
34+
skip_serializing_if = "Option::is_none",
35+
with = "alloy_serde::quantity::opt"
36+
)]
37+
pub blob_gas_used: Option<u64>,
3138
}
3239

3340
/// Represents the base configuration of an execution payload that remains constant

crates/rollup-boost/src/flashblocks/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl FlashblockBuilder {
114114
let withdrawals_root = diff.withdrawals_root;
115115

116116
let execution_payload = ExecutionPayloadV3 {
117-
blob_gas_used: 0,
117+
blob_gas_used: diff.blob_gas_used.unwrap_or(0),
118118
excess_blob_gas: 0,
119119
payload_inner: ExecutionPayloadV2 {
120120
withdrawals,

0 commit comments

Comments
 (0)