diff --git a/docs/gitbook/src/.gitbook/vars.yaml b/docs/gitbook/src/.gitbook/vars.yaml index e040ecdfc58..31ff46613bd 100644 --- a/docs/gitbook/src/.gitbook/vars.yaml +++ b/docs/gitbook/src/.gitbook/vars.yaml @@ -1 +1 @@ -version: 3.2.2 +version: 3.3.7 diff --git a/docs/gitbook/src/fundamentals/configuring-erigon.md b/docs/gitbook/src/fundamentals/configuring-erigon.md index 595ab645a51..b16fd69ce71 100644 --- a/docs/gitbook/src/fundamentals/configuring-erigon.md +++ b/docs/gitbook/src/fundamentals/configuring-erigon.md @@ -74,14 +74,14 @@ These flags control database performance and memory usage. Flags for managing how old chain data is handled and stored. -* `--prune.mode value`: Selects a pruning preset (`full`, `archive`, `minimal`, `blocks`). See also [Sync Modes](../fundamentals/sync-modes.md) +* `--prune.mode value`: Selects a pruning preset (`full`, `archive`, `minimal`, `blocks`). See also [Sync Modes](sync-modes.md) * Default: `"full"` * `--prune.distance value`: Keeps state history for the latest `N` blocks. * Default: `0` * `--prune.distance.blocks value`: Keeps block history for the latest `N` blocks. * Default: `0` * `--prune.experimental.include-commitment-history, --experimental.commitment-history`: Enables faster `eth_getProof` for executed blocks. - * Default: `false` + * Default: `false` * `--prune.include-commitment-history` : (experimental) Enables the storage of commitment history. When enabled, it allows for blazing fast retrieval of Merkle proofs for executed blocks using the `eth_getProof` JSON-RPC method. * Default: `false` * `--snap.keepblocks`: Keeps ancient blocks in the database for debugging. @@ -557,7 +557,7 @@ USAGE: erigon [command] [flags] VERSION: - 3.3.0-dev-fc7a858a + 3.3.7-9a898cf7 COMMANDS: init Bootstrap and initialize a new genesis block @@ -591,6 +591,8 @@ GLOBAL OPTIONS: archive: Keep the entire state history and all blocks, minimal: Keep only latest state (default: "full") --prune.include-commitment-history, --experimental.commitment-history, --prune.experimental.include-commitment-history Enables blazing fast eth_getProof for executed block (default: false) + --fcu.timeout value FCU timeout before it switches to being process async (use 0 to disable) (default: 1s) + --fcu.background.prune Enables background pruning post fcu (default: true) --batchSize value Batch size for the execution stage (default: "512M") --bodies.cache value Limit on the cache for block bodies (default: "268435456") --database.verbosity value Enabling internal db logs. Very high verbosity levels may require recompile db. Default: 2, means warning. (default: 2) @@ -602,7 +604,6 @@ GLOBAL OPTIONS: --tls.key value Specify key file --tls.cacert value Specify certificate authority --state.stream.disable Disable streaming of state changes from core to RPC daemon (default: false) - --experimental.bal generate block access list (default: false) --sync.loop.throttle value Sets the minimum time between sync loop starts (e.g. 1h30m, default is none) --bad.block value Marks block with given hex string as bad and forces initial reorg before normal staged sync --http JSON-RPC server (enabled by default). Use --http=false to disable it (default: true) @@ -636,6 +637,7 @@ GLOBAL OPTIONS: --rpc.txfeecap value Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default: 1) --txpool.api.addr value TxPool api network address, for example: 127.0.0.1:9090 (default: use value of --private.api.addr) --trace.maxtraces value Sets a limit on traces that can be returned in trace_filter (default: 200) + --experimental.always-generate-changesets Allows to override changesets generation logic (default: false) --http.timeouts.read value Maximum duration for reading the entire request, including the body. (default: 30s) --http.timeouts.write value Maximum duration before timing out writes of the response. It is reset whenever a new request's header is read. (default: 30m0s) --http.timeouts.idle value Maximum amount of time to wait for the next request when keep-alive connections are enabled. If http.timeouts.idle is zero, the value of http.timeouts.read is used. (default: 2m0s) @@ -655,7 +657,7 @@ GLOBAL OPTIONS: --snap.state.stop Workaround to stop producing new state files, if you meet some state-related critical bug. It will stop aggregate DB history in a state files. DB will grow and may slightly slow-down - and removing this flag in future will not fix this effect (db size will not greatly reduce). (default: false) --snap.skip-state-snapshot-download Skip state download and start from genesis block (default: false) --snap.download.to.block value, --shadow.fork.block value Download snapshots up to the given block number (exclusive). Disabled by default. Useful for testing and shadow forks. (default: 0) - --db.pagesize value DB is split to 'pages' of fixed size. Can't change DB creation. Must be power of 2 and '256b <= pagesize <= 64kb'. Default: equal to OperationSystem's pageSize. Bigger pageSize causing: 1. More writes to disk during commit 2. Smaller b-tree high 3. Less fragmentation 4. Less overhead on 'free-pages list' maintenance (a bit faster Put/Commit) 5. If expecting DB-size > 8Tb then set pageSize >= 8Kb (default: "16KB") + --db.pagesize value DB is splitted to 'pages' of fixed size. Can't change DB creation. Must be power of 2 and '256b <= pagesize <= 64kb'. Default: equal to OperationSystem's pageSize. Bigger pageSize causing: 1. More writes to disk during commit 2. Smaller b-tree high 3. Less fragmentation 4. Less overhead on 'free-pages list' maintainance (a bit faster Put/Commit) 5. If expecting DB-size > 8Tb then set pageSize >= 8Kb (default: "16KB") --db.size.limit value Runtime limit of chaindata db size (can change at any time) (default: "1TB") --db.writemap Enable WRITE_MAP feature for fast database writes and fast commit times (default: true) --torrent.port value Port to listen and serve BitTorrent protocol (default: 42069) @@ -679,7 +681,8 @@ GLOBAL OPTIONS: "stun" Uses STUN to detect an external IP using a default server "stun:" Uses STUN to detect an external IP using the given server (host:port) --nodiscover Disables the peer discovery mechanism (manual peer addition) (default: false) - --v5disc Enables the experimental RLPx V5 (Topic Discovery) mechanism (default: false) + --discovery.v4, --discv4 Enables the V4 discovery mechanism (default: true) + --discovery.v5, --discv5, --v5disc Enables the V5 discovery mechanism (default: true) --netrestrict value Restricts network communication to the given IP networks (CIDR masks) --nodekey value P2P node key file --nodekeyhex value P2P node key as hex (for testing) @@ -723,6 +726,7 @@ GLOBAL OPTIONS: --aa Enable AA transactions (default: false) --ethstats value Reporting URL of a ethstats service (nodename:secret@host:port) --override.osaka value Manually specify the Osaka fork time, overriding the bundled setting (default: 0) + --override.balancer value Manually specify the Balancer fork time, overriding the bundled setting (default: 0) --keep.stored.chain.config Avoid overriding chain config already stored in the DB (default: false) --caplin.discovery.addr value Address for Caplin DISCV5 protocol (default: "0.0.0.0") --caplin.discovery.port value Port for Caplin DISCV5 protocol (default: 4000) @@ -763,7 +767,7 @@ GLOBAL OPTIONS: --caplin.blocks-archive sets whether backfilling is enabled for caplin (default: false) --caplin.blobs-archive sets whether backfilling is enabled for caplin (default: false) --caplin.states-archive enables archival node for historical states in caplin (it will enable block archival as well) (default: false) - --caplin.blobs-immediate-backfill sets whether caplin should immediately backfill blobs (4096 epochs) (default: false) + --caplin.blobs-immediate-backfill sets whether caplin should immediatelly backfill blobs (4096 epochs) (default: false) --caplin.blobs-no-pruning disable blob pruning in caplin (default: false) --caplin.checkpoint-sync.disable disable checkpoint sync in caplin (default: false) --caplin.snapgen enables snapshot generation in caplin (default: false) @@ -773,7 +777,7 @@ GLOBAL OPTIONS: --caplin.custom-genesis value set the custom genesis for caplin --caplin.use-engine-api Use engine API for internal Caplin. useful for testing and if CL network is degraded (default: false) --trusted-setup-file value Absolute path to trusted_setup.json file - --rpc.slow value Print in logs RPC requests slower than given threshold: 100ms, 1s, 1m. Excluded methods: eth_getBlock,eth_getBlockByNumber,eth_getBlockByHash,eth_blockNumber,erigon_blockNumber,erigon_getHeaderByNumber,erigon_getHeaderByHash,erigon_getBlockByTimestamp,eth_call (default: 0s) + --rpc.slow value Print in logs RPC requests slower than given threshold: 100ms, 1s, 1m. Exluded methods: eth_getBlock,eth_getBlockByNumber,eth_getBlockByHash,eth_blockNumber,erigon_blockNumber,erigon_getHeaderByNumber,erigon_getHeaderByHash,erigon_getBlockByTimestamp,eth_call (default: 0s) --txpool.gossip.disable Disabling p2p gossip of txs. Any txs received by p2p - will be dropped. Some networks like 'Optimism execution engine'/'Optimistic Rollup' - using it to protect against MEV attacks (default: false) --sync.loop.block.limit value Sets the maximum number of blocks to process per loop iteration (default: 5000) --sync.loop.break.after value Sets the last stage of the sync loop to run @@ -812,5 +816,6 @@ GLOBAL OPTIONS: --config value Sets erigon flags from YAML/TOML file --help, -h show help --version, -v print the version + ``` {% endcode %} diff --git a/docs/gitbook/src/interacting-with-erigon/README.md b/docs/gitbook/src/interacting-with-erigon/README.md index 639a0af3a9e..a705ce51bd3 100644 --- a/docs/gitbook/src/interacting-with-erigon/README.md +++ b/docs/gitbook/src/interacting-with-erigon/README.md @@ -24,11 +24,11 @@ The Erigon RPC Service, managed by Erigon's modular [RPC daemon](../fundamentals {% include "../../../.gitbook/includes/warning-admin_-and-debug_-....md" %} -For a complete reference on the standard Ethereum JSON-RPC methods, especially those in the `eth`, `net`, and `web3` namespaces, it is recommended to consult the general documentation on [ethereum.org's JSON-RPC API page](https://ethereum.org/en/developers/docs/apis/json-rpc/). Additionally, for the formal specification of the `debug`, `engine`, and `eth` namespaces, including unique, detailed descriptions for methods like `eth_getProof` and `eth_simulateV1`, refer to the [Execution APIs documentation](https://ethereum.github.io/execution-apis/api-documentation/). +For a complete reference on the standard Ethereum JSON-RPC methods, especially those in the `eth`, `net`, and `web3` namespaces, it is recommended to consult the general documentation on [ethereum.org's JSON-RPC API page](https://ethereum.org/en/developers/docs/apis/json-rpc/). Additionally, for the formal specification of the `debug`, `engine`, and `eth` namespaces, including unique, detailed descriptions for methods like `eth_getProof` and `eth_simulateV1`, refer to the [Execution APIs documentation](https://ethereum.github.io/execution-apis). {% embed url="https://ethereum.org/en/developers/docs/apis/json-rpc/" %} -{% embed url="https://ethereum.github.io/execution-apis/api-documentation/" %} +{% embed url="https://ethereum.github.io/execution-apis" %} ## Erigon RPC Transports diff --git a/docs/gitbook/src/interacting-with-erigon/admin.md b/docs/gitbook/src/interacting-with-erigon/admin.md index f0066233f6f..e6adcc86676 100644 --- a/docs/gitbook/src/interacting-with-erigon/admin.md +++ b/docs/gitbook/src/interacting-with-erigon/admin.md @@ -1,5 +1,9 @@ --- description: Security-Sensitive Methods for Node Operators +metaLinks: + alternates: + - >- + https://app.gitbook.com/s/3DGBf2RdbfoitX1XMgq0/interacting-with-erigon/interacting-with-erigon/admin --- # admin @@ -34,7 +38,9 @@ The admin namespace must be explicitly enabled using the `--http.api` flag when *** -## **admin\_nodeInfo** +## **JSON-RPC Specification** + +### **admin\_nodeInfo** Returns information about the running node, including network details, protocols, and node identification. @@ -56,9 +62,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":"1"} | ------ | --------------------------------------------------------------- | | Object | Node information object containing network and protocol details | -*** - -## **admin\_peers** +### **admin\_peers** Returns information about connected peers, including their network addresses, protocols, and connection status. @@ -82,7 +86,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"admin_peers","params":[],"id":"1"}' - *** -## **admin\_addPeer** +### **admin\_addPeer** Attempts to add a new peer to the node's peer list by connecting to the specified enode URL. @@ -106,9 +110,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":["enode://a97 | ------- | -------------------------------------------------------- | | Boolean | True if the peer was successfully added, false otherwise | -*** - -## **admin\_removePeer** +### **admin\_removePeer** Removes a peer from the node's peer list by disconnecting from the specified enode URL. diff --git a/docs/gitbook/src/interacting-with-erigon/bor.md b/docs/gitbook/src/interacting-with-erigon/bor.md index 603c0134b2f..c7d7277c4a2 100644 --- a/docs/gitbook/src/interacting-with-erigon/bor.md +++ b/docs/gitbook/src/interacting-with-erigon/bor.md @@ -1,5 +1,9 @@ --- description: Accessing Polygon Validator and Bor Consensus Data +metaLinks: + alternates: + - >- + https://app.gitbook.com/s/3DGBf2RdbfoitX1XMgq0/interacting-with-erigon/interacting-with-erigon/bor --- # bor @@ -28,7 +32,9 @@ The bor namespace must be explicitly enabled using the `--http.api` flag when st *** -## **bor\_getSnapshot** +## **JSON-RPC Specification** + +### **bor\_getSnapshot** Returns the validator snapshot at a given block number, containing information about the current validator set and their voting power. @@ -52,9 +58,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getSnapshot","params":["latest"], | ------ | ------------------------------------------------------------------- | | Object | Snapshot object containing validator information and voting details | -*** - -## **bor\_getAuthor** +### **bor\_getAuthor** Returns the author (block proposer) of a block at the given block number or hash. @@ -78,9 +82,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getAuthor","params":["0x1b4"],"id | -------------- | ---------------------------------------- | | DATA, 20 BYTES | The address of the block author/proposer | -*** - -## **bor\_getSnapshotAtHash** +### **bor\_getSnapshotAtHash** Returns the validator snapshot at a specific block hash. @@ -104,9 +106,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getSnapshotAtHash","params":["0x1 | ------ | ---------------------------------------------------------------------------- | | Object | Snapshot object containing validator information at the specified block hash | -*** - -## **bor\_getSigners** +### **bor\_getSigners** Returns the list of authorized signers (validators) at a given block number. @@ -130,9 +130,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getSigners","params":["latest"]," | ----- | ------------------------------------------------------ | | Array | Array of validator addresses authorized to sign blocks | -*** - -## **bor\_getSignersAtHash** +### **bor\_getSignersAtHash** Returns the list of authorized signers (validators) at a specific block hash. @@ -156,9 +154,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getSignersAtHash","params":["0x1d | ----- | ---------------------------------------------------------------------------- | | Array | Array of validator addresses authorized to sign blocks at the specified hash | -*** - -## **bor\_getCurrentProposer** +### **bor\_getCurrentProposer** Returns the address of the current block proposer based on the current validator set and proposer selection algorithm. @@ -180,9 +176,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getCurrentProposer","params":[]," | -------------- | ----------------------------------- | | DATA, 20 BYTES | The address of the current proposer | -*** - -## **bor\_getCurrentValidators** +### **bor\_getCurrentValidators** Returns the current validator set with their details including voting power and other metadata. @@ -200,13 +194,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getCurrentValidators","params":[] **Returns** -| Type | Description | -| ----- | --------------------------------------------------------------------------- | -| Array | Array of validator objects with their addresses, voting power, and metadata | - -*** - -## **bor\_getSnapshotProposerSequence** +### **bor\_getSnapshotProposerSequence** Returns the proposer sequence for a given block, showing the order in which validators are expected to propose blocks. @@ -230,9 +218,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getSnapshotProposerSequence","par | ------ | ---------------------------------------------------------------- | | Object | BlockSigners object containing the proposer sequence information | -*** - -## **bor\_getRootHash** +### **bor\_getRootHash** Returns the root hash for a range of blocks, used for checkpoint verification and state synchronization. @@ -257,9 +243,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"bor_getRootHash","params":["0x1", "0x | ------ | ------------------------------------------- | | STRING | The root hash for the specified block range | -*** - -## **bor\_getVoteOnHash** +### **bor\_getVoteOnHash** Returns voting information for a specific block hash, used in the Bor consensus mechanism. diff --git a/docs/gitbook/src/interacting-with-erigon/debug.md b/docs/gitbook/src/interacting-with-erigon/debug.md index ee3ef547cf8..953540f841c 100644 --- a/docs/gitbook/src/interacting-with-erigon/debug.md +++ b/docs/gitbook/src/interacting-with-erigon/debug.md @@ -1,39 +1,445 @@ --- description: 'Erigon RPC debug Namespace: Deep Diagnostics and State Introspection' +metaLinks: + alternates: + - >- + https://app.gitbook.com/s/3DGBf2RdbfoitX1XMgq0/interacting-with-erigon/interacting-with-erigon/debug --- # debug -The `debug` namespace provides debugging and diagnostic methods for Erigon node operators and developers. These methods offer deep introspection into blockchain state, transaction execution, and node performance. The debug namespace is implemented through the `PrivateDebugAPI` interface and `DebugAPIImpl` struct. +The `debug` namespace provides debugging and diagnostic methods for Erigon node operators and developers. These methods offer deep introspection into blockchain state, transaction execution, and node performance. -The debug namespace must be explicitly enabled using the `--http.api` flag when starting the RPC daemon. For security reasons, these methods are considered private and should not be exposed on public RPC endpoints. +The debug namespace must be explicitly enabled using the `--http.api=debug` flag when starting the RPC daemon. -For API usage refer to the below official resources: +{% hint style="warning" %} +The `debug` namespace is intended for debugging and development purposes, not for production use. +{% endhint %} -{% embed url="https://ethereum.org/en/developers/docs/apis/json-rpc/" %} - -{% embed url="https://ethereum.github.io/execution-apis/api-documentation/" %} - -### Security and Access Control +#### Security and Access Control * Debug methods are considered private and should not be exposed on public RPC endpoints; * These methods can consume significant resources and should be used carefully in production environments; * Access should be restricted to trusted operators and developers only. -### Performance Considerations +#### Performance Considerations -* Tracing methods (`debug_traceTransaction`, `debug_traceBlockByHash`, etc.) support streaming to handle large results efficiently; +* Tracing methods (`debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceCallMany`) support streaming for large results to reduce memory usage * The `AccountRangeMaxResults` constant limits account range queries to 8192 results, or 256 when storage is included; * Memory and GC control methods allow fine-tuning of node performance. +* Some methods like `debug_accountRange` have compatibility layers for both Geth and legacy Erigon parameter formats `debug_api` -### Integration with Erigon Architecture +#### Integration with Erigon Architecture * Debug methods leverage Erigon's temporal database for historical state access; * The implementation uses `kv.TemporalRoDB` for efficient historical queries; * Tracing functionality integrates with Erigon's execution engine and EVM implementation. -### Usage in Development and Testing +#### Usage in Development and Testing * These methods are essential for debugging transaction execution issues; * Storage range methods help analyze contract state changes; * Memory management methods assist in performance optimization and resource monitoring. + +*** + +## JSON-RPC Specification + +### debug\_getRawReceipts + +Returns an array of EIP-2718 binary-encoded receipts from a single block. + +#### Parameters + +| Parameter | Type | Description | +| ------------- | ----------------------- | ------------------------------------------------------------------ | +| blockNrOrHash | QUANTITY \| TAG \| DATA | Block number, tag ("earliest", "latest", "pending"), or block hash | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_getRawReceipts","params":["0x123456"],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ------------- | -------------------------------------------- | +| Array of DATA | Array of binary-encoded transaction receipts | + +### debug\_accountRange + +Returns a range of accounts involved in the given block range. + +#### Parameters + +| Parameter | Type | Description | +| -------------- | --------------- | ----------------------------------------------------------- | +| blockNrOrHash | QUANTITY \| TAG | Block number or tag | +| start | DATAARRAY | Array of prefixes to match account addresses | +| maxResults | QUANTITY | Maximum number of accounts to retrieve | +| excludeCode | BOOLEAN | If true, exclude byte code from results | +| excludeStorage | BOOLEAN | If true, exclude storage from results | +| incompletes | BOOLEAN | If true, return missing preimages (not supported when true) | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_accountRange","params":["0xaaaaa",[1],1,true,true,true],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ------ | -------------------------------------------------- | +| Object | IteratorDump object containing account information | + +### debug\_accountAt + +Returns account information at a specific block and transaction index. + +#### Parameters + +| Parameter | Type | Description | +| --------- | -------------- | ---------------------------------- | +| blockHash | DATA, 32 Bytes | Hash of the block | +| txIndex | QUANTITY | Transaction index within the block | +| address | DATA, 20 Bytes | Account address | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_accountAt","params":["0x123456...",1,"0x123456..."],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ------ | ----------------------------------------------------- | +| Object | AccountResult with balance, nonce, code, and codeHash | + +### debug\_getModifiedAccountsByNumber + +Returns a list of accounts modified in the given block range by number. + +#### Parameters + +| Parameter | Type | Description | +| ----------- | --------------- | ---------------------------------- | +| startNumber | QUANTITY \| TAG | Start block number or tag | +| endNumber | QUANTITY \| TAG | End block number or tag (optional) | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_getModifiedAccountsByNumber","params":["0xccccd","0xcccce"],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ----------------------- | ----------------------------------- | +| Array of DATA, 20 Bytes | Array of modified account addresses | + +### debug\_getModifiedAccountsByHash + +Returns a list of accounts modified in the given block range by hash. + +#### Parameters + +| Parameter | Type | Description | +| --------- | -------------- | -------------------------------- | +| startHash | DATA, 32 Bytes | Hash of the start block | +| endHash | DATA, 32 Bytes | Hash of the end block (optional) | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_getModifiedAccountsByHash","params":["0x2a1af0...","0x4e3d3e..."],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ----------------------- | ----------------------------------- | +| Array of DATA, 20 Bytes | Array of modified account addresses | + +### debug\_storageRangeAt + +Returns information about a range of storage locations for a contract address. + +#### Parameters + +| Parameter | Type | Description | +| --------------- | ----------------- | --------------------------------------- | +| blockHash | DATA, 32 Bytes | Hash of block at which to retrieve data | +| txIndex | QUANTITY, 8 Bytes | Transaction index in the block | +| contractAddress | DATA, 20 Bytes | Contract address | +| keyStart | DATA, 32 Bytes | Storage key to start from | +| maxResult | QUANTITY, 8 Bytes | Maximum number of values to retrieve | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_storageRangeAt","params":["0xd3f185...",1,"0xb734c7...","0x00",2],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ------ | --------------------------------------------------- | +| Object | StorageRangeResult with key/value pairs and nextKey | + +### debug\_traceBlockByHash + +Returns Geth style transaction traces for a block by hash. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------- | --------------------------- | +| hash | DATA, 32 Bytes | Hash of block to trace | +| config | Object (optional) | Trace configuration options | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params":["0x123456...",{}],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ----- | ---------------------------------- | +| Array | Array of transaction trace objects | + +### debug\_traceBlockByNumber + +Returns Geth style transaction traces for a block by number. + +#### Parameters + +| Parameter | Type | Description | +| ----------- | ----------------- | --------------------------- | +| blockNumber | QUANTITY \| TAG | Block number or tag | +| config | Object (optional) | Trace configuration options | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","params":["0x123456",{}],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ----- | ---------------------------------- | +| Array | Array of transaction trace objects | + +### debug\_traceTransaction + +Returns Geth style transaction trace. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------- | ---------------------------- | +| hash | DATA, 32 Bytes | Hash of transaction to trace | +| config | Object (optional) | Trace configuration options | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0x123456...",{}],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ------ | ------------------------ | +| Object | Transaction trace object | + +### debug\_traceCall + +Returns Geth style call trace. + +#### Parameters + +| Parameter | Type | Description | +| ------------- | ----------------------- | ----------------------------------------------------- | +| args | Object | Call arguments (to, from, gas, gasPrice, value, data) | +| blockNrOrHash | QUANTITY \| TAG \| DATA | Block number, tag, or hash | +| config | Object (optional) | Trace configuration options | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_traceCall","params":[{"to":"0x123456..."},"latest",{}],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ------ | ----------------- | +| Object | Call trace object | + +### debug\_traceCallMany + +Returns Geth style traces for multiple call bundles. + +#### Parameters + +| Parameter | Type | Description | +| --------------- | ----------------- | -------------------------------------------------- | +| bundles | Array | Array of transaction bundles to trace | +| simulateContext | Object | Simulation context (blockNumber, transactionIndex) | +| config | Object (optional) | Trace configuration options | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_traceCallMany","params":[[{"transactions":[...]}],{"blockNumber":"latest"},{}],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ----- | -------------------------------------- | +| Array | Array of trace results for each bundle | + +### debug\_setMemoryLimit + +Sets the GOMEMLIMIT for the process. + +#### Parameters + +| Parameter | Type | Description | +| --------- | -------- | --------------------- | +| limit | QUANTITY | Memory limit in bytes | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_setMemoryLimit","params":[8589934592],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| -------- | --------------------- | +| QUANTITY | Previous memory limit | + +### debug\_setGCPercent + +Sets the garbage collection target percentage. + +#### Parameters + +| Parameter | Type | Description | +| --------- | -------- | ------------------------------------------ | +| v | QUANTITY | GC percentage (negative value disables GC) | + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_setGCPercent","params":[100],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| -------- | ------------------------------ | +| QUANTITY | Previous GC percentage setting | + +### debug\_freeOSMemory + +Forces a garbage collection to free OS memory. + +#### **Parameters** + +None + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_freeOSMemory","params":[],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ---- | --------------- | +| null | No return value | + +### debug\_gcStats + +Returns garbage collection statistics. + +#### **Parameters** + +None + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_gcStats","params":[],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ------ | -------------------- | +| Object | GC statistics object | + +### debug\_memStats + +Returns detailed runtime memory statistics. + +#### **Parameters** + +None + +#### Example + +{% code overflow="wrap" %} +```bash +curl -s --data '{"jsonrpc":"2.0","method":"debug_memStats","params":[],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545 +``` +{% endcode %} + +#### Returns + +| Type | Description | +| ------ | -------------------------------- | +| Object | Runtime memory statistics object | + diff --git a/docs/gitbook/src/interacting-with-erigon/engine.md b/docs/gitbook/src/interacting-with-erigon/engine.md index 61673e330d6..13f75109eea 100644 --- a/docs/gitbook/src/interacting-with-erigon/engine.md +++ b/docs/gitbook/src/interacting-with-erigon/engine.md @@ -1,5 +1,9 @@ --- description: Connecting Erigon (EL) to Consensus Clients (CL) +metaLinks: + alternates: + - >- + https://app.gitbook.com/s/3DGBf2RdbfoitX1XMgq0/interacting-with-erigon/interacting-with-erigon/engine --- # engine @@ -12,7 +16,7 @@ For API usage refer to the below official resources: {% embed url="https://ethereum.org/en/developers/docs/apis/json-rpc/" %} -{% embed url="https://ethereum.github.io/execution-apis/api-documentation/" %} +{% embed url="https://ethereum.github.io/execution-apis" %} #### Default Erigon Behavior (Caplin) diff --git a/docs/gitbook/src/interacting-with-erigon/erigon.md b/docs/gitbook/src/interacting-with-erigon/erigon.md index ce486644c35..cf01c7ab197 100644 --- a/docs/gitbook/src/interacting-with-erigon/erigon.md +++ b/docs/gitbook/src/interacting-with-erigon/erigon.md @@ -1,5 +1,9 @@ --- description: Erigon-Specific Methods for Optimized Data Access +metaLinks: + alternates: + - >- + https://app.gitbook.com/s/3DGBf2RdbfoitX1XMgq0/interacting-with-erigon/interacting-with-erigon/erigon --- # erigon @@ -28,7 +32,9 @@ See more details [here](https://github.com/erigontech/erigon/blob/main/cmd/rpcda *** -## **erigon\_forks** +## **JSON-RPC Specification** + +### **erigon\_forks** Returns the genesis block hash and a sorted list of all fork block numbers for the current chain configuration. @@ -53,9 +59,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_forks","params":[],"id":"1"}' | heightForks | ARRAY - Array of block numbers where height-based forks occur | | timeForks | ARRAY - Array of timestamps where time-based forks occur | -*** - -## **erigon\_blockNumber** +### **erigon\_blockNumber** Returns the latest executed block number. Unlike `eth_blockNumber`, this method can accept a specific block number parameter and returns the latest executed block rather than the fork choice head after the merge. @@ -79,9 +83,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_blockNumber","params":[],"id": | -------- | ------------------------------- | | QUANTITY | The block number as hexadecimal | -*** - -## **erigon\_getHeaderByNumber** +### **erigon\_getHeaderByNumber** Returns a block header by block number, ignoring transaction and uncle data for potentially faster response times. @@ -105,9 +107,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_getHeaderByNumber","params":[" | ------ | ------------------------------------------ | | Object | Block header object with all header fields | -*** - -## **erigon\_getHeaderByHash** +### **erigon\_getHeaderByHash** Returns a block header by block hash, ignoring transaction and uncle data for potentially faster response times. @@ -133,7 +133,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_getHeaderByHash","params":["0x *** -## **erigon\_getBlockByTimestamp** +### **erigon\_getBlockByTimestamp** Returns a block by timestamp using binary search to find the closest block to the specified timestamp. @@ -158,9 +158,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_getBlockByTimestamp","params": | ------ | ---------------------------------------------- | | Object | Block object matching closest to the timestamp | -*** - -## **erigon\_getBalanceChangesInBlock** +### **erigon\_getBalanceChangesInBlock** Returns all account balance changes that occurred within a specific block. @@ -184,9 +182,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_getBalanceChangesInBlock","par | ------ | ------------------------------------------------ | | Object | Mapping of addresses to their new balance values | -*** - -## **erigon\_getLogsByHash** +### **erigon\_getLogsByHash** Returns an array of arrays of logs generated by transactions in a block given by block hash. @@ -210,9 +206,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_getLogsByHash","params":["0x1d | ----- | --------------------------------------------------------- | | Array | Array of arrays of log objects, one array per transaction | -*** - -## **erigon\_getLogs** +### **erigon\_getLogs** Returns an array of logs matching a given filter object with enhanced filtering capabilities. @@ -236,9 +230,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_getLogs","params":[{"fromBlock | ----- | ------------------------------------------------- | | Array | Array of ErigonLog objects with enhanced metadata | -*** - -## **erigon\_getLatestLogs** +### **erigon\_getLatestLogs** Returns the latest logs matching a filter criteria in descending order with advanced pagination and topic matching options. @@ -265,7 +257,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_getLatestLogs","params":[{"add *** -## **erigon\_getBlockReceiptsByBlockHash** +### **erigon\_getBlockReceiptsByBlockHash** Returns all transaction receipts for a canonical block by block hash. @@ -291,7 +283,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"erigon_getBlockReceiptsByBlockHash"," *** -## **erigon\_nodeInfo** +### **erigon\_nodeInfo** Returns a collection of metadata known about the host node and connected peers. diff --git a/docs/gitbook/src/interacting-with-erigon/eth.md b/docs/gitbook/src/interacting-with-erigon/eth.md index 288bbe25d40..7c8d03863d4 100644 --- a/docs/gitbook/src/interacting-with-erigon/eth.md +++ b/docs/gitbook/src/interacting-with-erigon/eth.md @@ -12,13 +12,15 @@ The `eth` namespace is the foundational and most commonly used API set in Ethere Key methods within this namespace allow you to check an account's balance (`eth_getBalance`), get the current block number (`eth_blockNumber`), retrieve transaction details (`eth_getTransactionByHash`), and send signed transactions to the network (`eth_sendRawTransaction`). Essentially, the `eth` namespace contains all the fundamental tools needed to observe and participate in the life of the chain. -### API usage +## JSON-RPC Specification For API usage refer to the below official resources: {% embed url="https://ethereum.org/en/developers/docs/apis/json-rpc/" %} -{% embed url="https://ethereum.github.io/execution-apis/api-documentation/" %} +{% embed url="https://ethereum.github.io/execution-apis/" %} + + ### eth\_getProof diff --git a/docs/gitbook/src/interacting-with-erigon/internal.md b/docs/gitbook/src/interacting-with-erigon/internal.md index 2d494641c54..bc04bb38f8c 100644 --- a/docs/gitbook/src/interacting-with-erigon/internal.md +++ b/docs/gitbook/src/interacting-with-erigon/internal.md @@ -1,12 +1,18 @@ --- description: Internal Methods for Erigon Development and Debugging +metaLinks: + alternates: + - >- + https://app.gitbook.com/s/3DGBf2RdbfoitX1XMgq0/interacting-with-erigon/interacting-with-erigon/internal --- # internal The **`internal_`** methods are for development and debugging utilities and must be explicitly included in the `--http.api` flag if customizing enabled namespaces. -## **internal\_getTxNumInfo** +## JSON-RPC Specification + +### **`internal_getTxNumInfo`** Returns transaction number information for development and debugging purposes. This is part of Erigon's internal APIs and may change without notice. diff --git a/docs/gitbook/src/interacting-with-erigon/trace.md b/docs/gitbook/src/interacting-with-erigon/trace.md index 0e62418ed1f..cbfaed32063 100644 --- a/docs/gitbook/src/interacting-with-erigon/trace.md +++ b/docs/gitbook/src/interacting-with-erigon/trace.md @@ -1,5 +1,9 @@ --- description: Inspecting Transaction Execution with Trace, VMTrace, and StateDiff +metaLinks: + alternates: + - >- + https://app.gitbook.com/s/3DGBf2RdbfoitX1XMgq0/interacting-with-erigon/interacting-with-erigon/trace --- # trace @@ -58,7 +62,9 @@ then it should look something like: `[ {A: []}, {B: [0]}, {G: [0, 0]}, {C: [1]}, {G: [1, 0]} ]` -## JSON-RPC methods +*** + +## JSON-RPC Specification #### Ad-hoc Tracing @@ -75,8 +81,6 @@ then it should look something like: * [trace\_get](trace.md#trace_get) * [trace\_transaction](trace.md#trace_transaction) -## JSON-RPC API Reference - ### trace\_call Executes the given call and returns a number of possible traces for it. @@ -125,8 +129,6 @@ Response } ``` -*** - ### trace\_callMany Performs multiple call traces on top of the same block. i.e. transaction `n` will be executed on top of a pending block with all `n-1` transactions applied (traced) first. Allows to trace dependent transactions. @@ -229,8 +231,6 @@ Response } ``` -*** - ### trace\_rawTransaction Traces a call to `eth_sendRawTransaction` without making the call, returning the traces @@ -287,8 +287,6 @@ Response } ``` -*** - ### trace\_replayBlockTransactions Replays all transactions in a block returning the requested traces for each transaction. @@ -347,8 +345,6 @@ Response } ``` -*** - ### trace\_replayTransaction Replays a transaction, returning the traces. @@ -403,8 +399,6 @@ Response } ``` -*** - ### trace\_block Returns traces created at given block. @@ -466,8 +460,6 @@ Response } ``` -*** - ### trace\_filter Returns traces matching given filter @@ -539,8 +531,6 @@ Response } ``` -*** - ### trace\_get Returns trace at given position. @@ -603,8 +593,6 @@ Response } ``` -*** - ### trace\_transaction Returns all traces of given transaction diff --git a/docs/gitbook/src/interacting-with-erigon/txpool.md b/docs/gitbook/src/interacting-with-erigon/txpool.md index 27848993ea8..af1c6bb650b 100644 --- a/docs/gitbook/src/interacting-with-erigon/txpool.md +++ b/docs/gitbook/src/interacting-with-erigon/txpool.md @@ -1,5 +1,9 @@ --- description: Inspecting Unconfirmed Transactions in Erigon +metaLinks: + alternates: + - >- + https://app.gitbook.com/s/3DGBf2RdbfoitX1XMgq0/interacting-with-erigon/interacting-with-erigon/txpool --- # txpool @@ -45,7 +49,9 @@ The txpool namespace must be explicitly enabled using the `--http.api` flag when *** -## **txpool\_content** +## **JSON-RPC Specification** + +### **txpool\_content** Returns the content of the transaction pool, organized by sender address and categorized into pending, queued, and baseFee sub-pools. @@ -70,9 +76,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"txpool_content","params":[],"id":"1"} | baseFee | Object | | queued | Object | -*** - -## **txpool\_contentFrom** +### **txpool\_contentFrom** Returns the content of the transaction pool for a specific sender address, showing all transactions from that address across all sub-pools. @@ -99,9 +103,7 @@ curl -s --data '{"jsonrpc":"2.0","method":"txpool_contentFrom","params":["0xb60e | baseFee | Object | | queued | Object | -*** - -## **txpool\_status** +### **txpool\_status** Returns the current status of the transaction pool, including the count of transactions in each sub-pool.