Skip to content

Avoid copying transactions in get_mergeable_orders #214

@MegaRedHand

Description

@MegaRedHand

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:

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:

let commitment = block_blobs_bundles.commitments[index].clone();
let proof = block_blobs_bundles.proofs[index].clone();
let blob = block_blobs_bundles.blobs[index].clone();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions