Calculate the committee after a list of blocks.
(committee-after-blocks blocks all-vals) → 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.
The role of the
We show that the committee's members are in
Function:
(defun committee-after-blocks (blocks all-vals) (declare (xargs :guard (and (block-listp blocks) (address-setp all-vals)))) (let ((__function__ 'committee-after-blocks)) (declare (ignorable __function__)) (b* (((when (endp blocks)) (genesis-committee)) (commtt (committee-after-blocks (cdr blocks) all-vals))) (update-committee-with-transaction-list (block->transactions (car blocks)) commtt all-vals))))
Theorem:
(defthm committeep-of-committee-after-blocks (b* ((commtt (committee-after-blocks blocks all-vals))) (committeep commtt)) :rule-classes :rewrite)
Theorem:
(defthm committee-after-blocks-subset-all-vals (implies (and (address-setp all-vals) (subset (committee-members (genesis-committee)) all-vals)) (b* ((?commtt (committee-after-blocks blocks all-vals))) (subset (committee-members commtt) all-vals))))
Theorem:
(defthm committee-after-blocks-of-block-list-fix-blocks (equal (committee-after-blocks (block-list-fix blocks) all-vals) (committee-after-blocks blocks all-vals)))
Theorem:
(defthm committee-after-blocks-block-list-equiv-congruence-on-blocks (implies (block-list-equiv blocks blocks-equiv) (equal (committee-after-blocks blocks all-vals) (committee-after-blocks blocks-equiv all-vals))) :rule-classes :congruence)
Theorem:
(defthm committee-after-blocks-of-address-set-fix-all-vals (equal (committee-after-blocks blocks (address-set-fix all-vals)) (committee-after-blocks blocks all-vals)))
Theorem:
(defthm committee-after-blocks-address-set-equiv-congruence-on-all-vals (implies (address-set-equiv all-vals all-vals-equiv) (equal (committee-after-blocks blocks all-vals) (committee-after-blocks blocks all-vals-equiv))) :rule-classes :congruence)