-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Rationale
There are two geth evm tools that are currently not working with the fee-currency transactions:
- transition tool (
t8n
) : a stateless state transition utility - transaction tool (
t9n
) : a transaction validation utility
The main reason both tools do not work out of the box with fee-currency transactions is the dependency on
on-chain data for both tx validation and state transition, while the tools itself are "stateless":
The t9n
tools requires the intrinsic gas cost for the specific fee-currencies:
op-geth/cmd/evm/internal/t8ntool/transaction.go
Lines 136 to 146 in 111be39
// 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(), feeIntrinsic); err != nil { | |
r.Error = err | |
results = append(results, r) | |
continue |
And the t8n
tool requires exchange rates as well as intrinsic gas costs for the specific fee-currencies:
op-geth/cmd/evm/internal/t8ntool/execution.go
Lines 209 to 214 in 111be39
// NOTE: we can't provide exchange rates | |
// for fee-currencies here, since those are dynamically changing | |
// based on the oracle's exchange rates. | |
// When a Celo transaction with specified fee-currency is validated with this tool, | |
// this will thus result in a ErrNonWhitelistedFeeCurrency error for now. | |
msg, err := core.TransactionToMessage(tx, signer, pre.Env.BaseFee, vmContext.FeeCurrencyContext.ExchangeRates) |
Assessment
Before implementing this feature, determine wether this feature is required or wether we don't deem it necessary to use these evm CLI tools with fee-currency transactions.
Implementation
The main question for this issue is how the user can/should provide the required information to the CLI programs.