EIP-2935 Historical Block Hashes Detailed Guide#671
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
apps/core/content/developers/guides/eip2935-historical-block-hashes.md
Outdated
Show resolved
Hide resolved
|
@okjintao Thanks for your review! I've gone through and made changes, as well as left a comment for us to sync up on. |
|
|
||
| Before EIP-2935, smart contracts could access only the last 256 block hashes using the `BLOCKHASH` opcode. This process raised challenges though: | ||
|
|
||
| - Accessing a hash outside that window, returned `0x0`, silently, |
There was a problem hiding this comment.
| - Accessing a hash outside that window, returned `0x0`, silently, | |
| - Accessing a hash outside that window returns `0x0` silently |
| Before EIP-2935, smart contracts could access only the last 256 block hashes using the `BLOCKHASH` opcode. This process raised challenges though: | ||
|
|
||
| - Accessing a hash outside that window, returned `0x0`, silently, | ||
| - You couldn’t fetch a blockhash using dynamic inputs (e.g. calldata or computation), |
There was a problem hiding this comment.
Remove commas at the end
| - `eip2935GasComparison.s.sol` - A solidity script used to deploy the `eip2935GasComparison.sol` and make calls to it to simulate different blockhash reading methods. | ||
| - `run_gas_comparison.sh` - A bash script created to deploy `eip2935GasComparison.sol` and tabulate the gas expenditure results. | ||
|
|
||
| ### Prerequisites |
There was a problem hiding this comment.
| ### Prerequisites | |
| ### Requirements |
and make it a list with versions of each tool needed vs installs
|
|
||
| Anyone can later call the system contract to retrieve a blockhash from that range. | ||
|
|
||
| ## Guide |
There was a problem hiding this comment.
Revise for keywords
| ## Guide | |
| ## How To Obtain BlockHashes & Store Them |
|
|
||
| Go through the following steps: | ||
|
|
||
| ### Step 1 - Install Deps |
There was a problem hiding this comment.
| ### Step 1 - Install Deps | |
| ### Step 1 - Install Dependencies |
|
|
||
| ```bash | ||
| # From apps/eip-2935-gas-comparison | ||
| source .env && anvil --fork-url $BEPOLIA_RPC_URL --fork-block-number 4867668 --chain-id 80069 --port 8545 |
There was a problem hiding this comment.
Use ```bash-vue to add variables for the bepolia rpc and chain id
|
|
||
| ```bash | ||
| # From apps/eip-2935-gas-comparison | ||
| ./script/run_gas-comparison.sh |
There was a problem hiding this comment.
| ./script/run_gas-comparison.sh | |
| # FROM: ./ | |
| ./script/run_gas-comparison.sh; | |
| # [Expected Similar Result]: | |
| # ... |
There was a problem hiding this comment.
I believe I have seen it written in the way I wrote within other guides. So are we always doing relative path locations like this going forward?
There was a problem hiding this comment.
Changes made, and also added in a code snippit of what the terminal output should look like when running the script. I left it so the guide still elaborates on the results later on.
|
|
||
| The bash script, `run_gas_comparison.sh` deploys the `eip2935GasComparison.sol` contract on the locally ran anvil fork of Bepolia. It then goes through the results and tabulates the total gas expenses for each blockhashing method, including storing the blockhash or replicating the usage of an oracle. | ||
|
|
||
| #### Step 6 - Highlevel Review of the Solidity File |
There was a problem hiding this comment.
| #### Step 6 - Highlevel Review of the Solidity File | |
| ### Step 6 - Highlevel Review of the Solidity File |
| ### Step 5 - Understanding What the Script Does | ||
|
|
||
| The bash script, `run_gas_comparison.sh` deploys the `eip2935GasComparison.sol` contract on the locally ran anvil fork of Bepolia. It then goes through the results and tabulates the total gas expenses for each blockhashing method, including storing the blockhash or replicating the usage of an oracle. |
There was a problem hiding this comment.
Go over the solidity code here
There was a problem hiding this comment.
I continue to go through the solidity code, and the methods assessed after this small section. Did you want me to rewrite it in a particular way?
|
Missing link in sidebar or contributions section |
|
Thanks for the reviews @okjintao @codingwithmanny. Manny, I made a couple of comments on some of your CRs. Please let me know if you would like me to correct anything else / if I misinterpreted your comments. I will make the same changes to the quickstart (if applicable) in the guides repo.. |
Description
Guide for Write EIP 2935 Gas Comparison Guide #121.
Contribution
I have followed the Development Workflow
I have read the CODE OF CONDUCT
I HAVE MADE SURE TO ALLOW MAINTAINERS TO EDIT THIS PULL REQUEST