Logs
A Etn-sc node continually reports messages to the console allowing users to monitor Etn-sc's current status in real-time. The logs indicate when Etn-sc is running normally and indicates when some attention is required. However, reading these logs can be difficult for new users. This page will help to interpret the log messages to better understand what Etn-sc is doing.
Note that there are a large number of log messages covering a wide range of possible scenarios for a Etn-sc node. This page will only address a subset of commonly seen messages. For more, see the Etn-sc GitHub. Log messages are usually sufficiently self-describing that they do not require additional explanation.
Configuring log messages
Log messages are displayed to the console by default. The messages can be tuned to be more or less detailed by passing --verbosity
and a value between 0
and 5
to Etn-sc at startup:
The default is --verbosity 3
.
Log messages can also be redirected so they are saved to a text file instead of being displayed in the console. In Linux the syntax >> <path> 2>&1
redirects both stdout
and stderr
messages to <path>
. For example:
Startup
When Etn-sc starts up it immediately reports a fairly long page of configuration details and status reports that allow the user to confirm Etn-sc is on the right network and operating in its intended modes. The basic structure of a log message is as follows:
Where MESSAGE_TYPE
can be INFO
, WARN
, ERROR
or DEBUG
. These tags categorize log messages according to their purpose. INFO
messages inform the user about Etn-sc's current configuration and status. WARN
messages are for alerting the user to details that affect the way Etn-sc is running. ERROR
messages are for alerting the user to problems. DEBUG
is for messages that are relevant to troubleshooting or for developers working on Etn-sc.
The messages displayed on startup break down as follows:
The logs above show the user that the node is connecting to Electroneum Smart Chain Testnet and some low level configuration details. The cache size is bumped to the Testnet default (4096). The maximum peer count is the highest number of peers this node is allowed to connect to and can be used to control the bandwidth requirements of the node.
Syncing
The default for Etn-sc is to sync in snap mode. Etn-sc requests block headers from its peers that are parents of the target until there is a continuous chain of sequential headers of sufficient length. Then, Etn-sc requests block bodies and receipts for each header and simultaneously starts downloading state data. This state data is stored in the form of a Patricia Merkle Trie. Only the leaves of the trie are downloaded, the full trie structure is then locally regenerated from the leaves up. Meanwhile, the blockchain continues to progress and the target header is updated. This means some of the regenerated state data need to be updated. This is known as healing.
Assuming Etn-sc has some peers it will start importing headers, block bodies and receipts. The log messages for data downloading look as follows:
For state sync, Etn-sc reports when the state heal is in progress. This can take a long time. The log message includes values for the number of accounts
, slots
, codes
and nodes
that were downloaded in the current healing phase, and the pending field is the number of state entires waiting to be downloaded. The pending
value is not necessarily the number of state entries remaining until the healing is finished. As the blockchain progresses the state trie is updated and therefore the data that need to be downloaded to heal the trie can increase as well as decrease over time. Ultimately, the state should heal faster than the blockchain progresses so the node can get in sync. When the state healing is finished there is a post-sync snapshot generation phase. The node is not in sync until the state healing phase is over. If the node is still regularly reporting State heal in progress
it is not yet in sync - the state healing is still ongoing.
The sync can be confirmed using eth.syncing - it will return false
if the node is in sync. If eth.syncing
returns anything other than false
it has not finished syncing. Generally, if syncing is still ongoing, eth.syncing
will return block info that looks as follows:
There are other log messages that are commonly seen during syncing. For example:
This warning is nothing to worry about - it is reporting a configuration mismatch between the node and a peer. It does not mean syncing is stalling or failing, it simply results in the peer being dropped and replaced.
Transaction logs
Transactions submitted over local IPC, Websockets or HTTP connections are reported in the console logs. For example, a simple ETN transaction appears in the console logs as follows:
Other user actions have similar log messages that are displayed to the console.
Common warnings
There are many warnings that can be emitted by Etn-sc as part of its normal operation.
The above is often seen and misinterpreted as a problem with snap sync. In reality, it indicates a request timeout that may be because I/O speed is low. It is usually not an issue, but if this message is seen very often over prolonged periods of time it might be rooted in a local connectivity or hardware issue.
This message indicates that a peer is being dropped because it is not fully synced. This is normal - the necessary data will be requested from an alternative peer instead.
Summary
There are a wide range of log messages that are emitted while Etn-sc is running. The level of detail in the logs can be configured using the verbosity
flag at startup. This page has outlined some of the common messages users can expect to see when Etn-sc is run with default verbosity, without attempting to be comprehensive.
Last updated