Page MenuHomePhabricator

Fix a data race that could prevent the staking reward to be added to the block template when longpoll is used
ClosedPublic

Authored by Fabien on Jul 7 2024, 20:07.

Details

Summary

This diff turns the best block global into a block index instead of a hash and performs a staking reward computation
upon longpoll interruption when building the block template. It avoids a data race where the template could be
constructed and returned before the computation of staking rewards is complete, leading to an empty winner and
potentially a rejected block.

Test Plan
for i in {1..1000}; do echo "Trial $i/1000" && ./test/functional/test_runner.py abc_mining_stakingrewards || break; done

Diff Detail

Event Timeline

Fabien requested review of this revision.Jul 7 2024, 20:07

Remove the 2nd node in the functional test (leftover of a previous version of the test)

This revision is now accepted and ready to land.Jul 8 2024, 06:37