Bug Fix 4424 - non determinism in deposits #4435
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
close #4424
Explanation: banking engine got a number of asset actions for the same ethereum transactions. The asset actions are stored in a map by a unique identifier. When the asset action is first seen it will finalise the action (in this case the deposit). Nodes iterate over the map and process the asset actions sequentially - this leads to non-determinism - in this case, the each node have taken a different asset action and finalised a different deposit which lead to all nodes having different hash.
A good example to this in action is here: https://jenkins.ops.vega.xyz/blue/organizations/jenkins/system-tests%2Fsystem-tests/detail/system-tests/936/pipeline/384
log for node0: https://jenkins.ops.vega.xyz/blue/rest/organizations/jenkins/pipelines/system-tests/pipelines/LNL-create-restore/runs/922/nodes/386/steps/426/log/?start=0
log for node1: https://jenkins.ops.vega.xyz/blue/rest/organizations/jenkins/pipelines/system-tests/pipelines/system-tests/runs/936/nodes/386/steps/427/log/?start=0
log for node2: https://jenkins.ops.vega.xyz/blue/rest/organizations/jenkins/pipelines/system-tests/pipelines/LNL-create-restore/runs/922/nodes/385/steps/428/log/?start=0
It can be seen that the loss of consensus follows the error of "chain event reference a transaction already processed".