Skip to content

Conversation

@kantai
Copy link
Contributor

@kantai kantai commented Oct 7, 2020

This PR implements a few different things:

  1. It implements the threshold adjustment described in SIP-007 (PoX: Implement dynamic threshold adjustment #1947)
  2. When a Stacker reward address uses more than the threshold, the address is repeated in the reward set (PoX: Stacker reward does not depend on amount stacked #1924)
  3. The chains coordinator, when booting the node, executes set-burnchain-parameters on the PoX contract.
  4. To speed up the integration tests in the stacks-node, this parameterizes the wait time in the syncctl module.

The implementations of 1 and 2 are tested via unit tests, as well as some integration paths in the pox test in neon_integrations (which also tests 3).

@kantai kantai requested review from jcnelson and lgalabru October 8, 2020 18:11
@kantai kantai self-assigned this Oct 8, 2020
@kantai kantai changed the base branch from master to next October 8, 2020 18:37
@kantai kantai force-pushed the feat/pox-thresholds branch from 5530626 to f599d0d Compare October 8, 2020 23:41
#[cfg(not(test))]
const POX_SYNC_WAIT_MS: u64 = 1000;
#[cfg(test)]
const POX_SYNC_WAIT_MS: u64 = 0;
Copy link
Member

Choose a reason for hiding this comment

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

If this value is anything other than 1000, then the block download and processing time estimations won't work correctly -- the number of samples taken is supposed to be exactly equal to the number of seconds over which the samples were taken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left at 1000ms, the integration tests take about 2x as long to run -- is there a better way to disable the stalling behavior during tests?

Copy link
Member

Choose a reason for hiding this comment

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

You can set a smaller value for ConnectionOptions::timeout. This is what gets used to determine how many samples the PoX sync watchdog takes. The units are in seconds -- you can set this to something like 3 instead of 30 for a local test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made this configurable via 33ec31b

(define-public (set-burnchain-parameters (first-burn-height uint) (prepare-cycle-length uint) (reward-cycle-length uint) (rejection-fraction uint))
(begin
(asserts! (and is-in-regtest (not (var-get configured))) (err ERR_NOT_ALLOWED))
(asserts! (not (var-get configured)) (err ERR_NOT_ALLOWED))
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're getting rid of is-in-regtest, should we kill it completely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should keep it for the time being -- it may be useful elsewhere.

Copy link
Contributor

@lgalabru lgalabru left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you @kantai!

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

This LGTM. Thanks @kantai!

@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 29, 2024
@kantai kantai deleted the feat/pox-thresholds branch March 11, 2025 15:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PoX: Implement dynamic threshold adjustment PoX: Stacker reward does not depend on amount stacked

5 participants