Skip to content

Solve the compatibility problem between EIP-1559 and Policies #187

@txhsl

Description

@txhsl

Rationale

Briefly speaking, we are not fully compatible with EIP-1559 after #6 and #166. The compatibility problem between EIP-1559 and Policies are caused by a different economic model.

  • As I've mentioned in Implement minGasTipCap as minimum effective gas tip #186, EIP-1559 proposed a dynamic fee market scheme with baseFee and gasTip. Generally, when there is a network traffic, the gas price increases. But if there is no transaction in the network, baseFee and gasTip may drop to nearly 0;
  • But in N3, we don't have a dynamic price model. Instead, we maintain some price factors in the Neo Policy. As a result, the system fee remains the same regardless of traffic, and the only difference is the network fee.

There are also several facts I've noticed on testnet:

  1. It is frequent that CNs create empty blocks, so the gasPrice/baseFee is pretty low;
  2. To achieve a cost about 0.01 GAS per native transfer transaction (costs 21000 gas in EVM), we need a gasPrice about 0.01 * 10 ^ 18 / 21000 ≈ 500 Gwei, which is incredibly higher than other EVM chains, e.g. 7 Gwei on Ethereum, 1 Gwei on BNB Smart Chain, 100 Gwei on Polygon and 0.1 Gwei on Optimistic/Arbitrum;

Empty blocks and high gas price may cause problems in EIP-1559 compatible tools, e.g. MetaMask.

We've already modified some RPC APIs to suite Neo X Policies, like changing eth_gasPrice and eth_maxPriorityFeePerGas to provide a minimum acceptable value so that a transaction will not be rejected by txpool. But eth_feeHistory is somehow conflict with our Policy idea, it returns a fee list of recently accepted transactions. It would be confusing when the list is empty, for EIP-1559 compatible tools, this case equals to a zero eth_maxPriorityFeePerGas. Their logics don't consider a minimum value, so when I increase the minGasTipCap limit, MetaMask hits RPC errors.

Implementation

For the MetaMask problem, I found it can be solved by disabling eth_feeHistory RPC API. But this compatibility issue may happen on other tools or custom codes. Maybe they use 0.8*eth_maxPriorityFeePerGas and hit an error.

So we may need a discussion, are we good to continue with this EIP-1559 incompatible? Or we have other ideas about the price thing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdiscussionSomething that needs to be discussedquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions