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

[pox-4] Integrated/Rust Tests #4554

Open
21 tasks done
setzeus opened this issue Mar 18, 2024 · 0 comments
Open
21 tasks done

[pox-4] Integrated/Rust Tests #4554

setzeus opened this issue Mar 18, 2024 · 0 comments

Comments

@setzeus
Copy link
Collaborator

setzeus commented Mar 18, 2024

Multiple User(s) Tests

1. Two Solo Stacker-Signers Stack Across Cycles
In this scenario, two solo stacker-signers Alice & Bob sign & stack for one tenure. Alice provides a signature; Bob uses ‘set-signer-key-authorization.’

Error Checks

  • Alice provides a mal-formed signature
  • Bob submits an mal-formed ‘set-signer-key-authorization’
  • Alice fails signature replay for the next record cycle
  • Bob fails signer-key-authorization replay for the next record cycle

2. Two Signers, Two Solo Stackers Across Cycles
In this scenario, two solo/service signers, Alice & Bob, provide verification for Carl & Dave, solo stackers. Alice provides a signature for Carl; Bob uses ‘set-signer-key-authorization’ to provide signature-less authority to Dave.

Error Checks

  • Alice tries duplicating voting for an aggregate public key
  • Bob tries changing the round by +2
  • Carl submits a period inconsistent w/ the signature provided by Alice
  • Dave submits a pox-addr inconsistent w/ the pox-addr found in Bob’s signature

3. Three Signers, Two Solo Stackers, One Stacking Pool Across A Tenure
In this scenario, two solo signer-stackers (Alice, Bob) & one service signer (Carl) provide signatures for one stacking pool controlled by David which has three (3) stackers inside (Eve, Frank, Grace).

Alice, Bob, & two pool stackers (Frank & Grace) successfully stack for the first cycle in Nakamoto with the aggregated public key voted upon by Carl & Dave.

Error Checks

  • Alice creates a signature with period > 12
  • Bob creates a signature with a reward cycle in the past
  • David tries delegate-stacking for Eve with a longer period than submitted
  • Alice tries stacking & delegating
  • David tries stacking with an incorrect topic

4. Two Solo Stacker-Signers Stack Across Multiple Reward Cycles
In this scenario, two solo stacker-signers Alice & Bob sign & stack for two cycles. Alice provides a signature for one cycle; Bob uses ‘set-signer-key-authorization’ for four cycles.

They both successfully stack & sign blocks with their aggregate public key for cycle one (1).

At the end of cycle one (1), Alice calls stack-extend & passes in her new key to extend by two cycles. Bob calls stack-increase to increase their amount stacked.

At the end of cycle 3 , the next reward cycle, however, should fail since there will be a single signer for cycle 4 (Bob).

Error Checks

  • Alice tries, in cycle 1, to vote with Bob's signer index
  • Bob tries, in cycle 2, to vote for the previous aggregate public key
  • Alice tries, in cycle 2, to stack-extend using a signature for Bob
  • Prepare phase ends with no aggregate public key set for the fourth reward cycle- chain should stall

**5. Two Signers, One Solo Stacker-Signer, Two Pool Operators, Six Pool Stackers Across Multiple Reward Cycles
**
In this scenario, two service signers (Alice, Bob), one stacker-signer (Carl), two stacking pool operators (Dave, Eve), & six pool stackers (Frank, Grace, Heidi, Ivan, Judy, Mallory).

First Nakamoto Reward Cycle
First Nakamoto Tenure

1.Franks stacks for 1 reward cycle, Grace stacks for 2 reward cycles & so on…Mallory stacks for 6 reward cycles: (so 6 wallets stacking n, n+1, n+2… cycles)
2. Dave asks Alice for 3 signatures
3. Eve asks Bob for 3 set-authorizations
4. Ivan - Mallory ask Bob to set-approval-authorization
5. Carl stx-stacks & self-signs for 2 reward cycle

Error Checks

  • Alice provides multiple different signatures with the same auth-id

Second Nakamoto Tenure
6. Dave aggregate-commits with Alice-provided signature
7. Eve aggregate-commits without signature (since provided authorization)
8. Carl ‘stacks-extend’ for another 2 reward cycles

Error Checks

  • Dave aggregate-commits twice with the same signature
  • Bob aggregate-commits for than the max-amount

First Nakamoto Cycle Prepare Phase (last 99 tenures / burnchain blocks)
9. Dave votes for aggregate public key
10. Eve votes for aggregate public key
12. Carl ‘stacks-increases’

Error Checks

  • Carl ‘stack-increases’ fails due to straddling to two signers key due to previous stack-extend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Status: 🆕 New
Development

No branches or pull requests

2 participants