From 21b71bd29ca135ee6f192600051a6e8ac54d6f6c Mon Sep 17 00:00:00 2001 From: tersec Date: Fri, 11 Mar 2022 15:03:47 +0000 Subject: [PATCH] update URL and document Nim bug blocking further genericizing cleanups (#3483) --- beacon_chain/consensus_object_pools/block_pools_types.nim | 8 ++++++++ beacon_chain/networking/network_metadata.nim | 2 +- scripts/find_unchanged_consensus_spec_files.sh | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/beacon_chain/consensus_object_pools/block_pools_types.nim b/beacon_chain/consensus_object_pools/block_pools_types.nim index 842d939b8..e2a66b00b 100644 --- a/beacon_chain/consensus_object_pools/block_pools_types.nim +++ b/beacon_chain/consensus_object_pools/block_pools_types.nim @@ -236,6 +236,14 @@ type blck*: BlockRef ## The block associated with the state found in data + # TODO when Nim 1.2 support is dropped, make these generic. 1.2 generates + # invalid C code, which gcc refuses to compile. Example test case: + # type + # OnBlockAdded[T] = proc(x: T) + # OnPhase0BlockAdded = OnBlockAdded[int] + # proc f(x: OnPhase0BlockAdded) = discard + # const nilCallback = OnPhase0BlockAdded(nil) + # f(nilCallback) OnPhase0BlockAdded* = proc( blckRef: BlockRef, blck: phase0.TrustedSignedBeaconBlock, diff --git a/beacon_chain/networking/network_metadata.nim b/beacon_chain/networking/network_metadata.nim index 9b0d996f3..baef223d8 100644 --- a/beacon_chain/networking/network_metadata.nim +++ b/beacon_chain/networking/network_metadata.nim @@ -98,7 +98,7 @@ proc readBootEnr*(path: string): seq[string] {.raises: [IOError, Defect].} = proc loadEth2NetworkMetadata*(path: string, eth1Network = none(Eth1Network)): Eth2NetworkMetadata {.raises: [CatchableError, Defect].} = # Load data in eth2-networks format - # https://github.com/eth2-clients/eth2-networks/ + # https://github.com/eth-clients/eth2-networks try: let diff --git a/scripts/find_unchanged_consensus_spec_files.sh b/scripts/find_unchanged_consensus_spec_files.sh index 83596a7ec..98bfdbd39 100755 --- a/scripts/find_unchanged_consensus_spec_files.sh +++ b/scripts/find_unchanged_consensus_spec_files.sh @@ -11,8 +11,8 @@ REPO_URL=https://github.com/ethereum/consensus-specs.git VALID=".*\\.\\(md\\|py\\|yaml\\|sol\\)" UNCHANGED_SPEC_FILES=$(comm -12 --check-order <(git clone --branch "${PREV_VERSION}" --config advice.detachedHead=false --depth 1 --quiet "${REPO_URL}" "${TMPDIR1}" && cd "${TMPDIR1}" && find . -type f -regex "${VALID}" -print0 | xargs -0 sha256sum | sort) <(git clone --branch "${NEXT_VERSION}" --config advice.detachedHead=false --depth 1 --quiet "${REPO_URL}" "${TMPDIR2}" && cd "${TMPDIR2}" && find . -type f -regex "${VALID}" -print0 | xargs -0 sha256sum | sort) | awk '{print $2}' | sed -e"s/^\.\///" | shuf) -# One can use this to automate the search andreplace with a tool such as -# https://github.com/kcoyner/rpl/ or just a find/sed combination, e.g.,: +# One can use this to automate the search and replace with a tool such as +# https://github.com/kcoyner/rpl/, or just a find/sed combination, e.g.,: URL_BASE=https://github.com/ethereum/consensus-specs/blob/ FROM=${URL_BASE}${PREV_VERSION}/ TO=${URL_BASE}${NEXT_VERSION}/