2

I've got a private network that's using the clique consensus protocol and is running using Geth (if that's relevant).

I have been confused about gas and transaction fees, so wrote a script to look at how the fees change given the [gas] size of the previous block. I ran my script on the Rinkeby network to try it out, and what I saw aligns with what I expected. (If the block is >100% of the target size, I expect the baseFeePerGas to increase; if it's <100% I expect baseFeePerGas to decrease.)

However, when I run the same script on my private network, the baseFeePerGas property is missing from every block. Given that my network and Rinkeby use the same protocol, is it unreasonable of me to expect the same properties on blocks?

Currently my network is completely suboptimal in that it only has one miner. Could this be why baseFeePerGas is missing?

UPDATE:

Geth version is 1.10.16-stable-20356e57.

My genesis.json is:

{
  "config": {
    "chainId": 21456,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "clique": {
      "period": 600,
      "epoch": 30000
    }
  },
  "nonce": "0x0",
  "timestamp": "0x5eccf14a",
  "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000f1bfa564d354a59ca9c71e606c8f19eae19d52cb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "1000000000",
  "difficulty": "0x1",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "alloc": {
    "0000000000000000000000000000000000000000": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000001": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000002": {
      "balance": "0x1"
    },
    ...252 others...
    "00000000000000000000000000000000000000ff": {
      "balance": "0x1"
    },
    "000211184408e571bdb4fd96f1815f515e7b2a03": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "1081d21e1e6bcb3e71bcf025305e80f68e45351d": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "702e36767e3c5298c91160c5716ea0d9c807a881": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "793c20626b11a569460186e803a32391bc759ff9": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "f1bfa564d354a59ca9c71e606c8f19eae19d52cb": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    }
  },
  "number": "0x0",
  "gasUsed": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}

I've trimmed it to get rid of an excessive number of accounts.

8
  • What's the geth version used? Can you share your genesis file?
    – Ismael
    Commented Jun 12, 2022 at 21:09
  • @Ismael I've updated the question to include that information.
    – IpsRich
    Commented Jun 13, 2022 at 9:09
  • The property baseFeePerGas was introduced in EIP-1559 at the London hard fork. You've to upgrade the blockchain adding LondonBlock to the configuration.
    – Ismael
    Commented Jun 14, 2022 at 1:15
  • Many thanks, @Ismael. Is it possible to do that on a running blockchain, or will I have to delete all the data and let it start again?
    – IpsRich
    Commented Jun 15, 2022 at 6:58
  • 1
    Yes, it is possible. See here for a recent answer ethereum.stackexchange.com/questions/78616/….
    – Ismael
    Commented Jun 15, 2022 at 13:07

1 Answer 1

1

With thanks to @Ismael for the guidance, here's a trimmed version of my genesis.json file:

{
  "config": {
    "chainId": 21456,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "berlinBlock": 0,
    "londonBlock": 0,
    "clique": {
      "period": 150,
      "epoch": 30000
    }
  },
  ...
}

The relevant bits are the inclusion of londonBlock and berlinBlock. (I also changed period from 600 to 150, but that's unrelated.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.