Open morph-dev opened 3 weeks ago
My opinion is that in the long term, we should have:
mode
flag for selecting the mode(s) we are operating in (and we will enable all required subnetworks) (option 2. above)Both of these require some amount of refactoring (to be investigated how much), and I would rather have something that works better than the current approach and do more improvements in the future. So in the short term, we could:
portal-subnetworks
as is, but check that flags are configured correctly (option 1. above)
mb
flag with a respective flag for each subnetwork: history-mb
and state-mb
(and beacon-mb
if it makes sense) (option 1. above)
Configuring trin to run multiple subnetworks is currently not ideal for a couple of reasons:
Subnetwork selection
We have a flag for enabling subnetworks (
portal-subnetworks
), but not all combination should be valid.Once #1377 is merged, state network won't be able to run without history network. In a few months, history network won't be able to run without beacon network.
Potential solutions:
mode
) that enables all required subnetworkshistory
(beacon+history) andstate
(beacon+history+state)Side note: Validating state network requires having history network, but we don't need to store any history data ourself. However, I don't think we want to go this path (see section below).
Storage
We have only one flag (
mb
) for configuring the storage capacity. Currently, it applies on all subnetworks separately. Meaning, if user enables all 3 networks, and specifies 1GB, we will actually set capacity of 1GB per subnetwork (meaning 3GB in total).In the context of beacon network, my understanding is that storage capacity doesn't make sense. Firstly, it uses little storage to begin with (compare to history and state), and secondly it will never prune or do anything to stay under capacity, no matter how small it is. @ogenev is this correct?
Potential solutions:
mode
from section above (if we agree on that approach)history
andstate
mode and B: onlystate
mode. In both scenarios, we would run all 3 subnetworks, but more storage would be allocated for state subnetwork in scenario B.Side note: We currently estimate how much storage we are using (by adding lengths of content-id, content-key and content-value) which isn't totally accurate (we underestimate). This estimate is used when we decide whether to prune or not, resulting in us using more than specified with the capacity. The error is not too big (percentage wise), but I believe we can do better.
Bootnodes
Current flags only allow selecting one set of
bootnodes
, that is used for all subnetworks. This might be ok, as long as that set contains at least some bootnodes for every selected subnetwork.