Calculate the committee after a list of blocks.
(committee-after-blocks blocks) → commtt
The list of blocks is the blockchain (of a validator), or a prefix of that blockchain (more on this later). We calculate the committee that results from updating the genesis committee with all the transactions in the blocks. Since, as explained in validator-state, the blockchain goes from right to left (i.e. the leftmost block is the newest and the rightmost block is the oldest), we update the genesis committee from right to left to arrive at the resulting committee.
Function:
(defun committee-after-blocks (blocks) (declare (xargs :guard (block-listp blocks))) (let ((__function__ 'committee-after-blocks)) (declare (ignorable __function__)) (b* (((when (endp blocks)) (genesis-committee)) (commtt (committee-after-blocks (cdr blocks)))) (update-committee-with-transaction-list (block->transactions (car blocks)) commtt))))
Theorem:
(defthm committeep-of-committee-after-blocks (b* ((commtt (committee-after-blocks blocks))) (committeep commtt)) :rule-classes :rewrite)
Theorem:
(defthm committee-after-blocks-of-block-list-fix-blocks (equal (committee-after-blocks (block-list-fix blocks)) (committee-after-blocks blocks)))
Theorem:
(defthm committee-after-blocks-block-list-equiv-congruence-on-blocks (implies (block-list-equiv blocks blocks-equiv) (equal (committee-after-blocks blocks) (committee-after-blocks blocks-equiv))) :rule-classes :congruence)