Skip to content

feat: add host fills from built block to block header #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/tasks/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ impl SubmitTask {
resp: &SignResponse,
block: &BuiltBlock,
) -> Result<TransactionRequest, eyre::Error> {
// TODO: ENG-1082 Implement fills
let fills = vec![];

// manually retrieve nonce
let nonce =
self.provider().get_transaction_count(self.provider().default_signer_address()).await?;
Expand Down Expand Up @@ -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)?
Expand Down Expand Up @@ -394,6 +395,11 @@ impl SubmitTask {
Ok(block_num + 1)
}

// This function converts &[SignedFill] into [FillPermit2]
fn extract_fills(&self, block: &BuiltBlock) -> Vec<FillPermit2> {
block.host_fills().iter().map(FillPermit2::from).collect()
}

/// Task future for the submit task
/// NB: This task assumes that the simulator will only send it blocks for
/// slots that it's assigned.
Expand Down