Skip to content

Commit 55914d9

Browse files
authored
feat(tools): da-debug (#2729)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview Small tool to verify what heights are included in a namespace on DA. <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> -->
1 parent 1b74504 commit 55914d9

File tree

5 files changed

+1341
-0
lines changed

5 files changed

+1341
-0
lines changed

tools/da-debug/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# DA Debug Tool
2+
3+
A professional debugging tool for querying and inspecting Data Availability (DA) layer data in ev-node.
4+
5+
## Overview
6+
7+
The `da-debug` tool provides a command-line interface to interact with DA layers for debugging purposes. It offers two main commands: `query` for inspecting specific DA heights and `search` for finding blobs containing specific blockchain heights.
8+
9+
## Commands
10+
11+
### Query Command
12+
13+
Query and decode blobs at a specific DA height and namespace.
14+
15+
```bash
16+
da-debug query <height> <namespace> [flags]
17+
```
18+
19+
**Flags:**
20+
21+
- `--filter-height uint`: Filter blobs by specific blockchain height (0 = no filter)
22+
23+
**Examples:**
24+
25+
```bash
26+
# Basic query
27+
da-debug query 100 "my-rollup"
28+
29+
# Query with height filter (only show blobs containing height 50)
30+
da-debug query 100 "my-rollup" --filter-height 50
31+
32+
# Query with hex namespace
33+
da-debug query 500 "0x000000000000000000000000000000000000000000000000000000746573743031"
34+
```
35+
36+
### Search Command
37+
38+
Search through multiple DA heights to find blobs containing a specific blockchain height.
39+
40+
```bash
41+
da-debug search <start-da-height> <namespace> --target-height <height> [flags]
42+
```
43+
44+
**Flags:**
45+
46+
- `--target-height uint`: Target blockchain height to search for (required)
47+
- `--range uint`: Number of DA heights to search (default: 10)
48+
49+
**Examples:**
50+
51+
```bash
52+
# Search for blockchain height 1000 starting from DA height 500
53+
da-debug search 500 "my-rollup" --target-height 1000
54+
55+
# Search with custom range of 20 DA heights
56+
da-debug search 500 "my-rollup" --target-height 1000 --range 20
57+
58+
# Search with hex namespace
59+
da-debug search 100 "0x000000000000000000000000000000000000000000000000000000746573743031" --target-height 50 --range 5
60+
```
61+
62+
## Global Flags
63+
64+
All commands support these global flags:
65+
66+
- `--da-url string`: DA layer JSON-RPC URL (default: "http://localhost:7980")
67+
- `--auth-token string`: Authentication token for DA layer
68+
- `--timeout duration`: Request timeout (default: 30s)
69+
- `--verbose`: Enable verbose logging
70+
- `--max-blob-size uint`: Maximum blob size in bytes (default: 1970176)
71+
- `--gas-price float`: Gas price for DA operations (default: 0.0)
72+
- `--gas-multiplier float`: Gas multiplier for DA operations (default: 1.0)
73+
- `--no-color`: Disable colored output
74+
75+
## Namespace Format
76+
77+
Namespaces can be provided in two formats:
78+
79+
1. **Hex String**: A 29-byte hex string (with or without `0x` prefix)
80+
- Example: `0x000000000000000000000000000000000000000000000000000000746573743031`
81+
82+
2. **String Identifier**: Any string that gets automatically converted to a valid namespace
83+
- Example: `"my-app"` or `"test-namespace"`
84+
- The string is hashed and converted to a valid version 0 namespace

tools/da-debug/go.mod

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module github.com/evstack/ev-node/tools/da-debug
2+
3+
go 1.24.6
4+
5+
require (
6+
github.com/evstack/ev-node v1.0.0-beta.6
7+
github.com/evstack/ev-node/core v1.0.0-beta.3
8+
github.com/evstack/ev-node/da v1.0.0-beta.4
9+
github.com/rs/zerolog v1.34.0
10+
github.com/spf13/cobra v1.10.1
11+
google.golang.org/protobuf v1.36.9
12+
)
13+
14+
require (
15+
github.com/celestiaorg/go-header v0.7.3 // indirect
16+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
17+
github.com/filecoin-project/go-jsonrpc v0.8.0 // indirect
18+
github.com/gogo/protobuf v1.3.2 // indirect
19+
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
20+
github.com/google/uuid v1.6.0 // indirect
21+
github.com/gorilla/websocket v1.5.3 // indirect
22+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
23+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
24+
github.com/ipfs/go-cid v0.5.0 // indirect
25+
github.com/ipfs/go-log/v2 v2.8.0 // indirect
26+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
27+
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
28+
github.com/libp2p/go-libp2p v0.43.0 // indirect
29+
github.com/libp2p/go-libp2p-pubsub v0.15.0 // indirect
30+
github.com/libp2p/go-msgio v0.3.0 // indirect
31+
github.com/mattn/go-colorable v0.1.13 // indirect
32+
github.com/mattn/go-isatty v0.0.20 // indirect
33+
github.com/minio/sha256-simd v1.0.1 // indirect
34+
github.com/mr-tron/base58 v1.2.0 // indirect
35+
github.com/multiformats/go-base32 v0.1.0 // indirect
36+
github.com/multiformats/go-base36 v0.2.0 // indirect
37+
github.com/multiformats/go-multiaddr v0.16.1 // indirect
38+
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
39+
github.com/multiformats/go-multibase v0.2.0 // indirect
40+
github.com/multiformats/go-multicodec v0.9.2 // indirect
41+
github.com/multiformats/go-multihash v0.2.3 // indirect
42+
github.com/multiformats/go-multistream v0.6.1 // indirect
43+
github.com/multiformats/go-varint v0.0.7 // indirect
44+
github.com/spaolacci/murmur3 v1.1.0 // indirect
45+
github.com/spf13/pflag v1.0.10 // indirect
46+
go.opencensus.io v0.24.0 // indirect
47+
go.uber.org/multierr v1.11.0 // indirect
48+
go.uber.org/zap v1.27.0 // indirect
49+
golang.org/x/crypto v0.42.0 // indirect
50+
golang.org/x/exp v0.0.0-20250811191247-51f88131bc50 // indirect
51+
golang.org/x/sys v0.36.0 // indirect
52+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
53+
lukechampine.com/blake3 v1.4.1 // indirect
54+
)

0 commit comments

Comments
 (0)