celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

refactor(params): Moving params to nodebuilder and adding config

Open distractedm1nd opened this issue 2 years ago • 6 comments

Closes #1076

Reviewers: Please test for yourself to verify it still works.

@Wondertan what do you think of this approach?

In the style of #1161

distractedm1nd avatar Sep 26 '22 13:09 distractedm1nd

These params could honestly even live inside of p2p module bc they are related to p2p.

renaynay avatar Sep 29 '22 12:09 renaynay

I wouldnt be opposed to that, I originally had them in their own package - @Wondertan what do you think?

distractedm1nd avatar Sep 29 '22 12:09 distractedm1nd

I agree that p2p is fine also, so let's do this. This might also require changes in the flag names

Wondertan avatar Sep 30 '22 10:09 Wondertan

Some issues came up during rebasing, fixing

distractedm1nd avatar Oct 04 '22 07:10 distractedm1nd

@distractedm1nd, conflicts

Wondertan avatar Oct 12 '22 13:10 Wondertan

i literally rebased this morning 🥲

distractedm1nd avatar Oct 12 '22 13:10 distractedm1nd

Requesting changes because the solution for #1189 in this PR does not fix the core problem of #1189: our libs/pkgs should not import node and its modules, as it is a logical cyclic dependency(node depends on header and wise-versa) and prevents usage of header pkg without importing the node.

The alternative is passing the network name as a protocol prefix string which is better be optional. Our protocols will be used in other projects. Specifically, the header pkg and there is already ongoing work in https://github.com/celestiaorg/go-header

Let's revert the change and solve the #1189 issue in the subsequent PR, as it is out of scope. It's fine that the main will be broken for some time for Mamaki.

@Wondertan as long as celestia-node requires header-ex and fraud-ex to contain appended chainIDs, I'm fine with this approach.

renaynay avatar Oct 19 '22 09:10 renaynay

Codecov Report

Merging #1168 (046c992) into main (d239616) will increase coverage by 0.27%. The diff coverage is 49.01%.

@@            Coverage Diff             @@
##             main    #1168      +/-   ##
==========================================
+ Coverage   55.86%   56.14%   +0.27%     
==========================================
  Files         160      160              
  Lines        9725     9932     +207     
==========================================
+ Hits         5433     5576     +143     
- Misses       3756     3802      +46     
- Partials      536      554      +18     
Impacted Files Coverage Δ
cmd/celestia/full.go 36.76% <0.00%> (-3.56%) :arrow_down:
cmd/celestia/light.go 36.23% <0.00%> (-3.46%) :arrow_down:
cmd/start.go 29.26% <0.00%> (ø)
fraud/service.go 75.00% <ø> (ø)
header/p2p/exchange.go 68.38% <ø> (ø)
nodebuilder/init.go 63.51% <0.00%> (ø)
nodebuilder/p2p/bitswap.go 87.50% <ø> (ø)
nodebuilder/p2p/bootstrap.go 30.76% <ø> (ø)
nodebuilder/p2p/genesis.go 33.33% <ø> (ø)
nodebuilder/p2p/host.go 80.64% <ø> (ø)
... and 24 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Oct 21 '22 11:10 codecov-commenter