Skip to content

[r3.4] docs: trace response fields reference + sync-monitoring guidance#21063

Merged
bloxster merged 4 commits into
release/3.4from
docs/trace-fields-and-sync-monitoring
May 11, 2026
Merged

[r3.4] docs: trace response fields reference + sync-monitoring guidance#21063
bloxster merged 4 commits into
release/3.4from
docs/trace-fields-and-sync-monitoring

Conversation

@bloxster

@bloxster bloxster commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses two items from the docs feedback widget on release/3.4:

  • interacting-with-erigon/trace (was rated bad, "Needs definitions of the fields in the various responses") — every trace_* method previously had a one-line * Object - Block traces placeholder under "Returns". This PR introduces a single Response Fields Reference section (top-level shapes, TraceEntry fields, action variants for call/create/suicide/reward, result variants) and updates all 9 method "Returns" subsections to point at it.
  • get-started/installation (was rated ok, "no way of determining what stage of downloading or syncing the process is at") — the install page never pointed readers at sync-progress info. Added a "How do I know it's syncing?" section to fundamentals/basic-usage (the page Installation already links to as the next step) covering:
    • the staged-sync log prefix ([3/12 Bodies][12/12 Finish]) with a pointer to Logs → Stage Definitions
    • eth_syncing JSON-RPC with a curl example
  • Added FAQ Fix core/state tests, compilation errors for core tests #16 "How do I monitor my node's sync progress?" with three complementary approaches: log prefix, eth_syncing, and MCP (so an AI assistant like Claude Desktop can answer "is my node synced?" in plain language). Renumbered Intermediate fixes for core tests #17Fix p2p/discover and crypto/bn256/google tests #25 accordingly.

Files changed

File Change
docs/site/docs/interacting-with-erigon/trace.md +110 / −12 — Response Fields Reference + per-method Returns updates
docs/site/docs/fundamentals/basic-usage.mdx +33 — new "How do I know it's syncing?" section
docs/site/docs/get-started/installation/index.mdx +1 / −1 — closing line pointer to Basic Usage updated
docs/site/help-center/frequently-asked-questions-faqs.md +27 / −6 — new FAQ #16, renumbering

