From fa6aca0beb42ebfc01b3e726e432abae35e43b65 Mon Sep 17 00:00:00 2001 From: dylan Date: Tue, 27 May 2025 17:58:54 -0600 Subject: [PATCH 1/3] add host fills from built block to block header This PR adds the host fills from the build block to the rollup block header --- src/tasks/submit.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/tasks/submit.rs b/src/tasks/submit.rs index e5e002b..b7a50a7 100644 --- a/src/tasks/submit.rs +++ b/src/tasks/submit.rs @@ -192,9 +192,6 @@ impl SubmitTask { resp: &SignResponse, block: &BuiltBlock, ) -> Result { - // TODO: ENG-1082 Implement fills - let fills = vec![]; - // manually retrieve nonce let nonce = self.provider().get_transaction_count(self.provider().default_signer_address()).await?; @@ -222,6 +219,10 @@ impl SubmitTask { }; debug!(?header, "built block header"); + // Extract fills from the built block + let fills = self.extract_fills(block); + debug!(?fills, "extracted fills"); + // Create a blob transaction with the blob header and signature values and return it let tx = self .build_blob_tx(fills, header, v, r, s, block)? @@ -394,6 +395,15 @@ impl SubmitTask { Ok(block_num + 1) } + // This function converts &[SignedFill] --> [FillPermit2] + fn extract_fills(&self, block: &BuiltBlock) -> Vec { + let mut fills = vec![]; + for signed_fill in block.host_fills() { + fills.push(FillPermit2::from(signed_fill)) + } + fills + } + /// Task future for the submit task /// NB: This task assumes that the simulator will only send it blocks for /// slots that it's assigned. From cd249b51d6dc7cf02c9ec55a715b77dbdcb95595 Mon Sep 17 00:00:00 2001 From: dylan Date: Tue, 3 Jun 2025 20:23:22 -0600 Subject: [PATCH 2/3] turn into one liner --- src/tasks/submit.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/tasks/submit.rs b/src/tasks/submit.rs index b7a50a7..585d9cc 100644 --- a/src/tasks/submit.rs +++ b/src/tasks/submit.rs @@ -395,13 +395,9 @@ impl SubmitTask { Ok(block_num + 1) } - // This function converts &[SignedFill] --> [FillPermit2] + // This function converts &[SignedFill] into [FillPermit2] fn extract_fills(&self, block: &BuiltBlock) -> Vec { - let mut fills = vec![]; - for signed_fill in block.host_fills() { - fills.push(FillPermit2::from(signed_fill)) - } - fills + block.host_fills().iter().map(FillPermit2::from).collect() } /// Task future for the submit task From a873d45b77174d55236ad7f12188b5f792167f73 Mon Sep 17 00:00:00 2001 From: dylan Date: Tue, 3 Jun 2025 20:24:08 -0600 Subject: [PATCH 3/3] fmt + clippy --- src/tasks/submit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/submit.rs b/src/tasks/submit.rs index 585d9cc..6065a7d 100644 --- a/src/tasks/submit.rs +++ b/src/tasks/submit.rs @@ -222,7 +222,7 @@ impl SubmitTask { // Extract fills from the built block let fills = self.extract_fills(block); debug!(?fills, "extracted fills"); - + // Create a blob transaction with the blob header and signature values and return it let tx = self .build_blob_tx(fills, header, v, r, s, block)?