C-Chain Configs

This page describes the configuration options available for the C-Chain.

Note: These are the configuration options available in the coreth codebase. To set these values, you need to create a configuration file at {chain-config-dir}/C/config.json. This file does not exist by default.

For example if chain-config-dir has the default value which is $HOME/.avalanchego/configs/chains, then config.json should be placed at $HOME/.avalanchego/configs/chains/C/config.json.

For the AvalancheGo node configuration options, see the AvalancheGo Configuration page.

This document describes all configuration options available for coreth.

The C-Chain config is printed out in the log when a node starts. Default values for each config flag are specified below.

Default values are overridden only if specified in the given config file. It is recommended to only provide values which are different from the default, as that makes the config more resilient to future default changes. Otherwise, if defaults change, your node will remain with the old values, which might adversely affect your node operation.

Example Configuration

{
  "eth-apis": ["eth", "eth-filter", "net", "web3"],
  "pruning-enabled": true,
  "commit-interval": 4096,
  "trie-clean-cache": 512,
  "trie-dirty-cache": 512,
  "snapshot-cache": 256,
  "rpc-gas-cap": 50000000,
  "log-level": "info",
  "metrics-expensive-enabled": true,
  "continuous-profiler-dir": "./profiles",
  "state-sync-enabled": false,
  "accepted-cache-size": 32
}

Configuration Format

Configuration is provided as a JSON object. All fields are optional unless otherwise specified.

API Configuration

Ethereum APIs

OptionTypeDescriptionDefault
eth-apisarray of stringsList of Ethereum services that should be enabled["eth", "eth-filter", "net", "web3", "internal-eth", "internal-blockchain", "internal-transaction"]
ethboolAdds the eth_coinbase and eth_etherbase RPC calls to the eth_* namespace.true
eth-filterboolEnables the public filter API for the eth_* namespace and adds the following RPC calls (see here for complete documentation):
- eth_newPendingTransactionFilter
- eth_newPendingTransactions
- eth_newAcceptedTransactions
- eth_newBlockFilter
- eth_newHeads
- eth_logs
- eth_newFilter
- eth_getLogs
- eth_uninstallFilter
- eth_getFilterLogs
- eth_getFilterChanges
true
adminboolAdds the admin_importChain and admin_exportChain RPC calls to the admin_* namespacefalse
debugboolAdds the following RPC calls to the debug_* namespace.
- debug_dumpBlock
- debug_accountRange
- debug_preimage
- debug_getBadBlocks
- debug_storageRangeAt
- debug_getModifiedAccountsByNumber
- debug_getModifiedAccountsByHash
- debug_getAccessibleState
The following RPC calls are disabled for any nodes with state-scheme = firewood:
- debug_storageRangeAt
- debug_getModifiedAccountsByNumber
- debug_getModifiedAccountsByHash
false.
netboolAdds the following RPC calls to the net_* namespace.
- net_listening
- net_peerCount
- net_version
Note: Coreth is a virtual machine and does not have direct access to the networking layer, so net_listening always returns true and net_peerCount always returns 0. For accurate metrics on the network layer, users should use the AvalancheGo APIs.
true
debug-tracerboolAdds the following RPC calls to the debug_* namespace.
- debug_traceChain
- debug_traceBlockByNumber
- debug_traceBlockByHash
- debug_traceBlock
- debug_traceBadBlock
- debug_intermediateRoots
- debug_traceTransaction
- debug_traceCall
false
web3boolAdds the web3_clientVersion and web3_sha3 RPC calls to the web3_* namespacetrue
internal-ethboolAdds the following RPC calls to the eth_* namespace.
- eth_gasPrice
- eth_baseFee
- eth_maxPriorityFeePerGas
- eth_feeHistory
true
internal-blockchainboolAdds the following RPC calls to the eth_* namespace.
- eth_chainId
- eth_blockNumber
- eth_getBalance
- eth_getProof
- eth_getHeaderByNumber
- eth_getHeaderByHash
- eth_getBlockByNumber
- eth_getBlockByHash
- eth_getUncleBlockByNumberAndIndex
- eth_getUncleBlockByBlockHashAndIndex
- eth_getUncleCountByBlockNumber
- eth_getUncleCountByBlockHash
- eth_getCode
- eth_getStorageAt
- eth_call
- eth_estimateGas
- eth_createAccessList
eth_getProof is disabled for any node with state-scheme = firewood
true
internal-transactionboolAdds the following RPC calls to the eth_* namespace.
- eth_getBlockTransactionCountByNumber
- eth_getBlockTransactionCountByHash
- eth_getTransactionByBlockNumberAndIndex
- eth_getTransactionByBlockHashAndIndex
- eth_getRawTransactionByBlockNumberAndIndex
- eth_getRawTransactionByBlockHashAndIndex
- eth_getTransactionCount
- eth_getTransactionByHash
- eth_getRawTransactionByHash
- eth_getTransactionReceipt
- eth_sendTransaction
- eth_fillTransaction
- eth_sendRawTransaction
- eth_sign
- eth_signTransaction
- eth_pendingTransactions
- eth_resend
true
internal-tx-poolboolAdds the following RPC calls to the txpool_* namespace.
- txpool_content
- txpool_contentFrom
- txpool_status
- txpool_inspect
false
internal-debugboolAdds the following RPC calls to the debug_* namespace.
- debug_getHeaderRlp
- debug_getBlockRlp
- debug_printBlock
- debug_chaindbProperty
- debug_chaindbCompact
false
debug-handlerboolAdds the following RPC calls to the debug_* namespace.
- debug_verbosity
- debug_vmodule
- debug_backtraceAt
- debug_memStats
- debug_gcStats
- debug_blockProfile
- debug_setBlockProfileRate
- debug_writeBlockProfile
- debug_mutexProfile
- debug_setMutexProfileFraction
- debug_writeMutexProfile
- debug_writeMemProfile
- debug_stacks
- debug_freeOSMemory
- debug_setGCPercent
false
internal-accountboolAdds the eth_accounts RPC call to the eth_* namespacetrue
internal-personalboolAdds the following RPC calls to the personal_* namespace.
- personal_listAccounts
- personal_listWallets
- personal_openWallet
- personal_deriveAccount
- personal_newAccount
- personal_importRawKey
- personal_unlockAccount
- personal_lockAccount
- personal_sendTransaction
- personal_signTransaction
- personal_sign
- personal_ecRecover
- personal_signAndSendTransaction
- personal_initializeWallet
- personal_unpair
false

