Skip to content

Commit

Permalink
disallow users from sending deposit txs and blob txs via the rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
bharath-123 committed Jun 10, 2024
1 parent 14a96f6 commit 32b9f42
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 32b9f42

Please sign in to comment.