Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jumping peer stake total #2405

Merged
merged 1 commit into from Nov 15, 2019

Conversation

wezrule
Copy link
Contributor

@wezrule wezrule commented Nov 15, 2019

The issue was tracked down to the hash of an endpoint inside a boost::multi_index_container being different depending on where it was called. Unfortunately it seemed that it was only easily reproducible on a release configuration on Windows which made debugging a bit harder. The culprit was the ip_address_hash_raw function which assumes that the same random constants variable is used each time. This is the case in the same translation unit, but because it is defined inside an unnamed namespace in a header, each translation unit which includes this (common.hpp) gets its own copy and hence each initialises its own static random_constants. Why it is a problem for some compilers/configurations and not others probably boils down to some compiler specific optimisations.

@wezrule wezrule added the bug label Nov 15, 2019
@wezrule wezrule self-assigned this Nov 15, 2019
@wezrule wezrule changed the base branch from master to develop Nov 15, 2019
@wezrule wezrule merged commit 809deaa into nanocurrency:develop Nov 15, 2019
1 of 2 checks passed
@wezrule wezrule deleted the random_constants_static branch Nov 15, 2019
Srayman pushed a commit to Srayman/nano-node that referenced this issue Dec 12, 2019
@zhyatt zhyatt added this to the V21.0 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants