From 56986c08d6207bd39fdf58c28e51e09067946c6f Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Wed, 12 Apr 2023 01:31:47 +0200 Subject: [PATCH] rename `execution(Block|Payload)Root` > `executionBlockHash` (#4809) Note: `execution_payload_root` is _actually_ `htr(payload)`. Only `executionPayloadRoot` was used as `executionBlockHash`. --- beacon_chain/consensus_object_pools/block_dag.nim | 6 +++--- beacon_chain/consensus_object_pools/blockchain_dag.nim | 6 +++--- tests/testdbutil.nim | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/beacon_chain/consensus_object_pools/block_dag.nim b/beacon_chain/consensus_object_pools/block_dag.nim index a5a3efc45..050bc3952 100644 --- a/beacon_chain/consensus_object_pools/block_dag.nim +++ b/beacon_chain/consensus_object_pools/block_dag.nim @@ -34,7 +34,7 @@ type bid*: BlockId ##\ ## Root that can be used to retrieve block data from database - executionBlockRoot*: Opt[Eth2Digest] + executionBlockHash*: Opt[Eth2Digest] parent*: BlockRef ##\ ## Not nil, except for the finalized head @@ -54,10 +54,10 @@ template slot*(blck: BlockRef): Slot = blck.bid.slot func init*( T: type BlockRef, root: Eth2Digest, - executionPayloadRoot: Opt[Eth2Digest], slot: Slot): BlockRef = + executionBlockHash: Opt[Eth2Digest], slot: Slot): BlockRef = BlockRef( bid: BlockId(root: root, slot: slot), - executionBlockRoot: executionPayloadRoot) + executionBlockHash: executionBlockHash) func init*( T: type BlockRef, root: Eth2Digest, diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index 6ba641b7b..07787d468 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -1978,9 +1978,9 @@ proc loadExecutionBlockHash*(dag: ChainDAGRef, bid: BlockId): Eth2Digest = ZERO_HASH proc loadExecutionBlockHash*(dag: ChainDAGRef, blck: BlockRef): Eth2Digest = - if blck.executionBlockRoot.isNone: - blck.executionBlockRoot = Opt.some dag.loadExecutionBlockHash(blck.bid) - blck.executionBlockRoot.unsafeGet + if blck.executionBlockHash.isNone: + blck.executionBlockHash = Opt.some dag.loadExecutionBlockHash(blck.bid) + blck.executionBlockHash.unsafeGet from std/packedsets import PackedSet, incl, items diff --git a/tests/testdbutil.nim b/tests/testdbutil.nim index 1fa6f3cc6..5ee8513bc 100644 --- a/tests/testdbutil.nim +++ b/tests/testdbutil.nim @@ -51,19 +51,19 @@ proc getEarliestInvalidBlockRoot*( # Only allow this special case outside loop; it's when the LVH is the direct # parent of the reported invalid block - if curBlck.executionBlockRoot.isSome and - curBlck.executionBlockRoot.get == latestValidHash: + if curBlck.executionBlockHash.isSome and + curBlck.executionBlockHash.get == latestValidHash: return defaultEarliestInvalidBlockRoot while true: # This was supposed to have been either caught by the pre-loop check or the # parent check. - if curBlck.executionBlockRoot.isSome and - curBlck.executionBlockRoot.get == latestValidHash: + if curBlck.executionBlockHash.isSome and + curBlck.executionBlockHash.get == latestValidHash: doAssert false, "getEarliestInvalidBlockRoot: unexpected LVH in loop body" if (curBlck.parent.isNil) or - curBlck.parent.executionBlockRoot.get(latestValidHash) == + curBlck.parent.executionBlockHash.get(latestValidHash) == latestValidHash: break curBlck = curBlck.parent