You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Debugging an ISS is difficult. Today, we have tools on the consensus node that allow engineers to look at logs from an ISS node and a non-ISS node, compare the top level hashes from various parts of the merkle tree, and determine which part of the state contains the mismatch (i.e. NFT virtual map, accounts virtual map, platform state, etc.) These hashes are written for every single round for this exact purpose. Since there are only a couple dozen hashes, this is possible. Knowing which part of state differs is critical information for engineers trying to determine where the faulty logic is.
With the MegaMap project, there will no longer be top level hashes for each type of data in state. Everything will be mixed together and interleaved in a single virtual map. Engineers will no longer have any tools to determine where the faulty logic is - it will be like finding a needle in a haystack.
Solution
If a consensus node ISSes, there will be a mismatch between the block for that round the block with the same block ID from a non-ISS consensus node. Since block nodes will receive blocks from several consensus nodes, it is able to identify mismatches. When a block node receives a block with the same block ID but a different hash, an ISS has occurred.
To provide debugging information for engineers, the block node should start at the beginning of the two mismatching blocks, iterate through each block item, and compare the hashes. The first block item with mismatched hashes should be logged.
Information to log:
The ID of the non-ISS consensus node used to perform the comparison
The ID of the consensus node that ISSed (i.e. does not have a proof for the block)
The block ID and round number of the mismatched block
The contents of the mismatched block item in readable format
If the mismatched block item is a state change, the contents of the transaction (or other input) in readable format that is associated with that state change
Additionally, it may be useful to keep the ISS block on disk somewhere easy to access in case engineers need to inspect it.
Alternatives
If engineers have the states from the ISS node and a non-ISS node, they could do a state diff and find exactly which node diverged. However this is not practical. The vast majority of states are not written to disk and are cleared from memory when they get old enough. Consensus nodes will stop uploading state at some point, so even if the consensus node has special logic to save ISS states to disk AND a non-ISS node still have the same round in memory in order to save it to disk, engineers would need a way to download those states. As we become more and more decentralized, this will be increasingly difficult.
The text was updated successfully, but these errors were encountered:
poulok
added
the
New Feature
A new feature, service, or documentation. Major changes that are not backwards compatible.
label
Nov 26, 2024
Problem
Debugging an ISS is difficult. Today, we have tools on the consensus node that allow engineers to look at logs from an ISS node and a non-ISS node, compare the top level hashes from various parts of the merkle tree, and determine which part of the state contains the mismatch (i.e. NFT virtual map, accounts virtual map, platform state, etc.) These hashes are written for every single round for this exact purpose. Since there are only a couple dozen hashes, this is possible. Knowing which part of state differs is critical information for engineers trying to determine where the faulty logic is.
Example log output:
With the MegaMap project, there will no longer be top level hashes for each type of data in state. Everything will be mixed together and interleaved in a single virtual map. Engineers will no longer have any tools to determine where the faulty logic is - it will be like finding a needle in a haystack.
Solution
If a consensus node ISSes, there will be a mismatch between the block for that round the block with the same block ID from a non-ISS consensus node. Since block nodes will receive blocks from several consensus nodes, it is able to identify mismatches. When a block node receives a block with the same block ID but a different hash, an ISS has occurred.
To provide debugging information for engineers, the block node should start at the beginning of the two mismatching blocks, iterate through each block item, and compare the hashes. The first block item with mismatched hashes should be logged.
Information to log:
Additionally, it may be useful to keep the ISS block on disk somewhere easy to access in case engineers need to inspect it.
Alternatives
If engineers have the states from the ISS node and a non-ISS node, they could do a state diff and find exactly which node diverged. However this is not practical. The vast majority of states are not written to disk and are cleared from memory when they get old enough. Consensus nodes will stop uploading state at some point, so even if the consensus node has special logic to save ISS states to disk AND a non-ISS node still have the same round in memory in order to save it to disk, engineers would need a way to download those states. As we become more and more decentralized, this will be increasingly difficult.
The text was updated successfully, but these errors were encountered: