From 25d8251350ec9d567ee1eafa09bd1af74eecd336 Mon Sep 17 00:00:00 2001 From: rachid Date: Thu, 12 Oct 2023 00:18:10 +0200 Subject: [PATCH] chore: BlobStream -> Blobstream --- README.md | 16 +++--- cmd/bstream/base/config.go | 2 +- cmd/bstream/bootstrapper/cmd.go | 6 +-- cmd/bstream/bootstrapper/config.go | 4 +- cmd/bstream/common/helpers.go | 6 +-- cmd/bstream/deploy/cmd.go | 10 ++-- cmd/bstream/deploy/config.go | 4 +- cmd/bstream/keys/evm/config.go | 4 +- cmd/bstream/keys/evm/evm.go | 2 +- cmd/bstream/keys/keys.go | 2 +- cmd/bstream/keys/p2p/config.go | 2 +- cmd/bstream/keys/p2p/p2p.go | 2 +- cmd/bstream/orchestrator/cmd.go | 8 +-- cmd/bstream/orchestrator/config.go | 4 +- cmd/bstream/query/cmd.go | 10 ++-- cmd/bstream/relayer/cmd.go | 8 +-- cmd/bstream/relayer/config.go | 6 +-- cmd/bstream/root/cmd.go | 4 +- docker/entrypoint.sh | 2 +- docs/bootstrapper.md | 10 ++-- docs/deploy.md | 28 +++++----- docs/keys.md | 14 ++--- docs/orchestrator.md | 22 ++++---- docs/relayer.md | 26 ++++----- e2e/README.md | 6 +-- e2e/deployer_test.go | 10 ++-- e2e/docker-compose.yml | 2 +- e2e/orchestrator_test.go | 16 +++--- e2e/qgb_network.go | 84 +++++++++++++++--------------- e2e/relayer_test.go | 24 ++++----- e2e/scripts/deploy_qgb_contract.sh | 6 +-- e2e/scripts/start_relayer.sh | 2 +- e2e/test_commons.go | 4 +- evm/evm_client.go | 14 ++--- evm/evm_client_test.go | 4 +- orchestrator/broadcaster.go | 14 ++--- orchestrator/broadcaster_test.go | 2 +- orchestrator/orchestrator.go | 2 +- p2p/dht.go | 20 +++---- p2p/keys.go | 4 +- p2p/querier.go | 14 ++--- relayer/relayer.go | 4 +- relayer/suite_test.go | 2 +- rpc/app_querier.go | 2 +- store/init.go | 2 +- store/store.go | 4 +- testing/dht_network.go | 10 ++-- types/data_commitment_confirm.go | 2 +- types/valset_confirm.go | 2 +- 49 files changed, 229 insertions(+), 229 deletions(-) diff --git a/README.md b/README.md index 84c97693..cf23ad8b 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # orchestrator-relayer -Contains the implementation of the BlobStream orchestrator and relayer. +Contains the implementation of the Blobstream orchestrator and relayer. -The orchestrator is the software that signs the BlobStream attestations, and the relayer is the one that relays them to the target EVM chain. +The orchestrator is the software that signs the Blobstream attestations, and the relayer is the one that relays them to the target EVM chain. -For a high-level overview of how the BlobStream works, check [here](https://github.com/celestiaorg/quantum-gravity-bridge/tree/76efeca0be1a17d32ef633c0fdbd3c8f5e4cc53f#how-it-works) and [here](https://blog.celestia.org/celestiums/). +For a high-level overview of how the Blobstream works, check [here](https://github.com/celestiaorg/quantum-gravity-bridge/tree/76efeca0be1a17d32ef633c0fdbd3c8f5e4cc53f#how-it-works) and [here](https://blog.celestia.org/celestiums/). ## Install 1. [Install Go](https://go.dev/doc/install) 1.21.1 2. Clone this repo -3. Install the BlobStream CLI +3. Install the Blobstream CLI ```shell make install @@ -27,9 +27,9 @@ bstream --help If you are a Celestia-app validator, all you need to do is run the orchestrator. Check [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/orchestrator.md) for more details. -If you want to post commitments on an EVM chain, you will need to deploy a new BlobStream contract and run a relayer. Check [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/relayer.md) for relayer docs and [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/deploy.md) for how to deploy a new BlobStream contract. +If you want to post commitments on an EVM chain, you will need to deploy a new Blobstream contract and run a relayer. Check [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/relayer.md) for relayer docs and [here](https://github.com/celestiaorg/orchestrator-relayer/blob/main/docs/deploy.md) for how to deploy a new Blobstream contract. -Note: the BlobStream P2P network is a separate network than the consensus or the data availability one. Thus, you will need its specific bootstrappers to be able to connect to it. +Note: the Blobstream P2P network is a separate network than the consensus or the data availability one. Thus, you will need its specific bootstrappers to be able to connect to it. ## Contributing @@ -57,6 +57,6 @@ The smart contract implementation is in [blobstream-contracts](https://github.co The state machine implementation is in [x/blobstream](https://github.com/celestiaorg/celestia-app/tree/main/x/blobstream). -BlobStream ADRs are in the [docs](https://github.com/celestiaorg/celestia-app/tree/main/docs/architecture). +Blobstream ADRs are in the [docs](https://github.com/celestiaorg/celestia-app/tree/main/docs/architecture). -BlobStream design explained in this [blog](https://blog.celestia.org/celestiums). +Blobstream design explained in this [blog](https://blog.celestia.org/celestiums). diff --git a/cmd/bstream/base/config.go b/cmd/bstream/base/config.go index 75ecf78e..4c09783a 100644 --- a/cmd/bstream/base/config.go +++ b/cmd/bstream/base/config.go @@ -24,7 +24,7 @@ type Config struct { EVMPassphrase string } -// DefaultServicePath constructs the default BlobStream store path for +// DefaultServicePath constructs the default Blobstream store path for // the provided service. // It tries to get the home directory from an environment variable // called `_HOME`. If not set, then reverts to using diff --git a/cmd/bstream/bootstrapper/cmd.go b/cmd/bstream/bootstrapper/cmd.go index 1e77125e..e7afff9f 100644 --- a/cmd/bstream/bootstrapper/cmd.go +++ b/cmd/bstream/bootstrapper/cmd.go @@ -21,7 +21,7 @@ func Command() *cobra.Command { bsCmd := &cobra.Command{ Use: "bootstrapper", Aliases: []string{"bs"}, - Short: "BlobStream P2P network bootstrapper command", + Short: "Blobstream P2P network bootstrapper command", SilenceUsage: true, } @@ -110,7 +110,7 @@ func Start() *cobra.Command { } // creating the dht - dht, err := p2p.NewBlobStreamDHT(ctx, h, dataStore, aIBootstrappers, logger) + dht, err := p2p.NewBlobstreamDHT(ctx, h, dataStore, aIBootstrappers, logger) if err != nil { return err } @@ -137,7 +137,7 @@ func Start() *cobra.Command { func Init() *cobra.Command { cmd := cobra.Command{ Use: "init", - Short: "Initialize the BlobStream bootstrapper store. Passed flags have persisted effect.", + Short: "Initialize the Blobstream bootstrapper store. Passed flags have persisted effect.", RunE: func(cmd *cobra.Command, args []string) error { config, err := parseInitFlags(cmd) if err != nil { diff --git a/cmd/bstream/bootstrapper/config.go b/cmd/bstream/bootstrapper/config.go index 9d38e35f..3eace905 100644 --- a/cmd/bstream/bootstrapper/config.go +++ b/cmd/bstream/bootstrapper/config.go @@ -14,7 +14,7 @@ func addStartFlags(cmd *cobra.Command) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream bootstrappers home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream bootstrappers home directory") base.AddP2PNicknameFlag(cmd) base.AddP2PListenAddressFlag(cmd) base.AddBootstrappersFlag(cmd) @@ -65,7 +65,7 @@ func addInitFlags(cmd *cobra.Command) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream bootstrappers home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream bootstrappers home directory") return cmd } diff --git a/cmd/bstream/common/helpers.go b/cmd/bstream/common/helpers.go index eb7b4ae0..a827518c 100644 --- a/cmd/bstream/common/helpers.go +++ b/cmd/bstream/common/helpers.go @@ -60,7 +60,7 @@ func NewTmAndAppQuerier(logger tmlog.Logger, tendermintRPC string, celesGRPC str return tmQuerier, appQuerier, stopFuncs, nil } -// CreateDHTAndWaitForPeers helper function that creates a new BlobStream DHT and waits for some peers to connect to it. +// CreateDHTAndWaitForPeers helper function that creates a new Blobstream DHT and waits for some peers to connect to it. func CreateDHTAndWaitForPeers( ctx context.Context, logger tmlog.Logger, @@ -69,7 +69,7 @@ func CreateDHTAndWaitForPeers( p2pListenAddr string, bootstrappers string, dataStore ds.Batching, -) (*p2p.BlobStreamDHT, error) { +) (*p2p.BlobstreamDHT, error) { // get the p2p private key or generate a new one privKey, err := common2.GetP2PKeyOrGenerateNewOne(p2pKeyStore, p2pNickname) if err != nil { @@ -98,7 +98,7 @@ func CreateDHTAndWaitForPeers( } // creating the dht - dht, err := p2p.NewBlobStreamDHT(ctx, h, dataStore, aIBootstrappers, logger) + dht, err := p2p.NewBlobstreamDHT(ctx, h, dataStore, aIBootstrappers, logger) if err != nil { return nil, err } diff --git a/cmd/bstream/deploy/cmd.go b/cmd/bstream/deploy/cmd.go index bbd21e00..54b74dd2 100644 --- a/cmd/bstream/deploy/cmd.go +++ b/cmd/bstream/deploy/cmd.go @@ -25,7 +25,7 @@ import ( func Command() *cobra.Command { command := &cobra.Command{ Use: "deploy ", - Short: "Deploys the BlobStream contract and initializes it using the provided Celestia chain", + Short: "Deploys the Blobstream contract and initializes it using the provided Celestia chain", RunE: func(cmd *cobra.Command, args []string) error { config, err := parseDeployFlags(cmd) if err != nil { @@ -59,7 +59,7 @@ func Command() *cobra.Command { if err != nil { return errors.Wrap( err, - "cannot initialize the BlobStream contract without having a valset request: %s", + "cannot initialize the Blobstream contract without having a valset request: %s", ) } @@ -110,15 +110,15 @@ func Command() *cobra.Command { } defer backend.Close() - address, tx, _, err := evmClient.DeployBlobStreamContract(txOpts, backend, *vs, vs.Nonce, false) + address, tx, _, err := evmClient.DeployBlobstreamContract(txOpts, backend, *vs, vs.Nonce, false) if err != nil { - logger.Error("failed to deploy BlobStream contract") + logger.Error("failed to deploy Blobstream contract") return err } receipt, err := evmClient.WaitForTransaction(cmd.Context(), backend, tx) if err == nil && receipt != nil && receipt.Status == 1 { - logger.Info("deployed BlobStream contract", "proxy_address", address.Hex(), "tx_hash", tx.Hash().String()) + logger.Info("deployed Blobstream contract", "proxy_address", address.Hex(), "tx_hash", tx.Hash().String()) } return nil diff --git a/cmd/bstream/deploy/config.go b/cmd/bstream/deploy/config.go index 954c37a1..10d3309b 100644 --- a/cmd/bstream/deploy/config.go +++ b/cmd/bstream/deploy/config.go @@ -30,7 +30,7 @@ func addDeployFlags(cmd *cobra.Command) *cobra.Command { cmd.Flags().String( FlagStartingNonce, "latest", - "Specify the nonce to start the BlobStream contract from. "+ + "Specify the nonce to start the Blobstream contract from. "+ "\"earliest\": for genesis, "+ "\"latest\": for latest valset nonce, "+ "\"nonce\": for the latest valset before the provided nonce, provided nonce included.", @@ -40,7 +40,7 @@ func addDeployFlags(cmd *cobra.Command) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream deployer home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream deployer home directory") cmd.Flags().String(base.FlagEVMPassphrase, "", "the evm account passphrase (if not specified as a flag, it will be asked interactively)") return cmd diff --git a/cmd/bstream/keys/evm/config.go b/cmd/bstream/keys/evm/config.go index 6e398558..d909201d 100644 --- a/cmd/bstream/keys/evm/config.go +++ b/cmd/bstream/keys/evm/config.go @@ -15,7 +15,7 @@ func keysConfigFlags(cmd *cobra.Command, service string) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream evm keys home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream evm keys home directory") cmd.Flags().String(base.FlagEVMPassphrase, "", "the evm account passphrase (if not specified as a flag, it will be asked interactively)") return cmd } @@ -54,7 +54,7 @@ func keysNewPassphraseConfigFlags(cmd *cobra.Command, service string) *cobra.Com if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream evm keys home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream evm keys home directory") cmd.Flags().String(base.FlagEVMPassphrase, "", "the evm account passphrase (if not specified as a flag, it will be asked interactively)") cmd.Flags().String(FlagNewEVMPassphrase, "", "the evm account new passphrase (if not specified as a flag, it will be asked interactively)") return cmd diff --git a/cmd/bstream/keys/evm/evm.go b/cmd/bstream/keys/evm/evm.go index b5dbe4e2..d6656d49 100644 --- a/cmd/bstream/keys/evm/evm.go +++ b/cmd/bstream/keys/evm/evm.go @@ -21,7 +21,7 @@ import ( func Root(serviceName string) *cobra.Command { evmCmd := &cobra.Command{ Use: "evm", - Short: "BlobStream EVM keys manager", + Short: "Blobstream EVM keys manager", SilenceUsage: true, } diff --git a/cmd/bstream/keys/keys.go b/cmd/bstream/keys/keys.go index e6647598..4aa3b993 100644 --- a/cmd/bstream/keys/keys.go +++ b/cmd/bstream/keys/keys.go @@ -9,7 +9,7 @@ import ( func Command(serviceName string) *cobra.Command { keysCmd := &cobra.Command{ Use: "keys", - Short: "BlobStream keys manager", + Short: "Blobstream keys manager", SilenceUsage: true, } diff --git a/cmd/bstream/keys/p2p/config.go b/cmd/bstream/keys/p2p/config.go index a9e13868..df478948 100644 --- a/cmd/bstream/keys/p2p/config.go +++ b/cmd/bstream/keys/p2p/config.go @@ -11,7 +11,7 @@ func keysConfigFlags(cmd *cobra.Command, service string) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream p2p keys home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream p2p keys home directory") return cmd } diff --git a/cmd/bstream/keys/p2p/p2p.go b/cmd/bstream/keys/p2p/p2p.go index 0256b626..e422f79d 100644 --- a/cmd/bstream/keys/p2p/p2p.go +++ b/cmd/bstream/keys/p2p/p2p.go @@ -18,7 +18,7 @@ import ( func Root(serviceName string) *cobra.Command { p2pCmd := &cobra.Command{ Use: "p2p", - Short: "BlobStream p2p keys manager", + Short: "Blobstream p2p keys manager", SilenceUsage: true, } diff --git a/cmd/bstream/orchestrator/cmd.go b/cmd/bstream/orchestrator/cmd.go index a3a25fa6..8c192440 100644 --- a/cmd/bstream/orchestrator/cmd.go +++ b/cmd/bstream/orchestrator/cmd.go @@ -23,7 +23,7 @@ func Command() *cobra.Command { orchCmd := &cobra.Command{ Use: "orchestrator", Aliases: []string{"orch"}, - Short: "BlobStream orchestrator that signs attestations", + Short: "Blobstream orchestrator that signs attestations", SilenceUsage: true, } @@ -42,7 +42,7 @@ func Command() *cobra.Command { func Start() *cobra.Command { command := &cobra.Command{ Use: "start ", - Short: "Starts the BlobStream orchestrator to sign attestations", + Short: "Starts the Blobstream orchestrator to sign attestations", RunE: func(cmd *cobra.Command, args []string) error { config, err := parseOrchestratorFlags(cmd) if err != nil { @@ -106,7 +106,7 @@ func Start() *cobra.Command { }() // creating the broadcaster - broadcaster := orchestrator.NewBroadcaster(p2pQuerier.BlobStreamDHT) + broadcaster := orchestrator.NewBroadcaster(p2pQuerier.BlobstreamDHT) if err != nil { return err } @@ -144,7 +144,7 @@ func Start() *cobra.Command { func Init() *cobra.Command { cmd := cobra.Command{ Use: "init", - Short: "Initialize the BlobStream orchestrator store. Passed flags have persisted effect.", + Short: "Initialize the Blobstream orchestrator store. Passed flags have persisted effect.", RunE: func(cmd *cobra.Command, args []string) error { config, err := parseInitFlags(cmd) if err != nil { diff --git a/cmd/bstream/orchestrator/config.go b/cmd/bstream/orchestrator/config.go index 854ce194..66fb3c4a 100644 --- a/cmd/bstream/orchestrator/config.go +++ b/cmd/bstream/orchestrator/config.go @@ -32,7 +32,7 @@ func addOrchestratorFlags(cmd *cobra.Command) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream orchestrator home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream orchestrator home directory") cmd.Flags().String(base.FlagEVMPassphrase, "", "the evm account passphrase (if not specified as a flag, it will be asked interactively)") base.AddP2PNicknameFlag(cmd) base.AddP2PListenAddressFlag(cmd) @@ -119,7 +119,7 @@ func addInitFlags(cmd *cobra.Command) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream orchestrator home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream orchestrator home directory") return cmd } diff --git a/cmd/bstream/query/cmd.go b/cmd/bstream/query/cmd.go index 6e684e85..7aca0661 100644 --- a/cmd/bstream/query/cmd.go +++ b/cmd/bstream/query/cmd.go @@ -29,7 +29,7 @@ func Command() *cobra.Command { queryCmd := &cobra.Command{ Use: "query", Aliases: []string{"q"}, - Short: "Query relevant information from a running BlobStream", + Short: "Query relevant information from a running Blobstream", SilenceUsage: true, } @@ -47,8 +47,8 @@ func Signers() *cobra.Command { command := &cobra.Command{ Use: "signers ", Args: cobra.ExactArgs(1), - Short: "Queries the BlobStream for attestations signers", - Long: "Queries the BlobStream for attestations signers. The nonce is the attestation nonce that the command" + + Short: "Queries the Blobstream for attestations signers", + Long: "Queries the Blobstream for attestations signers. The nonce is the attestation nonce that the command" + " will query signatures for. It should be either a specific nonce starting from 2 and on." + " Or, use 'latest' as argument to check the latest attestation nonce", RunE: func(cmd *cobra.Command, args []string) error { @@ -107,7 +107,7 @@ func Signers() *cobra.Command { dataStore := dssync.MutexWrap(ds.NewMapDatastore()) // creating the dht - dht, err := p2p.NewBlobStreamDHT(cmd.Context(), h, dataStore, []peer.AddrInfo{}, logger) + dht, err := p2p.NewBlobstreamDHT(cmd.Context(), h, dataStore, []peer.AddrInfo{}, logger) if err != nil { return err } @@ -390,7 +390,7 @@ func Signature() *cobra.Command { dataStore := dssync.MutexWrap(ds.NewMapDatastore()) // creating the dht - dht, err := p2p.NewBlobStreamDHT(cmd.Context(), h, dataStore, []peer.AddrInfo{}, logger) + dht, err := p2p.NewBlobstreamDHT(cmd.Context(), h, dataStore, []peer.AddrInfo{}, logger) if err != nil { return err } diff --git a/cmd/bstream/relayer/cmd.go b/cmd/bstream/relayer/cmd.go index bcc2f2b6..a1d35988 100644 --- a/cmd/bstream/relayer/cmd.go +++ b/cmd/bstream/relayer/cmd.go @@ -27,7 +27,7 @@ func Command() *cobra.Command { relCmd := &cobra.Command{ Use: "relayer", Aliases: []string{"rel"}, - Short: "BlobStream relayer that relays signatures to the target EVM chain", + Short: "Blobstream relayer that relays signatures to the target EVM chain", SilenceUsage: true, } @@ -46,7 +46,7 @@ func Command() *cobra.Command { func Init() *cobra.Command { cmd := cobra.Command{ Use: "init", - Short: "Initialize the BlobStream relayer store. Passed flags have persisted effect.", + Short: "Initialize the Blobstream relayer store. Passed flags have persisted effect.", RunE: func(cmd *cobra.Command, args []string) error { config, err := parseInitFlags(cmd) if err != nil { @@ -81,7 +81,7 @@ func Init() *cobra.Command { func Start() *cobra.Command { command := &cobra.Command{ Use: "start ", - Short: "Runs the BlobStream relayer to submit attestations to the target EVM chain", + Short: "Runs the Blobstream relayer to submit attestations to the target EVM chain", RunE: func(cmd *cobra.Command, args []string) error { config, err := parseRelayerStartFlags(cmd) if err != nil { @@ -145,7 +145,7 @@ func Start() *cobra.Command { } }() - // connecting to a BlobStream contract + // connecting to a Blobstream contract ethClient, err := ethclient.Dial(config.evmRPC) if err != nil { return err diff --git a/cmd/bstream/relayer/config.go b/cmd/bstream/relayer/config.go index 71507c55..b1cbee1c 100644 --- a/cmd/bstream/relayer/config.go +++ b/cmd/bstream/relayer/config.go @@ -35,13 +35,13 @@ func addRelayerStartFlags(cmd *cobra.Command) *cobra.Command { cmd.Flags().String(FlagCoreRPCHost, "localhost", "Specify the rest rpc address host") cmd.Flags().Uint(FlagCoreRPCPort, 26657, "Specify the rest rpc address port") cmd.Flags().String(FlagEVMRPC, "http://localhost:8545", "Specify the ethereum rpc address") - cmd.Flags().String(FlagContractAddress, "", "Specify the contract at which the BlobStream is deployed") + cmd.Flags().String(FlagContractAddress, "", "Specify the contract at which the Blobstream is deployed") cmd.Flags().Uint64(FlagEVMGasLimit, evm.DefaultEVMGasLimit, "Specify the evm gas limit") homeDir, err := base.DefaultServicePath(ServiceNameRelayer) if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream relayer home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream relayer home directory") cmd.Flags().String(base.FlagEVMPassphrase, "", "the evm account passphrase (if not specified as a flag, it will be asked interactively)") base.AddP2PNicknameFlag(cmd) base.AddP2PListenAddressFlag(cmd) @@ -159,7 +159,7 @@ func addInitFlags(cmd *cobra.Command) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The BlobStream relayer home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream relayer home directory") return cmd } diff --git a/cmd/bstream/root/cmd.go b/cmd/bstream/root/cmd.go index 9d24cdcb..fc1eb85c 100644 --- a/cmd/bstream/root/cmd.go +++ b/cmd/bstream/root/cmd.go @@ -13,12 +13,12 @@ import ( "github.com/spf13/cobra" ) -// Cmd creates a new root command for the BlobStream CLI. It is called once in the +// Cmd creates a new root command for the Blobstream CLI. It is called once in the // main function. func Cmd() *cobra.Command { rootCmd := &cobra.Command{ Use: "bstream", - Short: "The BlobStream CLI", + Short: "The Blobstream CLI", SilenceUsage: true, } diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 9e45c439..7db3ac1b 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -2,7 +2,7 @@ set -e -echo "Starting Celestia BlobStream with command:" +echo "Starting Celestia Blobstream with command:" echo "$@" echo "" diff --git a/docs/bootstrapper.md b/docs/bootstrapper.md index 91686ab1..bf404006 100644 --- a/docs/bootstrapper.md +++ b/docs/bootstrapper.md @@ -1,12 +1,12 @@ -# BlobStream bootstrapper +# Blobstream bootstrapper -To bootstrap the BlobStream P2P network, we use the bootstrapper BlobStream node type to accept connections from freshly created orchestrators/relayers and share its peer table with them. +To bootstrap the Blobstream P2P network, we use the bootstrapper Blobstream node type to accept connections from freshly created orchestrators/relayers and share its peer table with them. ## How to run -### Install the BlobStream binary +### Install the Blobstream binary -Make sure to have the BlobStream binary installed. Check [the BlobStream binary page](https://docs.celestia.org/nodes/blobstream-binary) for more details. +Make sure to have the Blobstream binary installed. Check [the Blobstream binary page](https://docs.celestia.org/nodes/blobstream-binary) for more details. ### Init the store @@ -39,7 +39,7 @@ Now that we have the store initialized, we can start the bootstrapper: ```shell bstream bootstrapper -BlobStream P2P network bootstrapper command +Blobstream P2P network bootstrapper command Usage: bstream bootstrapper [command] diff --git a/docs/deploy.md b/docs/deploy.md index 32e5f0c5..4cd541b7 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -1,36 +1,36 @@ --- -sidebar_label: Deploy the BlobStream contract -description: Learn how to deploy the BlobStream smart contract. +sidebar_label: Deploy the Blobstream contract +description: Learn how to deploy the Blobstream smart contract. --- -# Deploy the BlobStream contract +# Deploy the Blobstream contract -The `deploy` is a helper command that allows deploying the BlobStream smart contract to a new EVM chain: +The `deploy` is a helper command that allows deploying the Blobstream smart contract to a new EVM chain: ```ssh bstream deploy --help -Deploys the BlobStream contract and initializes it using the provided Celestia chain +Deploys the Blobstream contract and initializes it using the provided Celestia chain Usage: bstream deploy [flags] bstream deploy [command] Available Commands: - keys BlobStream keys manager + keys Blobstream keys manager ``` ## How to run -### Install the BlobStream binary +### Install the Blobstream binary -Make sure to have the BlobStream binary installed. Check [the BlobStream binary page](https://docs.celestia.org/nodes/blobstream-binary) for more details. +Make sure to have the Blobstream binary installed. Check [the Blobstream binary page](https://docs.celestia.org/nodes/blobstream-binary) for more details. ### Add keys -In order to deploy a BlobStream smart contract, you will need a funded EVM address and its private key. The `keys` command will help you set up this key: +In order to deploy a Blobstream smart contract, you will need a funded EVM address and its private key. The `keys` command will help you set up this key: ```ssh bstream deploy keys --help @@ -54,7 +54,7 @@ For more information about the `keys` command, check [the `keys` documentation]( ### Deploy the contract -Now, we can deploy the BlobStream contract to a new EVM chain: +Now, we can deploy the Blobstream contract to a new EVM chain: ```ssh blobstream deploy \ @@ -68,8 +68,8 @@ blobstream deploy \ The `latest` can be replaced by the following: -- `latest`: to deploy the BlobStream contract starting from the latest validator set. -- `earliest`: to deploy the BlobStream contract starting from genesis. -- `nonce`: you can provide a custom nonce on where you want the BlobStream to start. If the provided nonce is not a `Valset` attestation, then the one before it will be used to deploy the BlobStream smart contract. +- `latest`: to deploy the Blobstream contract starting from the latest validator set. +- `earliest`: to deploy the Blobstream contract starting from genesis. +- `nonce`: you can provide a custom nonce on where you want the Blobstream to start. If the provided nonce is not a `Valset` attestation, then the one before it will be used to deploy the Blobstream smart contract. -And, now you will see the BlobStream smart contract address in the logs along with the transaction hash. +And, now you will see the Blobstream smart contract address in the logs along with the transaction hash. diff --git a/docs/keys.md b/docs/keys.md index e311971d..aa44bcdc 100644 --- a/docs/keys.md +++ b/docs/keys.md @@ -7,7 +7,7 @@ description: Learn how to manage EVM private keys and P2P identities. -The BlobStream `keys` command allows managing EVM private keys and P2P identities. It is defined as a subcommand for multiple commands with the only difference being the directory where the keys are stored. For the remaining functionality, it is the same for all the commands. +The Blobstream `keys` command allows managing EVM private keys and P2P identities. It is defined as a subcommand for multiple commands with the only difference being the directory where the keys are stored. For the remaining functionality, it is the same for all the commands. ## Orchestrator command @@ -50,14 +50,14 @@ The examples will use the orchestrator command to access the keys. However, the ```ssh bstream orchestrator keys --help -BlobStream keys manager +Blobstream keys manager Usage: bstream orchestrator keys [command] Available Commands: - evm BlobStream EVM keys manager - p2p BlobStream p2p keys manager + evm Blobstream EVM keys manager + p2p Blobstream p2p keys manager Flags: -h, --help help for keys @@ -74,7 +74,7 @@ The EVM keys are `ECDSA` keys using the `secp256k1` curve. The implementation us ```ssh bstream orchestrator keys evm --help -BlobStream EVM keys manager +Blobstream EVM keys manager Usage: bstream orchestrator keys evm [command] @@ -264,7 +264,7 @@ I[2023-04-13|17:31:58.436] successfully imported file address= I[2023-04-13|17:31:58.437] successfully closed store path=/home/midnight/.orchestrator ``` -with the `passphrase` being the current file passphrase, and the `new passphrase` being the new passphrase that will be used to encrypt the private key in the BlobStream store. +with the `passphrase` being the current file passphrase, and the `new passphrase` being the new passphrase that will be used to encrypt the private key in the Blobstream store. ### P2P keystore @@ -275,7 +275,7 @@ To access the P2P keystore, run the following: ```ssh bstream orchestrator keys p2p -BlobStream p2p keys manager +Blobstream p2p keys manager Usage: bstream orchestrator keys p2p [command] diff --git a/docs/orchestrator.md b/docs/orchestrator.md index 38b2b847..0b999b01 100644 --- a/docs/orchestrator.md +++ b/docs/orchestrator.md @@ -1,22 +1,22 @@ --- -sidebar_label: BlobStream Orchestrator -description: Learn about the BlobStream Orchestrator. +sidebar_label: Blobstream Orchestrator +description: Learn about the Blobstream Orchestrator. --- -# BlobStream Orchestrator +# Blobstream Orchestrator -The role of the orchestrator is to sign attestations using its corresponding validator EVM private key. These attestations are generated within the BlobStream module of the Celestia-app state machine. To learn more about what attestations are, you can refer to [the BlobStream overview](https://github.com/celestiaorg/celestia-app/tree/main/x/blobstream). +The role of the orchestrator is to sign attestations using its corresponding validator EVM private key. These attestations are generated within the Blobstream module of the Celestia-app state machine. To learn more about what attestations are, you can refer to [the Blobstream overview](https://github.com/celestiaorg/celestia-app/tree/main/x/blobstream). ## How it works The orchestrator does the following: 1. Connect to a Celestia-app full node or validator node via RPC and gRPC and wait for new attestations -2. Once an attestation is created inside the BlobStream state machine, the orchestrator queries it. -3. After getting the attestation, the orchestrator signs it using the provided EVM private key. The private key should correspond to the EVM address provided when creating the validator. Read [more about BlobStream keys](https://docs.celestia.org/nodes/blobstream-keys/). +2. Once an attestation is created inside the Blobstream state machine, the orchestrator queries it. +3. After getting the attestation, the orchestrator signs it using the provided EVM private key. The private key should correspond to the EVM address provided when creating the validator. Read [more about Blobstream keys](https://docs.celestia.org/nodes/blobstream-keys/). 4. Then, the orchestrator pushes its signature to the P2P network it is connected to, via adding it as a DHT value. 5. Listen for new attestations and go back to step 2. @@ -46,9 +46,9 @@ To run an orchestrator, you will need to have access to the following: * *A list of bootstrappers for the P2P network. These will be shared by the team for every network we plan on supporting. * *Access to your consensus node RPC and gRPC ports. -### Install the BlobStream binary +### Install the Blobstream binary -Make sure to have the BlobStream binary installed. Check [the BlobStream binary page](https://docs.celestia.org/nodes/blobstream-binary) for more details. +Make sure to have the Blobstream binary installed. Check [the Blobstream binary page](https://docs.celestia.org/nodes/blobstream-binary) for more details. ### Init the store @@ -114,7 +114,7 @@ The orchestrator accepts the following flags: ```ssh bstream orchestrator start --help -Starts the BlobStream orchestrator to sign attestations +Starts the Blobstream orchestrator to sign attestations Usage: bstream orchestrator start [flags] @@ -145,7 +145,7 @@ If not, then the signatures may not be available to the network and relayers wil #### Register EVM Address -When creating a validator, a random EVM address corresponding to its operator is set in the BlobStream state. This latter will be used by the orchestrator to sign attestations. And since validators will generally not have access to its corresponding private key, that address needs to be edited with one whose private key is known to the validator operator. +When creating a validator, a random EVM address corresponding to its operator is set in the Blobstream state. This latter will be used by the orchestrator to sign attestations. And since validators will generally not have access to its corresponding private key, that address needs to be edited with one whose private key is known to the validator operator. To edit an EVM address for a certain validator, its corresponding account needs to send a `RegisterEVMAddress` transaction with the new address. @@ -273,7 +273,7 @@ If you want to start the orchestrator as a `systemd` service, you could use the ```text [Unit] -Description=BlobStream orchestrator service +Description=Blobstream orchestrator service After=network.target [Service] diff --git a/docs/relayer.md b/docs/relayer.md index 626442db..bda66970 100644 --- a/docs/relayer.md +++ b/docs/relayer.md @@ -1,27 +1,27 @@ --- -sidebar_label: BlobStream Relayer -description: Learn about the BlobStream Relayer. +sidebar_label: Blobstream Relayer +description: Learn about the Blobstream Relayer. --- -# BlobStream Relayer +# Blobstream Relayer -The role of the relayer is to gather attestations' signatures from the orchestrators, and submit them to a target EVM chain. The attestations are generated within the BlobStream module of the Celestia-app state machine. To learn more about what attestations are, you can refer to [the BlobStream overview](https://github.com/celestiaorg/celestia-app/tree/main/x/blobstream). +The role of the relayer is to gather attestations' signatures from the orchestrators, and submit them to a target EVM chain. The attestations are generated within the Blobstream module of the Celestia-app state machine. To learn more about what attestations are, you can refer to [the Blobstream overview](https://github.com/celestiaorg/celestia-app/tree/main/x/blobstream). Also, while every validator in the Celestia validator set needs to run an orchestrator, we only need one entity to run the relayer, and it can be anyone. Thus, if you're a validator, most likely you want to read [the orchestrator documentation](https://docs.celestia.org/nodes/blobstream-orchestrator/). -Every relayer needs to target a BlobStream smart contract. This latter can be deployed, if not already, using the `bstream deploy` command. More details in the [Deploy the BlobStream contract guide](https://docs.celestia.org/nodes/blobstream-deploy/). +Every relayer needs to target a Blobstream smart contract. This latter can be deployed, if not already, using the `bstream deploy` command. More details in the [Deploy the Blobstream contract guide](https://docs.celestia.org/nodes/blobstream-deploy/). ## How it works The relayer works as follows: 1. Connect to a Celestia-app full node or validator node via RPC and gRPC and wait for attestations. -2. Once an attestation is created inside the BlobStream state machine, the relayer queries it. -3. After getting the attestation, the relayer checks if the target BlobStream smart contract's nonce is lower than the attestation. +2. Once an attestation is created inside the Blobstream state machine, the relayer queries it. +3. After getting the attestation, the relayer checks if the target Blobstream smart contract's nonce is lower than the attestation. 4. If so, the relayer queries the P2P network for signatures from the orchestrators. -5. Once the relayer finds more than 2/3s signatures, it submits them to the target BlobStream smart contract where they get validated. +5. Once the relayer finds more than 2/3s signatures, it submits them to the target Blobstream smart contract where they get validated. 6. Listen for new attestations and go back to step 2. The relayer connects to a separate P2P network than the consensus or the data availability one. So, we will provide bootstrappers for that one. @@ -36,9 +36,9 @@ I[2023-04-26|00:04:28.175] waiting for routing table to populate targetnu ## How to run -### Install the BlobStream binary +### Install the Blobstream binary -Make sure to have the BlobStream binary installed. Check out the [Install the BlobStream binary page](https://docs.celestia.org/nodes/blobstream-binary) for more details. +Make sure to have the Blobstream binary installed. Check out the [Install the Blobstream binary page](https://docs.celestia.org/nodes/blobstream-binary) for more details. ### Init the store @@ -95,14 +95,14 @@ For more information about the `keys` command, check [the `keys` documentation]( ### Start the relayer -Now that we have the store initialized, and we have a target BlobStream smart contract address, we can start the relayer. Make sure you have your Celestia-app node RPC and gRPC accessible, and able to connect to the P2P network bootstrappers. +Now that we have the store initialized, and we have a target Blobstream smart contract address, we can start the relayer. Make sure you have your Celestia-app node RPC and gRPC accessible, and able to connect to the P2P network bootstrappers. The relayer accepts the following flags: ```ssh bstream relayer start --help -Runs the BlobStream relayer to submit attestations to the target EVM chain +Runs the Blobstream relayer to submit attestations to the target EVM chain Usage: bstream relayer start [flags] @@ -124,4 +124,4 @@ To start the relayer using the default home directory, run the following: --p2p.listen-addr=/ip4/0.0.0.0/tcp/30001 ``` -And, you will be prompted to enter your EVM key passphrase for the EVM address passed using the `-d` flag, so that the relayer can use it to send transactions to the target BlobStream smart contract. Make sure that it's funded. +And, you will be prompted to enter your EVM key passphrase for the EVM address passed using the `-d` flag, so that the relayer can use it to send transactions to the target Blobstream smart contract. Make sure that it's funded. diff --git a/e2e/README.md b/e2e/README.md index 4f4b19ca..cda669b8 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -1,6 +1,6 @@ -# BlobStream end to end integration test +# Blobstream end to end integration test -This directory contains the BlobStream e2e integration tests. It serves as a way to fully test the BlobStream orchestrator and relayer in real network scenarios +This directory contains the Blobstream e2e integration tests. It serves as a way to fully test the Blobstream orchestrator and relayer in real network scenarios ## Topology @@ -10,7 +10,7 @@ as discussed under [#398](https://github.com/celestiaorg/celestia-app/issues/398 - 4 Orchestrator nodes that will each run aside of a celestia-app - 1 Ethereum node. Probably Ganache as it is easier to set up - 1 Relayer node that will listen to Celestia chain and relay attestations -- 1 Deployer node that can deploy a new BlobStream contract when needed. +- 1 Deployer node that can deploy a new Blobstream contract when needed. For more information on the environment variables required to run these tests, please check the `docker-compose.yml` file and the shell scripts defined under `celestia-app` directory. diff --git a/e2e/deployer_test.go b/e2e/deployer_test.go index 9dfe49eb..f29ca46e 100644 --- a/e2e/deployer_test.go +++ b/e2e/deployer_test.go @@ -14,10 +14,10 @@ import ( func TestDeployer(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -31,13 +31,13 @@ func TestDeployer(t *testing.T) { err = network.WaitForBlock(ctx, 2) HandleNetworkError(t, network, err, false) - _, err = network.GetLatestDeployedBlobStreamContractWithCustomTimeout(ctx, 15*time.Second) + _, err = network.GetLatestDeployedBlobstreamContractWithCustomTimeout(ctx, 15*time.Second) HandleNetworkError(t, network, err, true) - err = network.DeployBlobStreamContract() + err = network.DeployBlobstreamContract() HandleNetworkError(t, network, err, false) - bridge, err := network.GetLatestDeployedBlobStreamContract(ctx) + bridge, err := network.GetLatestDeployedBlobstreamContract(ctx) HandleNetworkError(t, network, err, false) evmClient := evm.NewClient(nil, bridge, nil, nil, network.EVMRPC, evm.DefaultEVMGasLimit) diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index c343c2c1..7a91bf99 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -302,7 +302,7 @@ services: - P2P_BOOTSTRAPPERS=/dns/core0-orch/tcp/30000/p2p/12D3KooWBSMasWzRSRKXREhediFUwABNZwzJbkZcYz5rYr9Zdmfn - P2P_LISTEN=/ip4/0.0.0.0/tcp/30000 # set the following environment variable to some value -# if you want to relay to an existing BlobStream contract +# if you want to relay to an existing Blobstream contract # - BLOBSTREAM_CONTRACT=0x123 entrypoint: [ "/bin/bash" diff --git a/e2e/orchestrator_test.go b/e2e/orchestrator_test.go index a29af385..abda2480 100644 --- a/e2e/orchestrator_test.go +++ b/e2e/orchestrator_test.go @@ -16,10 +16,10 @@ import ( func TestOrchestratorWithOneValidator(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -68,10 +68,10 @@ func TestOrchestratorWithOneValidator(t *testing.T) { func TestOrchestratorWithTwoValidators(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -157,10 +157,10 @@ func TestOrchestratorWithTwoValidators(t *testing.T) { func TestOrchestratorWithMultipleValidators(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() assert.NoError(t, err) // to release resources after tests @@ -246,10 +246,10 @@ func TestOrchestratorWithMultipleValidators(t *testing.T) { func TestOrchestratorReplayOld(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests diff --git a/e2e/qgb_network.go b/e2e/qgb_network.go index a98d8be7..140b892d 100644 --- a/e2e/qgb_network.go +++ b/e2e/qgb_network.go @@ -36,7 +36,7 @@ import ( testcontainers "github.com/testcontainers/testcontainers-go/modules/compose" ) -type BlobStreamNetwork struct { +type BlobstreamNetwork struct { ComposePaths []string Identifier string Instance *testcontainers.LocalDockerCompose @@ -53,7 +53,7 @@ type BlobStreamNetwork struct { toStopChan chan<- struct{} } -func NewBlobStreamNetwork() (*BlobStreamNetwork, error) { +func NewBlobstreamNetwork() (*BlobstreamNetwork, error) { id := strings.ToLower(uuid.New().String()) paths := []string{"./docker-compose.yml"} instance := testcontainers.NewLocalDockerCompose(paths, id) //nolint:staticcheck @@ -61,7 +61,7 @@ func NewBlobStreamNetwork() (*BlobStreamNetwork, error) { // given an initial capacity to avoid blocking in case multiple services failed // and wanted to notify the moderator. toStopChan := make(chan struct{}, 10) - network := &BlobStreamNetwork{ + network := &BlobstreamNetwork{ Identifier: id, ComposePaths: paths, Instance: instance, @@ -96,7 +96,7 @@ func registerModerator(stopChan chan<- struct{}, toStopChan <-chan struct{}) { // it is not calling `DeleteAll()` here as it is being called inside the tests. No need to call it two times. // this comes from the fact that we're sticking with unit tests style tests to be able to run individual tests // https://github.com/celestiaorg/celestia-app/issues/428 -func registerGracefulExit(network *BlobStreamNetwork) { +func registerGracefulExit(network *BlobstreamNetwork) { c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) go func() { @@ -117,9 +117,9 @@ func forceExitIfNeeded(exitCode int) { } } -// StartAll starts the whole BlobStream cluster with multiple validators, orchestrators and a relayer +// StartAll starts the whole Blobstream cluster with multiple validators, orchestrators and a relayer // Make sure to release the resources after finishing by calling the `StopAll()` method. -func (network BlobStreamNetwork) StartAll() error { +func (network BlobstreamNetwork) StartAll() error { // the reason for building before executing `up` is to avoid rebuilding all the images // if some container accidentally changed some files when running. // This to speed up a bit the execution. @@ -141,7 +141,7 @@ func (network BlobStreamNetwork) StartAll() error { // StopAll stops the network and leaves the containers created. This allows to resume // execution from the point where they stopped. -func (network BlobStreamNetwork) StopAll() error { +func (network BlobstreamNetwork) StopAll() error { err := network.Instance. WithCommand([]string{"stop"}). Invoke() @@ -152,7 +152,7 @@ func (network BlobStreamNetwork) StopAll() error { } // DeleteAll deletes the containers, network and everything related to the cluster. -func (network BlobStreamNetwork) DeleteAll() error { +func (network BlobstreamNetwork) DeleteAll() error { err := network.Instance. WithCommand([]string{"down"}). Invoke() @@ -163,7 +163,7 @@ func (network BlobStreamNetwork) DeleteAll() error { } // KillAll kills all the containers. -func (network BlobStreamNetwork) KillAll() error { +func (network BlobstreamNetwork) KillAll() error { err := network.Instance. WithCommand([]string{"kill"}). Invoke() @@ -175,7 +175,7 @@ func (network BlobStreamNetwork) KillAll() error { // Start starts a service from the `Service` enum. Make sure to call `Stop`, in the // end, to release the resources. -func (network BlobStreamNetwork) Start(service Service) error { +func (network BlobstreamNetwork) Start(service Service) error { serviceName, err := service.toString() if err != nil { return err @@ -196,10 +196,10 @@ func (network BlobStreamNetwork) Start(service Service) error { return nil } -// DeployBlobStreamContract uses the Deployer service to deploy a new BlobStream contract +// DeployBlobstreamContract uses the Deployer service to deploy a new Blobstream contract // based on the existing running network. If no Celestia-app nor ganache is // started, it creates them automatically. -func (network BlobStreamNetwork) DeployBlobStreamContract() error { +func (network BlobstreamNetwork) DeployBlobstreamContract() error { fmt.Println("building images...") err := network.Instance. WithCommand([]string{"build", "--quiet", DEPLOYER}). @@ -218,7 +218,7 @@ func (network BlobStreamNetwork) DeployBlobStreamContract() error { // StartMultiple start multiple services. Make sure to call `Stop`, in the // end, to release the resources. -func (network BlobStreamNetwork) StartMultiple(services ...Service) error { +func (network BlobstreamNetwork) StartMultiple(services ...Service) error { if len(services) == 0 { return fmt.Errorf("empty list of services provided") } @@ -246,7 +246,7 @@ func (network BlobStreamNetwork) StartMultiple(services ...Service) error { return nil } -func (network BlobStreamNetwork) Stop(service Service) error { +func (network BlobstreamNetwork) Stop(service Service) error { serviceName, err := service.toString() if err != nil { return err @@ -262,7 +262,7 @@ func (network BlobStreamNetwork) Stop(service Service) error { // StopMultiple start multiple services. Make sure to call `Stop` or `StopMultiple`, in the // end, to release the resources. -func (network BlobStreamNetwork) StopMultiple(services ...Service) error { +func (network BlobstreamNetwork) StopMultiple(services ...Service) error { if len(services) == 0 { return fmt.Errorf("empty list of services provided") } @@ -283,7 +283,7 @@ func (network BlobStreamNetwork) StopMultiple(services ...Service) error { return nil } -func (network BlobStreamNetwork) ExecCommand(service Service, command []string) error { +func (network BlobstreamNetwork) ExecCommand(service Service, command []string) error { serviceName, err := service.toString() if err != nil { return err @@ -299,7 +299,7 @@ func (network BlobStreamNetwork) ExecCommand(service Service, command []string) // StartMinimal starts a network containing: 1 validator, 1 orchestrator, 1 relayer // and a ganache instance. -func (network BlobStreamNetwork) StartMinimal() error { +func (network BlobstreamNetwork) StartMinimal() error { fmt.Println("building images...") err := network.Instance. WithCommand([]string{"build", "--quiet", "core0", "core0-orch", "relayer", "ganache"}). @@ -319,7 +319,7 @@ func (network BlobStreamNetwork) StartMinimal() error { // StartBase starts the very minimal component to have a network. // It consists of starting `core0` as it is the genesis validator, and the docker network // will be created along with it, allowing more containers to join it. -func (network BlobStreamNetwork) StartBase() error { +func (network BlobstreamNetwork) StartBase() error { fmt.Println("building images...") err := network.Instance. WithCommand([]string{"build", "--quiet", "core0"}). @@ -336,7 +336,7 @@ func (network BlobStreamNetwork) StartBase() error { return nil } -func (network BlobStreamNetwork) WaitForNodeToStart(_ctx context.Context, rpcAddr string) error { +func (network BlobstreamNetwork) WaitForNodeToStart(_ctx context.Context, rpcAddr string) error { ctx, cancel := context.WithTimeout(_ctx, 5*time.Minute) for { select { @@ -362,11 +362,11 @@ func (network BlobStreamNetwork) WaitForNodeToStart(_ctx context.Context, rpcAdd } } -func (network BlobStreamNetwork) WaitForBlock(_ctx context.Context, height int64) error { +func (network BlobstreamNetwork) WaitForBlock(_ctx context.Context, height int64) error { return network.WaitForBlockWithCustomTimeout(_ctx, height, 5*time.Minute) } -func (network BlobStreamNetwork) WaitForBlockWithCustomTimeout( +func (network BlobstreamNetwork) WaitForBlockWithCustomTimeout( _ctx context.Context, height int64, timeout time.Duration, @@ -415,7 +415,7 @@ func (network BlobStreamNetwork) WaitForBlockWithCustomTimeout( // and for any nonce, but would require adding a new method to the querier. Don't think it is worth it now as // the number of valsets that will be signed is trivial and reaching 0 would be in no time). // Returns the height and the nonce of some attestation that the orchestrator signed. -func (network BlobStreamNetwork) WaitForOrchestratorToStart(_ctx context.Context, dht *p2p.BlobStreamDHT, evmAddr string) (uint64, uint64, error) { +func (network BlobstreamNetwork) WaitForOrchestratorToStart(_ctx context.Context, dht *p2p.BlobstreamDHT, evmAddr string) (uint64, uint64, error) { // create p2p querier p2pQuerier := p2p.NewQuerier(dht, network.Logger) @@ -489,7 +489,7 @@ func (network BlobStreamNetwork) WaitForOrchestratorToStart(_ctx context.Context // GetValsetContainingVals Gets the last valset that contains a certain number of validator. // This is used after enabling orchestrators not to sign unless they belong to some valset. // Thus, any nonce after the returned valset should be signed by all orchestrators. -func (network BlobStreamNetwork) GetValsetContainingVals(_ctx context.Context, number int) (*types.Valset, error) { +func (network BlobstreamNetwork) GetValsetContainingVals(_ctx context.Context, number int) (*types.Valset, error) { appQuerier := rpc.NewAppQuerier(network.Logger, network.CelestiaGRPC, network.EncCfg) err := appQuerier.Start() if err != nil { @@ -530,9 +530,9 @@ func (network BlobStreamNetwork) GetValsetContainingVals(_ctx context.Context, n // GetValsetConfirm Returns the valset confirm for nonce `nonce` // signed by orchestrator whose EVM address is `evmAddr`. -func (network BlobStreamNetwork) GetValsetConfirm( +func (network BlobstreamNetwork) GetValsetConfirm( _ctx context.Context, - dht *p2p.BlobStreamDHT, + dht *p2p.BlobstreamDHT, nonce uint64, evmAddr string, ) (*blobstreamtypes.ValsetConfirm, error) { @@ -583,9 +583,9 @@ func (network BlobStreamNetwork) GetValsetConfirm( // GetDataCommitmentConfirm Returns the data commitment confirm for nonce `nonce` // signed by orchestrator whose EVM address is `evmAddr`. -func (network BlobStreamNetwork) GetDataCommitmentConfirm( +func (network BlobstreamNetwork) GetDataCommitmentConfirm( _ctx context.Context, - dht *p2p.BlobStreamDHT, + dht *p2p.BlobstreamDHT, nonce uint64, evmAddr string, ) (*blobstreamtypes.DataCommitmentConfirm, error) { @@ -643,9 +643,9 @@ func (network BlobStreamNetwork) GetDataCommitmentConfirm( // GetDataCommitmentConfirmByHeight Returns the data commitment confirm that commits // to height `height` signed by orchestrator whose EVM address is `evmAddr`. -func (network BlobStreamNetwork) GetDataCommitmentConfirmByHeight( +func (network BlobstreamNetwork) GetDataCommitmentConfirmByHeight( _ctx context.Context, - dht *p2p.BlobStreamDHT, + dht *p2p.BlobstreamDHT, height uint64, evmAddr string, ) (*blobstreamtypes.DataCommitmentConfirm, error) { @@ -669,7 +669,7 @@ func (network BlobStreamNetwork) GetDataCommitmentConfirmByHeight( } // GetLatestAttestationNonce Returns the latest attestation nonce. -func (network BlobStreamNetwork) GetLatestAttestationNonce(_ctx context.Context) (uint64, error) { +func (network BlobstreamNetwork) GetLatestAttestationNonce(_ctx context.Context) (uint64, error) { // create app querier appQuerier := rpc.NewAppQuerier(network.Logger, network.CelestiaGRPC, network.EncCfg) err := appQuerier.Start() @@ -686,9 +686,9 @@ func (network BlobStreamNetwork) GetLatestAttestationNonce(_ctx context.Context) } // WasAttestationSigned Returns true if the attestation confirm exist. -func (network BlobStreamNetwork) WasAttestationSigned( +func (network BlobstreamNetwork) WasAttestationSigned( _ctx context.Context, - dht *p2p.BlobStreamDHT, + dht *p2p.BlobstreamDHT, nonce uint64, evmAddress string, ) (bool, error) { @@ -763,11 +763,11 @@ func (network BlobStreamNetwork) WasAttestationSigned( } } -func (network BlobStreamNetwork) GetLatestDeployedBlobStreamContract(_ctx context.Context) (*blobstreamwrapper.Wrappers, error) { - return network.GetLatestDeployedBlobStreamContractWithCustomTimeout(_ctx, 5*time.Minute) +func (network BlobstreamNetwork) GetLatestDeployedBlobstreamContract(_ctx context.Context) (*blobstreamwrapper.Wrappers, error) { + return network.GetLatestDeployedBlobstreamContractWithCustomTimeout(_ctx, 5*time.Minute) } -func (network BlobStreamNetwork) GetLatestDeployedBlobStreamContractWithCustomTimeout( +func (network BlobstreamNetwork) GetLatestDeployedBlobstreamContractWithCustomTimeout( _ctx context.Context, timeout time.Duration, ) (*blobstreamwrapper.Wrappers, error) { @@ -820,7 +820,7 @@ func (network BlobStreamNetwork) GetLatestDeployedBlobStreamContractWithCustomTi if receipt.ContractAddress == (ethcommon.Address{}) { continue } - // If the bridge is loaded, then it's the latest-deployed proxy BlobStream contract + // If the bridge is loaded, then it's the latest-deployed proxy Blobstream contract bridge, err := blobstreamwrapper.NewWrappers(receipt.ContractAddress, client) if err != nil { continue @@ -837,7 +837,7 @@ func (network BlobStreamNetwork) GetLatestDeployedBlobStreamContractWithCustomTi } } -func (network BlobStreamNetwork) WaitForRelayerToStart(_ctx context.Context, bridge *blobstreamwrapper.Wrappers) error { +func (network BlobstreamNetwork) WaitForRelayerToStart(_ctx context.Context, bridge *blobstreamwrapper.Wrappers) error { ctx, cancel := context.WithTimeout(_ctx, 2*time.Minute) for { select { @@ -862,7 +862,7 @@ func (network BlobStreamNetwork) WaitForRelayerToStart(_ctx context.Context, bri } } -func (network BlobStreamNetwork) WaitForEventNonce(ctx context.Context, bridge *blobstreamwrapper.Wrappers, n uint64) error { +func (network BlobstreamNetwork) WaitForEventNonce(ctx context.Context, bridge *blobstreamwrapper.Wrappers, n uint64) error { ctx, cancel := context.WithTimeout(ctx, 5*time.Minute) for { select { @@ -889,7 +889,7 @@ func (network BlobStreamNetwork) WaitForEventNonce(ctx context.Context, bridge * } } -func (network BlobStreamNetwork) UpdateDataCommitmentWindow(ctx context.Context, newWindow uint64) error { +func (network BlobstreamNetwork) UpdateDataCommitmentWindow(ctx context.Context, newWindow uint64) error { fmt.Printf("updating data commitment window %d\n", newWindow) kr, err := keyring.New( "blobstream-tests", @@ -983,13 +983,13 @@ func (network BlobStreamNetwork) UpdateDataCommitmentWindow(ctx context.Context, return nil } -func (network BlobStreamNetwork) PrintLogs() { +func (network BlobstreamNetwork) PrintLogs() { _ = network.Instance. WithCommand([]string{"logs"}). Invoke() } -func (network BlobStreamNetwork) GetLatestValset(ctx context.Context) (*types.Valset, error) { +func (network BlobstreamNetwork) GetLatestValset(ctx context.Context) (*types.Valset, error) { // create app querier appQuerier := rpc.NewAppQuerier(network.Logger, network.CelestiaGRPC, network.EncCfg) err := appQuerier.Start() @@ -1005,7 +1005,7 @@ func (network BlobStreamNetwork) GetLatestValset(ctx context.Context) (*types.Va return valset, nil } -func (network BlobStreamNetwork) GetCurrentDataCommitmentWindow(ctx context.Context) (uint64, error) { +func (network BlobstreamNetwork) GetCurrentDataCommitmentWindow(ctx context.Context) (uint64, error) { var window uint64 queryFun := func() error { blobStreamGRPC, err := grpc.Dial("localhost:9090", grpc.WithTransportCredentials(insecure.NewCredentials())) diff --git a/e2e/relayer_test.go b/e2e/relayer_test.go index 776505a4..408621b7 100644 --- a/e2e/relayer_test.go +++ b/e2e/relayer_test.go @@ -19,10 +19,10 @@ import ( func TestRelayerWithOneValidator(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -50,7 +50,7 @@ func TestRelayerWithOneValidator(t *testing.T) { _, _, err = network.WaitForOrchestratorToStart(ctx, dht, CORE0EVMADDRESS) HandleNetworkError(t, network, err, false) - bridge, err := network.GetLatestDeployedBlobStreamContract(ctx) + bridge, err := network.GetLatestDeployedBlobstreamContract(ctx) HandleNetworkError(t, network, err, false) latestNonce, err := network.GetLatestAttestationNonce(ctx) @@ -70,10 +70,10 @@ func TestRelayerWithOneValidator(t *testing.T) { func TestRelayerWithTwoValidators(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -116,7 +116,7 @@ func TestRelayerWithTwoValidators(t *testing.T) { // give the orchestrators some time to catchup time.Sleep(time.Second) - bridge, err := network.GetLatestDeployedBlobStreamContract(ctx) + bridge, err := network.GetLatestDeployedBlobstreamContract(ctx) HandleNetworkError(t, network, err, false) err = network.WaitForRelayerToStart(ctx, bridge) @@ -136,10 +136,10 @@ func TestRelayerWithTwoValidators(t *testing.T) { func TestRelayerWithMultipleValidators(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -191,7 +191,7 @@ func TestRelayerWithMultipleValidators(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 4, len(latestValset.Members)) - bridge, err := network.GetLatestDeployedBlobStreamContract(ctx) + bridge, err := network.GetLatestDeployedBlobstreamContract(ctx) HandleNetworkError(t, network, err, false) err = network.WaitForRelayerToStart(ctx, bridge) @@ -208,10 +208,10 @@ func TestRelayerWithMultipleValidators(t *testing.T) { func TestUpdatingTheDataCommitmentWindow(t *testing.T) { if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping BlobStream integration tests") + t.Skip("Skipping Blobstream integration tests") } - network, err := NewBlobStreamNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -278,7 +278,7 @@ func TestUpdatingTheDataCommitmentWindow(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 4, len(latestValset.Members)) - bridge, err := network.GetLatestDeployedBlobStreamContract(ctx) + bridge, err := network.GetLatestDeployedBlobstreamContract(ctx) HandleNetworkError(t, network, err, false) err = network.WaitForRelayerToStart(ctx, bridge) diff --git a/e2e/scripts/deploy_qgb_contract.sh b/e2e/scripts/deploy_qgb_contract.sh index e3dcdc18..881e7376 100644 --- a/e2e/scripts/deploy_qgb_contract.sh +++ b/e2e/scripts/deploy_qgb_contract.sh @@ -1,11 +1,11 @@ #!/bin/bash -# This script deploys the BlobStream contract and outputs the address to stdout. +# This script deploys the Blobstream contract and outputs the address to stdout. # check whether to deploy a new contract or no need if [[ "${DEPLOY_NEW_CONTRACT}" != "true" ]] then - echo "no need to deploy a new BlobStream contract. exiting..." + echo "no need to deploy a new Blobstream contract. exiting..." exit 0 fi @@ -61,7 +61,7 @@ done # import keys to deployer /bin/bstream deploy keys evm import ecdsa "${PRIVATE_KEY}" --evm.passphrase=123 -echo "deploying BlobStream contract..." +echo "deploying Blobstream contract..." /bin/bstream deploy \ --evm.chain-id "${EVM_CHAIN_ID}" \ diff --git a/e2e/scripts/start_relayer.sh b/e2e/scripts/start_relayer.sh index 61a87bee..f03a7590 100644 --- a/e2e/scripts/start_relayer.sh +++ b/e2e/scripts/start_relayer.sh @@ -1,6 +1,6 @@ #!/bin/bash -# This script runs the BlobStream relayer with the ability to deploy a new BlobStream contract or +# This script runs the Blobstream relayer with the ability to deploy a new Blobstream contract or # pass one as an environment variable BLOBSTREAM_CONTRACT # check if environment variables are set diff --git a/e2e/test_commons.go b/e2e/test_commons.go index 1a601bfa..866279a7 100644 --- a/e2e/test_commons.go +++ b/e2e/test_commons.go @@ -15,7 +15,7 @@ import ( const TRUE = "true" -func HandleNetworkError(t *testing.T, network *BlobStreamNetwork, err error, expectError bool) { +func HandleNetworkError(t *testing.T, network *BlobstreamNetwork, err error, expectError bool) { if expectError && err == nil { network.PrintLogs() assert.Error(t, err) @@ -31,7 +31,7 @@ func HandleNetworkError(t *testing.T, network *BlobStreamNetwork, err error, exp } } -func ConnectToDHT(ctx context.Context, h host.Host, dht *p2p.BlobStreamDHT, target peer.AddrInfo) error { +func ConnectToDHT(ctx context.Context, h host.Host, dht *p2p.BlobstreamDHT, target peer.AddrInfo) error { timeout := time.NewTimer(time.Minute) for { select { diff --git a/evm/evm_client.go b/evm/evm_client.go index 795a00d5..1bf41262 100644 --- a/evm/evm_client.go +++ b/evm/evm_client.go @@ -31,7 +31,7 @@ type Client struct { GasLimit uint64 } -// NewClient Creates a new EVM Client that can be used to deploy the BlobStream contract and +// NewClient Creates a new EVM Client that can be used to deploy the Blobstream contract and // interact with it. // The wrapper parameter can be nil when creating the client for contract deployment. func NewClient( @@ -62,21 +62,21 @@ func (ec *Client) NewEthClient() (*ethclient.Client, error) { return ethClient, nil } -// DeployBlobStreamContract Deploys the BlobStream contract and initializes it with the provided valset. +// DeployBlobstreamContract Deploys the Blobstream contract and initializes it with the provided valset. // The waitToBeMined, when set to true, will wait for the transaction to be included in a block, // and log relevant information. // The initBridge, when set to true, will assign the newly deployed bridge to the wrapper. This // can be used later for further interactions with the new contract. -// Multiple calls to DeployBlobStreamContract with the initBridge flag set to true will overwrite everytime +// Multiple calls to DeployBlobstreamContract with the initBridge flag set to true will overwrite everytime // the bridge contract. -func (ec *Client) DeployBlobStreamContract( +func (ec *Client) DeployBlobstreamContract( opts *bind.TransactOpts, contractBackend bind.ContractBackend, contractInitValset types.Valset, contractInitNonce uint64, initBridge bool, ) (gethcommon.Address, *coregethtypes.Transaction, *blobstreamwrapper.Wrappers, error) { - // deploy the BlobStream implementation contract + // deploy the Blobstream implementation contract impAddr, impTx, _, err := ec.DeployImplementation(opts, contractBackend) if err != nil { return gethcommon.Address{}, nil, nil, err @@ -84,7 +84,7 @@ func (ec *Client) DeployBlobStreamContract( ec.logger.Info("deploying QGB implementation contract...", "address", impAddr.Hex(), "tx_hash", impTx.Hash().Hex()) - // encode the BlobStream contract initialization data using the chain parameters + // encode the Blobstream contract initialization data using the chain parameters ethVsHash, err := contractInitValset.Hash() if err != nil { return gethcommon.Address{}, nil, nil, err @@ -103,7 +103,7 @@ func (ec *Client) DeployBlobStreamContract( opts.Nonce.Add(opts.Nonce, big.NewInt(1)) } - // deploy the ERC1967 proxy, link it to the BlobStream implementation contract, and initialize it + // deploy the ERC1967 proxy, link it to the Blobstream implementation contract, and initialize it proxyAddr, tx, _, err := ec.DeployERC1867Proxy(opts, contractBackend, impAddr, initData) if err != nil { return gethcommon.Address{}, nil, nil, err diff --git a/evm/evm_client_test.go b/evm/evm_client_test.go index 299de5ee..854bb054 100644 --- a/evm/evm_client_test.go +++ b/evm/evm_client_test.go @@ -15,7 +15,7 @@ import ( func (s *EVMTestSuite) TestSubmitDataCommitment() { // deploy a new bridge contract - _, _, _, err := s.Client.DeployBlobStreamContract(s.Chain.Auth, s.Chain.Backend, *s.InitVs, 1, true) + _, _, _, err := s.Client.DeployBlobstreamContract(s.Chain.Auth, s.Chain.Backend, *s.InitVs, 1, true) s.NoError(err) // we just need something to sign over, it doesn't matter what @@ -72,7 +72,7 @@ func (s *EVMTestSuite) TestSubmitDataCommitment() { func (s *EVMTestSuite) TestUpdateValset() { // deploy a new bridge contract - _, _, _, err := s.Client.DeployBlobStreamContract(s.Chain.Auth, s.Chain.Backend, *s.InitVs, 1, true) + _, _, _, err := s.Client.DeployBlobstreamContract(s.Chain.Auth, s.Chain.Backend, *s.InitVs, 1, true) s.NoError(err) updatedValset := celestiatypes.Valset{ diff --git a/orchestrator/broadcaster.go b/orchestrator/broadcaster.go index 2d866b0d..f6d874c1 100644 --- a/orchestrator/broadcaster.go +++ b/orchestrator/broadcaster.go @@ -9,23 +9,23 @@ import ( ) type Broadcaster struct { - BlobStreamDHT *p2p.BlobStreamDHT + BlobstreamDHT *p2p.BlobstreamDHT } -func NewBroadcaster(blobStreamDHT *p2p.BlobStreamDHT) *Broadcaster { - return &Broadcaster{BlobStreamDHT: blobStreamDHT} +func NewBroadcaster(blobStreamDHT *p2p.BlobstreamDHT) *Broadcaster { + return &Broadcaster{BlobstreamDHT: blobStreamDHT} } func (b Broadcaster) ProvideDataCommitmentConfirm(ctx context.Context, nonce uint64, confirm types.DataCommitmentConfirm, dataRootTupleRoot string) error { - if len(b.BlobStreamDHT.RoutingTable().ListPeers()) == 0 { + if len(b.BlobstreamDHT.RoutingTable().ListPeers()) == 0 { return ErrEmptyPeersTable } - return b.BlobStreamDHT.PutDataCommitmentConfirm(ctx, p2p.GetDataCommitmentConfirmKey(nonce, confirm.EthAddress, dataRootTupleRoot), confirm) + return b.BlobstreamDHT.PutDataCommitmentConfirm(ctx, p2p.GetDataCommitmentConfirmKey(nonce, confirm.EthAddress, dataRootTupleRoot), confirm) } func (b Broadcaster) ProvideValsetConfirm(ctx context.Context, nonce uint64, confirm types.ValsetConfirm, signBytes string) error { - if len(b.BlobStreamDHT.RoutingTable().ListPeers()) == 0 { + if len(b.BlobstreamDHT.RoutingTable().ListPeers()) == 0 { return ErrEmptyPeersTable } - return b.BlobStreamDHT.PutValsetConfirm(ctx, p2p.GetValsetConfirmKey(nonce, confirm.EthAddress, signBytes), confirm) + return b.BlobstreamDHT.PutValsetConfirm(ctx, p2p.GetValsetConfirmKey(nonce, confirm.EthAddress, signBytes), confirm) } diff --git a/orchestrator/broadcaster_test.go b/orchestrator/broadcaster_test.go index b53a01b3..519cd694 100644 --- a/orchestrator/broadcaster_test.go +++ b/orchestrator/broadcaster_test.go @@ -101,7 +101,7 @@ func TestBroadcastValsetConfirm(t *testing.T) { // table is empty. func TestEmptyPeersTable(t *testing.T) { _, _, dht := blobstreamtesting.NewTestDHT(context.Background(), nil) - defer func(dht *p2p.BlobStreamDHT) { + defer func(dht *p2p.BlobstreamDHT) { err := dht.Close() if err != nil { require.NoError(t, err) diff --git a/orchestrator/orchestrator.go b/orchestrator/orchestrator.go index b13ec902..dfd1164c 100644 --- a/orchestrator/orchestrator.go +++ b/orchestrator/orchestrator.go @@ -306,7 +306,7 @@ func (orch Orchestrator) Process(ctx context.Context, nonce uint64) error { // if nonce == 1, then, the current valset should sign the confirm. // In fact, the first nonce should never be signed. Because, the first attestation, in the case // where the `earliest` flag is specified when deploying the contract, will be relayed as part of - // the deployment of the BlobStream contract. + // the deployment of the Blobstream contract. // It will be signed temporarily for now. previousValset, err = orch.AppQuerier.QueryValsetByNonce(ctx, att.GetNonce()) if err != nil { diff --git a/p2p/dht.go b/p2p/dht.go index 75a46c95..b9e4aeea 100644 --- a/p2p/dht.go +++ b/p2p/dht.go @@ -19,16 +19,16 @@ const ( ValsetConfirmNamespace = "vc" ) -// BlobStreamDHT wrapper around the `IpfsDHT` implementation. +// BlobstreamDHT wrapper around the `IpfsDHT` implementation. // Used to add helper methods to easily handle the DHT. -type BlobStreamDHT struct { +type BlobstreamDHT struct { *dht.IpfsDHT logger tmlog.Logger } -// NewBlobStreamDHT create a new IPFS DHT using a suitable configuration for the BlobStream. +// NewBlobstreamDHT create a new IPFS DHT using a suitable configuration for the Blobstream. // If nil is passed for bootstrappers, the DHT will not try to connect to any existing peer. -func NewBlobStreamDHT(ctx context.Context, h host.Host, store ds.Batching, bootstrappers []peer.AddrInfo, logger tmlog.Logger) (*BlobStreamDHT, error) { +func NewBlobstreamDHT(ctx context.Context, h host.Host, store ds.Batching, bootstrappers []peer.AddrInfo, logger tmlog.Logger) (*BlobstreamDHT, error) { // this value is set to 23 days, which is the unbonding period. // we want to have the signatures available for this whole period. providers.ProvideValidity = time.Hour * 24 * 23 @@ -48,7 +48,7 @@ func NewBlobStreamDHT(ctx context.Context, h host.Host, store ds.Batching, boots return nil, err } - return &BlobStreamDHT{ + return &BlobstreamDHT{ IpfsDHT: router, logger: logger, }, nil @@ -57,7 +57,7 @@ func NewBlobStreamDHT(ctx context.Context, h host.Host, store ds.Batching, boots // WaitForPeers waits for peers to be connected to the DHT. // Returns nil if the context is done or the peers list has more peers than the specified peersThreshold. // Returns error if it times out. -func (q BlobStreamDHT) WaitForPeers(ctx context.Context, timeout time.Duration, rate time.Duration, peersThreshold int) error { +func (q BlobstreamDHT) WaitForPeers(ctx context.Context, timeout time.Duration, rate time.Duration, peersThreshold int) error { if peersThreshold < 1 { return ErrPeersThresholdCannotBeNegative } @@ -101,7 +101,7 @@ func (q BlobStreamDHT) WaitForPeers(ctx context.Context, timeout time.Duration, // PutDataCommitmentConfirm encodes a data commitment confirm then puts its value to the DHT. // The key can be generated using the `GetDataCommitmentConfirmKey` method. // Returns an error if it fails to do so. -func (q BlobStreamDHT) PutDataCommitmentConfirm(ctx context.Context, key string, dcc types.DataCommitmentConfirm) error { +func (q BlobstreamDHT) PutDataCommitmentConfirm(ctx context.Context, key string, dcc types.DataCommitmentConfirm) error { encodedData, err := types.MarshalDataCommitmentConfirm(dcc) if err != nil { return err @@ -116,7 +116,7 @@ func (q BlobStreamDHT) PutDataCommitmentConfirm(ctx context.Context, key string, // GetDataCommitmentConfirm looks for a data commitment confirm referenced by its key in the DHT. // The key can be generated using the `GetDataCommitmentConfirmKey` method. // Returns an error if it fails to get the confirm. -func (q BlobStreamDHT) GetDataCommitmentConfirm(ctx context.Context, key string) (types.DataCommitmentConfirm, error) { +func (q BlobstreamDHT) GetDataCommitmentConfirm(ctx context.Context, key string) (types.DataCommitmentConfirm, error) { encodedConfirm, err := q.GetValue(ctx, key) // this is a blocking call, we should probably use timeout and channel if err != nil { return types.DataCommitmentConfirm{}, err @@ -131,7 +131,7 @@ func (q BlobStreamDHT) GetDataCommitmentConfirm(ctx context.Context, key string) // PutValsetConfirm encodes a valset confirm then puts its value to the DHT. // The key can be generated using the `GetValsetConfirmKey` method. // Returns an error if it fails to do so. -func (q BlobStreamDHT) PutValsetConfirm(ctx context.Context, key string, vc types.ValsetConfirm) error { +func (q BlobstreamDHT) PutValsetConfirm(ctx context.Context, key string, vc types.ValsetConfirm) error { encodedData, err := types.MarshalValsetConfirm(vc) if err != nil { return err @@ -146,7 +146,7 @@ func (q BlobStreamDHT) PutValsetConfirm(ctx context.Context, key string, vc type // GetValsetConfirm looks for a valset confirm referenced by its key in the DHT. // The key can be generated using the `GetValsetConfirmKey` method. // Returns an error if it fails to get the confirm. -func (q BlobStreamDHT) GetValsetConfirm(ctx context.Context, key string) (types.ValsetConfirm, error) { +func (q BlobstreamDHT) GetValsetConfirm(ctx context.Context, key string) (types.ValsetConfirm, error) { encodedConfirm, err := q.GetValue(ctx, key) // this is a blocking call, we should probably use timeout and channel if err != nil { return types.ValsetConfirm{}, err diff --git a/p2p/keys.go b/p2p/keys.go index 8f5c35e6..6b7132c2 100644 --- a/p2p/keys.go +++ b/p2p/keys.go @@ -11,7 +11,7 @@ import ( // - nonce: in hex format // - evm address: the 0x prefixed orchestrator EVM address in hex format // - data root tuple root: is the digest, in a 0x prefixed hex format, that is signed over for a -// data commitment and whose signature is relayed to the BlobStream smart contract. +// data commitment and whose signature is relayed to the Blobstream smart contract. // Expects the EVM address to be a correct address. func GetDataCommitmentConfirmKey(nonce uint64, evmAddr string, dataRootTupleRoot string) string { return "/" + DataCommitmentConfirmNamespace + "/" + @@ -24,7 +24,7 @@ func GetDataCommitmentConfirmKey(nonce uint64, evmAddr string, dataRootTupleRoot // - nonce: in hex format // - evm address: the orchestrator EVM address in hex format // - sign bytes: is the digest, in a 0x prefixed hex format, that is signed over for a valset and -// whose signature is relayed to the BlobStream smart contract. +// whose signature is relayed to the Blobstream smart contract. // Expects the EVM address to be a correct address. func GetValsetConfirmKey(nonce uint64, evmAddr string, signBytes string) string { return "/" + ValsetConfirmNamespace + "/" + diff --git a/p2p/querier.go b/p2p/querier.go index 8ff880ce..3be409ee 100644 --- a/p2p/querier.go +++ b/p2p/querier.go @@ -16,13 +16,13 @@ import ( // Querier used to query the DHT for confirms. type Querier struct { - BlobStreamDHT *BlobStreamDHT + BlobstreamDHT *BlobstreamDHT logger tmlog.Logger } -func NewQuerier(blobStreamDht *BlobStreamDHT, logger tmlog.Logger) *Querier { +func NewQuerier(blobStreamDht *BlobstreamDHT, logger tmlog.Logger) *Querier { return &Querier{ - BlobStreamDHT: blobStreamDht, + BlobstreamDHT: blobStreamDht, logger: logger, } } @@ -246,7 +246,7 @@ func (q Querier) QueryValsetConfirmByEVMAddress( address string, signBytes string, ) (*types.ValsetConfirm, error) { - confirm, err := q.BlobStreamDHT.GetValsetConfirm( + confirm, err := q.BlobstreamDHT.GetValsetConfirm( ctx, GetValsetConfirmKey(nonce, address, signBytes), ) @@ -264,7 +264,7 @@ func (q Querier) QueryValsetConfirmByEVMAddress( // and signed by the orchestrator whose EVM address is `address`. // Returns (nil, nil) if the confirm is not found func (q Querier) QueryDataCommitmentConfirmByEVMAddress(ctx context.Context, nonce uint64, address string, dataRootTupleRoot string) (*types.DataCommitmentConfirm, error) { - confirm, err := q.BlobStreamDHT.GetDataCommitmentConfirm( + confirm, err := q.BlobstreamDHT.GetDataCommitmentConfirm( ctx, GetDataCommitmentConfirmKey(nonce, address, dataRootTupleRoot), ) @@ -283,7 +283,7 @@ func (q Querier) QueryDataCommitmentConfirmByEVMAddress(ctx context.Context, non func (q Querier) QueryDataCommitmentConfirms(ctx context.Context, valset celestiatypes.Valset, nonce uint64, dataRootTupleRoot string) ([]types.DataCommitmentConfirm, error) { confirms := make([]types.DataCommitmentConfirm, 0) for _, member := range valset.Members { - confirm, err := q.BlobStreamDHT.GetDataCommitmentConfirm( + confirm, err := q.BlobstreamDHT.GetDataCommitmentConfirm( ctx, GetDataCommitmentConfirmKey(nonce, member.EvmAddress, dataRootTupleRoot), ) @@ -304,7 +304,7 @@ func (q Querier) QueryDataCommitmentConfirms(ctx context.Context, valset celesti func (q Querier) QueryValsetConfirms(ctx context.Context, nonce uint64, valset celestiatypes.Valset, signBytes string) ([]types.ValsetConfirm, error) { confirms := make([]types.ValsetConfirm, 0) for _, member := range valset.Members { - confirm, err := q.BlobStreamDHT.GetValsetConfirm( + confirm, err := q.BlobstreamDHT.GetValsetConfirm( ctx, GetValsetConfirmKey(nonce, member.EvmAddress, signBytes), ) diff --git a/relayer/relayer.go b/relayer/relayer.go index 6f388a82..0bfb491d 100644 --- a/relayer/relayer.go +++ b/relayer/relayer.go @@ -327,7 +327,7 @@ func (r *Relayer) SaveDataCommitmentSignaturesToStore(ctx context.Context, att c } // matchAttestationConfirmSigs matches and sorts the confirm signatures with the valset -// members as expected by the BlobStream contract. +// members as expected by the Blobstream contract. // Also, it leaves the non provided signatures as nil in the `sigs` slice: // https://github.com/celestiaorg/celestia-app/issues/628 func matchAttestationConfirmSigs( @@ -335,7 +335,7 @@ func matchAttestationConfirmSigs( currentValset celestiatypes.Valset, ) ([]wrapper.Signature, error) { sigs := make([]wrapper.Signature, len(currentValset.Members)) - // the BlobStream contract expects the signatures to be ordered by validators in valset + // the Blobstream contract expects the signatures to be ordered by validators in valset for i, val := range currentValset.Members { sig, has := signatures[val.EvmAddress] if !has { diff --git a/relayer/suite_test.go b/relayer/suite_test.go index b84a51a9..5f72ab25 100644 --- a/relayer/suite_test.go +++ b/relayer/suite_test.go @@ -34,7 +34,7 @@ func (s *RelayerTestSuite) SetupSuite() { go s.Node.EVMChain.PeriodicCommit(ctx, time.Millisecond) initVs, err := s.Relayer.AppQuerier.QueryLatestValset(s.Node.Context) require.NoError(t, err) - _, _, _, err = s.Relayer.EVMClient.DeployBlobStreamContract(s.Node.EVMChain.Auth, s.Node.EVMChain.Backend, *initVs, initVs.Nonce, true) + _, _, _, err = s.Relayer.EVMClient.DeployBlobstreamContract(s.Node.EVMChain.Auth, s.Node.EVMChain.Backend, *initVs, initVs.Nonce, true) require.NoError(t, err) } diff --git a/rpc/app_querier.go b/rpc/app_querier.go index c77ebaa2..a6397c5d 100644 --- a/rpc/app_querier.go +++ b/rpc/app_querier.go @@ -106,7 +106,7 @@ func (aq *AppQuerier) QueryDataCommitmentForHeight(ctx context.Context, height u return resp.DataCommitment, nil } -// QueryLatestDataCommitment query the latest data commitment in BlobStream state machine. +// QueryLatestDataCommitment query the latest data commitment in Blobstream state machine. func (aq *AppQuerier) QueryLatestDataCommitment(ctx context.Context) (*celestiatypes.DataCommitment, error) { queryClient := celestiatypes.NewQueryClient(aq.clientConn) resp, err := queryClient.LatestDataCommitment(ctx, &celestiatypes.QueryLatestDataCommitmentRequest{}) diff --git a/store/init.go b/store/init.go index ac949d3b..afe36b23 100644 --- a/store/init.go +++ b/store/init.go @@ -35,7 +35,7 @@ type InitOptions struct { NeedP2PKeyStore bool } -// Init initializes the BlobStream file system in the directory under +// Init initializes the Blobstream file system in the directory under // 'path'. // It also creates a lock under that directory, so it can't be used // by multiple processes. diff --git a/store/store.go b/store/store.go index e452a873..6d4d10d6 100644 --- a/store/store.go +++ b/store/store.go @@ -15,7 +15,7 @@ import ( tmlog "github.com/tendermint/tendermint/libs/log" ) -// Store contains relevant information about the BlobStream store. +// Store contains relevant information about the Blobstream store. type Store struct { // DataStore provides a Datastore - a KV store for dht p2p data to be stored on disk. DataStore datastore.Batching @@ -29,7 +29,7 @@ type Store struct { // P2PKeyStore provides a keystore for P2P private keys. P2PKeyStore *keystore2.FSKeystore - // Path the path to the BlobStream storage root. + // Path the path to the Blobstream storage root. Path string // storeLock protects directory when the data store is open. diff --git a/testing/dht_network.go b/testing/dht_network.go index 82ddbb76..63c5c8ad 100644 --- a/testing/dht_network.go +++ b/testing/dht_network.go @@ -19,7 +19,7 @@ type DHTNetwork struct { Context context.Context Hosts []host.Host Stores []ds.Batching - DHTs []*p2p.BlobStreamDHT + DHTs []*p2p.BlobstreamDHT } // NewDHTNetwork creates a new DHT test network running in-memory. @@ -34,7 +34,7 @@ func NewDHTNetwork(ctx context.Context, count int) *DHTNetwork { } hosts := make([]host.Host, count) stores := make([]ds.Batching, count) - dhts := make([]*p2p.BlobStreamDHT, count) + dhts := make([]*p2p.BlobstreamDHT, count) for i := 0; i < count; i++ { if i == 0 { hosts[i], stores[i], dhts[i] = NewTestDHT(ctx, nil) @@ -59,13 +59,13 @@ func NewDHTNetwork(ctx context.Context, count int) *DHTNetwork { } // NewTestDHT creates a test DHT not connected to any peers. -func NewTestDHT(ctx context.Context, bootstrappers []peer.AddrInfo) (host.Host, ds.Batching, *p2p.BlobStreamDHT) { +func NewTestDHT(ctx context.Context, bootstrappers []peer.AddrInfo) (host.Host, ds.Batching, *p2p.BlobstreamDHT) { h, err := libp2p.New() if err != nil { panic(err) } dataStore := dssync.MutexWrap(ds.NewMapDatastore()) - dht, err := p2p.NewBlobStreamDHT(ctx, h, dataStore, bootstrappers, tmlog.NewNopLogger()) + dht, err := p2p.NewBlobstreamDHT(ctx, h, dataStore, bootstrappers, tmlog.NewNopLogger()) if err != nil { panic(err) } @@ -73,7 +73,7 @@ func NewTestDHT(ctx context.Context, bootstrappers []peer.AddrInfo) (host.Host, } // WaitForPeerTableToUpdate waits for nodes to have updated their peers list -func WaitForPeerTableToUpdate(ctx context.Context, dhts []*p2p.BlobStreamDHT, timeout time.Duration) error { +func WaitForPeerTableToUpdate(ctx context.Context, dhts []*p2p.BlobstreamDHT, timeout time.Duration) error { withTimeout, cancel := context.WithTimeout(ctx, timeout) defer cancel() ticker := time.NewTicker(time.Millisecond) diff --git a/types/data_commitment_confirm.go b/types/data_commitment_confirm.go index 66147c10..ad391a0e 100644 --- a/types/data_commitment_confirm.go +++ b/types/data_commitment_confirm.go @@ -57,7 +57,7 @@ func IsEmptyMsgDataCommitmentConfirm(dcc DataCommitmentConfirm) bool { } // DataCommitmentTupleRootSignBytes EncodeDomainSeparatedDataCommitment takes the required input data and -// produces the required signature to confirm a validator set update on the BlobStream Ethereum contract. +// produces the required signature to confirm a validator set update on the Blobstream Ethereum contract. // This value will then be signed before being submitted to Cosmos, verified, and then relayed to Ethereum. func DataCommitmentTupleRootSignBytes(nonce *big.Int, commitment []byte) ethcmn.Hash { var dataCommitment [32]uint8 diff --git a/types/valset_confirm.go b/types/valset_confirm.go index 5537e261..33c66782 100644 --- a/types/valset_confirm.go +++ b/types/valset_confirm.go @@ -14,7 +14,7 @@ import ( // // If a sufficient number of validators (66% of voting power) submit ValsetConfirm // messages with their signatures, it is then possible for anyone to query them from -// the BlobStream P2P network and submit them to Ethereum to update the validator set. +// the Blobstream P2P network and submit them to Ethereum to update the validator set. type ValsetConfirm struct { // Ethereum address, associated to the orchestrator, used to sign the `ValSet` // message.