Skip to content

Commit 1fc9892

Browse files
authored
feat: add host fills from built block to block header (#96)
# feat: add host fills from built block to block header This PR adds the host fills from the build block to the rollup block header. Closes ENG-1080
1 parent a87da01 commit 1fc9892

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/tasks/submit.rs

Lines changed: 9 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,11 @@ impl SubmitTask {
394395
Ok(block_num + 1)
395396
}
396397

398+
// This function converts &[SignedFill] into [FillPermit2]
399+
fn extract_fills(&self, block: &BuiltBlock) -> Vec<FillPermit2> {
400+
block.host_fills().iter().map(FillPermit2::from).collect()
401+
}
402+
397403
/// Task future for the submit task
398404
/// NB: This task assumes that the simulator will only send it blocks for
399405
/// slots that it's assigned.

0 commit comments

Comments
 (0)