LiskArchive/lips

LIP 0047: check array length in command schema

sergeyshemyakov opened this issue · 0 comments

Motivation

In update authority command, the newValidators is an array of new validators. Command verification checks that its length is at least 1 and at most MAX_NUM_VALIDATORS, however this check should be moved into command schema as a schema property.

Current Specifications

Code in verify for the update authority command:

    if length(newValidators) < 1 or length(newValidators) > MAX_NUM_VALIDATORS:
        raise Exception()

Proposed Specifications

Addition to the command parameter schema:

"minLength": 1,
"maxLength": MAX_NUM_VALIDATORS,

Affected LIPs

0047