From 32b9f4275a3bc9e6ec1593d85b7e7f57e6db0ab8 Mon Sep 17 00:00:00 2001 From: Bharath Date: Mon, 3 Jun 2024 16:28:31 +0530 Subject: [PATCH] disallow users from sending deposit txs and blob txs via the rpc --- internal/ethapi/api.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 73f2f885a..ffa20fb62 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -57,7 +57,8 @@ import ( // allowed to produce in order to speed up calculations. const estimateGasErrorRatio = 0.015 -var errBlobTxNotSupported = errors.New("signing blob transactions not supported") +var errBlobTxNotSupported = errors.New("blob transactions not supported") +var errDepositTxNotSupported = errors.New("deposit transactions not supported") // EthereumAPI provides an API to access Ethereum related information. type EthereumAPI struct { @@ -1757,6 +1758,13 @@ func (s *TransactionAPI) sign(addr common.Address, tx *types.Transaction) (*type // SubmitTransaction is a helper function that submits tx to txPool and logs a message. func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common.Hash, error) { + if tx.Type() == types.BlobTxType { + return common.Hash{}, errBlobTxNotSupported + } + if tx.Type() == types.DepositTxType { + return common.Hash{}, errDepositTxNotSupported + } + // If the transaction fee cap is already specified, ensure the // fee of the given transaction is _reasonable_. if err := checkTxFee(tx.GasPrice(), tx.Gas(), b.RPCTxFeeCap()); err != nil {