or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
Opcode changes during the eth1/eth2 merge
Background
Given that core consensus is changing during the eth1/eth2 merge, it's valuable to understand which eth1 opcodes might change in behavior.
This document covers all of the opcodes that will change along with thoughts about how they should change given contracts running on eth1.
DIFFICULTY
DIFFICULTY
is meaningless after the merge as such a notion doesn't exist in proof of stake.Fortunately, there aren't public contracts that utilize
DIFFICULTY
meaningfully (i.e. see this github search). It's largely used as a seed for randomness in old lottery-style contracts.To keep these contracts functional, we can re-name opcode
0x44
fromDIFFICULTY
toRANDOM
and use the randao seed of a block to generate its value. This would need to be passed to the eth1-engine via RPC.COINBASE/NUMBER/TIMESTAMP/BLOCKHASH
Each of these 3 will be handled locally within the eth1-engine:
COINBASE
will be configured during startup (as the block producer address)TIMESTAMP
will be system time when the eth1-evm is processing the blockNUMBER
will be the continuation of eth1 block number (i.e. max_pow_block_num + slot)BLOCKHASH
will be available within the eth1-engine during constructionSo there's no change in behavior to worry about.
Two nuances to be mindful of:
BLOCKHASH
is often used as a source of randomness in eth1 contracts and is much easier to grind in eth2GASLIMIT
GASLIMIT
will now be decided on by validators or will be the gas limit defined in EIP1559 (initially2 * gas_target
) if that's implemented in time. This will need to be passed to the eth1-engine via RPC.