xxxxxxxxxx
Sign in to import from GitHub:
Link to GitHub:
Or start with a template:
This document presents how database access work during the overlay transition to verkle trees, and why the gas model need not be changed.
The adoption of a flat database model is reaching a consensus among clients. Even though not all of them have implemented it yet, we expect to reach complete adoption in the medium term.
Reads from the flat database are rather cheap, compared to tracing the tree from node to node, in order to reach the leaf node that one is looking for.
The reason why the gas for reading isn’t getting any cheaper, is that there is no garantee that the snapshot will be present. Typically, a deep reorg will invalidate the snapshot.
In this model, it is assumed that the conversion will use the overlay method with a readonly MPT.
Even though the presence of the snapshot is not required during normal operation, its presence can be guaranteed before the sweeping phase of the overlay method. Noting that:
there is, in fact, enough time to ensure that a snapshot is generated. For geth, snapshot generation takes about 2 hours currently on a fast nvme disk. There is, therefore, ample time between the finalization of the fork block and the start of the snapshot sweeping.
The snapshot needs to retain both MPT and verkle values. The MPT values that are “cloberred” by the verkle tree also need to be retained, so that they can be served to syncing nodes.
The snapshot is now designed to hold both MPT and verkle values. It is still keyed by the keccack of the address/slot, but the value is changing as follows:
1
or 2
, which is well outside of the range for an RLP list header (0x80..0xff
).In order to read, the snapshot is searched using the traditional key structure: key = keccak256(address) || keccak256(slot number)
.
N < 0x80
then the entry corresponds to an address/slot that was inserted in the verkle tree and was never present in the MPT;L
of that RLP payload.
L
, then the value is only present in the MPT;L
, then the extra bytes are the serialization of the verkle value;L
, then report an error.Because both MPT and verkle values can be read in one swoop, and because the I/O dominates the decoding, then there is no need to update the gas cost.
Since only the verkle tree is updated, the writing costs in the tree are unchanged during the transition, as all internal nodes need to be read and updated. Updating the snapshot has about the same costs, as both the MPT and verkle values are written together.
or
Do you really want to delete this template?
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.
Please sign in to GitHub and install the HackMD app on your GitHub repo. Learn more
Sign in to GitHubHackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
Syncing