Skip to content

Commit 423458d

Browse files
Merge #7449: refactor: clean up governance inv tests after request cache removal
2673240 test: extract AssertMisbehaviorScore helper in governance inv tests (PastaClaw) a8f2711 refactor(governance): move RELIABLE_PROPAGATION_TIME next to its only uses (PastaClaw) 83d8dd7 test: drop the governance inv fixture setup left over from CheckAndRemove (PastaClaw) 97abde6 test: reuse the peer helper in per_object_vote_sync_is_fulfilled_request_limited (PastaClaw) Pull request description: ## What was done? Follow-up to #7442 and knst's review: - reuse the existing `MakeGovernanceInvPeer` helper in `per_object_vote_sync_is_fulfilled_request_limited` - remove the stale scheduler/thread/meta-manager fixture setup left behind when the `CheckAndRemove` tests were deleted - update the fixture comments to describe the remaining sync and mock-time requirements - extract an `AssertMisbehaviorScore` helper to remove repetitive state-stat assertions - move `RELIABLE_PROPAGATION_TIME` beside its only remaining uses in `governance.cpp` and document its current additional-relay role Review context: #7442 (review) ## How was this tested? - full headless build - `test_dash --run_test=governance_inv_tests,net_tests,ratecheck_tests,miner_tests` - `lint-whitespace.py` - `lint-include-guards.py` - `lint-includes.py` - `lint-circular-dependencies.py` - `git diff --check` The mandatory independent pre-PR code-review gate returned `ship` with no findings. ACKs for top commit: UdjinM6: utACK 2673240 Tree-SHA512: 5e4ef12b85f355b130e90c305f53b5b58aef8708cb15f58f40afa2bcfdfac548a3784b8fc45a687df96de0b399cfa80137b75cde21aeaa213af03aff6e799b49
2 parents ca2912d + 2673240 commit 423458d

3 files changed

Lines changed: 76 additions & 109 deletions

File tree

‎src/governance/governance.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ namespace {
3232
constexpr std::chrono::seconds GOVERNANCE_DELETION_DELAY{10min};
3333
constexpr std::chrono::seconds GOVERNANCE_ORPHAN_EXPIRATION_TIME{10min};
3434
constexpr std::chrono::seconds MAX_TIME_FUTURE_DEVIATION{1h};
35-
using governance::RELIABLE_PROPAGATION_TIME;
35+
// Margin below MAX_TIME_FUTURE_DEVIATION so lagging-clock peers don't reject near-limit objects.
36+
constexpr std::chrono::seconds RELIABLE_PROPAGATION_TIME{60};
3637

3738
bool IsSyncableObject(const std::shared_ptr<CGovernanceObject>& govobj)
3839
{

‎src/governance/governance.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <primitives/transaction.h>
1111
#include <sync.h>
1212

13-
#include <chrono>
1413
#include <limits>
1514
#include <map>
1615
#include <memory>
@@ -39,8 +38,6 @@ class UniValue;
3938

4039
namespace governance {
4140
class SuperblockManager;
42-
// How long a requested governance inv hash remains in the request cache.
43-
inline constexpr std::chrono::seconds RELIABLE_PROPAGATION_TIME{60};
4441
} // namespace governance
4542

4643
using vote_time_pair_t = std::pair<CGovernanceVote, int64_t>;

0 commit comments

Comments
 (0)