stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

[pox-4] Integrated/Rust Tests

Open setzeus opened this issue 11 months ago • 0 comments

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

  • [x] Alice provides a mal-formed signature
  • [x] Bob submits an mal-formed ‘set-signer-key-authorization’
  • [x] Alice fails signature replay for the next record cycle
  • [x] 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

  • [x] Alice tries duplicating voting for an aggregate public key
  • [x] Bob tries changing the round by +2
  • [x] Carl submits a period inconsistent w/ the signature provided by Alice
  • [x] 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

  • [x] Alice creates a signature with period > 12
  • [x] Bob creates a signature with a reward cycle in the past
  • [x] David tries delegate-stacking for Eve with a longer period than submitted
  • [x] Alice tries stacking & delegating
  • [x] 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

  • [x] Alice tries, in cycle 1, to vote with Bob's signer index
  • [x] Bob tries, in cycle 2, to vote for the previous aggregate public key
  • [x] Alice tries, in cycle 2, to stack-extend using a signature for Bob
  • [x] 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

  • [x] 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

  • [x] Dave aggregate-commits twice with the same signature
  • [x] 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

  • [x] Carl ‘stack-increases’ fails due to straddling to two signers key due to previous stack-extend

setzeus avatar Mar 18 '24 13:03 setzeus