Skip to content

interop: Remove checkInterop from Block Building Path #585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: optimism
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/ethereum/go-ethereum/core/stateless"
"github.com/ethereum/go-ethereum/core/txpool"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types/interoptypes"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/log"
Expand All @@ -58,8 +57,6 @@ var (

txConditionalRejectedCounter = metrics.NewRegisteredCounter("miner/transactionConditional/rejected", nil)
txConditionalMinedTimer = metrics.NewRegisteredTimer("miner/transactionConditional/elapsedtime", nil)

txInteropRejectedCounter = metrics.NewRegisteredCounter("miner/transactionInterop/rejected", nil)
)

// environment is the worker's current environment and holds all
Expand Down Expand Up @@ -427,12 +424,6 @@ func (miner *Miner) applyTransaction(env *environment, tx *types.Transaction) (*
snap = env.state.Snapshot()
gp = env.gasPool.Gas()
)
if !env.noTxs && miner.chain.Config().IsInterop(env.header.Time) {
// avoid execution if the interop check fails
if err := miner.checkInterop(env.rpcCtx, tx, env.header.Time); err != nil {
return nil, err
}
}
receipt, err := core.ApplyTransaction(env.evm, env.gasPool, env.state, env.header, tx, &env.header.GasUsed)
if err != nil {
env.state.RevertToSnapshot(snap)
Expand All @@ -441,36 +432,6 @@ func (miner *Miner) applyTransaction(env *environment, tx *types.Transaction) (*
return receipt, err
}

func (miner *Miner) checkInterop(ctx context.Context, tx *types.Transaction, logTimestamp uint64) error {
if tx.Type() == types.DepositTxType {
return nil // deposit-txs are always safe
}
if tx.Rejected() {
return errors.New("transaction was previously rejected")
}
b, ok := miner.backend.(BackendWithInterop)
if !ok {
return fmt.Errorf("cannot mine interop txs without interop backend, got backend type %T", miner.backend)
}
if ctx == nil { // check if the miner was set up correctly to interact with an RPC
return errors.New("need RPC context to check executing messages")
}
accessList := interoptypes.TxToInteropAccessList(tx)
if len(accessList) == 0 {
return nil // avoid an RPC check if there are no executing messages to verify.
}
if err := b.CheckAccessList(ctx, accessList, interoptypes.CrossUnsafe, interoptypes.ExecutingDescriptor{Timestamp: logTimestamp, Timeout: 0}); err != nil {
if ctx.Err() != nil { // don't reject transactions permanently on RPC timeouts etc.
log.Debug("CheckAccessList timed out", "err", ctx.Err())
return err
}
txInteropRejectedCounter.Inc(1)
tx.SetRejected() // Mark the tx as rejected: it will not be welcome in the tx-pool anymore.
return err
}
return nil
}

func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *transactionsByPriceAndNonce, interrupt *atomic.Int32) error {
gasLimit := env.header.GasLimit
if env.gasPool == nil {
Expand Down