Open tynes opened 4 months ago
cc @protolambda
First Approach: In the txpool
module, we have this interface. Per our discussion, we'll definitely need to parallelize validation but i'm going to leave that as followup and do the simple path (iteration)
type OptimismTxPolicyStatus uint
const (
OptimismTxPolicyUnknown OptimismTxPolicyStatus = iota
OptimismTxPolicyInvalid
OptimismTxPolicyValid
)
type OptimismTxPoolPolicy interface {
ValidateTx(tx *types.Transaction) (OptimismTxPolicyStatus, error)
}
Introduce a new module txpool/policies
where there can be different policies to be constructed & in the future composed together and supplied to the higher level TxPool
. Only policy to exist for now is the SuperchainMessagingPolicy
that maintains a connection to the superchain backend.
The tx pool keeps reference to the set policy and is invoked as transactions are added.
For the high latency implementation, the tx pool will reject initiating messages that are not finalized or safe
This needs to be adapted to handle the low-latency case.
Implement transaction pool validation so that only valid executing messages are included in the transaction pool