Open enitrat opened 3 months ago
EVM and Starknet have different ways of pricing resource usages due to the underlying architecture differences. As such, there cannot be a 1 <> 1 mapping between the EVM gas consumed and the Starknet fee to pay.
As such, we need to design a mechanism ensuring that in the majority of cases, the fee charged for the user (based on gas price and gas used) matches the actual fee, paid by our relayers, for the execution of the starknet transcation.
Note that an option is also to use our STRK allocation to sponsor part of our users' transactions as part of an on-chain incentive to boost usage. At least until Stwo/Cairo native (they will bring L2 fees down)
Second note: there are extensive efforts to come up with a Rollup Improvement Proposal for EVM L2s to have multi dimensional gas.
A fine plan could be:
To ensure that the network only accepts pre-EIP1559 transactions, it's necessary to make the wallets understand that the network does not accept EIP1559 transactions. This is done in the network definition by specifying that the network does not support EIP1559, which will automatically allow wallets to send the correct transactions.
For example, MetaMask stores the data in a Redux state with metadata, which is used, for example, here and here to verify whether the network supports EIP1559 or not.
An example of netowrk configuration that does not accept EIP1559 is the following:
{
name: "Mordor Testnet",
title: "Ethereum Classic Mordor Testnet",
status: "active",
chain: "ETC",
icon: "ethereumclassictestnet",
rpc: [
"https://rpc.mordor.etccooperative.org",
"https://geth-mordor.etc-network.info"
],
features: [
{
name: "EIP155"
}
],
faucets: [
"https://easy.hebeswap.com/#/faucet",
"https://faucet.mordortest.net"
],
nativeCurrency: {
name: "Mordor Ether",
symbol: "METC",
decimals: 18
},
infoURL: "https://ethereumclassic.org/development/testnets",
shortName: "metc",
chainId: 63,
networkId: 7,
slip44: 1,
explorers: [
{
name: "blockscout-mordor",
url: "https://etc-mordor.blockscout.com",
standard: "EIP3091"
},
{
name: "etcnetworkinfo-expedition-mordor",
url: "https://explorer-expedition.etc-network.info/?network=Ethereum+Classic+at+etc-network.info+GETH+Mordor",
standard: "none"
}
]
}
Therefore, to exclude it, it is necessary to modify the configuration file by not including the EIP1559 feature, or by not inheriting from a network that accepts it.
Here is an example of a network that does accept EIP1559:
{
"name": "Ethereum Mainnet",
"chain": "ETH",
"rpc": [
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
"https://api.mycryptoapi.com/eth"
],
"faucets": [],
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"features": [{ "name": "EIP155" }, { "name": "EIP1559" }],
"infoURL": "https://ethereum.org",
"shortName": "eth",
"chainId": 1,
"networkId": 1,
"icon": "ethereum",
"explorers": [{
"name": "etherscan",
"url": "https://etherscan.io",
"icon": "etherscan",
"standard": "EIP3091"
}]
}
From the SDKs' perspective, the main SDKs allow sending pre-EIP1559 transactions, but we need to ensure that EIP1559 transactions are rejected on the RPC side.
EVM and Starknet have different ways of pricing resource usages due to the underlying architecture differences. As such, there cannot be a 1 <> 1 mapping between the EVM gas consumed and the Starknet fee to pay.
As such, we need to design a mechanism ensuring that in the majority of cases, the fee charged for the user (based on gas price and gas used) matches the actual fee, paid by our relayers, for the execution of the starknet transcation.