Enabling Avalanche Specific APIs

OptionTypeDescriptionDefault
admin-api-enabledboolEnables the Admin APIfalse
admin-api-dirstringSpecifies the directory for the Admin API to use to store CPU/Mem/Lock Profiles""
warp-api-enabledboolEnable the Warp API for cross-chain messagingfalse

API Limits and Security

OptionTypeDescriptionDefault
rpc-gas-capuint64Maximum gas limit for RPC calls50,000,000
rpc-tx-fee-capfloat64Maximum transaction fee cap in AVAX100
api-max-durationdurationMaximum duration for API calls (0 = no limit)0
api-max-blocks-per-requestint64Maximum number of blocks per getLogs request (0 = no limit)0
http-body-limituint64Maximum size of HTTP request bodies (0 = no limit)0
batch-request-limituint64Maximum number of requests that can be batched in an RPC call. For no limit, set either this or batch-response-max-size to 01000
batch-response-max-sizeuint64Maximum size (in bytes) of response that can be returned from a batched RPC call. For no limit, set either this or batch-request-limit to 0. Defaults to 25 MB1000

WebSocket Settings

OptionTypeDescriptionDefault
ws-cpu-refill-ratedurationRate at which WebSocket CPU usage quota is refilled (0 = no limit)0
ws-cpu-max-storeddurationMaximum stored WebSocket CPU usage quota (0 = no limit)0

Cache Configuration

Trie Caches

OptionTypeDescriptionDefault
trie-clean-cacheintSize of the trie clean cache in MB512
trie-dirty-cacheintSize of the trie dirty cache in MB512
trie-dirty-commit-targetintMemory limit to target in the dirty cache before performing a commit in MB20
trie-prefetcher-parallelismintMaximum concurrent disk reads trie prefetcher should perform16

Other Caches

OptionTypeDescriptionDefault
snapshot-cacheintSize of the snapshot disk layer clean cache in MB256
accepted-cache-sizeintDepth to keep in the accepted headers and logs cache (blocks)32
state-sync-server-trie-cacheintTrie cache size for state sync server in MB64

