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: adjust GetPaymentsLimit to work correctly with historical blocks, adjust sb params on regtest, tweak tests #5641

Merged
merged 5 commits into from
Oct 30, 2023

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Oct 23, 2023

Issue being fixed or feature implemented

Noticed a couple of things while I was trying to figure out if an issue @knst mentioned in #5627 could actually exist:

  1. GetPaymentsLimit() won't work correctly with historical blocks rn. We don't use it that way internally but it could be done via rpc and it should provide correct results.
  2. superblock params on regtest are too small to test them properly
  3. because of (2) and a huge v20 activation window (comparing to sb params) feature_governance.py doesn't test v20 switching states. There's also no "sb on v20 activation block" test.

NOTE: based on #5639 atm

What was done?

fix it, pls see individual commits

How Has This Been Tested?

run tests

Breaking Changes

n/a

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@UdjinM6 UdjinM6 added this to the 20 milestone Oct 23, 2023
@UdjinM6 UdjinM6 force-pushed the fix_v20_GetPaymentsLimit_past branch from 6fb102b to ae33635 Compare October 23, 2023 16:58
@UdjinM6 UdjinM6 marked this pull request as ready for review October 23, 2023 21:04
ogabrielides
ogabrielides previously approved these changes Oct 24, 2023
Copy link
Collaborator

@ogabrielides ogabrielides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 👍

@UdjinM6
Copy link
Author

UdjinM6 commented Oct 25, 2023

rebased on develop and added efce411

Copy link
Collaborator

@ogabrielides ogabrielides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK for squash merge; a few comments but nothing blocking

@@ -494,14 +494,16 @@ CAmount CSuperblock::GetPaymentsLimit(int nBlockHeight)
return 0;
}

const CBlockIndex* tipIndex = ::ChainActive().Tip();
const auto v20_state = llmq::utils::GetV20State(tipIndex);
const CBlockIndex* pindex = ::ChainActive().Tip();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could make this gsl::not_null

Comment on lines +145 to +147
self.p0_hash = self.nodes[0].gobject("submit", "0", 1, proposal_time, p0_collateral_prepare["hex"], p0_collateral_prepare["collateralHash"])
self.p1_hash = self.nodes[0].gobject("submit", "0", 1, proposal_time, p1_collateral_prepare["hex"], p1_collateral_prepare["collateralHash"])
self.p2_hash = self.nodes[0].gobject("submit", "0", 1, proposal_time, p2_collateral_prepare["hex"], p2_collateral_prepare["collateralHash"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would have been nice if these "self." only changes were in their own commit for easier review

@UdjinM6 UdjinM6 merged commit 965f5b2 into dashpay:develop Oct 30, 2023
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants