-
Notifications
You must be signed in to change notification settings - Fork 679
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
Feat/check pox 2 params #3409
Feat/check pox 2 params #3409
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shipit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## next #3409 +/- ##
===========================================
+ Coverage 28.58% 51.63% +23.04%
===========================================
Files 284 229 -55
Lines 260447 121772 -138675
===========================================
- Hits 74439 62872 -11567
+ Misses 186008 58900 -127108
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
… However, update integration tests to run in epoch 2.1
This PR now addresses #3367. It does so by pushing the boot receipts immediately after instantiating the chainstate, but before any bitcoin block header synchronization happens. To do this, it pushes the events attached to the true genesis block -- the one with height 0. |
…nd add some more debugging and test mechanisms for testing block withholding
… in the event dispatcher
…rom boot-up in order to verify that we push boot receipts immediately
@jcnelson can you add a check to one of the TestEventObserver tests to ensure the The |
@zone117x Try now. There was a bug in the epoch initialization code in which it didn't return the tx receipts for both |
Thanks for the quick fix @jcnelson, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the following changes from this PR and looks good:
- The toml config validation behavior is working as expected, e.g. early exit when invalid heights are configured, solves [Stacks 2.1] Miner error for epoch
start_height
andpox_2_activation
config values #3407 - The API has a PR that consumes the new the "block 0" changes, solves [Stacks 2.1] Epoch 2.0 boot data is not emitted to event-observers #3367
- The
pox-2
andcost-3
tx receipts from the epoch 2.1 block are all emitted consistently - The node no longer panics when stacking to both pox-1 and pox-2 during period 2a, instead the second stacking tx is rejected, solves [Stacks 2.1] Node panics when stacking to pox-2 while already locked to pox-1 #3423
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. |
This PR adds a config method that will validate the PoX 2 and epoch parameters. Specifically:
v1_unlock_height
must be strictly after the epoch 2.1 start height, and cannot fall on a reward cycle start boundary if it's in the subsequent reward cycle from the epoch 2.1 start.v1_unlock_height
falls in the same reward cycle as the epoch 2.1 start height, then the epoch 2.1 start height must be in the reward phase -- ideally, the very first block.The reasons for this are that the
v1_unlock_height
value is used to determine which PoX contract to query to determine a reward cycle's reward set. So,pox-2
must be instantiated before the PoX anchor block for its first reward cycle is mined. This also means thatv1_unlock_height
must not be at the very beginning of a reward cycle -- reward cycles start at the first block, not the zeroth block, of the reward cycle, so the reward cycle of av1_unlock_height
that fell on a sortition height such thatsortition_height % reward_cycle_len == 0
would be in the preceding reward cycle.This PR makes the both the mocknet and Neon nodes panic early if these conditions are not met.
I'm going to see if all integration tests continue to pass with the settings we've given them. But in the mean time, feel free to try this out. This is meant to address #3407.
EDIT: this PR now also fixes #3367.