From e08e00524aca0e59bf7100da344721bad6b6e89f Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 2 Aug 2024 16:07:57 -0300 Subject: [PATCH 1/5] eip-7748: fix phase naming Signed-off-by: Ignacio Hagopian --- EIPS/eip-7748.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EIPS/eip-7748.md b/EIPS/eip-7748.md index c73480e796e6c6..061255bac2837e 100644 --- a/EIPS/eip-7748.md +++ b/EIPS/eip-7748.md @@ -193,11 +193,11 @@ def state_convert(state: State, stride: int): else: # No more storage-slots. Move to the code migration starting # at chunk-number zero. - state.conversion_curr_account.phase = CodePhase(0) + state.conversion_curr_account.phase = BasicDataPhase() else: # There's no storage trie for the account, move directly to # migrating code (if any). - state.conversion_curr_account.phase = CodePhase(0) + state.conversion_curr_account.phase = BasicDataPhase() # Account code and basic data. else: # Getting the code from the Overlay Tree is fine since promises returning From 76df1398120758989db11c4802d0a88a99c466ed Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 2 Aug 2024 19:34:18 -0300 Subject: [PATCH 2/5] eip-7748: rename phase Signed-off-by: Ignacio Hagopian --- EIPS/eip-7748.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EIPS/eip-7748.md b/EIPS/eip-7748.md index 061255bac2837e..f88005bfad71b1 100644 --- a/EIPS/eip-7748.md +++ b/EIPS/eip-7748.md @@ -64,12 +64,12 @@ class StoragePhase: The account next conversion step continues converting the storage-slot with key greater or equal next_key. If there isn't such storage-slot, the account must move to - BasicDataPhase. + AccountDataPhase. """ next_key: Bytes @dataclass -class BasicDataPhase: +class AccountDataPhase: """ The account next conversion step continues migrating the account code (if any) and basic data. After processing, the account must @@ -84,7 +84,7 @@ class CurrentConvertingAccount: Contains the state conversion next step. """ address: Address - phase : StoragePhase | BasicDataPhase + phase : StoragePhase | AccountDataPhase ``` These new structures allows `State` to track where we're in the conversion process. @@ -193,11 +193,11 @@ def state_convert(state: State, stride: int): else: # No more storage-slots. Move to the code migration starting # at chunk-number zero. - state.conversion_curr_account.phase = BasicDataPhase() + state.conversion_curr_account.phase = AccountDataPhase() else: # There's no storage trie for the account, move directly to # migrating code (if any). - state.conversion_curr_account.phase = BasicDataPhase() + state.conversion_curr_account.phase = AccountDataPhase() # Account code and basic data. else: # Getting the code from the Overlay Tree is fine since promises returning From 34671a477252bac774b4f7363b099ba4b699269a Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 2 Aug 2024 21:04:50 -0300 Subject: [PATCH 3/5] fix comment Signed-off-by: Ignacio Hagopian --- EIPS/eip-7748.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/EIPS/eip-7748.md b/EIPS/eip-7748.md index f88005bfad71b1..bec187168fa946 100644 --- a/EIPS/eip-7748.md +++ b/EIPS/eip-7748.md @@ -191,8 +191,7 @@ def state_convert(state: State, stride: int): # There're more storage-slots to be converted, continue in this phase. state.conversion_curr_account.phase.next_key = next_key else: - # No more storage-slots. Move to the code migration starting - # at chunk-number zero. + # No more storage-slots. Move to the account data migration. state.conversion_curr_account.phase = AccountDataPhase() else: # There's no storage trie for the account, move directly to From d3608765177d1fbef187f6f88f12386f1bef4e40 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 2 Aug 2024 21:07:28 -0300 Subject: [PATCH 4/5] fix rationale title Signed-off-by: Ignacio Hagopian --- EIPS/eip-7748.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-7748.md b/EIPS/eip-7748.md index bec187168fa946..a86e98b612437c 100644 --- a/EIPS/eip-7748.md +++ b/EIPS/eip-7748.md @@ -252,7 +252,7 @@ TODO: We have an estimation, but it might be worth recalculating it closer to th The conversion logic runs at the start of each block, so missed slots don't create special situations. -### Accounts storage->code->basic-data order +### Accounts storage->account-data order The proposed order synergizes with many EL client flat-db architectures, minimizing random disk-IO. From 63438adabe760de5aa402dda5b05bd16dc83fd2a Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 2 Aug 2024 21:09:24 -0300 Subject: [PATCH 5/5] improve comment Signed-off-by: Ignacio Hagopian --- EIPS/eip-7748.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EIPS/eip-7748.md b/EIPS/eip-7748.md index a86e98b612437c..d975b7f3a8e519 100644 --- a/EIPS/eip-7748.md +++ b/EIPS/eip-7748.md @@ -208,10 +208,10 @@ def state_convert(state: State, stride: int): state_set_codechunk(state, address, chunk_num, chunked_code[chunk_num]) n += 1 - # If the account basic data lives in MPT, get_account will pull from MPT - # and then we write to the VKT. If the account basic data already lives in - # the VKT (i.e: it was indirectly converted by a tx), then it will return - # it from the VKT and write it again (i.e: it's a noop). + # If the account data (i.e: nonce, balance, code-size, code-hash) lives in MPT, + # get_account will pull from MPT and then we write to the VKT. If the account + # data already lives in the VKT (i.e: it was indirectly converted by a tx), then + # it will return it from the VKT and write it again (i.e: it's a noop). # Thus, this operation is correct under both scenarios. That is, it won't # write stale data. account = get_account(state, curr_account.address)