owned this note changed 2 years ago
Linked with GitHub

References

Notes on Blob Gas Pricing & Capacity

As of now, 1 Byte of Blob Storage can cost at minimum 1 Gwei, and each Blob can contain up to 4096 fields of 32 Bytes each, giving a total of 128kB per Blob. The limit on throughput derives from the maximum blob gas that can be spent per block, which is equivalent to 6 blobs on unit price, or 768kB for a 1 Gwei price.

In practice, using all possible blob capacity is only feasible if the blob gas price is at its minimum, as block usage above (or below) the target (which is set to 3 blobs per block, or 384kB) will change the price according to:

\[ \begin{align} \Delta b_{t} &= b_t - \hat{b} \\ \Sigma_{\Delta b_t} &= \max(\Sigma_{\Delta b_{t-1}} + \Delta b_{t}, 0) \\ p_{t+1} &= p_{b}^- e^{\frac{\Sigma_{\Delta b_t}}{\alpha}}\\ \end{align} \]

Where \(\hat b=393216\) (or 384kB) is the Target Blob Gas per Block, \(\Delta b\) is the Immediate Excess Blob Gas, \(\Sigma_{\Delta b_t}\) is the Excess Blob Gas, \(\alpha=3338477\) is the Blob Gas Price Updation Fraction and \(p_{b}^-=1\) is the Minimum Blob Gas Price.

In terms of dynamics, some insights can be gained through simulations. Some figures have been generated below and there's a simulation here.

Considering that the average L1 block time is 12s, this mechanism creates a cap on the sustained network-wide blob-gas usage throughput that is equal to the target blob-gas divided by the block time, which is approximately 32.0 kB/s, or 1.9 MB/min, or 112.5 MB/h, or 2.6 GB/day. Higher throughputs can only be achieved temporarily and will require intervals with lower throughputs afterwards in order to off-set it. "Resetting" the price and therefore the throughput can require several blocks (eg. 10 blocks, or ~2min), although this is unbounded and could potentially be an attack vector through forced congestion.

It is uncertain how much blob storage other applications will want to use.

The figures below demonstrates the Blob Gas Pricing behaviour under different relative usage scenarios, all of whom which starts with an Blob Gas Price of 1. The blue line indicates the maximum blob storage per block as based on the blob gas price, and the red line indicates the price itself.

The upper-left figure is what happens when 100% of the maximum blob storage is used since the beginning until the blob storage usage goes to 0% on block_time=75. Note that the recovery requires about ~50 blocks to happen. The lower-left figure is what happens when 60% of the maximum blob storage is used and then being interrupted at block_time=75. This time the recovery is faster: around ~20 blocks.

The right figures is when the usage is an random value between 100% and 0% of the maximum. The upper-right is an standard uniform distribution (eg. the average relative usage is 50%, or the target usage). There's an trend on it to increase and long intervals without recovery, which is partially generated by the impossibility of having negative excess bytes. Lastly the lower-right is an uniformed squared distribution (eg. the average relative usage is 25%, half the target usage) and it is sucessful in making the maximum available storage close to the theoretical maximum most of the time.

It is uncertain what the actual blob storage distribution is going to be, but given the initially relatively low prices and the fact that most users are expected to be constant throughput, it is not hard to imagine that congestions could become an common issue initially, especially considering the reinforcing feedback loop of more usage leading to more price which leads to less available storage and therefore more usage because of delays.

Fixed Scenarios Random Scenarios

Highlights & Notes from the References

  • From the EIP-4844 Website
    • "EIP-4844 introduces a new kind of transaction type to Ethereum which accepts "blobs" of data to be persisted in the beacon node for a short period of time"
  • From the EIP-4844 on Ethereum EIPs forum
    • Was created on 2022-02-05
    • Field size: 32 Bytes
    • Fields: 4096
    • Max bytes per blob: 128 kB
    • return GAS_PER_BLOB * len(tx.blob_versioned_hashes)
      • GAS_PER_BLOB = 2**17, or 131,072 Gas per Blob. Assuming that an blob uses the full space, then this implies 1 Gas per Byte of Blob.
    • Note: This implies an maximum of 768 kB per block. Or 5.23 GB per day.
    • Terminology: KZG means Kate-Zaverucha-Goldberg and it is described as a "polynomial commitment scheme", which is an ingredient used by ZK-based rollups. Source.
  • Deneb Beacon Chain Spec
    • Max blobs per Block: 6
    • Max block commitments per Block: 4096
    • Note: Ethereum average block time is ~12s. Or ~7150 blocks per day.
Select a repo