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

feat: start bee node without a connected chain backend #2783

Merged
merged 23 commits into from
Feb 24, 2022
Merged

Conversation

notanatol
Copy link
Contributor

@notanatol notanatol commented Jan 27, 2022

Checklist

  • I have read the coding guide
  • Bee can boot and do handshakes only with the provided transaction hash
  • Bee can retrieve data without a working back-end
  • Add the swap flag to packaging
  • Review flag name and semantics
  • Document the behavior of the bee started with a disabled chain backend (accounting, postage etc)

Description

We want to be able to start a light node with no postage, no overlay verification, no settlements and other chain related functionalities.
This will greatly simplify the onboarding of the Edina person since no blockchain provisioning is needed.

Motivation and context (Optional)

We need to be able to run bee with minimal knowledge/preparation.

https://hackmd.io/5h4BFSDOSPeWnuUd5OR8EA?view

In order to start minimal mode (even from scratch), a transaction must exist at the ETH address that the node started with, and the following configuration parameters must exist in the provided configuration: transaction: (the value of the transaction hash) and block-hash: (which is derived as follows: https://medium.com/@acud/go-ethereum-ethclient-provides-wrong-blockhash-on-xdai-d3da1f25240a)


This change is Reviewable

@notanatol notanatol marked this pull request as draft January 27, 2022 01:15
@notanatol notanatol added the in progress ongoing development , hold out with review label Jan 27, 2022
@notanatol notanatol force-pushed the minimal-mode branch 4 times, most recently from f55db4d to 987f922 Compare February 2, 2022 17:42
@notanatol notanatol marked this pull request as ready for review February 3, 2022 21:18
@notanatol notanatol added ready for review The PR is ready to be reviewed and removed in progress ongoing development , hold out with review labels Feb 3, 2022
cmd/bee/cmd/cmd.go Outdated Show resolved Hide resolved
pkg/node/chain_stub.go Outdated Show resolved Hide resolved
@notanatol
Copy link
Contributor Author

notanatol commented Feb 7, 2022

ENS resolver will work as long as we provide a valid configuration param (eg. resolver_options: "https://cloudflare-eth.com/") without a chain backend.

@mrekucci mrekucci force-pushed the minimal-mode branch 7 times, most recently from da57a9b to daa4882 Compare February 14, 2022 17:12
Copy link
Member

@acud acud left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good and I have some suggestions/questions

cmd/bee/cmd/cmd.go Outdated Show resolved Hide resolved
pkg/debugapi/postage.go Outdated Show resolved Hide resolved
pkg/node/chain_stub.go Outdated Show resolved Hide resolved
pkg/node/chain_stub_test.go Outdated Show resolved Hide resolved
pkg/node/node.go Outdated Show resolved Hide resolved
pkg/node/node.go Outdated Show resolved Hide resolved
pkg/p2p/libp2p/parser.go Outdated Show resolved Hide resolved
pkg/p2p/libp2p/parser.go Outdated Show resolved Hide resolved
pkg/p2p/libp2p/parser.go Outdated Show resolved Hide resolved
@mrekucci mrekucci requested a review from acud February 14, 2022 21:54
Copy link
Contributor

@mrekucci mrekucci left a comment

Choose a reason for hiding this comment

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

Reviewed 8 of 15 files at r1.
Reviewable status: 0 of 16 files reviewed, 10 unresolved discussions (waiting on @acud, @aloknerurkar, @istae, @mrekucci, @notanatol, and @ralph-pichler)


pkg/node/chain_stub_test.go, line 14 at r4 (raw file):

Previously, acud (acud) wrote…

any particular reason why these compile-time checks are in a _test file?

This is a test of whether a struct implements a certain interface, thus it belongs to tests.

@mrekucci mrekucci self-requested a review February 14, 2022 21:54
Copy link
Contributor Author

@notanatol notanatol left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 16 files reviewed, 10 unresolved discussions (waiting on @acud, @aloknerurkar, @istae, @mrekucci, @notanatol, and @ralph-pichler)


pkg/p2p/libp2p/parser.go, line 29 at r4 (raw file):

Previously, acud (acud) wrote…

not sure why this is needed? can't we somehow tell libp2p to initialize the handshake service in a way that just never verifies the overlay? or in a sense the handshake service would just plug a different noop parseAck function that would always approve the ack?

this was merely the solution with the smallest footprint changes wise

the alternative - which is passing down a boolean flag to skip verification seems more cumbersome, but we can entertain it

Copy link
Member

@acud acud left a comment

Choose a reason for hiding this comment

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

:lgtm: pending rebase

Reviewed 1 of 1 files at r9, 1 of 1 files at r10, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @aloknerurkar, @istae, @mrekucci, and @ralph-pichler)

Copy link
Contributor

@mrekucci mrekucci left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 16 files at r1, 2 of 23 files at r11, 24 of 24 files at r13, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @aloknerurkar, @istae, and @ralph-pichler)


pkg/debugapi/postage.go, line 195 at r13 (raw file):

	}

	if resp.Stamps == nil {

Not necessary.


pkg/node/node.go, line 1040 at r13 (raw file):

}

func isChainEnabled(o *Options, logger logging.Logger) bool {

Consider attaching it to the Options struct.

Copy link
Contributor Author

@notanatol notanatol left a comment

Choose a reason for hiding this comment

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

Reviewable status: 26 of 27 files reviewed, 3 unresolved discussions (waiting on @aloknerurkar, @istae, @mrekucci, and @ralph-pichler)


pkg/debugapi/postage.go, line 195 at r13 (raw file):

Previously, mrekucci wrote…

Not necessary.

removed

@notanatol notanatol merged commit 66f0799 into master Feb 24, 2022
@notanatol notanatol deleted the minimal-mode branch February 24, 2022 00:09
@aloknerurkar aloknerurkar added this to the 1.5.0 milestone Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull-request ready for review The PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants