ethereum / trin

An Ethereum portal client: a json-rpc server with nearly instant sync, and low CPU & storage usage
365 stars 113 forks source link

fix(storage): skip error log if storage config is 0 #1300

Closed njgheorghita closed 4 months ago

njgheorghita commented 4 months ago

What was wrong?

If storage capacity is set to 0, you get a whole lot of these ERROR warnings, which also sets the data_radius to MAX incorrectly.

How was it fixed?

Skip pruning if storage config is set to 0

To-Do

njgheorghita commented 4 months ago

Actually, not sure yet if this is the best way to solve this...

morph-dev commented 4 months ago

Probably the correct way would be to set radius to zero during init. I can add that logic to my PR #1295 that is already refactoring pruning.

Btw, what is the error that you are seeing? "Farthest not found!" or "Pruning requested but we are below target capacity" or both or something else?

morph-dev commented 4 months ago

Added logic to #1295. It will also make sure to empty the db (prune everything) at the startup.

njgheorghita commented 4 months ago

@morph-dev it's the Farthest not found! error, also if you check the scatter plot on glados, you can see that the bridge nodes are being incorrectly set to a radius of 100. But, imo it seems that probably the correct way would be to set radius to zero during init. is the way to go and should solve these issues. Closing this pr in favor of #1295