You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the new miden-node-stress-testing CLI, and in particular running the command miden-node-stress-testing seed-store, we saw that each note takes too much space in the DB (4.5KB). For ~100k notes means ~460.816384 MB. And, in our use case, represented more than 90% of the DB.
How should it be done?
Investigate and improve the notes tables to shrink.
According to Bobbin (#657 (comment)), it should be possible to reduce ~10x the size.
When is this task done?
The task can be considered done when the size of each note in the store is reduced.
Additional context
No response
The text was updated successfully, but these errors were encountered:
By my estimate, all fields in the notes table, except for the merkle_path and details, should required about 72 bytes of storage. merkle_path should be about 0.5KB, and details should be about 2.5KB. This gives us about 3.1KB - so, not sure what else is there to get it to 4.5KB on average - but we should find this out.
For the 3.1KB, optimization opportunities are:
Move details field into a separate table. In this table, don't record the metadata (we already have it in the notes table) and don't store note script separately for every note. Instead, we can have note_scripts table, and store every unique script there. This way, for things like P2ID notes, we should reduce the size of note details from 2.5KB to about 100 bytes.
Use compact representation of Merkle paths. This should cut down storage from 0.5KB to about 200 bytes per path.
All in all, with these optimizations we should be able to go from 3.1KB to about 400 bytes. So, the big question will be is where the 1.4KB (i.e., 4.5 - 3.1) is coming from.
I think we can leave it for the next milestone. One of the tasks, btw, is actually in the miden-crypto repo (specifically, 0xPolygonMiden/crypto#215 for introducing SparseMerklePath struct).
Node's components affected by this task
What should be done?
With the new
miden-node-stress-testing
CLI, and in particular running the commandmiden-node-stress-testing seed-store
, we saw that each note takes too much space in the DB (4.5KB). For ~100k notes means ~460.816384 MB. And, in our use case, represented more than 90% of the DB.How should it be done?
Investigate and improve the notes tables to shrink.
According to Bobbin (#657 (comment)), it should be possible to reduce ~10x the size.
When is this task done?
The task can be considered done when the size of each note in the store is reduced.
Additional context
No response
The text was updated successfully, but these errors were encountered: