skalenetwork / skaled

Running more than 20 production blockchains, SKALED is Ethereum-compatible, high performance C++ Proof-of-Stake client, tools and libraries. Uses SKALE consensus as a blockchain consensus core. Includes dynamic Oracle. Implements file storage and retrieval as an EVM extension.
https://skale.network
GNU General Public License v3.0
84 stars 40 forks source link

"maxFeePerGas" may be lower than maxPriorityFeePerGas #1994

Open oleksandrSydorenkoJ opened 1 month ago

oleksandrSydorenkoJ commented 1 month ago

Describe the bug Skale uses maxFeePerGas as a gasPrice for type0,1 transactions. maxPriorityFeePerGas doesn't use anywhere within the skaled functionality But, eip 1559 provides the formula maxFeePerGas = baseFeePerGas + maxPriorityFeePerGas Where maxFeePerGas cannot be lower than maxPriorityFeePerGas.

Versions skalenetwork/schain:3.19.2-beta.0

Preconditions Active schain medium type

To Reproduce

  1. Send type2 transaction with transaction params:
    transaction_type2_data = {
        'maxPriorityFeePerGas': 300000,
        'maxFeePerGas': 100000,
        'gas': 100000,
        'chainId': web3.eth.chain_id,
        'type': 2
    }
  2. Check transaction by hash

Expected behavior Skaled should return the error

E           ValueError: {'code': -32000, 'message': 'max priority fee per gas higher than max fee per gas'}

Actual state Skaled sends the transaction and receives the transaction by hash without any errors.

Log

2024-09-16 18:41:30 [    INFO] Get transaction is AttributeDict({'accessList': [], 'blockHash': HexBytes('0x86436c0f1adc9b829c6c70e19835a476b00dab598f598a0684baf7e174b122c3'), 'blockNumber': 1358170, 'chainId': 684753045, 'from': '0x71cBE3fedE33905d4D1Bf2Bd51f9d4A62375e659', 'gas': 100000, 'gasPrice': 100000, 'hash': HexBytes('0x1913bdedfecfecb45568ca85cbba716a555c2f4b3c98480bb07872fc643ac73c'), 'input': HexBytes('0x'), 'maxFeePerGas': 100000, 'maxPriorityFeePerGas': 300000, 'nonce': 3725, 'r': HexBytes('0xfdfa54aebc6de39f6b1bc605439ad716ea97906dc713d1aa61559dbf50732abf'), 's': HexBytes('0x408a41d44680e1f987006804f2c8002ec7129d2ad6c305ec50e9f09a593eea14'), 'to': '0x71cBE3fedE33905d4D1Bf2Bd51f9d4A62375e659', 'transactionIndex': 0, 'type': 2, 'v': 0, 'value': 0, 'yParity': 0}) (test_type2_transactions.py:108)
DmytroNazarenko commented 1 month ago

Needs patch to activate, decided to postpone and include into 3.1