iov-one / iovns

The IOV Name Service built on cosmos-sdk
Apache License 2.0
11 stars 13 forks source link

split update config and update configurer - Protect the chain from very harmful wrong input #348

Closed BenSim closed 4 years ago

BenSim commented 4 years ago

at the moment, updating config requires the configurer iovnscli query configuration get-config | jq { "configuration": { "configurer": "star1nrnx8mft8mks3l2akduxdjlf8rwqs8r9l36a78", "valid_domain_name": "^[-_a-z0-9]{4,16}$", "valid_accountname": "^[-.a-z0-9]{1,64}$", "valid_uri": "^[-a-z0-9A-Z:]+$", "valid_resource": "^[a-z0-9A-Z]+$", "domain_renew_period": "31557600000000000", "domain_renew_count_max": 2, "domain_grace_period": "2592000000000000", "account_renew_period": "31557600000000000", "account_renew_count_max": 2, "account_grace_period": "2592000000000000", "resources_max": 10, "certificate_size_max": "1024", "certificate_count_max": 5, "metadata_size_max": "1024" } }

if the configurer data is wrong by mistake, then the whole. system is blocked. This is really sensitive and dangerous situation at any domain config update.

I suggest to separate the configurer update as a specific transaction, requiring signing from the old configurer and the new configurer to be sure it is not sent to an address with missing key.

The config-update for domain parameters then update the other parameters which are much less sensitive and can always be updated again if the value is wrong.

davepuchyr commented 4 years ago

The protection you seek is achieved via the update_config.js script.