Ethereum Settings

Transaction Processing

⚠️ WARNING: allow-unfinalized-queries should likely be set to false in production. Enabling this flag can result in a confusing/unreliable user experience. Enabling this flag should only be done when users are expected to have knowledge of how Snow* consensus finalizes blocks. Unlike chains with reorgs and forks that require block confirmations, Avalanche does not increase the confidence that a block will be finalized based on the depth of the chain. Waiting for additional blocks does not confirm finalization. Enabling this flag removes the guarantee that the node only exposes finalized blocks; requiring users to guess if a block is finalized.

OptionTypeDescriptionDefault
preimages-enabledboolEnable preimage recordingfalse
allow-unfinalized-queriesboolAllow queries for unfinalized blocksfalse
allow-unprotected-txsboolAllow unprotected transactions (without EIP-155)false
allow-unprotected-tx-hashes[]TxHashSpecifies an array of transaction hashes that should be allowed to bypass replay protection. This flag is intended for node operators that want to explicitly allow specific transactions to be issued through their API.an empty list
local-txs-enabledboolEnable treatment of transactions from local accounts as localfalse

Snapshots

OptionTypeDescriptionDefault
snapshot-waitboolWait for snapshot generation on startupfalse
snapshot-verification-enabledboolEnable snapshot verificationfalse

Pruning and State Management

Note: If a node is ever run with pruning-enabled as false (archival mode), setting pruning-enabled to true will result in a warning and the node will shut down. This is to protect against unintentional misconfigurations of an archival node. To override this and switch to pruning mode, in addition to pruning-enabled: true, allow-missing-tries should be set to true as well.

Basic Pruning

OptionTypeDescriptionDefault
pruning-enabledboolEnable state pruning to save disk spacetrue
commit-intervaluint64Interval at which to persist EVM and atomic tries (blocks)4096
accepted-queue-limitintMaximum blocks to queue before blocking during acceptance64

State Reconstruction

OptionTypeDescriptionDefault
allow-missing-triesboolSuppress warnings about incomplete trie indexfalse
populate-missing-triesuint64Starting block for re-populating missing tries (null = disabled)null
populate-missing-tries-parallelismintConcurrent readers for re-populating missing tries1024

Offline Pruning

Note: If offline pruning is enabled it will run on startup and block until it completes (approximately one hour on Mainnet). This will reduce the size of the database by deleting old trie nodes. While performing offline pruning, your node will not be able to process blocks and will be considered offline. While ongoing, the pruning process consumes a small amount of additional disk space (for deletion markers and the bloom filter). For more information see here.. Since offline pruning deletes old state data, this should not be run on nodes that need to support archival API requests. This is meant to be run manually, so after running with this flag once, it must be toggled back to false before running the node again. Therefore, you should run with this flag set to true and then set it to false on the subsequent run.

OptionTypeDescriptionDefault
offline-pruning-enabledboolEnable offline pruningfalse
offline-pruning-bloom-filter-sizeuint64Bloom filter size for offline pruning in MB512
offline-pruning-data-directorystringDirectory for offline pruning data-

Historical Data

OptionTypeDescriptionDefault
historical-proof-query-windowuint64Number of blocks before last accepted for proof queries (archive mode only, ~24 hours)43200
state-historyuint64Number of most recent states that are accesible on disk (pruning mode only)32

Transaction Pool Configuration

OptionTypeDescriptionDefault
tx-pool-price-limituint64Minimum gas price for transaction acceptance1
tx-pool-price-bumpuint64Minimum price bump percentage for transaction replacement10%
tx-pool-account-slotsuint64Maximum number of executable transaction slots per account16
tx-pool-global-slotsuint64Maximum number of executable transaction slots for all accounts5120
tx-pool-account-queueuint64Maximum number of non-executable transaction slots per account64
tx-pool-global-queueuint64Maximum number of non-executable transaction slots for all accounts1024
tx-pool-lifetimedurationMaximum duration in nanoseconds a non-executable transaction will be allowed in the poll600000000000 (10 minutes)
price-options-slow-fee-percentageintegerPercentage to apply for slow fee estimation95
price-options-fast-fee-percentageintegerPercentage to apply for fast fee estimation105
price-options-max-tipintegerMaximum tip in wei for fee estimation20000000000 (20 Gwei)

Push Gossip Settings

OptionTypeDescriptionDefault
push-gossip-percent-stakefloat64Percentage of total stake to push gossip to (range: [0, 1])0.9
push-gossip-num-validatorsintNumber of validators to push gossip to100
push-gossip-num-peersintNumber of non-validator peers to push gossip to0

Regossip Settings

OptionTypeDescriptionDefault
push-regossip-num-validatorsintNumber of validators to regossip to10
push-regossip-num-peersintNumber of non-validator peers to regossip to0

Timing Configuration

OptionTypeDescriptionDefault
push-gossip-frequencydurationFrequency of push gossip100ms
pull-gossip-frequencydurationFrequency of pull gossip1s
regossip-frequencydurationFrequency of regossip30s

Logging and Monitoring

Logging

OptionTypeDescriptionDefault
log-levelstringLogging level (trace, debug, info, warn, error, crit)"info"
log-json-formatboolUse JSON format for logsfalse

Profiling

OptionTypeDescriptionDefault
continuous-profiler-dirstringDirectory for continuous profiler output (empty = disabled)""
continuous-profiler-frequencydurationFrequency to run continuous profiler15m
continuous-profiler-max-filesintMaximum number of profiler files to maintain5

Metrics

OptionTypeDescriptionDefault
metrics-expensive-enabledboolEnable expensive debug-level metrics; this includes Firewood metricstrue

Security and Access

Keystore

OptionTypeDescriptionDefault
keystore-directorystringDirectory for keystore files (absolute or relative path); if empty, uses a temporary directory at coreth-keystore""
keystore-external-signerstringSpecifies an external URI for a clef-type signer""
keystore-insecure-unlock-allowedboolAllow insecure account unlockingfalse

Network and Sync

Network

OptionTypeDescriptionDefault
max-outbound-active-requestsint64Maximum number of outbound active requests for VM2VM network16

State Sync

Note: If state-sync is enabled, the peer will download chain state from peers up to a recent block near tip, then proceed with normal bootstrapping. Please note that if you need historical data, state sync isn't the right option. However, it is sufficient if you are just running a validator.

OptionTypeDescriptionDefault
state-sync-enabledboolEnable state syncfalse
state-sync-skip-resumeboolForce state sync to use highest available summary blockfalse
state-sync-idsstringComma-separated list of state sync IDs; If not specified (or empty), peers are selected at random.""
state-sync-commit-intervaluint64Commit interval for state sync (blocks)16384
state-sync-min-blocksuint64Minimum blocks ahead required for state sync300000
state-sync-request-sizeuint16Number of key/values to request per state sync request1024

Database Configuration

WARNING: firewood and path schemes are untested in production. Using path is strongly discouraged. To use firewood, you must also set the following config options:

  • pruning-enabled: true (enabled by default)
  • state-sync-enabled: false
  • snapshot-cache: 0

Failing to set these options will result in errors on VM initialization. Additionally, not all APIs are available - see these portions of the config documentation for more details.

OptionTypeDescriptionDefault
inspect-databaseboolInspect database on startupfalse
state-schemestringEXPERIMENTAL: specifies the database scheme to store state data; can be one of hash, firewood, or pathhash

Transaction Indexing

OptionTypeDescriptionDefault
transaction-historyuint64Maximum number of blocks from head whose transaction indices are reserved (0 = no limit)0
skip-tx-indexingboolSkip indexing transactions entirelyfalse

Warp Configuration

OptionTypeDescriptionDefault
warp-off-chain-messagesarrayOff-chain messages the node should be willing to signempty array
prune-warp-db-enabledboolClear warp database on startupfalse

Miscellaneous

Note: If skip-upgrade-check is set to true, the chain will skip verifying that all expected network upgrades have taken place before the last accepted block on startup. This allows node operators to recover if their node has accepted blocks after a network upgrade with a version of the code prior to the upgrade.

OptionTypeDescriptionDefault
acceptor-queue-limitintegerSpecifies the maximum number of blocks to queue during block acceptance before blocking on Accept.64
gas-targetintegerThe target gas per second that this node will attempt to use when creating blocksParent block's target
skip-upgrade-checkboolSkip checking that upgrades occur before last accepted block ⚠️ Warning: Only use when you understand the implicationsfalse

Is this guide helpful?

Report Issue