Skip to content

Commit

Permalink
remove check performed in the mempool (#1708)
Browse files Browse the repository at this point in the history
* remove check performed in the mempool

* remove check performed in the mempool

* fix flakyness
  • Loading branch information
tudor-malene authored Dec 19, 2023
1 parent 4ee0cca commit 98e0913
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
16 changes: 0 additions & 16 deletions go/enclave/enclave.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,6 @@ func (e *enclaveImpl) SubmitTx(tx common.EncryptedTx) (*responses.RawTx, common.
if e.crossChainProcessors.Local.IsSyntheticTransaction(*decryptedTx) {
return responses.AsPlaintextError(responses.ToInternalError(fmt.Errorf("synthetic transaction coming from external rpc"))), nil
}
if err = e.checkGas(decryptedTx); err != nil {
e.logger.Info("gas check failed", log.ErrKey, err.Error())
return responses.AsEncryptedError(err, vkHandler), nil
}

if err = e.service.SubmitTransaction(decryptedTx); err != nil {
e.logger.Debug("Could not submit transaction", log.TxKey, decryptedTx.Hash(), log.ErrKey, err)
Expand Down Expand Up @@ -1436,18 +1432,6 @@ func (e *revertError) ErrorData() interface{} {
return e.reason
}

func (e *enclaveImpl) checkGas(tx *types.Transaction) error {
txGasPrice := tx.GasPrice()
if txGasPrice == nil {
return fmt.Errorf("rejected transaction %s. No gas price was set", tx.Hash())
}
minGasPrice := e.config.MinGasPrice
if txGasPrice.Cmp(minGasPrice) == -1 {
return fmt.Errorf("rejected transaction %s. Gas price was only %d, wanted at least %d", tx.Hash(), txGasPrice, minGasPrice)
}
return nil
}

// Returns the params extracted from an eth_getLogs request.
func extractGetLogsParams(paramList []interface{}) (*filters.FilterCriteria, *gethcommon.Address, error) {
// We extract the first param, the filter for the logs.
Expand Down
2 changes: 1 addition & 1 deletion go/enclave/nodetype/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (s *sequencer) createGenesisBatch(block *common.L1Block) error {

// produce batch #2 which has the message bus and any other system contracts
cb, err := s.produceBatch(
batch.Header.SequencerOrderNo.Add(batch.Header.SequencerOrderNo, big.NewInt(1)),
big.NewInt(0).Add(batch.Header.SequencerOrderNo, big.NewInt(1)),
block.Hash(),
batch.Hash(),
common.L2Transactions{msgBusTx},
Expand Down

0 comments on commit 98e0913

Please sign in to comment.