diff --git a/content/docs/api-reference/subnet-evm-api.mdx b/content/docs/api-reference/subnet-evm-api.mdx index b47d63178a6..9f8efcdfec4 100644 --- a/content/docs/api-reference/subnet-evm-api.mdx +++ b/content/docs/api-reference/subnet-evm-api.mdx @@ -256,3 +256,65 @@ curl -X POST --data '{ } } ``` + +## `validators_getCurrentValidators` + +This API retrieves the list of current validators for the Subnet/L1. It provides detailed information about each validator, including their ID, status, weight, connection, and uptime. + +URL: http:///ext/bc//validators + +**Signature:** + +```bash +validators_getCurrentValidators([nodeIDs]) -> {validators: []Validator} +``` + +**Example Call:** + +```bash +{ + "jsonrpc": "2.0", + "method": "validators.getCurrentValidators", + "params": { + "nodeIDs": [] + }, + "id": 1 +} +``` + +- `nodeIDs` is an optional parameter that specifies the node IDs of the validators to retrieve. If omitted, all validators are returned. + +**Example Response:** + +```json +{ + "jsonrpc": "2.0", + "result": { + "validators": [ + { + "validationID": "nESqWkcNXihfdZESS2idWbFETMzatmkoTCktjxG1qryaQXfS6", + "nodeID": "NodeID-P7oB2McjBGgW2NXXWVYjV8JEDFoW9xDE5", + "weight": 20, + "startTimestamp": 1732025492, + "isActive": true, + "isL1Validator": false, + "isConnected": true, + "uptimeSeconds": 36 + "uptimePercentage": 100, + } + ] + }, + "id": 1 +} +``` + +- validationID: (string) Unique identifier for the validation. This returns validation ID for L1s, AddSubnetValidator txID for Subnets. +- nodeID: (string) Node identifier for the validator. +- weight: (integer) The weight of the validator, often representing stake. +- startTimestamp: (integer) UNIX timestamp for when validation started. +- isActive: (boolean) Indicates if the validator is active. This returns true if this is L1 validator and has enough continuous subnet staking fees in P-Chain. + It always return true for subnet validators. +- isL1Validator: (boolean) Indicates if the validator is a L1 validator or a subnet validator. +- isConnected: (boolean) Indicates if the validator node is currently connected to the callee node. +- uptimeSeconds: (integer) The number of seconds the validator has been online. +- uptimePercentage: (float) The percentage of time the validator has been online. diff --git a/content/docs/nodes/chain-configs/subnet-evm.mdx b/content/docs/nodes/chain-configs/subnet-evm.mdx index 9311e7f8ec1..b955c573d2a 100644 --- a/content/docs/nodes/chain-configs/subnet-evm.mdx +++ b/content/docs/nodes/chain-configs/subnet-evm.mdx @@ -7,196 +7,196 @@ description: Configuration options available in the Subnet EVM codebase. These are the configuration options available in the Subnet-EVM codebase. To set these values, you need to create a configuration file at `~/.avalanchego/configs/chains//config.json`. For the AvalancheGo node configuration options, see the [AvalancheGo Configuration](/nodes/configure/avalanche-l1-configs) page. + ## Airdrop -| Option | Type | Description | Default | -|-----------|----------|----------------------------|---------| -| `airdrop` | `string` | Path to the airdrop file. | | +| Option | Type | Description | Default | +| --------- | -------- | ------------------------- | ------- | +| `airdrop` | `string` | Path to the airdrop file. | | ## Subnet EVM APIs -| Option | Type | Description | Default | -|-----------------------|----------|------------------------------|---------| -| `snowman-api-enabled` | `bool` | Enables the Snowman API. | `false` | -| `admin-api-enabled` | `bool` | Enables the Admin API. | `false` | -| `admin-api-dir` | `string` | Directory for the performance profiling in Admin API. | | -| `warp-api-enabled` | `bool` | Enables the Warp API. | `false` | +| Option | Type | Description | Default | +| ------------------------ | -------- | ----------------------------------------------------- | ------- | +| `snowman-api-enabled` | `bool` | Enables the Snowman API. | `false` | +| `admin-api-enabled` | `bool` | Enables the Admin API. | `false` | +| `admin-api-dir` | `string` | Directory for the performance profiling in Admin API. | | +| `warp-api-enabled` | `bool` | Enables the Warp API. | `false` | +| `validators-api-enabled` | `bool` | Enables the Validators API. | `true` | ## Enabled Ethereum APIs -| Option | Type | Description | Default | -|-------------|------------|--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------| -| `eth-apis` | `[]string` | A list of Ethereum APIs to enable. If none is specified, the default list is used. | `"eth"`, `"eth-filter"`, `"net"`, `"web3"`, `"internal-eth"`, `"internal-blockchain"`, `"internal-transaction"` | +| Option | Type | Description | Default | +| ---------- | ---------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `eth-apis` | `[]string` | A list of Ethereum APIs to enable. If none is specified, the default list is used. | `"eth"`, `"eth-filter"`, `"net"`, `"web3"`, `"internal-eth"`, `"internal-blockchain"`, `"internal-transaction"` | ## Continuous Profiler -| Option | Type | Description | Default | -|---------------------------------|------------|--------------------------------------------------------------------------------|--------------| -| `continuous-profiler-dir` | `string` | Directory to store profiler data. If set, creates a continuous profiler. | `""` (empty) | -| `continuous-profiler-frequency` | `Duration` | Frequency to run the continuous profiler if enabled. | `15m` | -| `continuous-profiler-max-files` | `int` | Maximum number of profiler files to maintain. | `5` | +| Option | Type | Description | Default | +| ------------------------------- | ---------- | ------------------------------------------------------------------------ | ------------ | +| `continuous-profiler-dir` | `string` | Directory to store profiler data. If set, creates a continuous profiler. | `""` (empty) | +| `continuous-profiler-frequency` | `Duration` | Frequency to run the continuous profiler if enabled. | `15m` | +| `continuous-profiler-max-files` | `int` | Maximum number of profiler files to maintain. | `5` | ## API Gas/Price Caps | Option | Type | Description | Default | -|------------------|-----------|--------------------------------------------------------|------------| +| ---------------- | --------- | ------------------------------------------------------ | ---------- | | `rpc-gas-cap` | `uint64` | Maximum gas allowed in a transaction via the API. | `50000000` | | `rpc-tx-fee-cap` | `float64` | Maximum transaction fee (in AVAX) allowed via the API. | `100.0` | ## Cache Settings -| Option | Type | Description | Default | -|-------------------------------|-------|--------------------------------------------------------------------|---------| -| `trie-clean-cache` | `int` | Size of the trie clean cache in MB. | `512` | -| `trie-dirty-cache` | `int` | Size of the trie dirty cache in MB. | `512` | +| Option | Type | Description | Default | +| ----------------------------- | ----- | ----------------------------------------------------------------------- | ------- | +| `trie-clean-cache` | `int` | Size of the trie clean cache in MB. | `512` | +| `trie-dirty-cache` | `int` | Size of the trie dirty cache in MB. | `512` | | `trie-dirty-commit-target` | `int` | Memory limit target in the dirty cache before performing a commit (MB). | `20` | -| `trie-prefetcher-parallelism` | `int` | Max concurrent disk reads the trie prefetcher should perform at once. | `16` | -| `snapshot-cache` | `int` | Size of the snapshot disk layer clean cache in MB. | `256` | +| `trie-prefetcher-parallelism` | `int` | Max concurrent disk reads the trie prefetcher should perform at once. | `16` | +| `snapshot-cache` | `int` | Size of the snapshot disk layer clean cache in MB. | `256` | ## Ethereum Settings | Option | Type | Description | Default | -|---------------------------------|--------|-----------------------------------------------------|---------| +| ------------------------------- | ------ | --------------------------------------------------- | ------- | | `preimages-enabled` | `bool` | Enables preimage storage. | `false` | | `snapshot-wait` | `bool` | Waits for snapshot generation before starting node. | `false` | | `snapshot-verification-enabled` | `bool` | Enables snapshot verification. | `false` | ## Pruning Settings -| Option | Type | Description | Default | -|-----------------------------------|------------|----------------------------------------------------------------------------|---------| -| `pruning-enabled` | `bool` | If enabled, trie roots are only persisted every N blocks. | `true` | -| `accepted-queue-limit` | `int` | Maximum blocks to queue before blocking during acceptance. | `64` | -| `commit-interval` | `uint64` | Commit interval at which to persist EVM and atomic tries. | `4096` | -| `allow-missing-tries` | `bool` | Suppresses warnings for incomplete trie index if enabled. | `false` | -| `populate-missing-tries` | `*uint64` | Starting point for re-populating missing tries; disables if `nil`. | `nil` | -| `populate-missing-tries-parallelism` | `int` | Concurrent readers when re-populating missing tries on startup. | `1024` | -| `prune-warp-db-enabled` | `bool` | Determines if the warpDB should be cleared on startup. | `false` | +| Option | Type | Description | Default | +| ------------------------------------ | --------- | ------------------------------------------------------------------ | ------- | +| `pruning-enabled` | `bool` | If enabled, trie roots are only persisted every N blocks. | `true` | +| `accepted-queue-limit` | `int` | Maximum blocks to queue before blocking during acceptance. | `64` | +| `commit-interval` | `uint64` | Commit interval at which to persist EVM and atomic tries. | `4096` | +| `allow-missing-tries` | `bool` | Suppresses warnings for incomplete trie index if enabled. | `false` | +| `populate-missing-tries` | `*uint64` | Starting point for re-populating missing tries; disables if `nil`. | `nil` | +| `populate-missing-tries-parallelism` | `int` | Concurrent readers when re-populating missing tries on startup. | `1024` | +| `prune-warp-db-enabled` | `bool` | Determines if the warpDB should be cleared on startup. | `false` | ## Metric Settings -| Option | Type | Description | Default | -|----------------------------|--------|----------------------------------------------------------------------|---------| -| `metrics-expensive-enabled` | `bool` | Enables debug-level metrics that may impact performance. | `true` | - +| Option | Type | Description | Default | +| --------------------------- | ------ | -------------------------------------------------------- | ------- | +| `metrics-expensive-enabled` | `bool` | Enables debug-level metrics that may impact performance. | `true` | ### Transaction Pool Settings -| Option | Type | Description | Default | -|----------------------------|-----------|--------------------------------------------------------------------|-----------------------------------------------------| -| `tx-pool-price-limit` | `uint64` | Minimum gas price (in wei) for the transaction pool. | 1 | -| `tx-pool-price-bump` | `uint64` | Minimum price bump percentage to replace an existing transaction. | 10 | -| `tx-pool-account-slots` | `uint64` | Max executable transaction slots per account. | 16 | -| `tx-pool-global-slots` | `uint64` | Max executable transaction slots for all accounts. | From `legacypool.DefaultConfig.GlobalSlots` | -| `tx-pool-account-queue` | `uint64` | Max non-executable transaction slots per account. | From `legacypool.DefaultConfig.AccountQueue` | -| `tx-pool-global-queue` | `uint64` | Max non-executable transaction slots for all accounts. | 1024 | -| `tx-pool-lifetime` | `Duration`| Maximum time a transaction can remain in the pool. | 10 Minutes | -| `local-txs-enabled` | `bool` | Enables local transactions. | `false` | - +| Option | Type | Description | Default | +| ----------------------- | ---------- | ----------------------------------------------------------------- | -------------------------------------------- | +| `tx-pool-price-limit` | `uint64` | Minimum gas price (in wei) for the transaction pool. | 1 | +| `tx-pool-price-bump` | `uint64` | Minimum price bump percentage to replace an existing transaction. | 10 | +| `tx-pool-account-slots` | `uint64` | Max executable transaction slots per account. | 16 | +| `tx-pool-global-slots` | `uint64` | Max executable transaction slots for all accounts. | From `legacypool.DefaultConfig.GlobalSlots` | +| `tx-pool-account-queue` | `uint64` | Max non-executable transaction slots per account. | From `legacypool.DefaultConfig.AccountQueue` | +| `tx-pool-global-queue` | `uint64` | Max non-executable transaction slots for all accounts. | 1024 | +| `tx-pool-lifetime` | `Duration` | Maximum time a transaction can remain in the pool. | 10 Minutes | +| `local-txs-enabled` | `bool` | Enables local transactions. | `false` | ### API Resource Limiting Settings -| Option | Type | Description | Default | -|------------------------------|------------------|-----------------------------------------------------|------------------| -| `api-max-duration` | `Duration` | Maximum API call duration. | `0` (no limit) | -| `ws-cpu-refill-rate` | `Duration` | CPU time refill rate for WebSocket connections. | `0` (no limit) | -| `ws-cpu-max-stored` | `Duration` | Max CPU time stored for WebSocket connections. | `0` (no limit) | -| `api-max-blocks-per-request` | `int64` | Max blocks per `getLogs` request. | `0` (no limit) | -| `allow-unfinalized-queries` | `bool` | Allows queries on unfinalized blocks. | `false` | -| `allow-unprotected-txs` | `bool` | Allows unprotected (non-EIP-155) transactions. | `false` | -| `allow-unprotected-tx-hashes`| `[]common.Hash` | List of unprotected transaction hashes allowed. | Includes EIP-1820 | +| Option | Type | Description | Default | +| ----------------------------- | --------------- | ----------------------------------------------- | ----------------- | +| `api-max-duration` | `Duration` | Maximum API call duration. | `0` (no limit) | +| `ws-cpu-refill-rate` | `Duration` | CPU time refill rate for WebSocket connections. | `0` (no limit) | +| `ws-cpu-max-stored` | `Duration` | Max CPU time stored for WebSocket connections. | `0` (no limit) | +| `api-max-blocks-per-request` | `int64` | Max blocks per `getLogs` request. | `0` (no limit) | +| `allow-unfinalized-queries` | `bool` | Allows queries on unfinalized blocks. | `false` | +| `allow-unprotected-txs` | `bool` | Allows unprotected (non-EIP-155) transactions. | `false` | +| `allow-unprotected-tx-hashes` | `[]common.Hash` | List of unprotected transaction hashes allowed. | Includes EIP-1820 | ## Keystore Settings -| Option | Type | Description | Default | -|----------------------------------|----------|---------------------------------------------------------|--------------| -| `keystore-directory` | `string` | Directory for keystore files. | `""` (empty) | -| `keystore-external-signer` | `string` | External signer for keystore. | `""` (empty) | -| `keystore-insecure-unlock-allowed` | `bool` | Allows insecure unlock of the keystore. | `false` | +| Option | Type | Description | Default | +| ---------------------------------- | -------- | --------------------------------------- | ------------ | +| `keystore-directory` | `string` | Directory for keystore files. | `""` (empty) | +| `keystore-external-signer` | `string` | External signer for keystore. | `""` (empty) | +| `keystore-insecure-unlock-allowed` | `bool` | Allows insecure unlock of the keystore. | `false` | ## Gossip Settings -| Option | Type | Description | Default | -|-------------------------------|-------------------|----------------------------------------------|------------------| -| `push-gossip-percent-stake` | `float64` | Percentage of stake to target when gossiping.| `0.9` | -| `push-gossip-num-validators` | `int` | Number of validators to gossip to. | `100` | -| `push-gossip-num-peers` | `int` | Number of peers to gossip to. | `0` | -| `push-regossip-num-validators`| `int` | Number of validators to re-gossip to. | `10` | -| `push-regossip-num-peers` | `int` | Number of peers to re-gossip to. | `0` | -| `push-gossip-frequency` | `Duration` | Frequency of gossiping. | `100ms` | -| `pull-gossip-frequency` | `Duration` | Frequency of pulling gossip. | `1s` | -| `regossip-frequency` | `Duration` | Frequency of re-gossiping. | `30s` | -| `priority-regossip-addresses` | `[]common.Address`| Addresses with priority for re-gossiping. | `[]` (empty) | +| Option | Type | Description | Default | +| ------------------------------ | ------------------ | --------------------------------------------- | ------------ | +| `push-gossip-percent-stake` | `float64` | Percentage of stake to target when gossiping. | `0.9` | +| `push-gossip-num-validators` | `int` | Number of validators to gossip to. | `100` | +| `push-gossip-num-peers` | `int` | Number of peers to gossip to. | `0` | +| `push-regossip-num-validators` | `int` | Number of validators to re-gossip to. | `10` | +| `push-regossip-num-peers` | `int` | Number of peers to re-gossip to. | `0` | +| `push-gossip-frequency` | `Duration` | Frequency of gossiping. | `100ms` | +| `pull-gossip-frequency` | `Duration` | Frequency of pulling gossip. | `1s` | +| `regossip-frequency` | `Duration` | Frequency of re-gossiping. | `30s` | +| `priority-regossip-addresses` | `[]common.Address` | Addresses with priority for re-gossiping. | `[]` (empty) | ## Logging -| Option | Type | Description | Default | -|-------------------|----------|----------------------------------|----------| -| `log-level` | `string` | Logging level. | `"info"` | +| Option | Type | Description | Default | +| ----------------- | -------- | ----------------------------------- | -------- | +| `log-level` | `string` | Logging level. | `"info"` | | `log-json-format` | `bool` | If `true`, logs are in JSON format. | `false` | ## Fee Recipient -| Option | Type | Description | Default | -|-----------------|----------|--------------------------------------------------------------|--------------| -| `feeRecipient` | `string` | Address to receive transaction fees; must be empty if unsupported. | `""` (empty) | +| Option | Type | Description | Default | +| -------------- | -------- | ------------------------------------------------------------------ | ------------ | +| `feeRecipient` | `string` | Address to receive transaction fees; must be empty if unsupported. | `""` (empty) | ## Offline Pruning Settings -| Option | Type | Description | Default | -|---------------------------------|----------|--------------------------------------------------|--------------| -| `offline-pruning-enabled` | `bool` | Enables offline pruning. | `false` | +| Option | Type | Description | Default | +| ----------------------------------- | -------- | -------------------------------------------- | ------------ | +| `offline-pruning-enabled` | `bool` | Enables offline pruning. | `false` | | `offline-pruning-bloom-filter-size` | `uint64` | Bloom filter size for offline pruning in MB. | `512` | -| `offline-pruning-data-directory`| `string` | Data directory for offline pruning. | `""` (empty) | +| `offline-pruning-data-directory` | `string` | Data directory for offline pruning. | `""` (empty) | ## VM2VM Network -| Option | Type | Description | Default | -|--------------------------------|---------|--------------------------------------------|---------| -| `max-outbound-active-requests` | `int64` | Max number of outbound active requests. | `16` | +| Option | Type | Description | Default | +| ------------------------------ | ------- | --------------------------------------- | ------- | +| `max-outbound-active-requests` | `int64` | Max number of outbound active requests. | `16` | ## Sync Settings -| Option | Type | Description | Default | -|------------------------------|-----------|------------------------------------------------------------------|---------------------------| -| `state-sync-enabled` | `bool` | Enables state synchronization. | `false` | -| `state-sync-skip-resume` | `bool` | Forces state sync to use highest available summary block. | `false` | -| `state-sync-server-trie-cache` | `int` | Cache size for state sync server trie in MB. | `64` | -| `state-sync-ids` | `string` | Node IDs for state sync. | `""` (empty) | -| `state-sync-commit-interval` | `uint64` | Commit interval for state sync. | `16384` (CommitInterval*4)| -| `state-sync-min-blocks` | `uint64` | Min blocks ahead of local last accepted to perform state sync. | `300000` | -| `state-sync-request-size` | `uint16` | Key/values per request during state sync. | `1024` | +| Option | Type | Description | Default | +| ------------------------------ | -------- | -------------------------------------------------------------- | --------------------------- | +| `state-sync-enabled` | `bool` | Enables state synchronization. | `false` | +| `state-sync-skip-resume` | `bool` | Forces state sync to use highest available summary block. | `false` | +| `state-sync-server-trie-cache` | `int` | Cache size for state sync server trie in MB. | `64` | +| `state-sync-ids` | `string` | Node IDs for state sync. | `""` (empty) | +| `state-sync-commit-interval` | `uint64` | Commit interval for state sync. | `16384` (CommitInterval\*4) | +| `state-sync-min-blocks` | `uint64` | Min blocks ahead of local last accepted to perform state sync. | `300000` | +| `state-sync-request-size` | `uint16` | Key/values per request during state sync. | `1024` | ## Database Settings -| Option | Type | Description | Default | -|----------------------------|-------------------|------------------------------------------------------------|--------------------| -| `inspect-database` | `bool` | Inspects the database on startup if enabled. | `false` | -| `skip-upgrade-check` | `bool` | Disables checking that upgrades occur before last accepted block. | `false` | -| `accepted-cache-size` | `int` | Depth to keep in the accepted headers and logs cache. | `32` | -| `transaction-history` | `uint64` | Max blocks from head whose transaction indices are reserved. | `0` (no limit) | -| `tx-lookup-limit` | `uint64` | **Deprecated**, use `transaction-history` instead. | | -| `skip-tx-indexing` | `bool` | Skips indexing transactions; useful for non-indexing nodes.| `false` | -| `warp-off-chain-messages` | `[]hexutil.Bytes` | Encoded off-chain messages to sign. | `[]` (empty list) | +| Option | Type | Description | Default | +| ------------------------- | ----------------- | ----------------------------------------------------------------- | ----------------- | +| `inspect-database` | `bool` | Inspects the database on startup if enabled. | `false` | +| `skip-upgrade-check` | `bool` | Disables checking that upgrades occur before last accepted block. | `false` | +| `accepted-cache-size` | `int` | Depth to keep in the accepted headers and logs cache. | `32` | +| `transaction-history` | `uint64` | Max blocks from head whose transaction indices are reserved. | `0` (no limit) | +| `tx-lookup-limit` | `uint64` | **Deprecated**, use `transaction-history` instead. | | +| `skip-tx-indexing` | `bool` | Skips indexing transactions; useful for non-indexing nodes. | `false` | +| `warp-off-chain-messages` | `[]hexutil.Bytes` | Encoded off-chain messages to sign. | `[]` (empty list) | ## RPC Settings -| Option | Type | Description | Default | -|-------------------|----------|------------------------------------|----------------| -| `http-body-limit` | `uint64` | Limit for HTTP request body size. | Not specified | +| Option | Type | Description | Default | +| ----------------- | -------- | --------------------------------- | ------------- | +| `http-body-limit` | `uint64` | Limit for HTTP request body size. | Not specified | ## Standalone Database Configuration -| Option | Type | Description | Default | -|----------------------------|-----------|-------------------------------------------|----------------| -| `use-standalone-database` | `*PBool` | Use a standalone database. By default Subnet-EVM uses a standalone database if no block was accepted. | `nil` | -| `database-config` | `string` | Content of the database configuration. | `""` (empty) | -| `database-config-file` | `string` | Path to the database configuration file. | `""` (empty) | -| `database-type` | `string` | Type of database to use. | `"pebbledb"` | -| `database-path` | `string` | Path to the database. | `""` (empty) | -| `database-read-only` | `bool` | Opens the database in read-only mode. | `false` | +| Option | Type | Description | Default | +| ------------------------- | -------- | ----------------------------------------------------------------------------------------------------- | ------------ | +| `use-standalone-database` | `*PBool` | Use a standalone database. By default Subnet-EVM uses a standalone database if no block was accepted. | `nil` | +| `database-config` | `string` | Content of the database configuration. | `""` (empty) | +| `database-config-file` | `string` | Path to the database configuration file. | `""` (empty) | +| `database-type` | `string` | Type of database to use. | `"pebbledb"` | +| `database-path` | `string` | Path to the database. | `""` (empty) | +| `database-read-only` | `bool` | Opens the database in read-only mode. | `false` | ---