Skip to content

Commit 145da7f

Browse files
committed
add host fills from built block to block header
This PR adds the host fills from the build block to the rollup block header
1 parent 455791f commit 145da7f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/tasks/submit.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,6 @@ impl SubmitTask {
193193
resp: &SignResponse,
194194
block: &BuiltBlock,
195195
) -> Result<TransactionRequest, eyre::Error> {
196-
// TODO: ENG-1082 Implement fills
197-
let fills = vec![];
198-
199196
// manually retrieve nonce
200197
let nonce =
201198
self.provider().get_transaction_count(self.provider().default_signer_address()).await?;
@@ -223,6 +220,10 @@ impl SubmitTask {
223220
};
224221
debug!(?header, "built block header");
225222

223+
// Extract fills from the built block
224+
let fills = self.extract_fills(block);
225+
debug!(?fills, "extracted fills");
226+
226227
// Create a blob transaction with the blob header and signature values and return it
227228
let tx = self
228229
.build_blob_tx(fills, header, v, r, s, block)?
@@ -395,6 +396,15 @@ impl SubmitTask {
395396
Ok(block_num + 1)
396397
}
397398

399+
// This function converts &[SignedFill] --> [FillPermit2]
400+
fn extract_fills(&self, block: &BuiltBlock) -> Vec<FillPermit2> {
401+
let mut fills = vec![];
402+
for signed_fill in block.host_fills() {
403+
fills.push(FillPermit2::from(signed_fill))
404+
}
405+
fills
406+
}
407+
398408
/// Task future for the submit task
399409
/// NB: This task assumes that the simulator will only send it blocks for
400410
/// slots that it's assigned.
@@ -442,6 +452,7 @@ impl SubmitTask {
442452
}
443453
}
444454

455+
445456
// Returns gas parameters based on retry counts. This uses
446457
fn calculate_gas_limits(
447458
retry_count: usize,

0 commit comments

Comments
 (0)