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

Fixed baseFee option #6335

Closed
suraneti opened this issue Jan 2, 2024 · 16 comments
Closed

Fixed baseFee option #6335

suraneti opened this issue Jan 2, 2024 · 16 comments
Labels
non mainnet (private networks) not related to mainnet features - covers privacy, permissioning, IBFT2, QBFT snack Smaller coding task - less than a day for an experienced dev

Comments

@suraneti
Copy link
Contributor

suraneti commented Jan 2, 2024

Description

As a developer, I need to enable EIP-1559 on Besu (IBFT 2.0 non-gas-free network) with zeroBaseFee: true to prevent a supply-burning mechanism and fixed baseFee as gasPrice value.

Currently, I've set zeroBaseFee: true. It works fine if I fixed baseFee to the same as my network's gasPrice. However, when calling the eth_feeHistory method, it always returns a 0, causing Metamask to estimate invalid maxBaseFee and maxPriority.

I know it sounds strange but I want to integrate some features that require EIP-1559, such as the Account Abstraction Bundler Node on my network.

Acceptance Criteria

  • Fix baseFee to be the same as gasPrice.
  • Disable the supply-burning mechanism.
  • When calling eth_feeHistory, it should return the fixed baseFee.

Steps to Reproduce (Bug)

  1. Run Besu IBFT 2.0 with the London upgrade.
  2. Enable zeroBaseFee.
  3. Call eth_feeHistory or use a wallet like Metamask to estimate gas.

Expected behavior: [What you expect to happen]

  1. zeroBaseFee should be a constant value as gasPrice
  2. eth_feeHistory should return non-zero value

Actual behavior: [What actually happens]

  1. eth_feeHistory always return zero value

Frequency: [What percentage of the time does it occur?]
100% on ibft 2.0

Logs (if a bug)

Please post relevant logs from Besu (and the consensus client, if running proof of stake) from before and after the issue.

Versions (Add all that apply)

  • Software version: [besu --version] 22.10.2
  • Java version: [java -version] Java-17
  • OS Name & Version: [cat /etc/*release] AWS Linux
  • Cloud VM, type, size: [Amazon Web Services I3-large] AWS l3-large

Additional Information (Add any of the following or anything else that may be relevant)

  • Besu setup info - genesis file, config options
{
  "config":{
    "chainId": 17778,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "constantinopleFixBlock": 0,
    "istanbulBlock": 0,
    "muirGlacierBlock": 0,
    "berlinBlock": 0,
    "londonBlock": 0,
    "zeroBaseFee": true,
    "ibft2": {
      "blockperiodseconds": 2,
      "epochlength": 30000,
      "requesttimeoutseconds": 10,
      "blockreward": "0x0"
    }
  },
  "nonce":"0x0",
  "timestamp":"0x56bf7d30",
  "gasLimit":"1500000",
  "difficulty":"0x1",
  "mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase":"0x1fb6794b264A29d9D5c3d44BC5799dCD8b80B699",
  "extraData":"0xf87ea00000000000000000000000000000000000000000000000000000000000000000f85494ddcd845222b6977fd5cbb094b98c9c3e39a4fa4f94acbb577f656ad3dbb7402b9bcf60050ac39aa0fe94ed80f1f186b81e18541a8f562e9d3e592ffbb7819453307539caf3fb8cd8a45cdb435697297c9d1ba9808400000000c0",
  "alloc": {},
  "baseFeePerGas":"0x000000174876E800"
}
@non-fungible-nelson non-fungible-nelson added non mainnet (private networks) not related to mainnet features - covers privacy, permissioning, IBFT2, QBFT snack Smaller coding task - less than a day for an experienced dev labels Jan 8, 2024
@non-fungible-nelson
Copy link
Contributor

non-fungible-nelson commented Jan 8, 2024

@fab-10 is there any code that is used for Linea's fee market that could allow for a fixed fee market in Besu private networks?

@non-fungible-nelson
Copy link
Contributor

non-fungible-nelson commented Jan 8, 2024

@matthew1001 any interest in this ticket? valuable for side-chains and straightforward config option changes.

@matthew1001
Copy link
Contributor

Hi @non-fungible-nelson, possibly, although it would be behind the QBFT/shanghai work and QBFT/empty-block-period work for me, so not likely to come to the top of my list for a little while

@fab-10
Copy link
Contributor

fab-10 commented Jan 9, 2024

Please review this work #6202 done by @Gabriel-Trintinalia, that could already satisfy your requirement, otherwise could be a good starting point for the development

@suraneti
Copy link
Contributor Author

suraneti commented Jan 9, 2024

For your additional information, here are transactions from my private network (Besu 22.10.2, IBFT2.0)

EIP-1559 transaction:

https://scan.tokenx-alpha.com/tx/0x44b6d7bc905a2ee131b7873106b45d96500e9f24258b4d00d15c577cd0a7dca0

Legacy transaction:

https://scan.tokenx-alpha.com/tx/0x6c1159a020efee86dc47fb3e84cbf44f294f44b3988e8b88471d38b0ad1a1801

Note that either the gasPrice or both the maxBaseFee and maxPriorityFee must be set to 100 gwei.
Otherwise, the validator node will not mine the transaction because my network's minimum gasPrice is 100 gwei.

@manojpramesh
Copy link
Contributor

I can take a look at this.

@suraneti
Copy link
Contributor Author

Could you kindly share if there have been any delightful updates?

@bhargav55
Copy link

bhargav55 commented Jan 18, 2024

I have issues implementing account abstraction in besu, it is reverting with execution reverted error, I have simulated the same scenario in polygon mumbai, it is working fine but not in besu, is this related to config file params? I am using the london block and qbft. I am not using bundlers for now, created userop and directly interacting with entrypoint contract
@suraneti

@manojpramesh
Copy link
Contributor

Could you kindly share if there have been any delightful updates?

@suraneti Targeting to get the PR out this weekend. Can you also post here a transaction payload that worked for you.

@suraneti
Copy link
Contributor Author

suraneti commented Jan 20, 2024

@manojpramesh Assuming that my network has set the minimum gas price to 100 gwei.

Legacy payload

{
      from: "<FROM_ADDR>",
      to: "<TO_ADDR>",
      value: "1000000000000000000",
      nonce: 0,
      gasPrice: "100000000000", // 100 gwei
      gasLimit: "21000"
 }

EIP-1559 payload

{
      from: "<FROM_ADDR>",
      to: "<TO_ADDR>",
      value: "1000000000000000000",
      nonce: 0,
      maxPriorityFeePerGas: "100000000000", // 100 gwei
      maxFeePerGas: "100000000000", // 100 gwei
      gasLimit: "21000"
 }

@suraneti
Copy link
Contributor Author

suraneti commented Jan 20, 2024

@bhargav55, my EIP-4337 setup on Besu includes:

Besu version: 22.10.2 or any Besu version that has debugTraceCall.
AA Contract: The standard one contract.
Account Abstraction SDK: https://docs.stackup.sh/docs/erc-4337-examples
Bundler-Node: https://github.com/etherspot/skandha

I've tried several Bundler-Node with Besu, and only Skandha worked.

Important note for Skandha: You have to use the --unsafeMode option to bypass staking validation (#117).

@bhargavkacharla
Copy link

bhargavkacharla commented Jan 23, 2024

@suraneti what are the values you are giving for callGasLimit, verificationGasLimit, preVerificationGas inside userOperation object. transaction getting failed with CALL_EXCEPTION'. you can find more details about the issue here #6434. I need help in implementing 4337 in besu network. The similar account abstraction contracts are working in mumbai and fuji

@suraneti
Copy link
Contributor Author

suraneti commented Feb 1, 2024

@manojpramesh I'm looking forward to using this feature and would appreciate an update. Thank you

@suraneti
Copy link
Contributor Author

I've submitted PR #6562, @non-fungible-nelson @matthew1001 @manojpramesh could you please take a moment to review it when you have the time? I'm unsure whether it's okay or not.

I'm new to the Java language

@non-fungible-nelson
Copy link
Contributor

Awesome contribution 💪🏻 I have asked the engineers to review

@macfarla
Copy link
Contributor

completed in #6562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non mainnet (private networks) not related to mainnet features - covers privacy, permissioning, IBFT2, QBFT snack Smaller coding task - less than a day for an experienced dev
Projects
None yet
Development

No branches or pull requests

8 participants