mirror of https://github.com/status-im/op-geth.git
Reject system deposit transactions in Regolith
This commit is contained in:
parent
7643709fe8
commit
7303e2be73
|
@ -100,4 +100,7 @@ var (
|
|||
|
||||
// ErrSenderNoEOA is returned if the sender of a transaction is a contract.
|
||||
ErrSenderNoEOA = errors.New("sender not an eoa")
|
||||
|
||||
// ErrSystemTxNotSupported is returned for any deposit tx with IsSystemTx=true after the Regolith fork
|
||||
ErrSystemTxNotSupported = errors.New("system tx not supported")
|
||||
)
|
||||
|
|
|
@ -259,6 +259,10 @@ func (st *StateTransition) preCheck() error {
|
|||
st.gas += st.msg.Gas() // Add gas here in order to be able to execute calls.
|
||||
// Don't touch the gas pool for system transactions
|
||||
if st.msg.IsSystemTx() {
|
||||
if st.evm.ChainConfig().IsOptimismRegolith(st.evm.Context.Time) {
|
||||
return fmt.Errorf("%w: address %v", ErrSystemTxNotSupported,
|
||||
st.msg.From().Hex())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return st.gp.SubGas(st.msg.Gas()) // gas used by deposits may not be used by other txs
|
||||
|
|
Loading…
Reference in New Issue