Proposed testing lang spec

A test looks like the following:

100V,8E,32S,8M: 0-5*A, 0-5AB, 2-7AC [2]6-7AC, 0-4CD,, [=6] 0-4DE 5-7AB: E**

This parses as follows:

  • Insert 100 validators into the first validator set. The EPOCH_LENGTH is 8. SHARD_COUNT is 32. The MIN_COMMITTEE_SIZE is 8.
  • In slot 1, validators 0-5 of the validator set of slot 1 vote on A, a child of the genesis (*)
  • In slot 2, validators 0-5 of the validator set of slot 2 vote on B, a child of A
  • In slot 3, validators 2-7 of the validator set of slot 3 vote on C, a child of A, and validators 6-7 from the validator set of slot 2 do the same
  • In slot 4, validators 0-4 of the validator set of slot 4 vote on D, a child of C
  • Nothing happens in slot 5
  • In slot 6, validators 0-4 of the validator set of slot 6 vote on E, a child of D, and validators 5-7 of the validator set of slot 6 vote on the same block B defined above. By the way, this slot actually is slot 6, and the interpreter should throw an exception if it’s not.

It is assumed that if a vote is made during slot n, it is included into all blocks created after slot n.

After doing this, the head is E, the last justified block is the genesis, and the last finalized block is the genesis.

Testing lang implementations should allow the last section of the test to be left out, in which case the test would run, and the implementation would output what it thinks is the correct result, and if desired a diagram of the blockchain structure (that looks something like https://vitalik.ca/files/RPJ.png).

Select a repo