Commit 582f7d7d authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #5528 from ethereum-optimism/inphi/fpp-specs

specs: Update op-program hint protocol
parents 37470523 0d9f79b8
...@@ -178,17 +178,21 @@ Note that hints may produce multiple pre-images: ...@@ -178,17 +178,21 @@ Note that hints may produce multiple pre-images:
e.g. a hint for an ethereum block with transaction list may prepare pre-images for the header, e.g. a hint for an ethereum block with transaction list may prepare pre-images for the header,
each of the transactions, and the intermediate merkle-nodes that form the transactions-list Merkle Patricia Trie. each of the transactions, and the intermediate merkle-nodes that form the transactions-list Merkle Patricia Trie.
Hinting is implemented with a minimal wire-protocol over a blocking one-way stream: Hinting is implemented with a request-acknowledgement wire-protocol over a blocking two-way stream:
```text ```text
<request> := <length prefix> <hint bytes> <end> <request> := <length prefix> <hint bytes>
<repsonse> := <ack>
<length prefix> := big-endian uint32 # length of <hint bytes> <length prefix> := big-endian uint32 # length of <hint bytes>
<hint bytes> := byte sequence <hint bytes> := byte sequence
<end> := 0 byte <ack> := 1-byte zero value
``` ```
The `<end>` trailing zero byte allows the server to block the program The ack informs the client that the hint has been processed. Servers may respond to hints and pre-image (see below)
(since the communication is blocking) until the hint is processed. requests asynchronously as they are on separate streams. To avoid requesting pre-images that are not yet fetched,
clients should request the pre-image only after it has observed the hint acknowledgement.
### Pre-image communication ### Pre-image communication
...@@ -201,7 +205,6 @@ This protocol can be implemented with blocking read/write syscalls. ...@@ -201,7 +205,6 @@ This protocol can be implemented with blocking read/write syscalls.
<response> := <length prefix> <pre-image bytes> <response> := <length prefix> <pre-image bytes>
<length prefix> := big-endian uint64 # length of <pre-image bytes>, note: uint64 <length prefix> := big-endian uint64 # length of <pre-image bytes>, note: uint64
<hint bytes> := byte sequence #
``` ```
The `<length prefix>` here may be arbitrarily high: The `<length prefix>` here may be arbitrarily high:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment