ethereum-optimism / op-geth

GNU Lesser General Public License v3.0
255 stars 653 forks source link

feat(interop): superchain messaging txpool policy #251

Open hamdiallam opened 4 months ago

hamdiallam commented 4 months ago

Closes ethereum-optimism/optimism#10890

Introduces a general abstraction, OptimismTxPoolPolicy that layers over the transaction pool and applied 3rdparty validation logic prior to txpool submission.

The only implementation of this abstraction with the txpool/policies package is for interop, the SuperchainMessagingPolicy. This policy maintains a connection to the superchain backend, implemented in ethereum-optimism/optimsim#9612 and checks for message safety of any executing interop message in the CrossL2Inbox predeploy address.

For now the policy only allows the for the passthrough of executing interop messages:

  1. superchain backend doesn't mark the initiated message pointed to by the identifier as invalid
  2. timestamp invariant holds
  3. policy only allows for initiated messages that are finalized -- for now