Skip to content

Commit

Permalink
Update EigenDA tutorial docs to reflect 4844 support
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyknox committed Apr 8, 2024
1 parent c376fe9 commit 6b73135
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 11 deletions.
20 changes: 19 additions & 1 deletion docs/eigenda/rollup-guides/blob-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,32 @@ If you do not adhere to this encoding scheme, you may encounter errors like thes
$ grpcurl \
-import-path ./api/proto \
-proto ./api/proto/disperser/disperser.proto \
-d '{"data": "////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8A=="}' \
-d '{"data": "hello"}' \
disperser-preprod-holesky.eigenda.xyz:443 disperser.Disperser/DisperseBlob

ERROR:
Code: InvalidArgument
Message: rpc error: code = InvalidArgument desc = encountered an error to convert a 32-bytes into a valid field element, please use the correct format where every 32bytes(big-endian) is less than 21888242871839275222246405745257275088548364400416034343698204186575808495617
```

The simplest way to resovlve this until we have a dedicated EigenDA CLI is to
use the `kzgpad` utility documented in the [tutorial](./tutorial.md):

```bash
$ grpcurl \
-proto ./api/proto/disperser/disperser.proto \
-import-path ./api/proto \
-d '{"data": "'$(tools/kzgpad/bin/kzgpad -e hello)'"}' \
disperser-holesky.eigenda.xyz:443 disperser.Disperser/DisperseBlob

{
"result": "PROCESSING",
"requestId": "OGEyYTVjOWI3Njg4MjdkZTVhOTU1MmMzOGEwNDRjNjY5NTljNjhmNmQyZjIxYjUyNjBhZjU0ZDJmODdkYjgyNy0zMTM3MzEzMjM2MzAzODM4MzYzOTMzMzgzMzMxMzYzMzM0MzYzNzJmMzAyZjMzMzMyZjMxMmYzMzMzMmZlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1"
}
```

## Pad One Byte Codec

One example golang encoding scheme for implementing the above validity rule is [copied
from the EigenDA codesbase][1] below:

Expand Down
42 changes: 32 additions & 10 deletions docs/eigenda/rollup-guides/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ gh repo clone Layr-Labs/eigenda
cd eigenda
```

**Step 1: Store (Disperse) a blob**
**Step 1: Build EigenDA Utils**

The next step requires the `kzgpad` utility, which you can build with the following:

```
make build
```

**Step 2: Store (Disperse) a blob**

Invoke the Disperser/DisperseBlob endpoint.

Expand All @@ -54,10 +62,14 @@ $ gh repo clone Layr-Labs/eigenda
# protobuf defintions correctly
$ cd eigenda
$ grpcurl -import-path ./api/proto -proto ./api/proto/disperser/disperser.proto -d '{"data": "LWhlbGxvLQ=="}' disperser-holesky.eigenda.xyz:443 disperser.Disperser/DisperseBlob
$ grpcurl \
-import-path ./api/proto \
-proto ./api/proto/disperser/disperser.proto \
-d '{"data": "'$(tools/kzgpad/bin/kzgpad -e hello)'"}' \
disperser-holesky.eigenda.xyz:443 disperser.Disperser/DisperseBlob
```

**Step 2: Validate the blob was stored in a batch**
**Step 3: Validate the blob was stored in a batch**

Invoke the Disperser/GetBlobStatus service in order to validate the blob was
correctly stored and dispersed to the EigenDA network. The GetBlobStatus service
Expand All @@ -75,10 +87,14 @@ Example request:
# Update the value of INSERT_REQUEST_ID with the result of your disperse call
# above
$ grpcurl -import-path ./api/proto -proto ./api/proto/disperser/disperser.proto -d '{"request_id": "INSERT_REQUEST_ID"}' disperser-holesky.eigenda.xyz:443 disperser.Disperser/GetBlobStatus
$ grpcurl \
-import-path ./api/proto \
-proto ./api/proto/disperser/disperser.proto \
-d '{"request_id": "INSERT_REQUEST_ID"}' \
disperser-holesky.eigenda.xyz:443 disperser.Disperser/GetBlobStatus
```

**Step 3: Retrieve a blob**
**Step 4: Retrieve a blob**

Option A: invoke the Disperser/RetrieveBlob rpc endpoint. This is a recommended
function for anyone that would like to inspect a stored blob.
Expand All @@ -90,7 +106,13 @@ Example request:
# Note the value for batch_header_hash can be obtained from the result of your
# call to GetBlobStatus via info.blob_verification_proof.batch_metadata.batch_header_hash.
$ grpcurl -import-path ./api/proto -proto ./api/proto/disperser/disperser.proto -d '{"batch_header_hash": "INSERT_VALUE", "blob_index":"INSERT_VALUE"}' disperser-holesky.eigenda.xyz:443 disperser.Disperser/RetrieveBlob
$ grpcurl \
-import-path ./api/proto \
-proto ./api/proto/disperser/disperser.proto \
-d '{"batch_header_hash": "INSERT_VALUE", "blob_index":"INSERT_VALUE"}' \
disperser-holesky.eigenda.xyz:443 disperser.Disperser/RetrieveBlob | \
jq -r .data | \
tools/kzgpad/bin/kzgpad -d -
```

Option B: Retrieve the blob directly from EigenDA nodes. Integrate the
Expand Down Expand Up @@ -120,10 +142,10 @@ ERROR:
This means that you have stumbled upon an idiosyncracy of how EigenDA currently
works. Essentially what this means is that you have tried to disperse a blob
that is not encoded correctly, and that in order to disperse this blob you
should first encode it. This error is much more likely to be encountered when
playing with EigenDA using a raw GRPC CLI, since there is no encoding logic
built-in. Please see [Blob Encoding Requirements](./blob-encoding.md) for more
detail.
should first encode it using `kzgpad`, a utility distributed in the `eigenda`
repo. This error is much more likely to be encountered when playing with EigenDA
using a raw GRPC CLI, since there is no encoding logic built-in. Please see
[Blob Encoding Requirements](./blob-encoding.md) for more detail.

## On-Chain: Configure Your Sequencer Smart Contracts

Expand Down

0 comments on commit 6b73135

Please sign in to comment.