Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lotus Light mode #40

Closed
wants to merge 1 commit into from
Closed

Lotus Light mode #40

wants to merge 1 commit into from

Conversation

magik6k
Copy link

@magik6k magik6k commented Feb 17, 2021

No description provided.

Copy link

@arajasek arajasek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me! Should be easy-ish to implement, and I definitely see demand for it.

Added some sentences.

#### Background & intent

Currently, running lotus nodes requires dedicating lots of resources. Users should
be able to talk to the blockchain without validating it fully

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
be able to talk to the blockchain without validating it fully
be able to talk to the blockchain without validating it fully.

Lotus would be much easier to run for non-miner users

#### Leverage
_How much would nailing this project improve our knowledge and ability to execute future projects?_

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_How much would nailing this project improve our knowledge and ability to execute future projects?_
The current difficulty of running a Lotus node is a frequent painpoint for developers and users. The typical solution is to abstract Lotus away behind some service, but we stand to gain a lot from also lowering the barrier to entry to the Filecoin network itself. This would reduce the space reqs needed to be connected to the network (no more running out of disk space every few weeks), the time to get started (no more gigabytes of data to download), and the computing power needed (no more hearing your laptop make angry sounds when it runs Lotus).

-->

#### Confidence
_How sure are we that this impact would be realized? Label from [this scale](https://medium.com/@nimay/inside-product-introduction-to-feature-priority-using-ice-impact-confidence-ease-and-gist-5180434e5b15)_.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_How sure are we that this impact would be realized? Label from [this scale](https://medium.com/@nimay/inside-product-introduction-to-feature-priority-using-ice-impact-confidence-ease-and-gist-5180434e5b15)_.
- Medium impact: It doesn't transform the user experience, but it is at the very heart of interacting with the network (running Lotus)
- High confidence: We know that the difficulty of running Lotus is a barrier to entry for many
- Medium ease: It's a non-trivial amount of work, but it is low-risk -- the probability that we run into some insurmountable challenge is basically zero, since most obstacles will just need some refactoring to be overcome.

gigabytes of data, and having to dedicate significant resources for the node

#### What does success look like?
_Success means impact. How will we know we did the right thing?_
Copy link

@arajasek arajasek Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_Success means impact. How will we know we did the right thing?_
- The number of people in our own team running Lotus increases thanks to the new light mode
- Partners report fewer issues with getting started with the network

Describe any choices and uncertainty in this scope estimate. (E.g. Uncertainty in the scope until design work is complete, low uncertainty in execution thereafter.)
-->

Medium

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on "appropriate skills" this might even be a Small tbh.

-->

#### Counterpoints & pre-mortem
* Even basic validation of the chain, pulling the state over Bitswap might still be very resource intensive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We should be able to pull actor state on-demand. Although we're likely going to need part of the power table state at every epoch. Without graphsync, this could be slow. It may be faster to just keep the entire power table in-sync assuming it's reasonably small.
  • We can re-use the same session for all requests. That'll let us ask the same peers instead of broadcasting.
  • We don't need messages.

Really, we want a pretty complex graphsync selector.

@rvagg
Copy link
Contributor

rvagg commented Feb 18, 2021

This depends on having a solid way to IPLD GC state doesn't it? I know @ribasushi has been doing reference counting with his custom block store (or something?) that might be useful for that. Or is there already an existing way to efficiently discard blocks not part of the current state tree without walking the whole lot every time a you get a new block and need to discard block+X's state?

@Stebalien
Copy link
Member

This depends on having a solid way to IPLD GC state doesn't it?

Not for the initial version. The dataset will grow, but not terribly fast.

Or is there already an existing way to efficiently discard blocks not part of the current state tree without walking the whole lot every time a you get a new block and need to discard block+X's state?

A hot/cold store (riba's?) would cover this.

  1. Read from hot and cold.
  2. When a block is read from cold, move to hot.
  3. Every 24 hours, delete the cold store and make the hot store cold.

Although, in this case, there's a much easier approach: delete everything. That is, whenever we hit some storage limit, we can just delete everything and re-download anything we actually need.

@magik6k
Copy link
Author

magik6k commented Feb 23, 2021

Worth noting - I have a hack-weekend POC of this idea, which works really well with caught-up mode, and within-finality sync, but is still computing state in some places, and is fetching all messages from the network when syncing (changing that requires some deeper changes in the syncer code).

The POC patch is really short - https://gist.github.com/magik6k/4d0603dcaf266b300b69af89b0599235, but it proves that it's really feasible, even without graphsync

@raulk
Copy link
Contributor

raulk commented Feb 23, 2021

A hot/cold store (riba's?) would cover this.

@Stebalien Are you referring to the splitstore developed by @vyzo?

@raulk
Copy link
Contributor

raulk commented Feb 23, 2021

All in this thread: please review the splitstore PR I linked above. It would probably benefit from package-level godocs, but it already does what seems to be needed (or at least enough, such that it can potentially be extended to accommodate further requirements).

@raulk
Copy link
Contributor

raulk commented Feb 23, 2021

A hot/cold store (riba's?) would cover this.

  1. Read from hot and cold.
  2. When a block is read from cold, move to hot.
  3. Every 24 hours, delete the cold store and make the hot store cold.

This is a read-through cache with a 24h window expiry. It doesn't solve:

efficiently discard blocks not part of the current state tree

(assuming this is what's actually needed)

@Stebalien
Copy link
Member

This is a read-through cache with a 24h window expiry. It doesn't solve:

You're right, they're two different things.

efficiently discard blocks not part of the current state tree

Right. But we don't really need to keep that. Really, we don't need to keep anything. It would just be nice to keep blocks we've accessed within the last 24 hours because we're likely to use them again.

@Stebalien Are you referring to the splitstore developed by @vyzo?

I probably was but that doesn't help here (as far as I can tell). From what I can tell, that just makes accessing the "hot" store faster.

Copy link
Contributor

@BigLep BigLep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for posting! The proposal makes sense. A couple of questions:

  1. Have any customers been asking for this?
  2. What do other Blockchains support (e.g., Bitcoin, Ethereum)? I'm wondering what the state-of-the-art is here and what customers expect.


Authors: @magik6k

Initial PR: TBD <!-- Reference the PR first proposing this document. Oooh, self-reference! -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Initial PR: TBD <!-- Reference the PR first proposing this document. Oooh, self-reference! -->
Initial PR: https://github.com/protocol/web3-dev-team/pull/40

@mikeal mikeal added the ease:low Ease rating is 5 or below. label Mar 24, 2021
@momack2 momack2 added the Bedrock Filecoin Golden Path label Mar 31, 2021
@BigLep
Copy link
Contributor

BigLep commented May 26, 2021

Per 2021-05-26 EM discussion, we're closing for now and will reevaluate the need here after miner-runtime rearchitecture: #98

@BigLep BigLep closed this May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bedrock Filecoin Golden Path ease:low Ease rating is 5 or below.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants