Skip to content

Commit

Permalink
Apply changes to translations [Fixes ethereum#6860]
Browse files Browse the repository at this point in the history
  • Loading branch information
lgaroche committed Jan 15, 2024
1 parent fcb3c37 commit 18dbc1d
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ Aquí está el código extendido para obtener un nodo en el Merkle Patricia trie

### Ejemplo de Trie {#example-trie}

Supongamos que queremos un trie que contenga cuatro pares ruta/valor `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coin')`, `('horse', 'stallion')`.
Supongamos que queremos un trie que contenga cuatro pares ruta/valor `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coins')`, `('horse', 'stallion')`.

En primer lugar, convertimos tanto las rutas como los valores en `bytes`. A continuación, las representaciones reales de bytes para _rutas_ se denotan con `<>`, aunque los _valores_ todavía se muestran como cadenas, denotadas por `''`, para facilitar la comprensión (estos también en realidad serían `bytes`):

```
<64 6f> : 'verb'
<64 6f 67> : 'puppy'
<64 6f 67 65> : 'coin'
<64 6f 67 65> : 'coins'
<68 6f 72 73 65> : 'stallion'
```

Expand All @@ -176,12 +176,12 @@ Ahora, construimos un trie con los siguientes pares clave/valor en la base de da
```
rootHash: [ <16>, hashA ]
hashA: [ <>, <>, <>, <>, hashB, <>, <>, <>, [ <20 6f 72 73 65>, 'stallion' ], <>, <>, <>, <>, <>, <>, <>, <> ]
hashB: [ <00 6f>, hashD ]
hashD: [ <>, <>, <>, <>, <>, <>, hashE, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashE: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coin' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
hashB: [ <00 6f>, hashC ]
hashC: [ <>, <>, <>, <>, <>, <>, hashD, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashD: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coins' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
```

Cuando se hace referencia a un nodo dentro de otro nodo, lo que se incluye es `H(rlp.encode(x))`, donde `H(x) = keccak256(x) if len(x) >= 32 else x` y `rlp.encode` es la función de codificación [RLP](/developers/docs/data-structures-and-encoding/rlp).
Cuando se hace referencia a un nodo dentro de otro nodo, lo que se incluye es `H(rlp.encode(node))`, donde `H(x) = keccak256(x) if len(x) >= 32 else x` y `rlp.encode` es la función de codificación [RLP](/developers/docs/data-structures-and-encoding/rlp).

Tenga en cuenta que al actualizar un trie, es necesario almacenar el par clave/valor `(keccak256(x), x)` en una tabla de búsqueda persistente _si_ el nodo recién creado tiene una longitud >= 32. Sin embargo, si el nodo es más corto, no es necesario almacenar nada, ya que la función f(x) = x es reversible.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ Voici le code étendu pour obtenir un nœud dans l'arbre de Merkle Patricia :

### Exemple d'arbre {#example-trie}

Supposons que nous voulions un tableau contenant quatre couples chemin/valeur `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coin')`, `('horse', 'stallion')`.
Supposons que nous voulions un tableau contenant quatre couples chemin/valeur `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coins')`, `('horse', 'stallion')`.

Tout d'abord, nous convertissons les chemins et les valeurs en `bytes` (octets). Ci-dessous, les représentations réelles d'octets pour les _chemins_ sont désignées par `<>`, bien que les _valeurs_ soient toujours représentées sous forme de chaînes, désignées par `''`, pour une compréhension plus facile (elles aussi seraient en fait des `octets`) :

```
<64 6f> : 'verb'
<64 6f 67> : 'puppy'
<64 6f 67 65> : 'coin'
<64 6f 67 65> : 'coins'
<68 6f 72 73 65> : 'stallion'
```

Expand All @@ -176,12 +176,12 @@ Nous construisons un tel arbre avec les paires clé/valeur suivantes dans la bas
```
rootHash: [ <16>, hashA ]
hashA: [ <>, <>, <>, <>, hashB, <>, <>, <>, [ <20 6f 72 73 65>, 'stallion' ], <>, <>, <>, <>, <>, <>, <>, <> ]
hashB: [ <00 6f>, hashD ]
hashD: [ <>, <>, <>, <>, <>, <>, hashE, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashE: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coin' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
hashB: [ <00 6f>, hashC ]
hashC: [ <>, <>, <>, <>, <>, <>, hashD, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashD: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coins' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
```

Lorsqu'un nœud est référencé à l'intérieur d'un autre nœud, ce qui est inclus est `H(rlp.encode(x))`, où `H(x) = keccak256(x) if len(x) >= 32 else x` et `rlp.encode` est la fonction d'encodage [RLP](/developers/docs/data-structures-and-encoding/rlp).
Lorsqu'un nœud est référencé à l'intérieur d'un autre nœud, ce qui est inclus est `H(rlp.encode(node))`, où `H(x) = keccak256(x) if len(x) >= 32 else x` et `rlp.encode` est la fonction d'encodage [RLP](/developers/docs/data-structures-and-encoding/rlp).

Notez que lors de la mise à jour d'un arbre, on doit stocker la paire clé/valeur `(keccak256(x), x)`dans une table de consultation persistante _si_ le nœud nouvellement créé a une longueur >= 32. Toutefois, si le nœud est plus court que cela, il n'est pas nécessaire de stocker quoi que ce soit, puisque la fonction f(x) = x est réversible.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ Ecco il codice esteso per ottenere un nodo nel trie di Patricia Merkle:

### Esempio di Trie {#example-trie}

Supponiamo di volere un trie contenente quattro coppie percorso/valore `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coin')`, `('horse', 'stallion')`.
Supponiamo di volere un trie contenente quattro coppie percorso/valore `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coins')`, `('horse', 'stallion')`.

Per prima cosa, convertiamo sia i percorsi che i valori in `bytes`. Di seguito, le rappresentazioni reali dei byte per i _percorsi_ sono denotate da `<>`, sebbene i _valori_ siano mostrati ancora come stringhe, denotate da `"`, per maggiore facilità di comprensione (anch'essi, sarebbero in realtà `bytes`):

```
<64 6f> : 'verb'
<64 6f 67> : 'puppy'
<64 6f 67 65> : 'coin'
<64 6f 67 65> : 'coins'
<68 6f 72 73 65> : 'stallion'
```

Expand All @@ -176,12 +176,12 @@ Ora, costruiamo un trie di questo tipo con le seguenti coppie chiave/valore nel
```
rootHash: [ <16>, hashA ]
hashA: [ <>, <>, <>, <>, hashB, <>, <>, <>, [ <20 6f 72 73 65>, 'stallion' ], <>, <>, <>, <>, <>, <>, <>, <> ]
hashB: [ <00 6f>, hashD ]
hashD: [ <>, <>, <>, <>, <>, <>, hashE, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashE: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coin' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
hashB: [ <00 6f>, hashC ]
hashC: [ <>, <>, <>, <>, <>, <>, hashD, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashD: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coins' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
```

Quando in un nodo si fa riferimento a un altro nodo, viene inserito `H(rlp.encode(x))`, dove `H(x) = keccak256(x) if len(x) >= 32 else x` e `rlp.encode` è la funzione di codifica [RLP](/developers/docs/data-structures-and-encoding/rlp).
Quando in un nodo si fa riferimento a un altro nodo, viene inserito `H(rlp.encode(node))`, dove `H(x) = keccak256(x) if len(x) >= 32 else x` e `rlp.encode` è la funzione di codifica [RLP](/developers/docs/data-structures-and-encoding/rlp).

Nota che, aggiornando un trie, si deve memorizzare la coppia chiave/valore `(keccak256(x), x)` in una tabella di ricerca persistente _se_ il nodo appena creato ha una lunghezza >= 32. Se invece il nodo è inferiore a questo valore, non è necessario memorizzare nulla, poiché la funzione f(x) = x è reversibile.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ sidebarDepth: 2

### ツリーの例 {#example-trie}

次の 4 つのパスバリューのペアを含むツリーが必要だとします。 `('do', 'verb')``('dog', 'puppy')``('doge', 'coin')``('horse', 'stallion')`
次の 4 つのパスバリューのペアを含むツリーが必要だとします。 `('do', 'verb')``('dog', 'puppy')``('doge', 'coins')``('horse', 'stallion')`

まず、パスと値(バリュー)の両方を`bytes`に変換します。 以下では、*paths*を実際のバイト表現 `<>`によって表示しています。しかし、 *values*は、分かりやすいように文字列として`''`で表示しています(実際は`bytes`) 。

```
<64 6f> : 'verb'
<64 6f 67> : 'puppy'
<64 6f 67 65> : 'coin'
<64 6f 67 65> : 'coins'
<68 6f 72 73 65> : 'stallion'
```

Expand All @@ -176,12 +176,12 @@ sidebarDepth: 2
```
rootHash: [ <16>, hashA ]
hashA: [ <>, <>, <>, <>, hashB, <>, <>, <>, [ <20 6f 72 73 65>, 'stallion' ], <>, <>, <>, <>, <>, <>, <>, <> ]
hashB: [ <00 6f>, hashD ]
hashD: [ <>, <>, <>, <>, <>, <>, hashE, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashE: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coin' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
hashB: [ <00 6f>, hashC ]
hashC: [ <>, <>, <>, <>, <>, <>, hashD, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashD: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coins' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
```

1 つのノードが内部の別のノードから参照されるとき、含まれているのは、`H(rlp.encode(x))`であり、`H(x) = keccak256(x) if len(x) >= 32 else x``rlp.encode`は、[RLP](/developers/docs/data-structures-and-encoding/rlp)エンコーディング関数です。
1 つのノードが内部の別のノードから参照されるとき、含まれているのは、`H(rlp.encode(node))`であり、`H(x) = keccak256(x) if len(x) >= 32 else x``rlp.encode`は、[RLP](/developers/docs/data-structures-and-encoding/rlp)エンコーディング関数です。

ツリーを更新するとき、新しく作成されたノードの長さが 32 以上の*場合*、キーバリューのペア`(keccak256(x), x)`を永続的なルックアップテーブルに格納する必要があることに注意してください。 ただし、ノードがそれよりも短い場合、関数 function f(x) = x は可逆であるため、何も格納する必要はありません。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ Aqui está o código estendido para obter um nó na árvore Merkle Patricia:

### Árvore de exemplo {#example-trie}

Suponha que nós queremos uma árvore contendo quatro pares de caminho/valor `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coin')`, `('horse', 'stallion')`.
Suponha que nós queremos uma árvore contendo quatro pares de caminho/valor `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coins')`, `('horse', 'stallion')`.

Primeiro, convertemos ambos caminhos e valores para `bytes`. Abaixo, representações reais em bytes para _caminhos_ são indicadas por `<>`, embora _valores_ ainda sejam mostrados como strings, denotado por `''`, para melhor compreensão (eles, também, seriam `bytes`):

```
<64 6f> : 'verb'
<64 6f 67> : 'puppy'
<64 6f 67 65> : 'coin'
<64 6f 67 65> : 'coins'
<68 6f 72 73 65> : 'stallion'
```

Expand All @@ -176,12 +176,12 @@ Agora, construímos uma árvore com os seguintes pares chave/valor no banco de d
```
rootHash: [ <16>, hashA ]
hashA: [ <>, <>, <>, <>, hashB, <>, <>, <>, [ <20 6f 72 73 65>, 'stallion' ], <>, <>, <>, <>, <>, <>, <>, <> ]
hashB: [ <00 6f>, hashD ]
hashD: [ <>, <>, <>, <>, <>, <>, hashE, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashE: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coin' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
hashB: [ <00 6f>, hashC ]
hashC: [ <>, <>, <>, <>, <>, <>, hashD, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashD: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coins' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
```

Quando um nó é referenciado dentro de outro nó, o que é incluído é `H(rlp. ncode(x))`, onde `H(x) = keccak256(x) if len(x) >= 32 else x` e `rlp. ncode` é a função de codificação [RLP](/developers/docs/data-structures-and-encoding/rlp).
Quando um nó é referenciado dentro de outro nó, o que é incluído é `H(rlp. ncode(node))`, onde `H(x) = keccak256(x) if len(x) >= 32 else x` e `rlp. ncode` é a função de codificação [RLP](/developers/docs/data-structures-and-encoding/rlp).

Observe que, ao atualizar uma árvore, é necessário armazenar o par chave/valor `(keccak256(x), x)` em uma tabela de pesquisa persistente _se_ o nó recém-criado tem comprimento >= 32. Entretanto, se o nó é menor do que isso, não é preciso armazenar nada, já que a função f(x) = x é reversível.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ Merkle Patricia dijital ağacında bir düğüm almak için genişletilmiş kod:

### Örnek Dijital Ağaç {#example-trie}

Dört yol/değer çifti içeren bir dijital ağaç istediğimizi varsayalım: `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coin')`, `('horse', 'stallion')`.
Dört yol/değer çifti içeren bir dijital ağaç istediğimizi varsayalım: `('do', 'verb')`, `('dog', 'puppy')`, `('doge', 'coins')`, `('horse', 'stallion')`.

İlk olarak, hem yolları hem de değerleri `bytes`' dönüştürürüz. Aşağıda, daha kolay anlaşılması için _yollar_ için gerçek bayt gösterimleri `<>` ile gösterilirken _değerler_ hala `''` dizeler olarak gösterilir(bunlar da aslında `byte` olacaktır):

```
<64 6f> : 'verb'
<64 6f 67> : 'puppy'
<64 6f 67 65> : 'coin'
<64 6f 67 65> : 'coins'
<68 6f 72 73 65> : 'stallion'
```

Expand All @@ -176,12 +176,12 @@ Dört yol/değer çifti içeren bir dijital ağaç istediğimizi varsayalım: `(
```
rootHash: [ <16>, hashA ]
hashA: [ <>, <>, <>, <>, hashB, <>, <>, <>, [ <20 6f 72 73 65>, 'stallion' ], <>, <>, <>, <>, <>, <>, <>, <> ]
hashB: [ <00 6f>, hashD ]
hashD: [ <>, <>, <>, <>, <>, <>, hashE, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashE: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coin' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
hashB: [ <00 6f>, hashC ]
hashC: [ <>, <>, <>, <>, <>, <>, hashD, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashD: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coins' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
```

Bir düğüme başka bir düğüm içinde başvurulduğunda, dahil edilenler `H(rlp.encode(x))` olur, burada `H(x) = keccak256(x) if len(x) > = 32 else x` ve `rlp.encode`, [RLP](/developers/docs/data-structures-and-encoding/rlp) kodlama işlevidir.
Bir düğüme başka bir düğüm içinde başvurulduğunda, dahil edilenler `H(rlp.encode(node))` olur, burada `H(x) = keccak256(x) if len(x) > = 32 else x` ve `rlp.encode`, [RLP](/developers/docs/data-structures-and-encoding/rlp) kodlama işlevidir.

Bir dijital ağacı güncellerken _eğer_ yeni oluşturulan düğümün uzunluğu >= 32 ise, `(keccak 256 (x), x)` anahtar/değer çiftini kalıcı bir arama tablosunda saklamanız gerektiğini unutmayın. Bununla birlikte düğüm bundan daha kısaysa, f (x) = x işlevi tersine çevrilebilir olduğundan hiçbir şeyin depolanmasına gerek yoktur.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ sidebarDepth: 2

### 前缀树示例 {#example-trie}

假定我们想要包含四个路径/值对 `('do', 'verb')``('dog', 'puppy')``('doge', 'coin')``('horse', 'stallion')` 的前缀树。
假定我们想要包含四个路径/值对 `('do', 'verb')``('dog', 'puppy')``('doge', 'coins')``('horse', 'stallion')` 的前缀树。

首先,我们将路径和值都转换为 `bytes`。 在下方代码中,*路径*的实际字节代表用 `<>` 表示。而**仍然显示为字符串,用 `''` 表示,以便于理解(值也应为 `bytes`):

```
<64 6f> : 'verb'
<64 6f 67> : 'puppy'
<64 6f 67 65> : 'coin'
<64 6f 67 65> : 'coins'
<68 6f 72 73 65> : 'stallion'
```

Expand All @@ -176,12 +176,12 @@ sidebarDepth: 2
```
rootHash: [ <16>, hashA ]
hashA: [ <>, <>, <>, <>, hashB, <>, <>, <>, [ <20 6f 72 73 65>, 'stallion' ], <>, <>, <>, <>, <>, <>, <>, <> ]
hashB: [ <00 6f>, hashD ]
hashD: [ <>, <>, <>, <>, <>, <>, hashE, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashE: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coin' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
hashB: [ <00 6f>, hashC ]
hashC: [ <>, <>, <>, <>, <>, <>, hashD, <>, <>, <>, <>, <>, <>, <>, <>, <>, 'verb' ]
hashD: [ <17>, [ <>, <>, <>, <>, <>, <>, [ <35>, 'coins' ], <>, <>, <>, <>, <>, <>, <>, <>, <>, 'puppy' ] ]
```

当一个节点在另一个节点内部引用时,包含的是 `H(rlp.encode(x))`,其中 `H(x) = keccak256(x) if len(x) > > = 32 else x``rlp.encode`[递归长度前缀](/developers/docs/data-structures-and-encoding/rlp)编码函数。
当一个节点在另一个节点内部引用时,包含的是 `H(rlp.encode(node))`,其中 `H(x) = keccak256(x) if len(x) > > = 32 else x``rlp.encode`[递归长度前缀](/developers/docs/data-structures-and-encoding/rlp)编码函数。

请注意,更新前缀树时,*如果*新创建节点的长度 >= 32,则需要将键/值对 `(keccak256(x), x)` 存储在一个持久的查询表中。 然而,如果节点比这短,则不需要存储任何数据,因为函数 f(x) = x 是可逆的。

Expand Down

0 comments on commit 18dbc1d

Please sign in to comment.