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

Suggestion for "feat(regtest): Add regtest halving interval and port test" #8921

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Oct 10, 2024

This is a suggestion PR for #8888 that addresses this comment by:

  • Clearing the Regtest funding streams,
  • Panicking when there's an attempt to set Testnet parameters in the ParametersBuilder that affect the funding stream address period after setting configured funding streams, and
  • Checking that the funding streams in a ParametersBuilder are valid for the derived network's funding stream address period.

@oxarbitrage can review and optionally merge it into their PR.

…reams, updates funding stream setter methods to set a flag indicating that parameters affecting the funding stream address period should be locked, updates the setter methods for parameters that affect the funding stream address period to panic if those parameters should be locked.
@arya2 arya2 requested review from a team as code owners October 10, 2024 01:48
@arya2 arya2 requested review from oxarbitrage and removed request for a team October 10, 2024 01:48
@github-actions github-actions bot added C-feature Category: New features C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG labels Oct 10, 2024
@@ -231,6 +217,9 @@ pub struct ParametersBuilder {
pre_nu6_funding_streams: FundingStreams,
/// Post-NU6 funding streams for this network
post_nu6_funding_streams: FundingStreams,
/// A flag indicating whether to allow changes to fields that affect
/// the funding stream address period.
should_lock_funding_stream_address_period: bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This field and the related checks aren't strictly necessary if we want ParametersBuilder to be more flexible, it could be useful for debugging otherwise.

@oxarbitrage oxarbitrage merged commit dea0ce4 into regtest-halving-interval Oct 10, 2024
145 checks passed
@oxarbitrage oxarbitrage deleted the custom-testnet-funding-stream-addr-period-check branch October 10, 2024 11:22
mergify bot pushed a commit that referenced this pull request Oct 10, 2024
* add halving interval to regtest and to custom testnet

* add nuparams.py rpc test

* fix inconsistency in nu6 name in rpc methods

* rename `halving_interval` to `pre_blossom_halving_interval` in the config

* make fixes

* Suggestion for "feat(regtest): Add regtest halving interval and port test" (#8894)

* adds `height_for_halving_index()` and `num_halvings()` fns

* avoid unnecessary panic

* avoid using constant pre/post blossom halving intervals in num_halvings()

* make regtest and testnet constant more private

* move `height_for_halving_index`

* fmt

* add a `funding_stream_address_change_interval` method

* add checked operations to `height_for_halving_index` fn

* add post_blossom interval as paramneters + other refactors

* rename function

* fix docs

* move constant

* Updates `new_regtest()` method to return a Testnet without funding streams, updates funding stream setter methods to set a flag indicating that parameters affecting the funding stream address period should be locked, updates the setter methods for parameters that affect the funding stream address period to panic if those parameters should be locked. (#8921)

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
dmidem pushed a commit to QED-it/zebra that referenced this pull request Oct 29, 2024
…ation#8888)

* add halving interval to regtest and to custom testnet

* add nuparams.py rpc test

* fix inconsistency in nu6 name in rpc methods

* rename `halving_interval` to `pre_blossom_halving_interval` in the config

* make fixes

* Suggestion for "feat(regtest): Add regtest halving interval and port test" (ZcashFoundation#8894)

* adds `height_for_halving_index()` and `num_halvings()` fns

* avoid unnecessary panic

* avoid using constant pre/post blossom halving intervals in num_halvings()

* make regtest and testnet constant more private

* move `height_for_halving_index`

* fmt

* add a `funding_stream_address_change_interval` method

* add checked operations to `height_for_halving_index` fn

* add post_blossom interval as paramneters + other refactors

* rename function

* fix docs

* move constant

* Updates `new_regtest()` method to return a Testnet without funding streams, updates funding stream setter methods to set a flag indicating that parameters affecting the funding stream address period should be locked, updates the setter methods for parameters that affect the funding stream address period to panic if those parameters should be locked. (ZcashFoundation#8921)

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: New features C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants