diff --git a/cmd/evm/internal/t8ntool/transaction.go b/cmd/evm/internal/t8ntool/transaction.go index 1ee2d5142a..379837eef5 100644 --- a/cmd/evm/internal/t8ntool/transaction.go +++ b/cmd/evm/internal/t8ntool/transaction.go @@ -133,8 +133,14 @@ func Transaction(ctx *cli.Context) error { r.Address = sender } // Check intrinsic gas + // NOTE: we can't provide specific intrinsic gas costs + // for fee-currencies here, since those are written to the + // FeeCurrencyDirectory contract and are chain-specific. + // When a Celo transaction with specified fee-currency is validated with this tool, + // this will thus result in a ErrNonWhitelistedFeeCurrency error for now. + var feeIntrinsic common.IntrinsicGasCosts if gas, err := core.IntrinsicGas(tx.Data(), tx.AccessList(), tx.To() == nil, - chainConfig.IsHomestead(new(big.Int)), chainConfig.IsIstanbul(new(big.Int)), chainConfig.IsShanghai(new(big.Int), 0), tx.FeeCurrency()); err != nil { + chainConfig.IsHomestead(new(big.Int)), chainConfig.IsIstanbul(new(big.Int)), chainConfig.IsShanghai(new(big.Int), 0), tx.FeeCurrency(), feeIntrinsic); err != nil { r.Error = err results = append(results, r) continue diff --git a/core/bench_test.go b/core/bench_test.go index 893758029f..55a1a9104f 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -83,7 +83,8 @@ func genValueTx(nbytes int) func(int, *BlockGen) { return func(i int, gen *BlockGen) { toaddr := common.Address{} data := make([]byte, nbytes) - gas, _ := IntrinsicGas(data, nil, false, false, false, false, nil) + var feeIntrinsic common.IntrinsicGasCosts + gas, _ := IntrinsicGas(data, nil, false, false, false, false, nil, feeIntrinsic) signer := gen.Signer() gasPrice := big.NewInt(0) if gen.header.BaseFee != nil { diff --git a/tests/transaction_test_util.go b/tests/transaction_test_util.go index 8f8c07ea53..22c60f7c57 100644 --- a/tests/transaction_test_util.go +++ b/tests/transaction_test_util.go @@ -55,7 +55,8 @@ func (tt *TransactionTest) Run(config *params.ChainConfig) error { return nil, nil, err } // Intrinsic gas - requiredGas, err := core.IntrinsicGas(tx.Data(), tx.AccessList(), tx.To() == nil, isHomestead, isIstanbul, false, nil) + var feeIntrinsic common.IntrinsicGasCosts + requiredGas, err := core.IntrinsicGas(tx.Data(), tx.AccessList(), tx.To() == nil, isHomestead, isIstanbul, false, nil, feeIntrinsic) if err != nil { return nil, nil, err }