ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.29k stars 20.01k forks source link

Is it possible to set up a PoS private chain with 0 gas price using Kurtosis? #30102

Closed milc0x closed 1 month ago

milc0x commented 3 months ago

Hi Geth Team,

Our development team is currently conducting performance testing for blockchain transactions, which requires a large number of test tokens to complete. Collecting test tokens on the Sepolia testnet takes a considerable amount of time. Therefore, we are planning to adopt a more efficient approach by setting up a private testnet (private chain) with the gas price set to 0 so that there won't be any transaction fees.

However, in the past, we used the POA consensus algorithm provided by Geth through the Clique protocol. I recently discovered that in version 1.14.0 of Geth, POA (Clique) is deprecated and it is recommended to migrate to PoS using Kurtosis. I wonder if I can still build a PoS private chain with a gas price of 0.

If not, I may choose to use a version of Geth below 1.14.0, which is compatible with the POA consensus. Could you please specify which latest versions are suitable for this?

s1na commented 3 months ago

with the gas price set to 0 so that there won't be any transaction fees.

Please help me understand why you need the gas price to be 0? It is your private network. You can assign an account as much ether as you want to pay for gas.

milc0x commented 3 months ago

Please help me understand why you need the gas price to be 0? It is your private network. You can assign an account as much ether as you want to pay for gas.

Given the premise that this is built on our private chain within a private subnet, with a low likelihood of being exposed to DoS attacks.

Enabling 0-gas transactions in developer private chains simplifies the testing process by allowing developers to focus on testing smart contract functionality without the overhead of managing gas for every address involved. This approach streamlines testing efforts, ensuring that developers can concentrate on the core aspects of their smart contracts without the need to allocate gas funds or set up complex automation scripts for each testing scenario.

milc0x commented 3 months ago

https://github.com/ethereum/go-ethereum/issues/27517#issuecomment-1597673251

After the London fork, if setting the gas price to 0 is not feasible, what is the minimum gas price that can be set for the least base fee using Kurtosis or a similar tool?

s1na commented 3 months ago

what is the minimum gas price that can be set for the least base fee using Kurtosis or a similar tool?

7 is the minimum base fee allowed by the protocol.

without the overhead of managing gas for every address involved

Right I believe that overhead is minimal since the addresses will need to be managed anyway so they can send transactions. And kurtosis ethereum-package comes with a list of prefunded accounts. See https://github.com/ethpandaops/ethereum-package?tab=readme-ov-file#pre-funded-accounts-at-genesis. Unless the issue is estimating gas?

chanderprakash20 commented 2 months ago

Hi Please try one of the methood to take it gas fee to zero Options for Setting Up a Private Ethereum Network:

  1. Using Proof of Stake (PoS) with Geth 1.14.0 and Later:

    Kurtosis for PoS: With Geth 1.14.0 and later, you can set up a private network using Proof of Stake (PoS) as recommended. Gas Price: You can configure the gas price to be zero in your network settings, although this is unusual for PoS, it can be done for testing purposes. Setup: Utilize Kurtosis to create a PoS network. Kurtosis provides tooling to help configure Ethereum networks with different consensus mechanisms, including PoS.

  2. Using Clique (PoA) with Geth Version Below 1.14.0:

    Clique Consensus: You can use Clique (PoA) by running a Geth version earlier than 1.14.0. Versions: The latest version before 1.14.0 would be 1.13.x, which supports Clique. Gas Price: In Clique, you can set the gas price to zero, effectively allowing transactions without fees. Setup: Follow the Clique documentation for setting up a private PoA network. This involves configuring genesis.json and adding sealers. Happy to connect for further Discusison

lightclient commented 1 month ago

Geth isn't really geared toward private network use, so this isn't really functionality we are focused on supporting. It's probably not possible anymore since you would need to run pre-London when EIP-1559 was introduced. I recommend using an older version of geth.