Repository: celestiaorg/celestia-node
Pull request #267 (2021-12-06 16:11:56)

changelog: add v0.1.0
Adds changelog of features and quick description of the first-ever release of celestia-node.


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7bc32c57..edbe60bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,21 +1,59 @@
-# Unreleased Changes
+# CHANGELOG
 
-## vX.Y.Z
+## v0.1.0 | 2021-11-3
+This is the first `celestia-node` release. The release constitutes the foundation for the data availability "halo" network that will complement the core consensus network.
 
-Month, DD, YYYY
+Mainly, we introduce 3 packages:
+* `service/header` - defines everything related to syncing, exchanging, and storing chain headers. 
+* `service/share` - defines everything related to sampling and requesting `Shares` (chunks of erasure-coded block data) from the network
+* `node` - defines the Node singleton with its assembly, essentially gluing all the bits together.
 
-### BREAKING CHANGES
-
-- [go package] (Link to PR) Description @username
+For further information regarding the architecture and features introduced in this release, refer to the [devnet ADR](https://github.com/celestiaorg/celestia-node/blob/main/docs/adr/adr-001-predevnet-celestia-node.md).
 
 ### FEATURES
-
-- [go package] (Link to PR) Description @username
-
-### IMPROVEMENTS
-
-- [go package] (Link to PR) Description @username
-
-### BUG FIXES
-
-- [go package] (Link to PR) Description @username
+- [das: Log out square width after sampling #254](https://github.com/celestiaorg/celestia-node/pull/254) [@Wondertan](https://github.com/Wondertan)
+- [das: log time it takes to complete as sampling routine for a header #238](https://github.com/celestiaorg/celestia-node/pull/238) [@renaynay](https://github.com/renaynay)
+- [node/p2p: Deduplicate PubSub msgs #239](https://github.com/celestiaorg/celestia-node/pull/239) [@Wondertan](https://github.com/Wondertan)
+- [service/header: more descriptive err log for append in store.go #231](https://github.com/celestiaorg/celestia-node/pull/231) [@renaynay](https://github.com/renaynay)
+- [cmd, service/header: rename genesis to trustedHash to avoid confusion, extract flags to common var for re-use #229](https://github.com/celestiaorg/celestia-node/pull/229) [@renaynay](https://github.com/renaynay)
+- [service/header: Verify hash matches header retrieved in RequestByHash() #224](https://github.com/celestiaorg/celestia-node/pull/224) [@renaynay](https://github.com/renaynay)
+- [Genesis: The PR to make testnet happen! #221](https://github.com/celestiaorg/celestia-node/pull/221) [@Wondertan](https://github.com/Wondertan)
+- [feat(cmd): allow setting log level for start comamnd #217](https://github.com/celestiaorg/celestia-node/pull/217) [@Wondertan](https://github.com/Wondertan)
+- [service/header: Header Exchange implemented over Core Node #216](https://github.com/celestiaorg/celestia-node/pull/216) [@renaynay](https://github.com/renaynay)
+- [Persist generated key to keystore and reuse existing key if present #213](https://github.com/celestiaorg/celestia-node/pull/216) [@jbowen93](https://github.com/jbowen93)
+- [service/header: implement basic syncer #212](https://github.com/celestiaorg/celestia-node/pull/212) [@Wondertan](https://github.com/Wondertan)
+- [node: add p2p multiaddr log #204](https://github.com/celestiaorg/celestia-node/pull/204) [@bidon15](https://github.com/bidon15)
+- [service/block, service/header: BlockService broadcasts generated ExtendedHeaders to network #203](https://github.com/celestiaorg/celestia-node/pull/203) [@renaynay](https://github.com/renaynay)
+- [cmd: add flag to start node on remote core #196](https://github.com/celestiaorg/celestia-node/pull/196) [@vgonkivs](https://github.com/vgonkivs)
+- [service/header: Store implementation #195](https://github.com/celestiaorg/celestia-node/pull/195) [@Wondertan](https://github.com/Wondertan)
+- [service/header: Implement HeaderExchange #188](https://github.com/celestiaorg/celestia-node/pull/188) [@renaynay](https://github.com/renaynay)
+- [das: implement DASer #177](https://github.com/celestiaorg/celestia-node/pull/177) [@Wondertan](https://github.com/Wondertan)
+- [share: Availability interface and implementation #171](https://github.com/celestiaorg/celestia-node/pull/171) [@Wondertan](https://github.com/Wondertan)
+- [service/share, ipld: adds ability to retrieve shares by namespace ID #170](https://github.com/celestiaorg/celestia-node/pull/170) [@renaynay](https://github.com/renaynay)
+- [service/share: Service interface and basic implementation for GetShare #167](https://github.com/celestiaorg/celestia-node/pull/167) [@Wondertan](https://github.com/Wondertan)
+- [service/block: add Commit from current block in ExtendedHeader #165](https://github.com/celestiaorg/celestia-node/pull/165) [@renaynay](https://github.com/renaynay)
+- [service/share, ipld: adds ability to retrieve shares by namespace ID #160](https://github.com/celestiaorg/celestia-node/pull/160) [@renaynay](https://github.com/renaynay)
+- [Add version command #159](https://github.com/celestiaorg/celestia-node/pull/159) [@orlandorode97](https://github.com/orlandorode97)
+- [node: start and stop block service by notification from lifecycle#158](https://github.com/celestiaorg/celestia-node/pull/158) [@vgonkivs](https://github.com/vgonkivs)
+- [service/header: extension of ExtendedHeader and protobuf serialization #153](https://github.com/celestiaorg/celestia-node/pull/153) [@Wondertan](https://github.com/Wondertan)
+- [service/header: Implement basic header Service structure and interfaces #148](https://github.com/celestiaorg/celestia-node/pull/148) [@renaynay](https://github.com/renaynay)
+- [node: add cache for blockstore #136](https://github.com/celestiaorg/celestia-node/pull/136) [@vgonkivs](https://github.com/vgonkivs)
+- [MAKEFILE: make build #133](https://github.com/celestiaorg/celestia-node/pull/133) [@renaynay](https://github.com/renaynay)
+- [ipld: adding IPLD package to provide helpers for dealing with IPLD-based data storage #110](https://github.com/celestiaorg/celestia-node/pull/110) [@renaynay](https://github.com/renaynay)
+- [feat(node): unified node constructor #104](https://github.com/celestiaorg/celestia-node/pull/104) [@Wondertan](https://github.com/Wondertan)
+- [cmd: main function, full and light commands with subcommands #97](https://github.com/celestiaorg/celestia-node/pull/97) [@Wondertan](https://github.com/Wondertan)
+- [service/block: add basic encoding validation in BlockService #96](https://github.com/celestiaorg/celestia-node/pull/96) [@renaynay](https://github.com/renaynay)
+- [node: provide DAGService #95](https://github.com/celestiaorg/celestia-node/pull/95) [@Wondertan](https://github.com/Wondertan)
+- [node: use Repository on the Node and slightly improve testing utilites #94](https://github.com/celestiaorg/celestia-node/pull/94) [@Wondertan](https://github.com/Wondertan)
+- [service/header, service/block: Implements spec'd out types for block and header #93](https://github.com/celestiaorg/celestia-node/pull/93) [@renaynay](https://github.com/renaynay)
+- [node: initialization and Repository #86](https://github.com/celestiaorg/celestia-node/pull/86) [@Wondertan](https://github.com/Wondertan)
+- [core: initialization and Repository #81](https://github.com/celestiaorg/celestia-node/pull/81) [@Wondertan](https://github.com/Wondertan)
+- [service/block: new block listener + erasure coding #77](https://github.com/celestiaorg/celestia-node/pull/77) [@renaynay](https://github.com/renaynay)
+- [node: updates for node.Config #74](https://github.com/celestiaorg/celestia-node/pull/74) [@Wondertan](https://github.com/Wondertan)
+- [libs/fslock: a simple utility to lock directories #71](https://github.com/celestiaorg/celestia-node/pull/71) [@Wondertan](https://github.com/Wondertan)
+- [libs/keystore: introduce Keystore a crypto key manager #66](https://github.com/celestiaorg/celestia-node/pull/66) [@Wondertan](https://github.com/Wondertan)
+- [block: create Fetcher interface #59](https://github.com/celestiaorg/celestia-node/pull/59) [@renaynay](https://github.com/renaynay)
+- [node: add more p2p services and protocols #57](https://github.com/celestiaorg/celestia-node/pull/57) [@Wondertan](https://github.com/Wondertan)
+- [core: package managing Core Node #51](https://github.com/celestiaorg/celestia-node/pull/51) [@Wondertan](https://github.com/Wondertan)
+- [rpc: implement simple RPC client to dial Celestia Core endpoints #48](https://github.com/celestiaorg/celestia-node/pull/48) [@renaynay](https://github.com/renaynay)
+- [node: Implement basic Node #29](https://github.com/celestiaorg/celestia-node/pull/29) [@Wondertan](https://github.com/Wondertan)
\ No newline at end of file
diff --git a/cmd/celestia/full.go b/cmd/celestia/full.go
index ede4b62a..126308b9 100644
--- a/cmd/celestia/full.go
+++ b/cmd/celestia/full.go
@@ -8,13 +8,13 @@ import (
 )
 
 func init() {
+	const repoName = "repository"
 	fullCmd.AddCommand(
-		cmd.Init(repoFlagName, node.Full),
-		cmd.Start(repoFlagName, node.Full),
+		cmd.Init(repoName, node.Full),
+		cmd.Start(repoName, node.Full),
 	)
-	fullCmd.PersistentFlags().StringP(
-		repoFlagName,
-		repoFlagShort,
+	fullCmd.PersistentFlags().StringP(repoName,
+		"r",
 		"~/.celestia-full",
 		"The root/home directory of your Celestial Full Node",
 	)
diff --git a/cmd/celestia/light.go b/cmd/celestia/light.go
index 313474ed..b3c81fc4 100644
--- a/cmd/celestia/light.go
+++ b/cmd/celestia/light.go
@@ -8,13 +8,14 @@ import (
 )
 
 func init() {
+	const repoName = "repository"
 	lightCmd.AddCommand(
-		cmd.Init(repoFlagName, node.Light),
-		cmd.Start(repoFlagName, node.Light),
+		cmd.Init(repoName, node.Light),
+		cmd.Start(repoName, node.Light),
 	)
 	lightCmd.PersistentFlags().StringP(
-		repoFlagName,
-		repoFlagShort,
+		repoName,
+		"r",
 		"~/.celestia-light",
 		"The root/home directory of your Celestial Light Node",
 	)
diff --git a/cmd/celestia/main.go b/cmd/celestia/main.go
index 55e9ebea..73b30765 100644
--- a/cmd/celestia/main.go
+++ b/cmd/celestia/main.go
@@ -6,11 +6,6 @@ import (
 	"github.com/spf13/cobra"
 )
 
-const (
-	repoFlagName  = "repo.path"
-	repoFlagShort = "r"
-)
-
 func init() {
 	rootCmd.AddCommand(
 		fullCmd,
diff --git a/cmd/init.go b/cmd/init.go
index 00e6624a..68afd7ed 100644
--- a/cmd/init.go
+++ b/cmd/init.go
@@ -1,8 +1,6 @@
 package cmd
 
 import (
-	"fmt"
-
 	"github.com/spf13/cobra"
 
 	"github.com/celestiaorg/celestia-node/node"
@@ -10,11 +8,11 @@ import (
 
 // Init constructs a CLI command to initialize Celestia Node of the given type 'tp'.
 // It is meant to be used a subcommand and also receive persistent flag name for repository path.
-func Init(repoFlagName string, tp node.Type) *cobra.Command {
+func Init(repoName string, tp node.Type) *cobra.Command {
 	if !tp.IsValid() {
 		panic("cmd: Init: invalid Node Type")
 	}
-	if len(repoFlagName) == 0 {
+	if len(repoName) == 0 {
 		panic("parent command must specify a persistent flag name for repository path")
 	}
 
@@ -23,10 +21,7 @@ func Init(repoFlagName string, tp node.Type) *cobra.Command {
 		Short: "Initialization for Celestia Node. Passed flags have persisted effect.",
 		Args:  cobra.NoArgs,
 		RunE: func(cmd *cobra.Command, args []string) error {
-			repoPath := cmd.Flag(repoFlagName).Value.String()
-			if repoPath == "" {
-				return fmt.Errorf("repository path must be specified")
-			}
+			repo := cmd.Flag("repository").Value.String() // TODO @renaynay: create persistentFlags var
 
 			nodeConfig := cmd.Flag(nodeConfigFlag.Name).Value.String()
 			if nodeConfig != "" {
@@ -35,7 +30,7 @@ func Init(repoFlagName string, tp node.Type) *cobra.Command {
 					return err
 				}
 
-				return node.InitWith(repoPath, tp, cfg)
+				return node.InitWith(repo, tp, cfg)
 			}
 
 			var opts []node.Option
@@ -59,7 +54,7 @@ func Init(repoFlagName string, tp node.Type) *cobra.Command {
 				opts = append(opts, node.WithRemoteCore(protocol, ip))
 			}
 
-			return node.Init(repoPath, tp, opts...)
+			return node.Init(repo, tp, opts...)
 		},
 	}
 	for _, flag := range configFlags {
diff --git a/cmd/start.go b/cmd/start.go
index 3e0ad46e..38100002 100644
--- a/cmd/start.go
+++ b/cmd/start.go
@@ -17,11 +17,11 @@ import (
 
 // Start constructs a CLI command to start Celestia Node daemon of the given type 'tp'.
 // It is meant to be used a subcommand and also receive persistent flag name for repository path.
-func Start(repoFlagName string, tp node.Type) *cobra.Command {
+func Start(repoName string, tp node.Type) *cobra.Command {
 	if !tp.IsValid() {
 		panic("cmd: Start: invalid Node Type")
 	}
-	if len(repoFlagName) == 0 && tp != node.Dev { // repository path not necessary for **DEV MODE**
+	if len(repoName) == 0 && tp != node.Dev { // repository path not necessary for **DEV MODE**
 		panic("parent command must specify a persistent flag name for repository path")
 	}
 
@@ -35,11 +35,6 @@ func Start(repoFlagName string, tp node.Type) *cobra.Command {
 		Args:         cobra.NoArgs,
 		SilenceUsage: true,
 		RunE: func(cmd *cobra.Command, args []string) error {
-			repoPath := cmd.Flag(repoFlagName).Value.String()
-			if repoPath == "" {
-				return fmt.Errorf("repository path must be specified")
-			}
-
 			level, err := logging.LevelFromString(cmd.Flag(loglevelFlag.Name).Value.String())
 			if err != nil {
 				return fmt.Errorf("while setting log level: %w", err)
@@ -84,7 +79,7 @@ func Start(repoFlagName string, tp node.Type) *cobra.Command {
 				opts = append(opts, node.WithConfig(cfg))
 			}
 
-			repo, err := node.Open(repoPath, tp)
+			repo, err := node.Open(repoName, tp)
 			if err != nil {
 				return err
 			}
diff --git a/das/daser.go b/das/daser.go
index 246c23d4..33eac5a1 100644
--- a/das/daser.go
+++ b/das/daser.go
@@ -76,7 +76,7 @@ func (d *DASer) sampling(ctx context.Context, sub header.Subscription) {
 				return
 			}
 
-			log.Errorw("failed to get next header", "err", err)
+			log.Errorw("DASer failed to get next header", "err", err)
 			continue
 		}
 
@@ -87,13 +87,12 @@ func (d *DASer) sampling(ctx context.Context, sub header.Subscription) {
 			if err == context.Canceled {
 				return
 			}
-			log.Errorw("sampling failed", "height", h.Height, "hash", h.Hash(),
-				"square width", len(h.DAH.RowsRoots), "data root", h.DAH.Hash(), "err", err)
+			log.Errorw("validation failed", "root", h.DAH.Hash(), "err", err)
 			// continue sampling
 		}
 
 		sampleTime := time.Since(startTime)
 		log.Infow("sampling successful", "height", h.Height, "hash", h.Hash(),
-			"square width", len(h.DAH.RowsRoots), "finished (s)", sampleTime.Seconds())
+			"finished (s)", sampleTime.Seconds())
 	}
 }


Test patch:
diff --git a/service/block/event_test.go b/service/block/event_test.go
index a193966d..35538e1b 100644
--- a/service/block/event_test.go
+++ b/service/block/event_test.go
@@ -96,7 +96,7 @@ func TestExtendedHeaderBroadcast(t *testing.T) {
 
 	i := 0
 	for i < numBlocks {
-		got, err := sub.NextHeader(ctx)
+		got, err := sub.NextHeader(context.Background())
 		require.NoError(t, err)
 		assert.Equal(t, validRawBlocks[i].Header.Height, got.Height)
 		assert.Equal(t, validRawBlocks[i].Header.DataHash.Bytes(), got.DAH.Hash())