From 4c8d7e177428eefc3fa1842c2af81a72fa94a69b Mon Sep 17 00:00:00 2001 From: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com> Date: Wed, 8 May 2024 11:44:25 +0200 Subject: [PATCH] Fix CIP-64/66 related sanity checks The fee-currency conversion pre-London (legacy-tx) was unneccessary, since we don't allow celo transactions here. Additionally some sanity-checks regarding Celo related fields were missing --- internal/ethapi/transaction_args.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index b9f5e32984..688dc2c7d3 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -209,6 +209,10 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b CeloBackend) // other tx values. See https://github.com/ethereum/go-ethereum/pull/23274 // for more information. eip1559ParamsSet := args.MaxFeePerGas != nil && args.MaxPriorityFeePerGas != nil + + if args.MaxFeeInFeeCurrency != nil && args.FeeCurrency == nil { + return errors.New("feeCurrency must be set when maxFeeInFeeCurrency is given") + } // Sanity check the EIP-1559 fee parameters if present. if args.GasPrice == nil && eip1559ParamsSet { if args.MaxFeePerGas.ToInt().Sign() == 0 { @@ -245,12 +249,6 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b CeloBackend) if err != nil { return err } - if args.IsFeeCurrencyDenominated() { - price, err = b.ConvertToCurrency(ctx, head.Hash(), price, args.FeeCurrency) - if err != nil { - return fmt.Errorf("can't convert suggested gasTipCap to fee-currency: %w", err) - } - } args.GasPrice = (*hexutil.Big)(price) } return nil