# EIP-2935: gas cost + verkle
**Problem**: One of the main motivations for [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) is for Verkle and stateless clients. But if we deploy 2935 *before* Verkle, then we're making blockhash more expensive without a benefit until Verkle. (gas price increases because with 2935 BLOCKHASH would be served from state, and we're doing an SLOAD).
#### **Option 1**:
- activate 2935, but just dont have BLOCKHASH available for ~45 mins (256 blocks)
- why not available for 256 blocks? because no backfilling
- note: might break too much stuff to be practical solution?
#### **Option 2**:
* activate 2935 across 2 forks
* fork 1: only writing to the state
* fork 2: reading activated (at Verkle time)
#### Next Steps
- Get a better understanding of what Option 1 breaks
- L2s?
- dapps using BLOCKHASH as a source of randomness?
- Option 1 would be preferable if nothing breaks, otherwise Option 2?
#### Other questions/comments?
[add here]
* What about L2 / AltL1s? [@shemnon]
Changing the definition of the BLOCKHASH operation could have downstream impacts on L2 and other users of the EVM that may be hard to predict. So a change that has minimal client impact would be preferable.
Option 2 could be revised to just Fork 1, and then verkle adds it's "touch" requirement when the operation is called. Possibly with gas schedule changes in fork 2.
What would be nice to have for L2/Library compatability is no change to the lookback window. If clients want to look hours back they can query the contract directly.
* Tim: Option 2, but fork 1 happens 256 blocks before fork 2. So you ship only 2935 "minutes to hours" before the verkle transition
---
Georgios: We actually have a more interesting find… by @mattsse, expectedly, blockhash is used by good ol’ lotteries contracts
https://etherscan.io/tx/0xaff52eed1e83cd0d16c7ef64729f18e12f336619ce52968add3836730443a69e
```
//Spin the wheel,
bytes32 blockHash= block.blockhash(playerblock+blockDelay);
```
---
### **Notes from May 15th Breakout**
**Questions**:
(1) activation of the EIP and its (2) gas costs
-two options (see above)
-why not do "option 1" (i.e. activate 2935, but no block hashes available for 256 blocks which breaks stuff)
-matt: backfilling not good.. one-time action in the protocol and then never use it again
-can do it other ways
-what should blockhash return at the fork boundary
immediately transition to looking up the state and until the value is written it returns 0.. but this breaks applications. How bad? L2 not a big deal. They can write logic around it. But with dapps its broken in ways we cant mitigate. Have to do "Option 2"?
-What about "Option 3": keep current behavior of blockhash 256, no backfill no nothing. continues same as today
-we fill the contract storage so that if want older than 256 you can just call the get function of the contract. they pay the SLOAD cost. This is compatible bc when verkle happens you swap. Backwards compatible.
-NOTE: blockhash might be disabled in EOF at some point
-EOF could instead rely on contract query
-TLDR: keeping blockhash as-is. No change. If you want to get anything older than 256 you go to contract
-right now / pre pectra: if you call blockhash you pay 20. if you call with any block less than 256 blocks ago you get blockhash.. if you call greater (say 1000) then you get 0.
-post pectra: Same behavior! no backfill. If contract at first block calls BLOCKHASH with less than 256 blocks ago, they will get blockhash. If they call 1000 then they get 0. Same behavior. But now at the beginning of the fork the history contract is filled with the last block before pectra.
-when verkle happens, exactly same thing, only difference is that whatever slot in the contract gets accessed will end up in the witness. We fill the buffer live.
-what should solidity do?
-when verkle happens, when they call blockhash instruction, it goes through the contract bc needs to be witness. Question is whether we change gas cost in prague or osaka. But for sure in Osaka you will have full cost.
-solidity should prefer the blockhash instruciton bc its cheaper
-solidity compiles to blockhash and users can opt-in if they want to future proof their contract.
-blockhash operates the same, no backfill, but what about gas costs..
-Gas cost question:
-geth loads blockhash from DB
-should we change blockhash gas cost in Pectra for Verkle? Nah
-agreement: no reason to change gas cost before verkle
-ADD TO EIP @guillaume: implications around devnet for Osaka: if osaka devnet doesnt start from prague genesis.. prague and osaka at genesis. Then you need to be aware blockhash instruction will return 0 when you expect non-0.
---
### Popular contracts with `BLOCKHASH`
The collections of contracts having `BLOCKHASH` instruction
(before `INVALID` instruction) out of top 1000 popular
contracts (by gas usage) in the last year.
BLOCKHASH users (22):0x00000000000000adc04c56bf30ac9d3c0aaf14dc, Seaport 1.5
0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45, Uniswap V3: Router 2, `blockhash(block.number - 1)`, the function `function multicall(bytes32 previousBlockhash, bytes[] calldata data)` uses `BLOCKHASH`
0x00000000000001ad428e4906ae43d8f9852d0dd6, Seaport 1.4
'0x13f4ea83d0bd40e75c8222255bc855a974568dd4', '0x0000000000000068f116a894984e2db1123eb395', '0x054086d40cf8fd5bf6200eda7f9c6877b0302dd1', '0x60e4d786628fea6478f785a6d7e704777c86a7c6', '0x5e4e65926ba27467555eb562121fac00d24e9dd2', '0xd0921691c7debc698e6e372c6f74dc01fc9d3778', '0xca11bde05977b3631167028862be2a173976ca11', '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d', '0x271682deb8c4e0901d1a1550ad2e64d568e69909', '0xc77f8768774e1c9244beed705c4354f2113cfc09', '0xde5d4949f445650325c7c8739610c3a979c7a6db', '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2', '0x6593c7de001fc8542bb1703532ee1e5aa0d458fd', '0x0000000000e655fae4d56241588680f86e3b2377', '0xb6a37b5d14d502c3ab0ae6f3a0e058bc9517786e', '0xba30e5f9bb24caa003e9f2f0497ad287fdf95623', '0x056fd409e1d7a124bd7017459dfea2f387b6d5cd', '0x02777053d6764996e594c3e88af1d58d5363a2e6', '0x0c9663115b36fa95d18e71d59054117bcb0342ef']