Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make t9n and t8n tool compatible with fee-currency transactions #198

Open
ezdac opened this issue Aug 5, 2024 · 0 comments
Open

Make t9n and t8n tool compatible with fee-currency transactions #198

ezdac opened this issue Aug 5, 2024 · 0 comments
Labels
type:enhancement New feature or request

Comments

@ezdac
Copy link

ezdac commented Aug 5, 2024

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:

// 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:

// 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.

@ezdac ezdac added this to the 6 - Post MVP Mainnet milestone Aug 5, 2024
@ezdac ezdac added the type:enhancement New feature or request label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant