centrifuge / centrifuge-chain

Centrifuge Chain: the layer-1 blockchain for real-world assets, built on Substrate.
https://centrifuge.io
GNU Lesser General Public License v3.0
184 stars 81 forks source link

Pallet anchors: Evict anchors redesign #988

Open lemunozm opened 2 years ago

lemunozm commented 2 years ago

Description

The current evict_anchor method performs a clean over an unbounded list of elements. Also, the whole evict_anchor process has too much complexity, which can lead to future bugs and reduce its maintainability.

By redesigning this part of the pallet, we could improve both security and maintainability.

How will this affect the code base

What are foreseen obstacles or hurdles to overcome?

lemunozm commented 1 year ago

Currently, pallet-anchors benchmarks don't find some hashes in the benchmarks, increasing the measured weights. This is not a security issue, but we are adding more weight than is needed. We need to take this into account for the redesign