-
Notifications
You must be signed in to change notification settings - Fork 44
Avoid copying transactions in get_mergeable_orders #214
Description
See #212 (comment)
When extracting the mergeable orders inside get_mergeable_orders, we're copying each transaction. We should instead modify the execution payload type to store transactions as Bytes, so we can cheaply clone them here.
The clone is inside this to_vec call:
helix/crates/api/src/builder/api.rs
Line 612 in 9d0cad6
| transaction: Bytes::from(raw_tx.to_vec()), |
The current type of the raw_tx is &VariableList, which comes from inside lh_types::ExecutionPayload. To change this, we'd need to implement our own ExecutionPayload type, changing each transaction to be Bytes instead.
This same approach can be used to avoid cloning blobs from blob transactions:
helix/crates/api/src/builder/api.rs
Lines 706 to 708 in 9d0cad6
| let commitment = block_blobs_bundles.commitments[index].clone(); | |
| let proof = block_blobs_bundles.proofs[index].clone(); | |
| let blob = block_blobs_bundles.blobs[index].clone(); |