From 2fa1f651f4421f4b4ffc3368077db492ddacb699 Mon Sep 17 00:00:00 2001 From: perama-v <83961755+perama-v@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:10:29 +1000 Subject: [PATCH] doc(appearances): Fix spelling --- specs/appearances.md | 57 ++++++++++++++++++++++++++++++-------------- wordlist.txt | 1 + 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/specs/appearances.md b/specs/appearances.md index b9d9d4935..53ca3cc0a 100644 --- a/specs/appearances.md +++ b/specs/appearances.md @@ -63,58 +63,79 @@ An address has the following formal definition: - MUST begin or end with `MIN_NONZERO_BYTES` non-zero bytes. This allows for vanity address inclusion of up to `MAX_VANITY_ZERO_CHARS`. - MUST NOT be a known precompile -- When detected within > 20 bytes, 32 bytes MUST appear with left padding (12 leading zero-bytes). +- When detected within byte sequence of greater than 20 bytes, the bytes MUST appear with left padding (12 leading zero-bytes for the case of a 32 byte sequence). The address that meets the criteria is extracted from the source bytes. -- When inspecting >32 bytes, the bytes MUST first trimmed to a multiple of 32 bytes and divided +- When inspecting more than 32 bytes, the bytes MUST first trimmed to a multiple of 32 bytes and divided into 32 byte sections (length modulo 32) to be examined separately. The following examples show the detection and extraction of an address/addresses from a sequence of bytes. ### Example "address" Deposit contract address in a 32 byte hex string with left padding: +```command +"0x00000000000000000000000000000000219ab540356cbb839cbe05303d7705fa" ``` -"0x00000000000000000000000000000000219ab540356cBB839Cbe05303d7705Fa" -> ["0x00000000219ab540356cBB839Cbe05303d7705Fa"] +Result: +```console +["0x00000000219ab540356cbb839cbe05303d7705fa"] ``` Deposit contract address bytes, but shifted left. A valid address is detected, but is not the deposit contract address: +```command +"0x00000000000000000000219ab540356cbb839cbe05303d7705fa000000000000" ``` -"0x00000000000000000000219ab540356cBB839Cbe05303d7705Fa000000000000" -> ["0x219ab540356cBB839Cbe05303d7705Fa00000000"] +Result: +```console +["0x219ab540356cbb839cbe05303d7705fa00000000"] ``` Data from the two examples above, concatenated: +```command +"0x00000000000000000000000000000000219ab540356cbb839cbe05303d7705fa00000000000000000000219ab540356cbb839cbe05303d7705fa000000000000" ``` -0x00000000000000000000000000000000219ab540356cBB839Cbe05303d7705Fa00000000000000000000219ab540356cBB839Cbe05303d7705Fa000000000000 -> ["0x219ab540356cBB839Cbe05303d7705Fa00000000", "0x00000000219ab540356cBB839Cbe05303d7705Fa] +Result: +```console +["0x219ab540356cbb839cbe05303d7705fa00000000", "0x00000000219ab540356cbb839cbe05303d7705fa] ``` Data from the example above, with additional bytes that are truncated as modulo 32 bytes: ``` -0x00000000000000000000000000000000219ab540356cBB839Cbe05303d7705Fa00000000000000000000219ab540356cBB839Cbe05303d7705Fa000000000000 -> ["0x219ab540356cBB839Cbe05303d7705Fa00000000", "0x00000000219ab540356cBB839Cbe05303d7705Fa] +"0x00000000000000000000000000000000219ab540356cbb839cbe05303d7705fa00000000000000000000219ab540356cbb839cbe05303d7705fa000000000000" +``` +Result: +```console +["0x219ab540356cbb839cbe05303d7705fa00000000", "0x00000000219ab540356cbb839cbe05303d7705fa] ``` ### Example "not address" Deposit contract address in a 32 byte hex string with right padding. No address is detected because the leftmost 24 characters (12 bytes) must all be zeros: +```command +"0x00000000219ab540356cbb839cbe05303d7705fa000000000000000000000000" ``` -"0x00000000219ab540356cBB839Cbe05303d7705Fa000000000000000000000000" -> [] +Result: +```console +[] ``` No address is detected because the leftmost 24 characters (12 bytes) are ignored and the -remaining string has too many trailing 0's (`0x9Cbe05303d7705Fa000000000000000000000000`): +remaining string has too many trailing 0's (`0x9cbe05303d7705fa000000000000000000000000`): +```command +"0x0000000000000000000000009cbe05303d7705fa000000000000000000000000" ``` -"0x0000000000000000000000009Cbe05303d7705Fa000000000000000000000000" -> [] +Result: +```console +[] ``` Nonzero characters long enough for an address, but rejected for spanning a 32 byte boundary -(read as `0x...000219ab540356cBB83` and `0x9Cbe05303d7705Fa000...`): +(read as `0x...000219ab540356cbb83` and `0x9cbe05303d7705fa000...`): +```command +"0x000000000000000000000000000000000000000000000000219ab540356cbb839cbe05303d7705fa000000000000000000000000000000000000000000000000" ``` -"0x000000000000000000000000000000000000000000000000219ab540356cBB839Cbe05303d7705Fa000000000000000000000000000000000000000000000000" -> [] +Result: +```console +[] ``` ## Appearance definition diff --git a/wordlist.txt b/wordlist.txt index fef7a4af8..3d60e6084 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -57,3 +57,4 @@ randao src https forkchoiceupdatedresponsev +retSize