keep-ecdsa icon indicating copy to clipboard operation
keep-ecdsa copied to clipboard

System Test: Operator

Open nkuba opened this issue 5 years ago • 1 comments

Stake

  • [x] Start client when operator account has just minimum stake

  • [x] Start client when operator account has multiples of minimum stake

    • client starts successfully and is selected to new keep after open keep request

Insufficient stake

🚫 Blocked by https://github.com/keep-network/keep-core/issues/1588


  • [ ] Start client when operator account has ZERO stake
  • [ ] Start client when operator account has below minimum stake

Expected results:

  • client starts and is monitoring the chain
  • other peers nodes reject connection
  • operator does not get selected to any new keep group
  • it does not pick requests for a signature from the existing keep

  • [ ] Drop stake below minimum while client is running Expected results:

    • client updates it's status in sortition pool
    • other peers nodes reject connection
    • operator does not get selected to any new keep group
    • it does not pick requests for a signature from the existing keep
  • [ ] Drop stake below minimum and restart the client

    After start get into some keeps to generate the key, later unstake and restart the client.

    Expected results:

    • client starts and is monitoring the chain
    • other peers nodes reject connection
    • operator does not get selected to any new keep group
    • it does not pick requests for a signature from the existing keep

Ether


  • [x] Start client when operator account has some ETH
  • [x] Drop ETH for operator account while client is running
  • [x] Drop ETH for operator account and restart the client

Expected results:

  • client starts and is monitoring the chain
  • client establishes a connection with peer nodes
  • operator gets selected to a new keep group
  • operator takes part in signature generation for keeps

  • [x] Start client when operator account has ZERO ETH and open new keep

    Ensure the operator is selected to the keep.

    • client starts and is monitoring the chain
    • client establishes a connection with peer nodes
    • operator gets selected to a new keep group but fails on key submission
    • it is not possible to request a signature as public key has not been published
    • other keep members succeed to generate the public key

  • [x] Start client when operator account has ZERO ETH and request a signature

    • client starts and is monitoring the chain
    • client establishes a connection with peer nodes
    • operator calculates the signature but fails to publish it to the chain
    • other keep members succeed to calculate the signature and one of them publishes the signature to the chain

  • [x] Monitor ETH usage for opening new keep and generating a signature

Bond

  • [x] Start client when operator account has ZERO unbonded value

    • client starts and is monitoring the chain
    • client establishes a connection with peer nodes
  • [x] Start client when operator account has 1 ETH of unbonded value

    • client starts and is monitoring the chain
    • client establishes a connection with peer nodes
  • [x] Request new keep when operator's unbonded value is ZERO

    • operator is not selected to the keep
  • [ ] Request new keep when operator's unbonded value is positive but less than requested bond / group size

    • operator is not selected to the keep
  • [ ] Request new keep when operator's unbonded value is equal to requested bond / group size

    • operator is selected to the keep
  • [ ] Request new keep when operator's unbonded value is greater than requested bond / group size

    • operator is selected to the keep
  • [ ] Request a signature for existing keep when operators unbonded value is ZERO

    • Signature is successfully calculated and submitted

--

  • [ ] Drop unbonded value to ZERO while client is running

  • [ ] Drop unbonded value to ZERO and restart the client --

  • client is working and is monitoring the chain

  • client updates operator's status in the factory contract

  • client establishes a connection with peer nodes

  • operator does not get selected to a new keep

  • operator takes part in signature generation for existing keeps

Operator Contract Authorization

  • [ ] Start client without BondedECDSAKeepFactory authorization in TokenStaking contract

    • client is working and is monitoring the chain
    • client establishes a connection with peer nodes
    • operator does not get selected to a new keep
  • [x] Authorize BondedECDSAKeepFactory in TokenStaking contract for operator

    • client is working and is monitoring the chain
    • client establishes a connection with peer nodes
    • operator gets selected to a new keep

Sortition Pool Authorization

  • [x] Start client when sortition pool is not yet created

    • client starts and is monitoring the chain
    • client establishes a connection with peer nodes
    • operator is not selected to a new keep
  • [x] Start client without sortition pool authorization in KeepBonding contract

    • client starts and is monitoring the chain
    • client establishes a connection with peer nodes
    • operator is not selected to a new keep
  • [x] Authorize sortition pool in KeepBonding contract for operator

    • client is working and is monitoring the chain
    • client establishes a connection with peer nodes
    • operator gets selected to a new keep

Stake Initialization Period

Execute these tests in a setup where group size is the same as number of running nodes.

  • [x] Start client just after delegating a stake to the operator, so stake initialization period has not passed yet.

    • client starts and is monitoring the chain
    • client establishes a connection with peer nodes
    • operator is not selected to a new keep
    • open keep fails
  • [x] Request new keep after stake initialization period (10 blocks) has passed

    • operator is selected to a new keep

nkuba avatar Apr 10 '20 09:04 nkuba

Gas costs for opening new keep and signing. Keep of size 3 with threshold 3.

Operation Gas Used ETH TX
openNewKeep* 1 006 341 0.0050317 tx
submitPublicKey - operator 1 111 818 0.0005591 tx
submitPublicKey - operator 2 111 045 0.0005552 tx
submitPublicKey - operator 3 173 527 0.0008676 tx
sign 88 283 0.0004414 tx
submitSignature - operator 1 31 944 0.0001597 tx
submitSignature - operator 2 29 219 0.0001461 tx
submitSignature - operator 3 29 365 0.0001468 tx

Calculations assumed Gas Price = 5 gwei (https://ethgasstation.info/).

* cost doesn't include the random beacon fee.

nkuba avatar Apr 15 '20 13:04 nkuba