Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

debug

The debug namespace serves raw RLP and EIP-2718 encodings of headers, blocks, transactions and receipts, geth-style EVM traces of blocks, transactions and simulated calls, execution witnesses, and a few chain-state helpers. It is off by default: a node serves it only when debug is named in --http.api or --ws.api, and all never includes it. The cost to serve it is high, because the tracing and witness methods re-execute historical blocks against archive state, and one request can take seconds of CPU time and return a large response. Serve it only from a private archive or indexer node behind authentication or a method allowlist, never from a validator or a public RPC endpoint; see Enabling Namespaces.

debug_traceBlock, debug_traceBlockByHash, debug_traceBlockByNumber, debug_traceTransaction, debug_traceCall, debug_traceCallMany, debug_executionWitness and debug_executionWitnessByBlockHash each hold a permit from the node’s tracing pool while they run. The pool size is --rpc.max-tracing-requests, and the same pool serves trace_* and eth_callBundle; a request that finds no free permit waits for one.

Traces cover the block’s transactions only. The system calls a block runs before its transactions (EIP-4788 beacon root, EIP-2935 block hashes) and the epoch-closing system calls (applyIncentives and concludeEpoch) are not transactions, so no tracer shows them.

Example values are illustrative; field names and types match what the node returns.

MethodDescription
debug_chainConfigThe chain configuration from the node’s genesis
debug_codeByHashContract bytecode for a code hash
debug_dbGetContract bytecode for a 0x63-prefixed code-hash database key
debug_executionWitnessExecution witness of a block, by number or tag
debug_executionWitnessByBlockHashExecution witness of a block, by hash
debug_getBadBlocksAlways [] on Telcoin Network
debug_getRawBlockRLP-encoded block
debug_getRawHeaderRLP-encoded block header
debug_getRawReceiptsEIP-2718 encoded receipts of a block
debug_getRawTransactionEIP-2718 encoded transaction, by hash
debug_getRawTransactionsEIP-2718 encoded transactions of a block
debug_stateRootWithUpdatesState root and trie updates for a hashed state applied on top of a block
debug_traceBlockTrace every transaction of an RLP-encoded block
debug_traceBlockByHashTrace every transaction of a block, by hash
debug_traceBlockByNumberTrace every transaction of a block, by number or tag
debug_traceCallTrace a call simulated on a block’s state
debug_traceCallManyTrace bundles of calls simulated on a block’s state
debug_traceTransactionTrace one transaction

Not supported

The node registers more debug_* method names than the ones above, and none of the others does useful work on Telcoin Network. debug_getBadBlocks is served but always returns [], because the execution engine never reports a bad block (tracked in #1590).

Methods that return an error

MethodResponse
debug_getBlockAccessListError -32603 unimplemented
debug_traceChainError -32603 unimplemented

Methods registered as no-ops

These 41 methods accept their parameters and return success without doing anything. Each returns null, except debug_seedHash, which returns the zero hash 0x0000000000000000000000000000000000000000000000000000000000000000. A success response does not mean the action happened. debug_setHead in particular returns null and leaves the chain head where it was, so a script that calls it to rewind the node reports success while the node keeps its chain.

MethodWhat geth does with it
debug_accountRangePages through the accounts at a block
debug_backtraceAtSets a logging backtrace location
debug_blockProfileWrites a block profile to disk
debug_chaindbCompactCompacts the key-value database
debug_chaindbPropertyReturns a property of the key-value database
debug_cpuProfileWrites a CPU profile to disk
debug_dbAncientReads a blob from the ancient store
debug_dbAncientsCounts the items in the ancient store
debug_dumpBlockDumps the accounts at a block
debug_freeOSMemoryForces garbage collection
debug_freezeClientFreezes the client temporarily
debug_gcStatsReturns garbage-collection statistics
debug_getAccessibleStateFinds the first block with state on disk
debug_getModifiedAccountsByHashLists the accounts changed between two blocks, by hash
debug_getModifiedAccountsByNumberLists the accounts changed between two blocks, by number
debug_goTraceWrites a Go runtime trace to disk
debug_intermediateRootsReturns the state root after each transaction of a block
debug_memStatsReturns runtime memory statistics
debug_mutexProfileWrites a mutex profile to disk
debug_preimageReturns the preimage of a Keccak-256 hash
debug_printBlockPretty-prints a block
debug_seedHashReturns the Ethash seed hash of a block (here always the zero hash)
debug_setBlockProfileRateSets the block profiling rate
debug_setGCPercentSets the garbage-collection target percentage
debug_setHeadRewinds the local chain head to a block number
debug_setMutexProfileFractionSets the mutex profiling rate
debug_setTrieFlushIntervalSets how often in-memory state tries are flushed to disk
debug_stacksPrints the stacks of all goroutines
debug_standardTraceBadBlockToFileWrites a trace of a bad block to a file
debug_standardTraceBlockToFileWrites a trace of a block to a file
debug_startCPUProfileStarts CPU profiling to a file
debug_startGoTraceStarts a Go runtime trace to a file
debug_stopCPUProfileStops CPU profiling
debug_stopGoTraceStops the Go runtime trace
debug_storageRangeAtPages through a contract’s storage at a transaction
debug_traceBadBlockTraces a block from the bad-block list
debug_verbositySets the log level
debug_vmoduleSets a per-module log pattern
debug_writeBlockProfileWrites a goroutine blocking profile to a file
debug_writeMemProfileWrites an allocation profile to a file
debug_writeMutexProfileWrites a mutex profile to a file

Not registered

MethodResponse
debug_executePayloadError -32601 “Method not found”: reth declares it in a separate API that the node never registers

Tracked in #1591.