Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique selector bytes for History, Beacon, and State networks #233

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading