Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Refactor dalc into celestia-node plugin #55

Merged
merged 9 commits into from
Mar 21, 2022
Merged

Conversation

evan-forbes
Copy link
Member

@evan-forbes evan-forbes commented Jan 31, 2022

Description

The dalc needs access to certain celestia-node internals. This PR is using the plugin mechanism introduced in (unmerged) #407 to better integrate with celestia-node, and refactor the dalc's celestia-node usage to fully utilize preexisting components.

This is a short term solution. In the future we will likely use native celestia-node instead of wrapping it here. After connecting this to devnet, I can confirm that this is significantly easier to use than before. The setup is identical to a normal celestia-node setup, with the addtional optimint-server.toml config file added.

closes #51

@evan-forbes evan-forbes marked this pull request as ready for review March 17, 2022 04:19
@evan-forbes
Copy link
Member Author

evan-forbes commented Mar 17, 2022

we are currently experiencing this bug, as we are using the latest version of celestia-node here. We will either need to change to a stable version, or update as soon as this is fixed.

celestiaorg/celestia-node#511

what do we think? wait or downgrade? Everything seems to be working, an error is just thrown

@adlerjohn
Copy link
Member

wait or downgrade?

Depends on the timeline of fixing the mentioned issue. What's the timeline?

Copy link
Member

@tzdybal tzdybal left a comment

Choose a reason for hiding this comment

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

utACK. Looks fine.

@tzdybal
Copy link
Member

tzdybal commented Mar 17, 2022

what do we think? wait or downgrade? Everything seems to be working, an error is just thrown

I would merge this and keep an eye on celestiaorg/celestia-node#511.

Copy link
Collaborator

@jbowen93 jbowen93 left a comment

Choose a reason for hiding this comment

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

The Makefile (build function), docker/Dockerfile, and entrypoint.sh should be updated.

For Makefile.build you need to do go build ./cmd/celestia

entrypoint.sh needs to be changed to if [ "$1" = 'celestia' ]; then on line 5

The Dockerfile needs to copy from /dalc/celestia to /root/celestia on line 17 and line 24 needs to be CMD ["celestia"].

@jbowen93
Copy link
Collaborator

I'm getting the following errors when attempting to run this as a docker container

2022-03-17T22:18:57.385Z	INFO	node	node/init.go:30	Initializing Light Node Store over '/celestia-light'
2022-03-17T22:18:57.386Z	INFO	node	node/init.go:66	Saving config	{"path": "/celestia-light/config.toml"}
2022-03-17T22:18:57.386Z	INFO	dalc/server	server/plugin.go:29	Config already exists	{"path": "/celestia-light/optimint_server.toml"}
2022-03-17T22:18:57.386Z	INFO	node	node/init.go:91	Node Store initialized
len parsed 35 1
2022-03-17T22:18:57.432Z	INFO	badger	v2@v2.2007.4/levels.go:183	All 0 tables opened in 0s

2022-03-17T22:18:57.439Z	ERROR	node/services	services/service.go:112	initializing store failed: protocol not supported
2022-03-17T22:18:57.439Z	INFO	watchdog	go-watchdog@v1.2.0/watermarks.go:16	initialized watermark watchdog policy; watermarks: []; thresholds: [67467048960 80960458752 94453868544 114693983232 121440688128 124814040576 128187393024]
2022-03-17T22:18:57.439Z	INFO	watchdog	go-watchdog@v1.2.0/watchdog.go:471	initialized heap profile capture; threshold: 0.900000; max captures: 10; dir: /celestia-light
2022-03-17T22:18:57.439Z	INFO	header	header/p2p_server.go:37	p2p-server: listening for inbound header requests
2022-03-17T22:18:57.439Z	INFO	node	node/node.go:113	started Light Node
The p2p host is listening on:
*  /ip4/192.167.10.14/tcp/2121/p2p/12D3KooWJSus3RxUQpNWwDH8XoxrwtufttUFbNCnH2ULxdDox2bB
2022-03-17T22:18:57.439Z	ERROR	header	header/sync.go:170	getting trusted head	{"err": "header/store: no chain head"}

it sounds like the header/sync error is expected. Is the ERROR node/services services/service.go:112 initializing store failed: protocol not supported related?

@evan-forbes
Copy link
Member Author

evan-forbes commented Mar 17, 2022

Is the ERROR node/services services/service.go:112 initializing store failed: protocol not supported related?

2022-03-17T18:42:54.199-0500	INFO	badger	v2@v2.2007.4/levels.go:183	All 0 tables opened in 0s

2022-03-17T18:42:54.208-0500	INFO	node/services	services/config.go:36	No trusted peers given, initializing with default bootstrappers as trusted peers
2022-03-17T18:42:54.875-0500	ERROR	node/services	services/service.go:112	initializing store failed: protocol not supported
...

I don't know if that's related or not, but it does occur running the normal celestia-node (latest commit main) on devnet.

While we might want to merge this version to master, considering the current issues, I think we should definitely create a version of the plugin/dalc based on the latest stable release of celestia-node as well. That way we can feel more comfortable pointing potential devs to it, while also having a version that we can test the latest and greatest on.

@evan-forbes evan-forbes merged commit 672719f into main Mar 21, 2022
@evan-forbes evan-forbes deleted the evan/update-celestia-node branch March 21, 2022 21:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.