Skip to content

use prepared Txenv for flashblocks #18181

@mattsse

Description

@mattsse

Describe the feature

we currently do:

for encoded in transactions {
let tx = N::SignedTx::decode_2718_exact(encoded.as_ref())?;
let signer = tx.try_recover()?;
let tx = WithEncoded::new(encoded, tx.with_signer(signer));
let _gas_used = builder.execute_transaction(tx)?;
}

for the entire block on every new flashblock, this is wasteful work and we can cache this in

blocks: Vec<FlashBlock>,

instead.

we can either prepare this when we push

self.blocks.push(flashblock);

or lazily

on push is probably more efficient because then it's already prepared

TODO

  • introduce new inner flashblock container type that has txs: WithEnoceded<Recovered<N::SignedTx> as well
  • use those during execution
  • if recovery fails (we don't expect this) we simply reset the entire blocks

Additional context

blocked by #18183

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-op-rethRelated to Optimism and op-rethC-enhancementNew feature or requestC-perfA change motivated by improving speed, memory usage or disk footprint

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions