Page MenuHomePhabricator

[avalanche] Increase the delay for a proof to be eligible to staking rewards
ClosedPublic

Authored by Fabien on Apr 1 2024, 15:44.

Details

Summary

Bump from 30 minutes to 60 minutes, and set the recent registration
window to +/-30 minutes.

Depends on D15791.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Branch
staking_reward_timing_symetrical_slack
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28232
Build 56009: Build Difflint-circular-dependencies · build-clang · build-without-wallet · build-diff · build-debug · build-clang-tidy
Build 56008: arc lint + arc unit

Event Timeline

Failed tests logs:

====== Bitcoin ABC functional tests with the next upgrade activated: abc_mining_stakingrewards.py ======

------- Stdout: -------
2024-04-01T15:59:26.338000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_155617/abc_mining_stakingrewards_67
2024-04-01T15:59:28.528000Z TestFramework (INFO): Staking rewards not ready yet, check getblocktemplate lacks the staking rewards data
2024-04-01T15:59:28.529000Z TestFramework (INFO): Staking rewards not ready yet, check the miner doesn't produce the staking rewards output
2024-04-01T15:59:28.547000Z TestFramework (INFO): Staking rewards are computed, check the block template returns the staking rewards data
2024-04-01T15:59:31.063000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 147, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 137, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_mining_stakingrewards.py", line 161, in run_test
    assert_equal(
  File "/work/test/functional/test_framework/util.py", line 61, in assert_equal
    raise AssertionError(
AssertionError: not([{'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}, {'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}] == [{'asm': 'OP_DUP OP_HASH160 0000000000000000000000000000000000000000 OP_EQUALVERIFY OP_CHECKSIG', 'hex': '76a914000000000000000000000000000000000000000088ac', 'reqSigs': 1, 'type': 'pubkeyhash', 'addresses': ['ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt']}])
2024-04-01T15:59:31.114000Z TestFramework (INFO): Stopping nodes
2024-04-01T15:59:31.215000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_155617/abc_mining_stakingrewards_67
2024-04-01T15:59:31.215000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_155617/abc_mining_stakingrewards_67/test_framework.log
2024-04-01T15:59:31.215000Z TestFramework (ERROR): 
2024-04-01T15:59:31.215000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_155617/abc_mining_stakingrewards_67' to consolidate all logs
2024-04-01T15:59:31.215000Z TestFramework (ERROR): 
2024-04-01T15:59:31.215000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-04-01T15:59:31.216000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2024-04-01T15:59:31.216000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_policy_stakingrewards.py ======

------- Stdout: -------
2024-04-01T15:58:11.262000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_155617/abc_p2p_avalanche_policy_stakingrewards_28
2024-04-01T15:58:15.958000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 147, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 137, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_policy_stakingrewards.py", line 170, in run_test
    new_block(
  File "/work/test/functional/abc_p2p_avalanche_policy_stakingrewards.py", line 149, in new_block
    assert_equal(node.getbestblockhash(), expected_tip)
  File "/work/test/functional/test_framework/util.py", line 61, in assert_equal
    raise AssertionError(
AssertionError: not(10ff9fd733c1b4468ecc80af37f42ec25e95d80d840d5892fba77cd34a1db3d9 == 6fe08702857cc05c841f36645f64088d12573d5f5ab15d3787060b28543c107b)
2024-04-01T15:58:16.010000Z TestFramework (INFO): Stopping nodes
2024-04-01T15:58:16.113000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_155617/abc_p2p_avalanche_policy_stakingrewards_28
2024-04-01T15:58:16.113000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_155617/abc_p2p_avalanche_policy_stakingrewards_28/test_framework.log
2024-04-01T15:58:16.113000Z TestFramework (ERROR): 
2024-04-01T15:58:16.113000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_155617/abc_p2p_avalanche_policy_stakingrewards_28' to consolidate all logs
2024-04-01T15:58:16.114000Z TestFramework (ERROR): 
2024-04-01T15:58:16.114000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-04-01T15:58:16.114000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2024-04-01T15:58:16.114000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests with the next upgrade activated: abc_mining_stakingrewards.py
Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_policy_stakingrewards.py

Fix test after activation

Failed tests logs:

====== Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_policy_stakingrewards.py ======

------- Stdout: -------
2024-04-01T19:20:52.841000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_191900/abc_p2p_avalanche_policy_stakingrewards_28
2024-04-01T19:20:57.383000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 147, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 137, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_policy_stakingrewards.py", line 170, in run_test
    new_block(
  File "/work/test/functional/abc_p2p_avalanche_policy_stakingrewards.py", line 149, in new_block
    assert_equal(node.getbestblockhash(), expected_tip)
  File "/work/test/functional/test_framework/util.py", line 61, in assert_equal
    raise AssertionError(
AssertionError: not(4dfe3a878c552d66669f4fa96e4f81c21e7bca8f74161e53d64caec2ad98c929 == 45f89a54233de484f3037d8689710e1c860c63f28b8f6f4e4f0959c2d3e62bf9)
2024-04-01T19:20:57.434000Z TestFramework (INFO): Stopping nodes
2024-04-01T19:20:57.538000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_191900/abc_p2p_avalanche_policy_stakingrewards_28
2024-04-01T19:20:57.538000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_191900/abc_p2p_avalanche_policy_stakingrewards_28/test_framework.log
2024-04-01T19:20:57.538000Z TestFramework (ERROR): 
2024-04-01T19:20:57.538000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20240401_191900/abc_p2p_avalanche_policy_stakingrewards_28' to consolidate all logs
2024-04-01T19:20:57.539000Z TestFramework (ERROR): 
2024-04-01T19:20:57.539000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-04-01T19:20:57.539000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2024-04-01T19:20:57.539000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_policy_stakingrewards.py

Fix another test post-activation

PiRK added inline comments.
src/avalanche/peermanager.cpp
998–1005 ↗(On Diff #46743)

You could factor out std::min(pprev->GetBlockTime(), GetTime())

Check winner registration time

Fabien published this revision for review.Apr 3 2024, 08:14
This revision is now accepted and ready to land.Apr 3 2024, 08:17
This revision was landed with ongoing or failed builds.Apr 3 2024, 08:19
This revision was automatically updated to reflect the committed changes.