LiskArchive/lips

LIP 0047: check that `totalWeight` is non-zero

sergeyshemyakov opened this issue · 0 comments

Motivation

Update authority command from LIP 0047 does not have an explicit check that totalWeight of new authorities is greater than zero. This condition is guaranteed by the check

    if trsParams.threshold < totalWeight // 3 + 1 or trsParams.threshold > totalWeight:
        raise Exception()

however it should be made more explicitly.

Current Specifications

Change this part of verify:

    if totalWeight > MAX_UINT64:
        raise Exception()

Proposed Specifications

Proposed change:

    if totalWeight == 0 or totalWeight > MAX_UINT64:
        raise Exception()

Affected LIPs

0047