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

Add poke to state network spec #347

Merged
merged 3 commits into from
Nov 28, 2024
Merged
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
15 changes: 13 additions & 2 deletions state/state-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,18 @@ custom_payload = SSZ.serialize(custom_data)

#### POKE Mechanism

The [POKE Mechanism](./portal-wire-protocol#poke-mechanism) MUST be disabled for the state network. As `content_for_retrieval` is different from `content_for_offer` the POKE mechanism cannot offer content that is verifiable.
As `content_for_retrieval` is different from `content_for_offer` the POKE mechanism cannot offer content that is verifiable without providing
the proof/s that are contained in the `content_for_offer` payload. These proofs are usually available when walking down the trie during content
lookups such as during an `eth_getBalance` JSON-RPC call implemented in the state network.

The [POKE Mechanism](./portal-wire-protocol#poke-mechanism) for the state network requires building a `content_for_offer` by combining the `content_for_retrieval` with the parent proof/s and block hash. This is implemented differently for each
type of content:
- For account trie nodes the trie node in the `content_for_retrieval` is appended to the parent account proof and then combined with the block hash to build the `content_for_offer`.
- For contract trie nodes the trie node in the `content_for_retrieval` is appended to the parent storage proof and then combined with the account proof and block hash to build the `content_for_offer`.
- For contract code the code in the `content_for_retrieval` is combined with the account proof and block hash to build the `content_for_offer`.

This POKE mechanism as described above SHOULD be executed after looking up content from the network, whenever the proofs and block hash are locally available
to be used to build the `content_for_offer`.

### Routing Table

Expand Down Expand Up @@ -340,7 +351,7 @@ something like this (numbers next to branches indicate the index in the branch n

```
branch (root)
/0 \1
/0 \1
prefix: 123 prefix: 234
value: A value: B
```
Expand Down
Loading