filecoin-saturn / L2-node

Saturn L2 Node implementation in Golang
MIT License
35 stars 9 forks source link

Clarification about MAX_L2_DISK_SPACE #43

Open juliangruber opened 2 years ago

juliangruber commented 2 years ago
  1. MAX_L2_DISK_SPACE MAX_L2_DISK_SPACE is the environment variable that determines the maximum disk space the L2 node can use to store cached CAR files. If this env variable is not configured, it defaults to 200GiB. Note: The configured value should be greater than or equal to 200Gib.

Does the "should" mean that the value must be at least 200Gib, or that something might fail with a lower number, or that it will just be inefficient?

bajtos commented 2 years ago

What is the unit? When I set MAX_L2_DISK_SPACE=200, does it mean 200GiB?

gruns commented 2 years ago

What is the unit?

do you mean gibibyte (2**30) vs gigabyte (10**9)?

if so, storage space, software side, is always gibibytes. eg as reported by linux, windows, etc. we should use gibibytes, too

The configured value should be greater than or equal to 200Gib.

zooming out: where did 200GB here come from? this minimum should be much lower. we want to allow l2s, which will include user laptops and desktops, to be able to participate with less than 200GB of free space available

many production laptops have 256GB of storage. for example the default, latest m1 mac only has 256GB

if 200GB is the minimum l2 cache size, none of these machines can contribute

as for what that minimum should be instead? my gut really says it should be very low. 2GB? 10GB? why? because we can be clear that

we want to cast as wide a net as possible

juliangruber commented 2 years ago

do you mean gibibyte (230) vs gigabyte (109)?

if so, storage space, software side, is always gibibytes. eg as reported by linux, windows, etc. we should use gibibytes, too

I was wondering about this too, and thought it could be in Bytes. Shall we document that it's in Gib?

zooming out: where did 200GB here come from?

Very good that you ask this, I didn't realize this value was so high. I'm quite sure the majority of users don't have 200Gib to spare, especially on laptops. Can L2 work efficiently with less?

Intuitively I would also go for something around 2-10GB as the default

juliangruber commented 2 years ago

cc @aarshkshah1992

aarshkshah1992 commented 2 years ago

Hi, this is in Gib. This default is a random default for now. I am not sure what a meaningful default would be here ? I guess we can also not ship with any default and ask users to configure the allocated space the first time they start Station ?

juliangruber commented 2 years ago

Cool, can we document the unit in readme and help text?

I think for the CLI it could make sense not to have a default, or it could default to no limit? 🤔 Don't worry about the Station perspective, as long as we know that we're free to choose any limit basically we're good to go

gruns commented 2 years ago

I think for the CLI it could make sense not to have a default, or it could default to no limit? 🤔

default limit should exist for the cli

if i own a VPS, download the l2, and run it to earn FIL, i dont want it filling up my VPS hard drive until the machine crashes unless i know to set some --cache-size flag. by default, i just want it to run so i can monetize my VPS, not sabotage my VPS from within 😊

best default: use half of available storage space, adjusted dynamically. like chrome easiest to implement first default: use 10GB max

Don't worry about the Station perspective, as long as we know that we're free to choose any limit basically we're good to go

i vote same defaults as above

ideal: half of available storage, adjusted dynamically easiest to implement first default: 10GB

substitute 10GB with some flat, constant default above if more appropriate. 20GB, 25GB, w/e