Test plan

  • Verified locally with npm run start (Docusaurus 3.10) — pages render, anchor links resolve (#response-fields-reference, #how-do-i-know-its-syncing)
  • Pre-existing search-plugin warnings only — none introduced by this PR
  • eth_syncing curl + [3/12 Bodies] prefix verified against fundamentals/logs (existing source of truth on stages)
  • MCP claim verified against fundamentals/mcp.mdx (eth_syncing is in the standard MCP tool list, and sync_analysis is an exposed resource)
  • Visual review of trace fields tables for accuracy before merge

Notes for reviewers

  • Scope is intentionally narrow: only trace.md got per-field tables. Other namespaces (erigon, debug, admin, bor, parity, internal, overlay) already have Returns tables — sometimes coarse-grained, but not the gap users complained about. Happy to follow up with a separate pass if desired.
  • versioned_docs/version-v3.3/... is intentionally not touched (frozen snapshot).

🤖 Generated with Claude Code

Addresses two pieces of user feedback collected via the docs feedback widget:

1. trace.md — "Needs definitions of the fields in the various responses"
   Added a single "Response Fields Reference" section that defines every
   field returned by the trace_* methods (top-level shapes, TraceEntry
   fields, action variants for call/create/suicide/reward, result variants).
   Updated all 9 method "Returns" subsections to point at it instead of
   the previous one-line "Object - Block traces" placeholder.

2. installation — "no way of determining what stage of downloading or
   syncing the process is at"
   Added a "How do I know it's syncing?" section to Basic Usage covering
   the staged-sync log prefix (e.g. "[3/12 Bodies]") and eth_syncing.
   Installation now points readers to it.

Also added FAQ #16 "How do I monitor my node's sync progress?" with three
approaches: log prefix, eth_syncing, and MCP for AI-assistant queries.
Renumbered subsequent FAQs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yperbasis yperbasis changed the title docs: trace response fields reference + sync-monitoring guidance [r3.4] docs: trace response fields reference + sync-monitoring guidance May 8, 2026

@yperbasis yperbasis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice structural improvement — the previous one-line * Object - Block traces placeholders were unhelpful, and the new Response Fields Reference is much better. Conventions ([r3.4] title, base release/3.4, versioned_docs/ untouched) all look correct. However, several factual claims do not match the code on release/3.4 and should be fixed before merge.

Accuracy (must fix)

1. Stage-prefix examples are wrong ([3/12 Bodies] / [12/12 Finish])

The prefix is built in execution/stagedsync/sync.go:230 (release/3.4):

logPrefixes[i] = fmt.Sprintf("%d/%d %s", i+1, len(stagesList), stagesList[i].ID)

On release/3.4, DefaultStages (execution/stagedsync/default_stages.go) has 8 stages, not 12: Snapshots, Headers, BlockHashes, Bodies, Senders, Execution, TxLookup, Finish. So Bodies is the 4th of 8 — the actual prefix is [4/8 Bodies], and finish is [8/8 Finish].

Wrong instances introduced by this PR:

  • basic-usage.mdx example block — [3/12 Bodies]
  • basic-usage.mdx[4/12 Senders], [5/12 Execution], [12/12 Finish]
  • frequently-asked-questions-faqs.md (FAQ #16) — [3/12 Bodies] and [12/12 Finish]

(The pre-existing logs.md already says "1/10 Headers" — also wrong, but out of scope here. Worth a follow-up.)

2. "reward" is not "only in trace_block"

The TraceEntry fields table says:

type | String | … "reward" (block/uncle reward, only in trace_block).

But rpc/jsonrpc/trace_filtering.go emits reward traces inside the Filter method too (block reward around line 504, uncle rewards around line 544). When a filter matches block coinbases or uncle authors, reward entries appear in trace_filter results.

Suggested wording: "only in trace_block and trace_filter".

3. creationMethod is missing from the type: "create" action variant

The PR's Action variants table for type: "create" lists only from, value, gas, init. But CreateTraceAction has:

// rpc/jsonrpc/trace_types.go:97
type CreateTraceAction struct {
    From           common.Address `json:"from"`
    CreationMethod string         `json:"creationMethod"`
    Gas            hexutil.Big    `json:"gas"`
    Init           hexutil.Bytes  `json:"init"`
    Value          hexutil.Big    `json:"value"`
}

It is set in trace_adhoc.go:428 to strings.ToLower(typ.String()) — so "create", "create2", "eofcreate". Confirmed in actual JSON via gen_traces_test.go ("creationMethod": "create2"). The flat tracer (call_flat.go) emits it too. Should be added to the table.

4. error description is misleading (claims "instead of result")

PR says:

error | String | (Optional) Present instead of result when the call frame reverted, e.g. "Reverted", "Out of gas", "Bad instruction".

But in trace_adhoc.go:489-505, when err == ErrExecutionReverted (the most common case — "Reverted"), both error: "Reverted" AND result (with gasUsed and output/code) are set. Only for non-revert errors does the code do topTrace.Result = nil.

Suggested wording: "Present when the call frame errored. For "Reverted", result is still populated with gasUsed and output (or code/address for create); for other errors, result is null."

Completeness (nice-to-fix)

5. eth_syncing response shape is incomplete

Actual response in rpc/jsonrpc/eth_system.go:81-86:

return map[string]any{
    "startingBlock": "0x0", // 0x0 is a placeholder, I do not think it matters what we return here
    "currentBlock":  hexutil.Uint64(currentBlock),
    "highestBlock":  hexutil.Uint64(highestBlock),
    "stages":        stagesMap, // []{StageName string, BlockNumber hexutil.Uint64}
}

Two things the doc omits:

  • stages: the per-stage progress array. Arguably the most useful field for "what stage am I in?" — it ties this section directly to the staged-sync log-prefix discussion.
  • startingBlock is hardcoded to "0x0" (per the source comment). The doc currently presents it as if it carries meaningful info. The highestBlock - currentBlock math suggested is fine; just don't imply startingBlock is meaningful.

6. Error-string list is partial (e.g. is defensible)

e.g. "Reverted", "Out of gas", "Bad instruction" is fine as illustrative. For completeness, the full mapping in execution/tracing/tracers/native/call_flat.go:49-65 also includes "Bad jump destination", "Out of bounds", "Out of stack", "Built-in failed", "Stack underflow". Optional to expand.

Style (minor)

  • The :::tip callout in basic-usage.mdx links to /help-center/frequently-asked-questions-faqs without an anchor. Anchoring to the new FAQ (e.g. #how-do-i-monitor-my-nodes-sync-progress) would land the reader directly on the relevant entry.
  • The TraceEntry fields table marks transactionHash/transactionPosition as absent for "reward" entries — verified against the reward branches in trace_filtering.go. ✓

Recommendation

Request changes for issues 1–4 (factual). 5–6 are nice-to-have and could be a follow-up. The unchecked test-plan item "Visual review of trace fields tables for accuracy before merge" is exactly the gap above — the details here can drive that pass. Once the log-prefix examples match the actual 8-stage list and the trace-field gaps are closed, this is a solid backport.

@bloxster bloxster added the docs label May 8, 2026
Fixes the four factual issues flagged in the CHANGES_REQUESTED review
on #21063, plus the eth_syncing shape correction:

1. Stage prefixes now match release/3.4 (8 stages, not 12)
   - basic-usage.mdx example: [3/12 Bodies] -> [4/8 Bodies]
   - basic-usage.mdx narrative: [4/12 Senders] / [5/12 Execution] /
     [12/12 Finish] -> [5/8 Senders] / [6/8 Execution] / [8/8 Finish]
   - FAQ #16: same prefix corrections
   Source: execution/stagedsync/default_stages.go (DefaultStages: Snapshots,
   Headers, BlockHashes, Bodies, Senders, Execution, TxLookup, Finish).

2. trace.md: "reward" trace type also appears in trace_filter (not only
   trace_block) — updated TraceEntry fields table, the type: "reward"
   variant header, and the trace_filter Returns description. Source:
   rpc/jsonrpc/trace_filtering.go (block reward + uncle reward emitted
   when the filter matches coinbases / uncle authors).

3. trace.md: added creationMethod field to type: "create" action variant
   table — values "create", "create2", "eofcreate".
   Source: rpc/jsonrpc/trace_types.go:97 (CreateTraceAction).

4. trace.md: rewrote `error` description. The previous wording said
   error appears "instead of result" which is wrong for the most common
   case — when a frame reverts, both `error: "Reverted"` and `result`
   (with gasUsed and output/code/address) are populated. Only non-revert
   errors set result to null. Source: trace_adhoc.go:489-505.

5. eth_syncing response shape (basic-usage.mdx + FAQ #16): added the
   `stages` array (per-stage progress, ties directly to the log prefix)
   and noted that startingBlock is hardcoded to "0x0" so it carries no
   meaningful info. Source: rpc/jsonrpc/eth_system.go:81-86.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bloxster bloxster requested a review from yperbasis May 8, 2026 12:18

@yperbasis yperbasis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

Docs-only PR addressing two items from the docs feedback widget:

  1. trace.md: a single Response Fields Reference section (top-level shapes, TraceEntry, action variants for call/create/suicide/reward, result variants). All 9 trace_* "Returns" subsections are updated to point at it.
  2. Sync-monitoring guidance: a "How do I know it's syncing?" section in basic-usage.mdx, a closing pointer from the install page, and a new FAQ #16 (with #17#25 renumbered).

Title prefix [r3.4], scope, and not touching versioned_docs/version-v3.3/ all follow the project's backport conventions.

What's good

  • Strong information architecture. A single canonical reference replaces nine identical placeholder lines (* Object - Block traces). Each method's Returns now states the top-level shape and links to the reference. This is the right structure.
  • Top-level shapes table, TraceEntry table, call/suicide/reward action variants, and result variants are all consistent with rpc/jsonrpc/trace_types.go and trace_adhoc.go on release/3.4 (verified ParityTrace, CallTraceAction, SuicideTraceAction, RewardTraceAction, TraceResult, CreateTraceResult).
  • Stage-prefix description matches the actual format from execution/stagedsync/sync.go:230 ([%d/%d %s]); [4/8 Bodies] and [8/8 Finish] correctly match DefaultStages on release/3.4 (8 active stages: Snapshots, Headers, BlockHashes, Bodies, Senders, Execution, TxLookup, Finish; CustomTrace is commented out).
  • The note that startingBlock is hardcoded to "0x0" matches rpc/jsonrpc/eth_system.go:81 exactly — useful detail to surface.
  • Renumbering of FAQs #16#25 looks clean.

Factual issues to fix

These are concrete inaccuracies verified against release/3.4 source.

1. (HIGH) creationMethod: "eofcreate" is not a real value

The new type: "create" action table claims:

creationMethod … How the contract was created: "create", "create2", or "eofcreate".

But on release/3.4 (and on main), execution/vm/opcodes.go only defines CREATE and CREATE2 — there's no EOFCREATE opcode. CreationMethod = strings.ToLower(typ.String()) (rpc/jsonrpc/trace_adhoc.go:428) can therefore only produce "create" or "create2". EOF is not on release/3.4.

Fix: drop the "eofcreate" value (or note as a footnote that EOF creation methods may appear in future hardforks, but don't list it as a current value).

2. (MEDIUM) stages array element keys are documented in wrong case

Both basic-usage.mdx and FAQ #16 describe the eth_syncing stages array as:

a stages array (one entry per stage, with {StageName, BlockNumber})

The actual JSON keys (rpc/jsonrpc/eth_system.go:70-72 on release/3.4) are snake_case:

```go
type S struct {
StageName string `json:"stage_name"`
BlockNumber hexutil.Uint64 `json:"block_number"`
}
```

A user copying this into client code (stages[i].StageName) will silently read undefined. Two locations need updating.

Fix: {stage_name, block_number} in both basic-usage.mdx and the FAQ entry.

3. (MEDIUM) error string casing is misleading for trace_*

The TraceEntry table gives examples:

e.g. "Reverted", "Out of gas", "Bad instruction".

In trace_adhoc.go:499-514, only vm.ErrExecutionReverted is mapped to the title-cased "Reverted". Every other error falls through to err.Error() as-is, so trace_* actually emits the lowercase Go-style strings: "out of gas", "invalid opcode: PUSH...", "stack underflow", etc.

The title-cased Parity-style strings ("Out of gas", "Bad instruction", "Stack underflow") are produced by a different code path — the flat call tracer in execution/tracing/tracers/native/call_flat.go:50-65 (used by debug_traceTransaction with callTracer in flat mode), not by trace_*. Documenting them under trace_* will mislead users writing string comparisons.

Fix: either replace the examples with what trace_* actually produces ("Reverted", "out of gas", "invalid opcode: …") or note explicitly that "Reverted" is the only title-cased value and other errors come through verbatim from the EVM.

Smaller things

  • rewardType value list is incomplete. Docs say "block" or "uncle". rpc/jsonrpc/trace_filtering.go:172-184 (rewardKindToString) can also return "emptyStep", "external", or "unknown". Probably acceptable to leave as-is given the audience targets PoW-style chains, but a short note ("on PoA chains, additional values may appear") would be more accurate.
  • PR description vs. doc text mismatch (cosmetic). The PR body lists [3/12 Bodies][12/12 Finish], but the actual added text correctly uses [4/8 Bodies][8/8 Finish]. The doc is right; just the PR description is stale. No action needed in the diff itself.
  • code on revert. The result-variants table says code: "Deployed runtime bytecode of the new contract." On a reverted create, the code field actually carries the revert output, not deployed bytecode. Worth a parenthetical, but optional.

Risk

Minimal — docs-only on a release branch, no runtime impact, no test changes needed. The reader-facing risk is items 1–3 above: they will mislead anyone using the doc as a copy-paste reference for client code, which is precisely the use case the PR was opened to address.

Recommendation

Request changes for items 1–3 (small textual fixes), then this is good to go. Everything else is solid and the structural improvement is genuinely useful.

- creationMethod: drop eofcreate (not on release/3.4, only create/create2 exist)
- error field: clarify only Reverted is title-cased; other trace_* errors
  are verbatim Go strings (e.g. 'out of gas'), not the call_flat.go list
- stages array: fix JSON keys to snake_case (stage_name, block_number)
  matching the actual Go struct json tags in eth_system.go

Addresses yperbasis review.
@bloxster bloxster requested a review from yperbasis May 9, 2026 06:54
@bloxster

Copy link
Copy Markdown
Collaborator Author

The docs-site / build CI failure here is caused by a pre-existing TypeScript error in the release/3.4 base branch (SidebarsConfig was moved from @docusaurus/types to @docusaurus/plugin-content-docs in Docusaurus 3.x).

This is fixed in #21074, which is currently green and awaiting review. Once #21074 merges into release/3.4, this PR's CI should pass automatically — no changes needed here.

@bloxster bloxster merged commit 17563c4 into release/3.4 May 11, 2026
21 of 24 checks passed
@bloxster bloxster deleted the docs/trace-fields-and-sync-monitoring branch May 11, 2026 10:52
pull Bot pushed a commit to Dustin4444/erigon that referenced this pull request May 13, 2026
## Summary

Brings the full `docs/site/` Docusaurus tree into `main`, incorporating
all documentation improvements developed against `release/3.4`.

**Scope:** `docs/site/**` + root `llms.txt` / `llms-full.txt` + removal
of superseded `docs/gitbook/` and `docs/gitbook-help/`. No changes to
Go, proto, or any non-docs source files.

### Included — merged to release/3.4

| PR | What |
|----|------|
| [erigontech#20883](erigontech#20883) | Docusaurus
v3 migration — full `docs/site/` tree, Docusaurus config, versioned v3.3
snapshot |
| [erigontech#20263](erigontech#20263) /
[erigontech#20264](erigontech#20264) | All v3.3
docs ported; branch/versioning convention established |
| [erigontech#20978](erigontech#20978) | Mobile
footer fix, SEO meta tags, OG image |
| [erigontech#20991](erigontech#20991) | Self-host
brand fonts (remove Google Fonts / CDN) |
| [erigontech#21000](erigontech#21000) | `llms.txt`
/ `llms-full.txt` generator script + root artifacts |
| [erigontech#21018](erigontech#21018) | May 2026
w19 maintenance — stale flags, broken links, accuracy fixes |
| [erigontech#21045](erigontech#21045) | CI:
docs-only path filter (skip Go jobs, run docs-site build) |
| [erigontech#21063](erigontech#21063) | `trace`
response fields reference + sync-monitoring guidance |
| [erigontech#21074](erigontech#21074) | Regenerate
`llms.txt` after sync-modes update |
| [erigontech#20997](erigontech#20997) | Brand font
consistency fix, installation page UX |

### Included — pending review on release/3.4

| PR | What |
|----|------|
| [erigontech#21030](erigontech#21030) | Automated
disk size pipeline: `update-disk-sizes.py`, `disk-sizes.json`,
`hardware-requirements.mdx` JSX fix, `generate-llms.py` `—` fallback,
unit tests |
| [erigontech#21129](erigontech#21129) | May 2026
w20 maintenance — `--caplin.nat`, `--caplin.columns-keep-slots`, RPC
subscription defaults, `nat.md` Caplin section, log.dir.verbosity
default |

### What changes on `main`

- `docs/site/` added (full Docusaurus tree, current v3.4 + frozen v3.3
snapshot)
- `docs/gitbook/` and `docs/gitbook-help/` removed (superseded by
Docusaurus)
- Root `llms.txt` and `llms-full.txt` updated to Docusaurus-generated
versions

> ⚠️ This PR does **not** remove `docs/gitbook/` yet — that cleanup will
be a separate commit once this PR is reviewed and approved.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Bloxster <bloxster@proton.me>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: lupin012 <58134934+lupin012@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants