From f7de7be378bbb255d809e9494b669cfef2603072 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Tue, 23 Jul 2024 14:15:10 -0300 Subject: [PATCH 1/3] update naming of code hash field Signed-off-by: Ignacio Hagopian --- EIPS/eip-6800.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EIPS/eip-6800.md b/EIPS/eip-6800.md index 9c3585682d3738..3c8f0b3dc053d7 100644 --- a/EIPS/eip-6800.md +++ b/EIPS/eip-6800.md @@ -116,7 +116,7 @@ Instead of a two-layer structure as in the Patricia tree, in the Verkle tree we | Parameter | Value | | --------------------- | ------- | | BASIC_DATA_LEAF_KEY | 0 | -| CODE_KECCAK_LEAF_KEY | 1 | +| CODE_HASH_LEAF_KEY | 1 | | HEADER_STORAGE_OFFSET | 64 | | CODE_OFFSET | 128 | | VERKLE_NODE_WIDTH | 256 | @@ -158,8 +158,8 @@ def get_tree_key_for_basic_data(address: Address32): return get_tree_key(address, 0, BASIC_DATA_LEAF_KEY) # Backwards compatibility for EXTCODEHASH -def get_tree_key_for_code_keccak(address: Address32): - return get_tree_key(address, 0, CODE_KECCAK_LEAF_KEY) +def get_tree_key_for_code_hash(address: Address32): + return get_tree_key(address, 0, CODE_HASH_LEAF_KEY) ``` An account's `version`, `balance`, `nonce` and `code_size` fields are packed in the value found at `BASIC_DATA_LEAF_KEY`: @@ -175,7 +175,7 @@ Bytes `1..4` are reserved for future use. Note: the code size is stored on 3 bytes. To allow for an extension to 4 bytes without changing the account version is possible, reserved byte #4 should be allocated last. -When any account header field is set, the `version` field is also set to zero. The `code_keccak` and `code_size` fields are set upon contract or EoA creation. +When any account header field is set, the `version` field is also set to zero. The `codehash` and `code_size` fields are set upon contract or EoA creation. #### Code From 654eb2a4ca438137b4a730e0b04f6b09e1631d6b Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Tue, 23 Jul 2024 14:17:19 -0300 Subject: [PATCH 2/3] layout clarifications Signed-off-by: Ignacio Hagopian --- EIPS/eip-6800.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EIPS/eip-6800.md b/EIPS/eip-6800.md index 3c8f0b3dc053d7..aa8d882552d7bb 100644 --- a/EIPS/eip-6800.md +++ b/EIPS/eip-6800.md @@ -162,7 +162,7 @@ def get_tree_key_for_code_hash(address: Address32): return get_tree_key(address, 0, CODE_HASH_LEAF_KEY) ``` -An account's `version`, `balance`, `nonce` and `code_size` fields are packed in the value found at `BASIC_DATA_LEAF_KEY`: +An account's `version`, `balance`, `nonce` and `code_size` fields are packed with big-endian encoding in the value found at `BASIC_DATA_LEAF_KEY`: | Name | Offset | Size | | ----------- | ------ | ---- | @@ -173,7 +173,7 @@ An account's `version`, `balance`, `nonce` and `code_size` fields are packed in Bytes `1..4` are reserved for future use. -Note: the code size is stored on 3 bytes. To allow for an extension to 4 bytes without changing the account version is possible, reserved byte #4 should be allocated last. +The current layout and encoding allows for an extension of `code_size` to 4 bytes without changing the account version. When any account header field is set, the `version` field is also set to zero. The `codehash` and `code_size` fields are set upon contract or EoA creation. From 1741373dcb02b715f1e91084d5f64f71f1ff9eb5 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Wed, 24 Jul 2024 10:11:35 -0300 Subject: [PATCH 3/3] feedback Signed-off-by: Ignacio Hagopian --- EIPS/eip-6800.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-6800.md b/EIPS/eip-6800.md index aa8d882552d7bb..de1dc97e490822 100644 --- a/EIPS/eip-6800.md +++ b/EIPS/eip-6800.md @@ -173,7 +173,7 @@ An account's `version`, `balance`, `nonce` and `code_size` fields are packed wit Bytes `1..4` are reserved for future use. -The current layout and encoding allows for an extension of `code_size` to 4 bytes without changing the account version. +The current layout and encoding allow for an extension of `code_size` to 4 bytes without changing the account version. When any account header field is set, the `version` field is also set to zero. The `codehash` and `code_size` fields are set upon contract or EoA creation.