Skip to content

Commit

Permalink
Gives beacon and state networks unique content key selector bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrferris committed Nov 3, 2023
1 parent 1614bd7 commit 1ec1c8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions beacon-chain/beacon-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ HISTORICAL_ROOTS_LIMIT = 2**24 # = 16,777,216

```
light_client_bootstrap_key = Container(block_hash: Bytes32)
selector = 0x00
selector = 0x10
content = ForkDigest + SSZ.serialize(LightlientBootstrap)
content_key = selector + SSZ.serialize(light_client_bootstrap_key)
Expand All @@ -165,7 +165,7 @@ content_key = selector + SSZ.serialize(light_client_bootstrap_key

```
light_client_update_keys = Container(start_period: uint64, count: uint64)
selector = 0x01
selector = 0x11
content = SSZList(ForkDigest + LightClientUpdate, max_lenght=MAX_REQUEST_LIGHT_CLIENT_UPDATES)
content_key = selector + SSZ.serialize(light_client_update_keys)
Expand All @@ -178,7 +178,7 @@ the requested range it MUST NOT reply any content.

```
light_client_finality_update_key = Container(finalized_slot: uint64)
selector = 0x02
selector = 0x12
content = ForkDigest + SSZ.serialize(light_client_finality_update)
content_key = selector + SSZ.serialize(light_client_finality_update_key)
Expand All @@ -197,7 +197,7 @@ are potentially finalized.

```
light_client_optimistic_update_key = Container(optimistic_slot: uint64)
selector = 0x03
selector = 0x13
content = ForkDigest + SSZ.serialize(light_client_optimistic_update)
content_key = selector + SSZ.serialize(light_client_optimistic_update_key)
Expand Down Expand Up @@ -226,7 +226,7 @@ historical_summaries_with_proof = HistoricalSummariesWithProof(
)
historical_summaries_key = 0 (uint8)
selector = 0x04
selector = 0x14
content = ForkDigest + SSZ.serialize(historical_summaries_with_proof)
content_key = selector + SSZ.serialize(historical_summaries_key)
Expand Down
6 changes: 3 additions & 3 deletions state-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ A leaf node from the main account trie and accompanying merkle proof against a r

```
account_trie_proof_key := Container(address: Bytes20, state_root: Bytes32)
selector := 0x00
selector := 0x20
content := Container(witness: MPTWitness)
content_id := keccak(address)
Expand All @@ -153,7 +153,7 @@ A leaf node from a contract storage trie and accompanying merkle proof against t

```
storage_trie_proof_key := Container(address: Bytes20, slot: uint256, state_root: Bytes32)
selector := 0x01
selector := 0x21
content := Container(witness: MPTWitness)
content_id := (keccak(address) + keccak(slot)) % 2**256
Expand All @@ -166,7 +166,7 @@ The bytecode for a specific contract as referenced by `Account.code_hash`

```
contract_bytecode_key := Container(address: Bytes20, code_hash: Bytes32)
selector := 0x02
selector := 0x22
content := ByteList(24756) // Represents maximum possible size of contract bytecode
content_id := sha256(address + code_hash)
Expand Down

0 comments on commit 1ec1c8d

Please sign in to comment.