Differenciate `add_cert` and `renew_cert`
Currently there is only one call add_cert
that can add a new cert or renew an existing one depending on the state. This as the following consequences:
- a same extrinsic can trigger different events (
CertAdded
andCertRenewed
) which is strange to implement in clients - the benchmark only covers the worst case which is adding a new cert, so the cost of
renew_cert
is overestimated - a user could be trying to achieve an action because of mis-information and actually perform the other
An attack scenario would be: make an user think he already certified us (by manipulating an indexer for instance) and ask for renewing the certification, which lowers the suspicion compared to certifying someone new. Then the user calls add_cert
, but instead of renewing, Duniter adds a new cert. We could prevent this attack scenario by having two different calls that are handeled differently by the clients.