near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 615 forks source link

Save recorded storage proof sizes in the database #11102

Open jancionear opened 4 months ago

jancionear commented 4 months ago

During chunk application we calculate how much storage proof was recorded for each receipt and chunk, along with the upper bounds. (code).

These values are already exposed as metrics, but it'd be nice to also save them to the database. Metrics come and go along with the nodes, when a node is destroyed we lose continuity of its metrics.

Having these values in the archival databases would give us a solid source of data for analysis. We would be able to go over the past year and see how much storage proof was generated by receipts, which would allow us to confidently choose good values for the storage proof limits.

We could add it to the ExecutionOutcome struct, along with gas_burnt, compute_usage, etc.

Not necessary for stateless validation MVP, but would be nice to have.

andrei-near commented 3 months ago

How much storage will these proofs consume given current network load? Archival DB is without this already pretty large

jancionear commented 3 months ago

I'd like to save just the size of the proof, which would be a single u64 per transaction/receipt.