原文标题:《 How The Merge Impacts Ethereum’s Application Layer 》
Tim Beiko, Ethereum developer and Community manager of the Ethereum Foundation
RexHuang7
Ethereum's transition to POS (proof of interest) -- consolidation -- is already in sight: development networks are being set up, specifications are being finalized, and community advocacy is underway. The purpose of the merger is to minimize the impact on ethereum's end users, smart contracts, and the way dApps operate, which means there are some small changes worth highlighting. Before we dive into them, here are a few links to provide background on the overall merge architecture.
- Evolution of roadmap & NBSP;
- The combined customer architecture
The rest of this article will assume familiarity with the above. For those who want to take a closer look, The full specifications of The Merge are available here.
- Executive layer & NBSP;
-Consensus layer & NBSP;
-API engine & NBSP;
After the merger, POW (Proof of Work) blocks will no longer exist in the network, and the contents of the previous POW Chain will become part of the blocks created on the Beacon Chain. Then you can think of the Beacon chain as the consensus layer of the Ethereum POS chain, replacing the previous proof of work consensus layer. The beacon chain block will contain ExecutionPayloads, which are the block equivalents of the current proof of work chain after merging.
The picture below shows this relationship.

For end users and application developers, these ExecutionPayloads are places to interact with Ethereum. Transactions at this tier will still be handled by executive-tier clients (Besu, Erigon, Geth, Nethermind, etc.). Fortunately, mergers cause minimal disruption due to the stability of the executive layer.
After the merge, several fields previously contained in the proof of work block header become unusable because they are irrelevant to POS (proof of equity). To minimize disruption to tools and infrastructure, these fields are set to 0, or their equivalent of the data structure, rather than being removed from the data structure entirely. For details about how to modify a block field, see EIP-3675.

Since POS (Proof of equity) does not naturally produce omers (uncle blocks) like POW (Proof of work), these lists in each block will be empty and the hash of this list will become the RLP-coded hash of an empty list. Similarly, since difficulty and Nonce are characteristics of POW (proof of work), they will both be set to 0 given their byte size values.
MixHash, another mining-related field, is not set to 0, but contains the RANDAO value of the beacon chain.
See the following sections for more details on this.
After the merge, the BLOCKHASH opcode will still be usable, but since it can no longer be forged through a working proof hash calculation process, the pseudo-randomness provided by the opcode will be significantly reduced.
In connection with this, the DIFFICULTY opcode (0x44) will be upgraded and renamed RANDOM. After merging, it returns the output of random beacons supplied by the beacon chain. Thus, this opcode will become a more powerful (though still biased) source of randomness available to program developers than BLOCKHASH.
Values exposed by RANDOM will be stored in ExecutionPayload, where mixHash is a value associated with a proof of work calculation. The mixHash field of payload will also be renamed random.
Below is a description of how the DIFFICULTY and RANDOM opcodes work before and after the merge.

Before the merge, we see that the 0x44 opcode returns the difficulty field in the bulk. After the merge, the opcode was renamed RANDOM, referring to the bulk field that previously contained the mixHash, and now stores the RANDOM value from the beacon chain state.
This change, formalized in IP-4399, also provides a way for on-chain applications to evaluate whether merging has occurred.
From the EIP:
In addition, the changes proposed in this EIP allow smart contracts to determine if they have been upgraded to PoS. This can be done by analyzing the return value of the DIFFICULTY opcode; a value greater than 2**64 indicates that the transaction is being executed in the PoS block.
The merger will affect ethereum's average block time. Currently under POW (Proof of work) a block is entered on average every 13 seconds (there is some variation in actual block times) and under POS (Proof of equity) a block is entered every 12 seconds unless a time period is missed due to the verifier being offline or not submitting the block in time. In practice, this is only the case in < 1% of the time.
This means that the average block time on the network will be reduced by 1 second, and those smart contracts that have the need to calculate a specific average block time will need to take this into account.
Under POW (Proof of work), there is always the possibility of a rearrangement, and applications often wait for several blocks to be mined on a new head, and then consider it less likely to be removed from the recognized chain, or "confirmed." It was also in the 1600s, after the merger, that we had the finalized King of France and the Safe head. These blocks can be used even more reliably than "confirmed" POW blocks, but a mindset shift is required to use them correctly.
A final block is accepted as a recognized block by more than two-thirds of the verifiers. To create a conflicting block, an attacker must burn off at least one-third of the total stake. As of this writing, this represents over $10 billion (or more than 2.5 million ETH) on Ethereum.
A secure head block is a block that we expect to be included in a recognized chain under normal network conditions. Assuming network latency is less than 4 seconds, most verifiers are honest, and there is no attack on the fork selection rule, the security head will never be an orphan.
Here is a report detailing how to calculate security headers in various situations. In addition, the assumptions and guarantees of safe head blocks in forthcoming papers are being formally defined and analyzed.
After the merge, executive-layer apis (such as JSON RPC) will return security headers by default when asking for the latest block. Under normal network conditions, the safety head and the actual top of the chain will be equal (the safety head block is only a few seconds behind). The security header will be less likely to be resuspended than the latest block of the current POW. To expose the actual top of the POS chain, an unsafe flag will be added to the JSON RPC.
Finalized blocks (1600s) will also be exposed via JSON RPC, with a new finalized flag. These can then serve as a more powerful alternative to confirmation of employment.
This is summarized in the table below.

We hope this article will help developers prepare for the much anticipated transition to the POS (Proof of stake) stage.
In the coming weeks, a long-standing test network will be made available to the wider community for testing, as well as an upcoming merge community teleconference to ask questions from infrastructure, tools, and application developers and hear the latest technical updates on the merge.
The original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia