-
Notifications
You must be signed in to change notification settings - Fork 682
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
Add stack-aggregation-commit command signature and authorization #4628
Add stack-aggregation-commit command signature and authorization #4628
Conversation
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitAuthCommand.ts
Outdated
Show resolved
Hide resolved
contrib/core-contract-tests/tests/pox-4/pox_DelegateStackIncreaseCommand.ts
Outdated
Show resolved
Hide resolved
contrib/core-contract-tests/tests/pox-4/pox_DelegateStackStxCommand.ts
Outdated
Show resolved
Hide resolved
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitAuthCommand.ts
Outdated
Show resolved
Hide resolved
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitAuthCommand.ts
Outdated
Show resolved
Hide resolved
? model.wallets.get(this.operator.lockedAddresses[0])!.delegatedPoxAddress | ||
: this.operator.btcAddress; | ||
|
||
this.operator.lockedAddresses.forEach((stacker) => { |
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.
Could something like this work?
(Typed on the fly)
sameDelegatedPoxAddrAllStackers =
!this.operator.lockedAddresses.some(stacker =>
model.wallets.get(stacker)!.delegatedPoxAddress !== firstDelegatedPoxAddress
);
?
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.
And then sameDelegatedPoxAddrAllStackers
can be const
-bound.
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.
The operator can lock stx for some stackers pox address 1 and some to pox address 2. Then there need to be two commits.
One for each pox address.
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.
A more common use case is that the operator calls commit several times in a cycle. In between the operator calls delegate-stack.. With the same index.
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.
Second this^, the popular use-case is to "override" or "top-off" the same pool / index to include as many member as possible.
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.
@friedger @setzeus
So a more suitable flow is:
- pick all the stackers'
delegated pox addresses
- call
stack-aggregation-commit
for all the pox addresses found (e.g. found 3 addresses, callstack-aggregation-commit
3 times, one for each pox address)
Is this correct? If not, please let me know what other flow will suit the command better.
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.
Sounds good. You could also add a random value whether the pox address belongs to the pool or not.
Then you would have maybe only 2 commit txs
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitAuthCommand.ts
Outdated
Show resolved
Hide resolved
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitSigCommand.ts
Outdated
Show resolved
Hide resolved
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitSigCommand.ts
Outdated
Show resolved
Hide resolved
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.
Looks good.
Fast Pool sends several commit txs in a cycle.
? model.wallets.get(this.operator.lockedAddresses[0])!.delegatedPoxAddress | ||
: this.operator.btcAddress; | ||
|
||
this.operator.lockedAddresses.forEach((stacker) => { |
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.
The operator can lock stx for some stackers pox address 1 and some to pox address 2. Then there need to be two commits.
One for each pox address.
? model.wallets.get(this.operator.lockedAddresses[0])!.delegatedPoxAddress | ||
: this.operator.btcAddress; | ||
|
||
this.operator.lockedAddresses.forEach((stacker) => { |
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.
A more common use case is that the operator calls commit several times in a cycle. In between the operator calls delegate-stack.. With the same index.
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitAuthCommand.ts
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat/pox-4-stateful-property-testing #4628 +/- ##
=========================================================================
- Coverage 82.86% 66.52% -16.34%
=========================================================================
Files 470 470
Lines 332564 332151 -413
Branches 317 317
=========================================================================
- Hits 275575 220974 -54601
- Misses 56981 111169 +54188
Partials 8 8 see 268 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitAuthCommand.ts
Outdated
Show resolved
Hide resolved
https://github.com/stacks-network/stacks-core/pull/4628/files#r1549544398 Co-authored-by: Nikos Baxevanis <[email protected]>
https://github.com/stacks-network/stacks-core/pull/4628/files#r1549544650 Co-authored-by: Nikos Baxevanis <[email protected]>
https://github.com/stacks-network/stacks-core/pull/4628/files#r1549546009 Co-authored-by: Nikos Baxevanis <[email protected]>
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitSigCommand.ts
Outdated
Show resolved
Hide resolved
contrib/core-contract-tests/tests/pox-4/pox_StackAggregationCommitSigCommand.ts
Outdated
Show resolved
Hide resolved
https://github.com/stacks-network/stacks-core/pull/4628/files#r1549557014 Co-authored-by: Nikos Baxevanis <[email protected]>
https://github.com/stacks-network/stacks-core/pull/4628/files#r1549556367 Co-authored-by: Nikos Baxevanis <[email protected]>
- removed check that verifies all the stackers have delegated to the same PoX address - addressed comments: #4628 (comment), #4628 (comment), #4628 (comment)
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
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
Merging into |
9eeb2d1
into
feat/pox-4-stateful-property-testing
- removed check that verifies all the stackers have delegated to the same PoX address - addressed comments: - #4628 (comment) - #4628 (comment) - #4628 (comment)
- removed check that verifies all the stackers have delegated to the same PoX address - addressed comments: - #4628 (comment) - #4628 (comment) - #4628 (comment)
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 the
stack-aggregation-commit
command, using both signature and authorization, to the stateful property testing environment. It is part of #4548 and targetsfeat/pox-4-stateful-property-testing
(#4550).