Skip to content

Commit 4438917

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 e40f408 commit 4438917

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/tasks/submit.rs

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

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

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

0 commit comments

Comments
 (0)