Update a committee with a transaction.
(update-committee-with-transaction trans commtt all-vals) → new-commtt
There are three kinds of transactions: bonding, unbonding, and other. A bonding transaction adds the validator address to the committee; there is no change if the validator is already in the committee. An unbonding transaction removes the validator address from the committee (except in a case explained below); there is no change if the validator is not in the committee. The other kind of transaction leaves the committee unchanged.
In order to maintain the non-emptiness of the committee, attempting to remove the only member of the committee does not actually remove it. An implementation of AleoBFT may require larger minimal committees, but for the purposes of our model, it suffices for the committee to be never empty. The protocol works, although in a degenerate way, with just one validator.
It is an interesting question whether an AleoBFT implementation
should have mechanisms in place to guarantee minimal committee sizes.
If it does, our model of unbonding captures a form of that.
If it does not, which is plausible since validators
should be generally free to bond and unbond as they want,
then the whole network could be considered to fail
if all validators unbond and there is nobody to run the network.
If that is the case, our model of unbonding is still adequate to capture
the situation in which the whole network has not failed;
as mentioned above, the unbonding transaction that does not unbond
can be simply regarded as if it were an
In order to maintain the fact that
the committee is a subset of all the validators in the system,
we pass to this function an input
We prove that, if the old committee's members are in
Function:
(defun update-committee-with-transaction (trans commtt all-vals) (declare (xargs :guard (and (transactionp trans) (committeep commtt) (address-setp all-vals)))) (let ((__function__ 'update-committee-with-transaction)) (declare (ignorable __function__)) (transaction-case trans :bond (b* ((addresses (committee->addresses commtt)) (new-addresses (insert trans.validator addresses))) (if (in trans.validator (address-set-fix all-vals)) (change-committee commtt :addresses new-addresses) (committee-fix commtt))) :unbond (b* ((addresses (committee->addresses commtt)) (new-addresses (delete trans.validator addresses))) (if (emptyp new-addresses) (committee-fix commtt) (change-committee commtt :addresses new-addresses))) :other (committee-fix commtt))))
Theorem:
(defthm committeep-of-update-committee-with-transaction (b* ((new-commtt (update-committee-with-transaction trans commtt all-vals))) (committeep new-commtt)) :rule-classes :rewrite)
Theorem:
(defthm update-committee-with-transactions-subset-all-vals (implies (and (address-setp all-vals) (subset (committee-members commtt) all-vals)) (b* ((?new-commtt (update-committee-with-transaction trans commtt all-vals))) (subset (committee-members new-commtt) all-vals))))
Theorem:
(defthm update-committee-with-transaction-of-transaction-fix-trans (equal (update-committee-with-transaction (transaction-fix trans) commtt all-vals) (update-committee-with-transaction trans commtt all-vals)))
Theorem:
(defthm update-committee-with-transaction-transaction-equiv-congruence-on-trans (implies (transaction-equiv trans trans-equiv) (equal (update-committee-with-transaction trans commtt all-vals) (update-committee-with-transaction trans-equiv commtt all-vals))) :rule-classes :congruence)
Theorem:
(defthm update-committee-with-transaction-of-committee-fix-commtt (equal (update-committee-with-transaction trans (committee-fix commtt) all-vals) (update-committee-with-transaction trans commtt all-vals)))
Theorem:
(defthm update-committee-with-transaction-committee-equiv-congruence-on-commtt (implies (committee-equiv commtt commtt-equiv) (equal (update-committee-with-transaction trans commtt all-vals) (update-committee-with-transaction trans commtt-equiv all-vals))) :rule-classes :congruence)
Theorem:
(defthm update-committee-with-transaction-of-address-set-fix-all-vals (equal (update-committee-with-transaction trans commtt (address-set-fix all-vals)) (update-committee-with-transaction trans commtt all-vals)))
Theorem:
(defthm update-committee-with-transaction-address-set-equiv-congruence-on-all-vals (implies (address-set-equiv all-vals all-vals-equiv) (equal (update-committee-with-transaction trans commtt all-vals) (update-committee-with-transaction trans commtt all-vals-equiv))) :rule-classes :congruence)