diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 9298e501..df6ff3bc 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -22,6 +22,6 @@ jobs: uses: goreleaser/goreleaser-action@v5.0.0 with: args: release --rm-dist - workdir: ./cmd/qgb + workdir: ./cmd/blobstream env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4b241b4..473f4ae3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: - name: Run tests in race mode run: make test-race - test-qgb-e2e: + test-blobstream-e2e: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -62,4 +62,4 @@ jobs: working-directory: ./e2e run: go test -test.timeout 60m -failfast -v github.com/celestiaorg/orchestrator-relayer/e2e # yamllint disable-line rule:line-length env: - QGB_INTEGRATION_TEST: true + BLOBSTREAM_INTEGRATION_TEST: true diff --git a/Dockerfile b/Dockerfile index 5257da31..caa342e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# stage 1 Build qgb binary +# stage 1 Build blobstream binary FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.3-alpine3.18 as builder RUN apk update && apk --no-cache add make gcc musl-dev git bash @@ -27,7 +27,7 @@ RUN apk update && apk add --no-cache \ -s /sbin/nologin \ -u ${UID} -COPY --from=builder /orchestrator-relayer/build/qgb /bin/qgb +COPY --from=builder /orchestrator-relayer/build/blobstream /bin/blobstream COPY --chown=${USER_NAME}:${USER_NAME} docker/entrypoint.sh /opt/entrypoint.sh USER ${USER_NAME} diff --git a/Makefile b/Makefile index b48ab2e9..6c360e5b 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ DOCKER := $(shell which docker) all: install install: go.sum - @echo "--> Installing qgb" - @go install -mod=readonly ./cmd/qgb + @echo "--> Installing blobstream" + @go install -mod=readonly ./cmd/blobstream go.sum: mod @echo "--> Verifying dependencies have expected content" @@ -24,7 +24,7 @@ pre-build: build: mod @mkdir -p build/ - @go build -o build ./cmd/qgb + @go build -o build ./cmd/blobstream build-docker: @echo "--> Building Docker image" diff --git a/README.md b/README.md index bed0d9de..67975349 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # orchestrator-relayer -Contains the implementation of the QGB orchestrator and relayer. +Contains the implementation of the Blobstream orchestrator and relayer. -The orchestrator is the software that signs the QGB attestations, and the relayer is the one that relays them to the target EVM chain. +The orchestrator is the software that signs Blobstream attestations, and the relayer is the one that relays them to the target EVM chain. -For a high-level overview of how the QGB 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 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 QGB CLI +3. Install the Blobstream CLI ```shell make install @@ -20,16 +20,16 @@ make install ```sh # Print help -qgb --help +blobstream --help ``` ## How to run 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 QGB 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 QGB 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 QGB 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 @@ -41,7 +41,7 @@ Note: the QGB P2P network is a separate network than the consensus or the data a ### Helpful Commands ```sh -# Build a new orchestrator-relayer binary and output to build/qgb +# Build a new orchestrator-relayer binary and output to build/blobstream make build # Run tests @@ -53,10 +53,10 @@ make fmt ## Useful links -The smart contract implementation is in [quantum-gravity-bridge](https://github.com/celestiaorg/quantum-gravity-bridge/). +The smart contract implementation is in [blobstream-contracts](https://github.com/celestiaorg/blobstream-contracts). -The state machine implementation is in [x/qgb](https://github.com/celestiaorg/celestia-app/tree/main/x/qgb). +The state machine implementation is in [x/blobstream](https://github.com/celestiaorg/celestia-app/tree/main/x/blobstream). -QGB 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). -QGB 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/qgb/base/config.go b/cmd/blobstream/base/config.go similarity index 96% rename from cmd/qgb/base/config.go rename to cmd/blobstream/base/config.go index 68c42823..4c09783a 100644 --- a/cmd/qgb/base/config.go +++ b/cmd/blobstream/base/config.go @@ -24,7 +24,7 @@ type Config struct { EVMPassphrase string } -// DefaultServicePath constructs the default qgb 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/qgb/bootstrapper/cmd.go b/cmd/blobstream/bootstrapper/cmd.go similarity index 92% rename from cmd/qgb/bootstrapper/cmd.go rename to cmd/blobstream/bootstrapper/cmd.go index 4f71389b..e9e91962 100644 --- a/cmd/qgb/bootstrapper/cmd.go +++ b/cmd/blobstream/bootstrapper/cmd.go @@ -6,7 +6,7 @@ import ( "strings" "time" - p2pcmd "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/p2p" + p2pcmd "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/p2p" "github.com/celestiaorg/orchestrator-relayer/helpers" "github.com/celestiaorg/orchestrator-relayer/p2p" "github.com/celestiaorg/orchestrator-relayer/store" @@ -21,7 +21,7 @@ func Command() *cobra.Command { bsCmd := &cobra.Command{ Use: "bootstrapper", Aliases: []string{"bs"}, - Short: "QGB 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.NewQgbDHT(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 QGB 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/qgb/bootstrapper/config.go b/cmd/blobstream/bootstrapper/config.go similarity index 88% rename from cmd/qgb/bootstrapper/config.go rename to cmd/blobstream/bootstrapper/config.go index c5e751fb..19310dbd 100644 --- a/cmd/qgb/bootstrapper/config.go +++ b/cmd/blobstream/bootstrapper/config.go @@ -1,7 +1,7 @@ package bootstrapper import ( - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base" "github.com/spf13/cobra" ) @@ -14,7 +14,7 @@ func addStartFlags(cmd *cobra.Command) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The qgb 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 qgb bootstrappers home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream bootstrappers home directory") return cmd } diff --git a/cmd/qgb/common/helpers.go b/cmd/blobstream/common/helpers.go similarity index 92% rename from cmd/qgb/common/helpers.go rename to cmd/blobstream/common/helpers.go index 45a19f92..934a2d3b 100644 --- a/cmd/qgb/common/helpers.go +++ b/cmd/blobstream/common/helpers.go @@ -12,7 +12,7 @@ import ( "github.com/celestiaorg/celestia-app/app" "github.com/celestiaorg/celestia-app/app/encoding" - common2 "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/p2p" + common2 "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/p2p" "github.com/celestiaorg/orchestrator-relayer/helpers" "github.com/celestiaorg/orchestrator-relayer/p2p" "github.com/celestiaorg/orchestrator-relayer/rpc" @@ -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 QGB 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.QgbDHT, 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.NewQgbDHT(ctx, h, dataStore, aIBootstrappers, logger) + dht, err := p2p.NewBlobstreamDHT(ctx, h, dataStore, aIBootstrappers, logger) if err != nil { return nil, err } diff --git a/cmd/qgb/deploy/cmd.go b/cmd/blobstream/deploy/cmd.go similarity index 84% rename from cmd/qgb/deploy/cmd.go rename to cmd/blobstream/deploy/cmd.go index c9a8d7a9..2866d4e4 100644 --- a/cmd/qgb/deploy/cmd.go +++ b/cmd/blobstream/deploy/cmd.go @@ -5,9 +5,9 @@ import ( "os" "strconv" - evm2 "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/evm" + evm2 "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/evm" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -25,7 +25,7 @@ import ( func Command() *cobra.Command { command := &cobra.Command{ Use: "deploy ", - Short: "Deploys the QGB 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 { @@ -37,7 +37,7 @@ func Command() *cobra.Command { // checking if the provided home is already initiated isInit := store.IsInit(logger, config.Home, store.InitOptions{NeedEVMKeyStore: true}) if !isInit { - logger.Info("please initialize the EVM keystore using the `qgb deploy keys add/import` command") + logger.Info("please initialize the EVM keystore using the `blobstream deploy keys add/import` command") return store.ErrNotInited } @@ -59,7 +59,7 @@ func Command() *cobra.Command { if err != nil { return errors.Wrap( err, - "cannot initialize the QGB 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.DeployQGBContract(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 QGB 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 QGB 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/qgb/deploy/config.go b/cmd/blobstream/deploy/config.go similarity index 93% rename from cmd/qgb/deploy/config.go rename to cmd/blobstream/deploy/config.go index dd30a890..f84cdc3b 100644 --- a/cmd/qgb/deploy/config.go +++ b/cmd/blobstream/deploy/config.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base" "github.com/celestiaorg/orchestrator-relayer/evm" "github.com/spf13/cobra" @@ -30,7 +30,7 @@ func addDeployFlags(cmd *cobra.Command) *cobra.Command { cmd.Flags().String( FlagStartingNonce, "latest", - "Specify the nonce to start the QGB 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 qgb 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/qgb/deploy/errors.go b/cmd/blobstream/deploy/errors.go similarity index 100% rename from cmd/qgb/deploy/errors.go rename to cmd/blobstream/deploy/errors.go diff --git a/cmd/qgb/generate/cmd.go b/cmd/blobstream/generate/cmd.go similarity index 100% rename from cmd/qgb/generate/cmd.go rename to cmd/blobstream/generate/cmd.go diff --git a/cmd/qgb/keys/common/common.go b/cmd/blobstream/keys/common/common.go similarity index 100% rename from cmd/qgb/keys/common/common.go rename to cmd/blobstream/keys/common/common.go diff --git a/cmd/qgb/keys/evm/config.go b/cmd/blobstream/keys/evm/config.go similarity index 90% rename from cmd/qgb/keys/evm/config.go rename to cmd/blobstream/keys/evm/config.go index 2620e3b0..a96834fc 100644 --- a/cmd/qgb/keys/evm/config.go +++ b/cmd/blobstream/keys/evm/config.go @@ -1,7 +1,7 @@ package evm import ( - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" ) @@ -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 qgb 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 qgb 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/qgb/keys/evm/evm.go b/cmd/blobstream/keys/evm/evm.go similarity index 99% rename from cmd/qgb/keys/evm/evm.go rename to cmd/blobstream/keys/evm/evm.go index c2ed957e..4af6eb8a 100644 --- a/cmd/qgb/keys/evm/evm.go +++ b/cmd/blobstream/keys/evm/evm.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/keystore" - common2 "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/common" + common2 "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/common" "github.com/celestiaorg/orchestrator-relayer/store" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" @@ -21,7 +21,7 @@ import ( func Root(serviceName string) *cobra.Command { evmCmd := &cobra.Command{ Use: "evm", - Short: "QGB EVM keys manager", + Short: "Blobstream EVM keys manager", SilenceUsage: true, } diff --git a/cmd/qgb/keys/keys.go b/cmd/blobstream/keys/keys.go similarity index 63% rename from cmd/qgb/keys/keys.go rename to cmd/blobstream/keys/keys.go index e2c865a3..4733dd69 100644 --- a/cmd/qgb/keys/keys.go +++ b/cmd/blobstream/keys/keys.go @@ -1,15 +1,15 @@ package keys import ( - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/evm" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/p2p" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/evm" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/p2p" "github.com/spf13/cobra" ) func Command(serviceName string) *cobra.Command { keysCmd := &cobra.Command{ Use: "keys", - Short: "QGB keys manager", + Short: "Blobstream keys manager", SilenceUsage: true, } diff --git a/cmd/qgb/keys/p2p/config.go b/cmd/blobstream/keys/p2p/config.go similarity index 81% rename from cmd/qgb/keys/p2p/config.go rename to cmd/blobstream/keys/p2p/config.go index ba3bf5be..f2d76a47 100644 --- a/cmd/qgb/keys/p2p/config.go +++ b/cmd/blobstream/keys/p2p/config.go @@ -1,7 +1,7 @@ package p2p import ( - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" ) @@ -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 qgb p2p keys home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream p2p keys home directory") return cmd } diff --git a/cmd/qgb/keys/p2p/p2p.go b/cmd/blobstream/keys/p2p/p2p.go similarity index 98% rename from cmd/qgb/keys/p2p/p2p.go rename to cmd/blobstream/keys/p2p/p2p.go index 524cee54..1b5c9586 100644 --- a/cmd/qgb/keys/p2p/p2p.go +++ b/cmd/blobstream/keys/p2p/p2p.go @@ -7,7 +7,7 @@ import ( "github.com/ipfs/boxo/keystore" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/common" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/common" "github.com/celestiaorg/orchestrator-relayer/store" util "github.com/ipfs/boxo/util" "github.com/libp2p/go-libp2p/core/crypto" @@ -18,7 +18,7 @@ import ( func Root(serviceName string) *cobra.Command { p2pCmd := &cobra.Command{ Use: "p2p", - Short: "QGB p2p keys manager", + Short: "Blobstream p2p keys manager", SilenceUsage: true, } diff --git a/cmd/qgb/keys/p2p/p2p_test.go b/cmd/blobstream/keys/p2p/p2p_test.go similarity index 94% rename from cmd/qgb/keys/p2p/p2p_test.go rename to cmd/blobstream/keys/p2p/p2p_test.go index ec94a663..3d0c47b2 100644 --- a/cmd/qgb/keys/p2p/p2p_test.go +++ b/cmd/blobstream/keys/p2p/p2p_test.go @@ -3,7 +3,7 @@ package p2p_test import ( "testing" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/p2p" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/p2p" "github.com/ipfs/boxo/keystore" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/cmd/qgb/main.go b/cmd/blobstream/main.go similarity index 71% rename from cmd/qgb/main.go rename to cmd/blobstream/main.go index 863abd49..b09e1205 100644 --- a/cmd/qgb/main.go +++ b/cmd/blobstream/main.go @@ -4,7 +4,7 @@ import ( "context" "os" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/root" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/root" ) func main() { diff --git a/cmd/qgb/orchestrator/cmd.go b/cmd/blobstream/orchestrator/cmd.go similarity index 88% rename from cmd/qgb/orchestrator/cmd.go rename to cmd/blobstream/orchestrator/cmd.go index be31a76d..41fd21bd 100644 --- a/cmd/qgb/orchestrator/cmd.go +++ b/cmd/blobstream/orchestrator/cmd.go @@ -5,12 +5,12 @@ import ( "os" "time" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/common" - evm2 "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/evm" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/common" + evm2 "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/evm" "github.com/celestiaorg/orchestrator-relayer/p2p" dssync "github.com/ipfs/go-datastore/sync" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys" "github.com/celestiaorg/orchestrator-relayer/store" "github.com/celestiaorg/orchestrator-relayer/helpers" @@ -23,7 +23,7 @@ func Command() *cobra.Command { orchCmd := &cobra.Command{ Use: "orchestrator", Aliases: []string{"orch"}, - Short: "QGB 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 QGB 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.QgbDHT) + 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 QGB 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/qgb/orchestrator/config.go b/cmd/blobstream/orchestrator/config.go similarity index 94% rename from cmd/qgb/orchestrator/config.go rename to cmd/blobstream/orchestrator/config.go index 3d52492d..eff7cd24 100644 --- a/cmd/qgb/orchestrator/config.go +++ b/cmd/blobstream/orchestrator/config.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" ) @@ -32,7 +32,7 @@ func addOrchestratorFlags(cmd *cobra.Command) *cobra.Command { if err != nil { panic(err) } - cmd.Flags().String(base.FlagHome, homeDir, "The qgb 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 qgb orchestrator home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream orchestrator home directory") return cmd } diff --git a/cmd/qgb/query/cmd.go b/cmd/blobstream/query/cmd.go similarity index 96% rename from cmd/qgb/query/cmd.go rename to cmd/blobstream/query/cmd.go index 64b9d866..200954c4 100644 --- a/cmd/qgb/query/cmd.go +++ b/cmd/blobstream/query/cmd.go @@ -12,7 +12,7 @@ import ( common2 "github.com/ethereum/go-ethereum/common" celestiatypes "github.com/celestiaorg/celestia-app/x/qgb/types" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/common" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/common" "github.com/celestiaorg/orchestrator-relayer/p2p" "github.com/celestiaorg/orchestrator-relayer/rpc" "github.com/celestiaorg/orchestrator-relayer/types" @@ -29,7 +29,7 @@ func Command() *cobra.Command { queryCmd := &cobra.Command{ Use: "query", Aliases: []string{"q"}, - Short: "Query relevant information from a running QGB", + 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 QGB for attestations signers", - Long: "Queries the QGB 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.NewQgbDHT(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.NewQgbDHT(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/qgb/query/config.go b/cmd/blobstream/query/config.go similarity index 96% rename from cmd/qgb/query/config.go rename to cmd/blobstream/query/config.go index e2a35f75..22e6c050 100644 --- a/cmd/qgb/query/config.go +++ b/cmd/blobstream/query/config.go @@ -3,7 +3,7 @@ package query import ( "fmt" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/relayer" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/relayer" "github.com/spf13/cobra" ) diff --git a/cmd/qgb/relayer/cmd.go b/cmd/blobstream/relayer/cmd.go similarity index 85% rename from cmd/qgb/relayer/cmd.go rename to cmd/blobstream/relayer/cmd.go index 59ecd263..4b5e0c83 100644 --- a/cmd/qgb/relayer/cmd.go +++ b/cmd/blobstream/relayer/cmd.go @@ -5,14 +5,14 @@ import ( "os" "time" - qgbwrapper "github.com/celestiaorg/quantum-gravity-bridge/v2/wrappers/QuantumGravityBridge.sol" + blobstreamwrapper "github.com/celestiaorg/quantum-gravity-bridge/v2/wrappers/QuantumGravityBridge.sol" - evm2 "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys/evm" + evm2 "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys/evm" "github.com/celestiaorg/orchestrator-relayer/p2p" dssync "github.com/ipfs/go-datastore/sync" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/common" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/keys" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/common" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/keys" "github.com/celestiaorg/orchestrator-relayer/evm" "github.com/celestiaorg/orchestrator-relayer/helpers" "github.com/celestiaorg/orchestrator-relayer/store" @@ -27,7 +27,7 @@ func Command() *cobra.Command { relCmd := &cobra.Command{ Use: "relayer", Aliases: []string{"rel"}, - Short: "QGB 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 QGB 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 QGB 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,20 +145,20 @@ func Start() *cobra.Command { } }() - // connecting to a QGB contract + // connecting to a Blobstream contract ethClient, err := ethclient.Dial(config.evmRPC) if err != nil { return err } defer ethClient.Close() - qgbWrapper, err := qgbwrapper.NewWrappers(config.contractAddr, ethClient) + blobStreamWrapper, err := blobstreamwrapper.NewWrappers(config.contractAddr, ethClient) if err != nil { return err } evmClient := evm.NewClient( logger, - qgbWrapper, + blobStreamWrapper, s.EVMKeyStore, &acc, config.evmRPC, diff --git a/cmd/qgb/relayer/config.go b/cmd/blobstream/relayer/config.go similarity index 95% rename from cmd/qgb/relayer/config.go rename to cmd/blobstream/relayer/config.go index a5380029..a957fc91 100644 --- a/cmd/qgb/relayer/config.go +++ b/cmd/blobstream/relayer/config.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/base" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/base" "github.com/celestiaorg/orchestrator-relayer/evm" "github.com/spf13/cobra" @@ -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 qgb 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 qgb 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 qgb relayer home directory") + cmd.Flags().String(base.FlagHome, homeDir, "The Blobstream relayer home directory") return cmd } diff --git a/cmd/blobstream/root/cmd.go b/cmd/blobstream/root/cmd.go new file mode 100644 index 00000000..3d955c0a --- /dev/null +++ b/cmd/blobstream/root/cmd.go @@ -0,0 +1,38 @@ +package root + +import ( + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/bootstrapper" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/generate" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/query" + + "github.com/celestiaorg/celestia-app/x/qgb/client" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/deploy" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/orchestrator" + "github.com/celestiaorg/orchestrator-relayer/cmd/blobstream/relayer" + + "github.com/spf13/cobra" +) + +// 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: "blobstream", + Short: "The Blobstream CLI", + SilenceUsage: true, + } + + rootCmd.AddCommand( + orchestrator.Command(), + relayer.Command(), + deploy.Command(), + client.VerifyCmd(), + generate.Command(), + query.Command(), + bootstrapper.Command(), + ) + + rootCmd.SetHelpCommand(&cobra.Command{}) + + return rootCmd +} diff --git a/cmd/qgb/root/cmd.go b/cmd/qgb/root/cmd.go deleted file mode 100644 index b859cce6..00000000 --- a/cmd/qgb/root/cmd.go +++ /dev/null @@ -1,38 +0,0 @@ -package root - -import ( - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/bootstrapper" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/generate" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/query" - - "github.com/celestiaorg/celestia-app/x/qgb/client" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/deploy" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/orchestrator" - "github.com/celestiaorg/orchestrator-relayer/cmd/qgb/relayer" - - "github.com/spf13/cobra" -) - -// Cmd creates a new root command for the QGB CLI. It is called once in the -// main function. -func Cmd() *cobra.Command { - rootCmd := &cobra.Command{ - Use: "qgb", - Short: "The Quantum-Gravity-Bridge CLI", - SilenceUsage: true, - } - - rootCmd.AddCommand( - orchestrator.Command(), - relayer.Command(), - deploy.Command(), - client.VerifyCmd(), - generate.Command(), - query.Command(), - bootstrapper.Command(), - ) - - rootCmd.SetHelpCommand(&cobra.Command{}) - - return rootCmd -} diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index da160d68..7db3ac1b 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -2,7 +2,7 @@ set -e -echo "Starting Celestia QGB with command:" +echo "Starting Celestia Blobstream with command:" echo "$@" echo "" diff --git a/e2e/Dockerfile_e2e b/e2e/Dockerfile_e2e index bdc24548..1ff6c61d 100644 --- a/e2e/Dockerfile_e2e +++ b/e2e/Dockerfile_e2e @@ -1,4 +1,4 @@ -# stage 1 Build qgb binary +# stage 1 Build blobstream binary FROM golang:1.21.1-alpine as builder RUN apk update && apk --no-cache add make gcc musl-dev git COPY . /orchestrator-relayer @@ -13,9 +13,9 @@ USER root # hadolint ignore=DL3018 RUN apk update && apk --no-cache add bash jq coreutils curl -COPY --from=builder /orchestrator-relayer/build/qgb /bin/qgb +COPY --from=builder /orchestrator-relayer/build/blobstream /bin/blobstream # p2p port EXPOSE 9090 26657 30000 -CMD [ "/bin/qgb" ] +CMD [ "/bin/blobstream" ] diff --git a/e2e/Makefile b/e2e/Makefile index 1ae17432..8e8b68d2 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -5,4 +5,4 @@ PACKAGES=$(shell go list ./...) all: test test: - @QGB_INTEGRATION_TEST=true go test -mod=readonly -failfast -test.timeout 50m -v $(PACKAGES) + @BLOBSTREAM_INTEGRATION_TEST=true go test -mod=readonly -failfast -test.timeout 50m -v $(PACKAGES) diff --git a/e2e/README.md b/e2e/README.md index ed4ef278..cda669b8 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -1,16 +1,16 @@ -# Quantum Gravity Bridge end to end integration test +# Blobstream end to end integration test -This directory contains the QGB e2e integration tests. It serves as a way to fully test the QGB 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 -as discussed under [#398](https://github.com/celestiaorg/celestia-app/issues/398) The e2e network defined under `qgb_network.go` has the following components: +as discussed under [#398](https://github.com/celestiaorg/celestia-app/issues/398) The e2e network defined under `blobstream_network.go` has the following components: - 4 Celestia-app nodes that can be validators - 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 QGB 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. @@ -22,7 +22,7 @@ In some test scenarios, we only care about running a single orchestrator node. T // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) -_, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) +_, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() ``` @@ -47,13 +47,13 @@ make test To run a single test, run the following: ```shell -QGB_INTEGRATION_TEST=true go test -mod=readonly -test.timeout 30m -v -run +BLOBSTREAM_INTEGRATION_TEST=true go test -mod=readonly -test.timeout 30m -v -run ``` ### Run all the tests using `go` directly ```shell -QGB_INTEGRATION_TEST=true go test -mod=readonly -test.timeout 30m -v +BLOBSTREAM_INTEGRATION_TEST=true go test -mod=readonly -test.timeout 30m -v ``` ## Common issues @@ -62,7 +62,7 @@ Currently, when the tests are run using the above ways, there are possible issue ### hanging docker containers after a sudden network stop -If the tests were stopped unexpectedly, for example, sending a `SIGINT`, ie, `ctrl+c`, the resources will not be releases correctly (might be fixed in the future). This will result in seeing similar logs to the following : +If the tests were stopped unexpectedly, for example, sending a `SIGINT`, ie, `ctrl+c`, the resources will not be released correctly (might be fixed in the future). This will result in seeing similar logs to the following : ```text ERROR: for core0 Cannot create container for service core0: Conflict. The container name "/core0" is already in use by container "4bdaf40e2cd26bf549738ea95f53ba49cb5407c3d892b50b5a75e72e08e @@ -87,4 +87,4 @@ To fix it, run the `cleanup.sh` script under `scripts` directory : ./scripts/cleanup.sh ``` -NB : This will kill and remove hanging containers and networks related to the executed. But, might also delete unrelated ones if they have the same name. +NB: This will kill and remove hanging containers and networks related to the executed. But might also delete unrelated ones if they have the same name. diff --git a/e2e/celestia-app/config.toml b/e2e/celestia-app/config.toml index eb236f16..d1fe4eec 100644 --- a/e2e/celestia-app/config.toml +++ b/e2e/celestia-app/config.toml @@ -15,7 +15,7 @@ proxy_app = "tcp://127.0.0.1:26658" # A custom human readable name for this node -moniker = "qgb-e2e" +moniker = "blobstream-e2e" # If this node is many blocks behind the tip of the chain, FastSync # allows them to catchup quickly by downloading blocks in parallel diff --git a/e2e/celestia-app/core0/config/gentx/gentx-40664e2a69d5557b0d35ec8b9d423785b12579b7.json b/e2e/celestia-app/core0/config/gentx/gentx-40664e2a69d5557b0d35ec8b9d423785b12579b7.json deleted file mode 100644 index ef81cc67..00000000 --- a/e2e/celestia-app/core0/config/gentx/gentx-40664e2a69d5557b0d35ec8b9d423785b12579b7.json +++ /dev/null @@ -1 +0,0 @@ -{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"qgb-e2e","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a","validator_address":"celestiavaloper1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjrw6e8m","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"op2bcHACpdcKUxbdTmDnW2aTXpdZod37uYZBUeHhPlk="},"value":{"denom":"utia","amount":"5000000000"}}],"memo":"40664e2a69d5557b0d35ec8b9d423785b12579b7@192.168.122.1:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AsIx/It5+oWua4C/oHtVy6Ns3/z3omXy10uuKSVINbas"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"210000","payer":"","granter":""},"tip":null},"signatures":["PJugSCNf0gV/E9kvmwqnY8cAHE1sMzEwqbL7trr+HX9zFi5xfE/9oz2GNv9GbKthyv86Quk2bm9ZJTYz230yXQ=="]} diff --git a/e2e/celestia-app/core0/config/gentx/gentx-de74a671b839639ed638fd4140f797ddadb3c2f1.json b/e2e/celestia-app/core0/config/gentx/gentx-de74a671b839639ed638fd4140f797ddadb3c2f1.json new file mode 100644 index 00000000..d6df2326 --- /dev/null +++ b/e2e/celestia-app/core0/config/gentx/gentx-de74a671b839639ed638fd4140f797ddadb3c2f1.json @@ -0,0 +1 @@ +{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"blobstream-e2e","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a","validator_address":"celestiavaloper1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjrw6e8m","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"bYso1zvhv8DD3mUM688cUff7U90670GM1fjnMzAbGfg="},"value":{"denom":"utia","amount":"5000000000"}}],"memo":"de74a671b839639ed638fd4140f797ddadb3c2f1@192.168.122.1:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AsIx/It5+oWua4C/oHtVy6Ns3/z3omXy10uuKSVINbas"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"210000","payer":"","granter":""},"tip":null},"signatures":["ixd1gyJnu7JHEHfrEkXoerUNjIDweOcyM87Hfp8ByHtG+wrXgjiNLxHV6MLg29CjiwgCj5EEeyc2o5Y8OJW5/w=="]} diff --git a/e2e/celestia-app/core0/config/node_key.json b/e2e/celestia-app/core0/config/node_key.json index 854f27e2..7c7ec962 100644 --- a/e2e/celestia-app/core0/config/node_key.json +++ b/e2e/celestia-app/core0/config/node_key.json @@ -1 +1 @@ -{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"UBoGaJ3RKtemvZDfHxi7iD6V63+xovKmTDW3kC9VROxkAuNh13cNysawBtEHqZGBL6vOJfsl8oExXHMpiVn8lg=="}} \ No newline at end of file +{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"e7Js9od4TAqfyihJrc3+zFo9bQCEX0PD0ho5NJ2jjCfMh/nz645apZWJLLnlFa1iP376gJrJLnpDUN4tfXPb3w=="}} \ No newline at end of file diff --git a/e2e/celestia-app/core0/config/priv_validator_key.json b/e2e/celestia-app/core0/config/priv_validator_key.json index 15a48d24..b25f4db9 100644 --- a/e2e/celestia-app/core0/config/priv_validator_key.json +++ b/e2e/celestia-app/core0/config/priv_validator_key.json @@ -1,11 +1,11 @@ { - "address": "6B6C0A34D67E7E7CDDDA9EE525F7E56BBCB00449", + "address": "EB7463ED828FEB5FED88364EBB272044A0FD2990", "pub_key": { "type": "tendermint/PubKeyEd25519", - "value": "op2bcHACpdcKUxbdTmDnW2aTXpdZod37uYZBUeHhPlk=" + "value": "bYso1zvhv8DD3mUM688cUff7U90670GM1fjnMzAbGfg=" }, "priv_key": { "type": "tendermint/PrivKeyEd25519", - "value": "tdTqBDW51HtVCwavRABzBy2hBtlu0j7tlofLU77jh9+inZtwcAKl1wpTFt1OYOdbZpNel1mh3fu5hkFR4eE+WQ==" + "value": "itECjJ4X7YWn18RxDrNpQoXz8OI3VyBxv8PJOEGvUe5tiyjXO+G/wMPeZQzrzxxR9/tT3TrvQYzV+OczMBsZ+A==" } } \ No newline at end of file diff --git a/e2e/celestia-app/genesis.json b/e2e/celestia-app/genesis.json index 779ece17..8b07d56e 100644 --- a/e2e/celestia-app/genesis.json +++ b/e2e/celestia-app/genesis.json @@ -1,16 +1,16 @@ { - "genesis_time": "2023-08-19T12:26:21.927143572Z", - "chain_id": "qgb-e2e", + "genesis_time": "2023-10-11T23:57:54.655221669Z", + "chain_id": "blobstream-e2e", "initial_height": "1", "consensus_params": { "block": { - "max_bytes": "22020096", + "max_bytes": "1974272", "max_gas": "-1", - "time_iota_ms": "1000" + "time_iota_ms": "1" }, "evidence": { - "max_age_num_blocks": "100000", - "max_age_duration": "172800000000000", + "max_age_num_blocks": "120961", + "max_age_duration": "1814400000000000", "max_bytes": "1048576" }, "validator": { @@ -18,7 +18,9 @@ "ed25519" ] }, - "version": {} + "version": { + "app_version": "1" + } }, "app_hash": "", "app_state": { @@ -188,7 +190,7 @@ { "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", "description": { - "moniker": "qgb-e2e", + "moniker": "blobstream-e2e", "identity": "", "website": "", "security_contact": "", @@ -204,7 +206,7 @@ "validator_address": "celestiavaloper1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjrw6e8m", "pubkey": { "@type": "/cosmos.crypto.ed25519.PubKey", - "key": "op2bcHACpdcKUxbdTmDnW2aTXpdZod37uYZBUeHhPlk=" + "key": "bYso1zvhv8DD3mUM688cUff7U90670GM1fjnMzAbGfg=" }, "value": { "denom": "utia", @@ -212,7 +214,7 @@ } } ], - "memo": "40664e2a69d5557b0d35ec8b9d423785b12579b7@192.168.122.1:26656", + "memo": "de74a671b839639ed638fd4140f797ddadb3c2f1@192.168.122.1:26656", "timeout_height": "0", "extension_options": [], "non_critical_extension_options": [] @@ -241,7 +243,7 @@ "tip": null }, "signatures": [ - "PJugSCNf0gV/E9kvmwqnY8cAHE1sMzEwqbL7trr+HX9zFi5xfE/9oz2GNv9GbKthyv86Quk2bm9ZJTYz230yXQ==" + "ixd1gyJnu7JHEHfrEkXoerUNjIDweOcyM87Hfp8ByHtG+wrXgjiNLxHV6MLg29CjiwgCj5EEeyc2o5Y8OJW5/w==" ] } ] @@ -255,7 +257,7 @@ "min_deposit": [ { "denom": "utia", - "amount": "100" + "amount": "10000000000" } ], "max_deposit_period": "172800s" @@ -313,11 +315,11 @@ }, "slashing": { "params": { - "signed_blocks_window": "100", - "min_signed_per_window": "0.500000000000000000", - "downtime_jail_duration": "600s", - "slash_fraction_double_sign": "0.050000000000000000", - "slash_fraction_downtime": "0.010000000000000000" + "signed_blocks_window": "5000", + "min_signed_per_window": "0.750000000000000000", + "downtime_jail_duration": "60s", + "slash_fraction_double_sign": "0.020000000000000000", + "slash_fraction_downtime": "0.000000000000000000" }, "signing_infos": [], "missed_blocks": [] diff --git a/e2e/celestia-app/genesis_template.json b/e2e/celestia-app/genesis_template.json index 6dbfae0e..a009ac65 100644 --- a/e2e/celestia-app/genesis_template.json +++ b/e2e/celestia-app/genesis_template.json @@ -1,16 +1,16 @@ { - "genesis_time": "", - "chain_id": "qgb-e2e", + "genesis_time": "2023-10-11T23:14:10.887740385Z", + "chain_id": "blobstream-e2e", "initial_height": "1", "consensus_params": { "block": { - "max_bytes": "22020096", + "max_bytes": "1974272", "max_gas": "-1", - "time_iota_ms": "1000" + "time_iota_ms": "1" }, "evidence": { - "max_age_num_blocks": "100000", - "max_age_duration": "172800000000000", + "max_age_num_blocks": "120961", + "max_age_duration": "1814400000000000", "max_bytes": "1048576" }, "validator": { @@ -18,7 +18,9 @@ "ed25519" ] }, - "version": {} + "version": { + "app_version": "1" + } }, "app_hash": "", "app_state": { @@ -188,7 +190,7 @@ { "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", "description": { - "moniker": "qgb-e2e", + "moniker": "blobstream-e2e", "identity": "", "website": "", "security_contact": "", @@ -204,7 +206,7 @@ "validator_address": "celestiavaloper1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjrw6e8m", "pubkey": { "@type": "/cosmos.crypto.ed25519.PubKey", - "key": "op2bcHACpdcKUxbdTmDnW2aTXpdZod37uYZBUeHhPlk=" + "key": "bYso1zvhv8DD3mUM688cUff7U90670GM1fjnMzAbGfg=" }, "value": { "denom": "utia", @@ -212,7 +214,7 @@ } } ], - "memo": "40664e2a69d5557b0d35ec8b9d423785b12579b7@192.168.122.1:26656", + "memo": "de74a671b839639ed638fd4140f797ddadb3c2f1@192.168.122.1:26656", "timeout_height": "0", "extension_options": [], "non_critical_extension_options": [] @@ -241,7 +243,7 @@ "tip": null }, "signatures": [ - "PJugSCNf0gV/E9kvmwqnY8cAHE1sMzEwqbL7trr+HX9zFi5xfE/9oz2GNv9GbKthyv86Quk2bm9ZJTYz230yXQ==" + "ixd1gyJnu7JHEHfrEkXoerUNjIDweOcyM87Hfp8ByHtG+wrXgjiNLxHV6MLg29CjiwgCj5EEeyc2o5Y8OJW5/w==" ] } ] @@ -255,7 +257,7 @@ "min_deposit": [ { "denom": "utia", - "amount": "100" + "amount": "10000000000" } ], "max_deposit_period": "172800s" @@ -313,11 +315,11 @@ }, "slashing": { "params": { - "signed_blocks_window": "100", - "min_signed_per_window": "0.500000000000000000", - "downtime_jail_duration": "600s", - "slash_fraction_double_sign": "0.050000000000000000", - "slash_fraction_downtime": "0.010000000000000000" + "signed_blocks_window": "5000", + "min_signed_per_window": "0.750000000000000000", + "downtime_jail_duration": "60s", + "slash_fraction_double_sign": "0.020000000000000000", + "slash_fraction_downtime": "0.000000000000000000" }, "signing_infos": [], "missed_blocks": [] diff --git a/e2e/deployer_test.go b/e2e/deployer_test.go index 9b92b976..f29ca46e 100644 --- a/e2e/deployer_test.go +++ b/e2e/deployer_test.go @@ -13,11 +13,11 @@ import ( ) func TestDeployer(t *testing.T) { - if os.Getenv("QGB_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping QGB integration tests") + if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { + t.Skip("Skipping Blobstream integration tests") } - network, err := NewQGBNetwork() + 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.GetLatestDeployedQGBContractWithCustomTimeout(ctx, 15*time.Second) + _, err = network.GetLatestDeployedBlobstreamContractWithCustomTimeout(ctx, 15*time.Second) HandleNetworkError(t, network, err, true) - err = network.DeployQGBContract() + err = network.DeployBlobstreamContract() HandleNetworkError(t, network, err, false) - bridge, err := network.GetLatestDeployedQGBContract(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 ebe420a7..7a91bf99 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -259,7 +259,7 @@ services: environment: # By default, we don't want to run the deploy on each run. - DEPLOY_NEW_CONTRACT=false - - EVM_CHAIN_ID=qgb-e2e + - EVM_CHAIN_ID=blobstream-e2e - EVM_ACCOUNT=0x95359c3348e189ef7781546e6E13c80230fC9fB5 - PRIVATE_KEY=0e9688e585562e828dcbd4f402d5eddf686f947fb6bf75894a85bf008b017401 - CORE_RPC_HOST=core0 @@ -273,10 +273,10 @@ services: "/bin/bash" ] command: [ - "/opt/deploy_qgb_contract.sh" + "/opt/deploy_blobstream_contract.sh" ] volumes: - - ${PWD}/scripts/deploy_qgb_contract.sh:/opt/deploy_qgb_contract.sh:ro + - ${PWD}/scripts/deploy_blobstream_contract.sh:/opt/deploy_blobstream_contract.sh:ro relayer: container_name: relayer @@ -289,7 +289,7 @@ services: ports: - "30004:30000" environment: - - EVM_CHAIN_ID=qgb-e2e + - EVM_CHAIN_ID=blobstream-e2e - EVM_ACCOUNT=0x95359c3348e189ef7781546e6E13c80230fC9fB5 - PRIVATE_KEY=0e9688e585562e828dcbd4f402d5eddf686f947fb6bf75894a85bf008b017401 - CORE_RPC_HOST=core0 @@ -302,8 +302,8 @@ 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 QGB contract -# - QGB_CONTRACT=0x123 +# if you want to relay to an existing Blobstream contract +# - BLOBSTREAM_CONTRACT=0x123 entrypoint: [ "/bin/bash" ] @@ -312,4 +312,4 @@ services: ] volumes: - ${PWD}/scripts/start_relayer.sh:/opt/start_relayer.sh:ro - - ${PWD}/scripts/deploy_qgb_contract.sh:/opt/deploy_qgb_contract.sh:ro + - ${PWD}/scripts/deploy_blobstream_contract.sh:/opt/deploy_blobstream_contract.sh:ro diff --git a/e2e/orchestrator_test.go b/e2e/orchestrator_test.go index 6898ffa7..abda2480 100644 --- a/e2e/orchestrator_test.go +++ b/e2e/orchestrator_test.go @@ -8,18 +8,18 @@ import ( "github.com/celestiaorg/orchestrator-relayer/helpers" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestOrchestratorWithOneValidator(t *testing.T) { - if os.Getenv("QGB_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping QGB integration tests") + if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { + t.Skip("Skipping Blobstream integration tests") } - network, err := NewQGBNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -42,7 +42,7 @@ func TestOrchestratorWithOneValidator(t *testing.T) { // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) - host, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) + host, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() // force the connection to the DHT to start the orchestrator @@ -67,11 +67,11 @@ func TestOrchestratorWithOneValidator(t *testing.T) { } func TestOrchestratorWithTwoValidators(t *testing.T) { - if os.Getenv("QGB_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping QGB integration tests") + if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { + t.Skip("Skipping Blobstream integration tests") } - network, err := NewQGBNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -103,7 +103,7 @@ func TestOrchestratorWithTwoValidators(t *testing.T) { // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) - host, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) + host, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() // force the connection to the DHT to start the orchestrator @@ -156,11 +156,11 @@ func TestOrchestratorWithTwoValidators(t *testing.T) { } func TestOrchestratorWithMultipleValidators(t *testing.T) { - if os.Getenv("QGB_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping QGB integration tests") + if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { + t.Skip("Skipping Blobstream integration tests") } - network, err := NewQGBNetwork() + network, err := NewBlobstreamNetwork() assert.NoError(t, err) // to release resources after tests @@ -179,7 +179,7 @@ func TestOrchestratorWithMultipleValidators(t *testing.T) { // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) - host, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) + host, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() // force the connection to the DHT to start the orchestrator @@ -245,11 +245,11 @@ func TestOrchestratorWithMultipleValidators(t *testing.T) { } func TestOrchestratorReplayOld(t *testing.T) { - if os.Getenv("QGB_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping QGB integration tests") + if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { + t.Skip("Skipping Blobstream integration tests") } - network, err := NewQGBNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -284,7 +284,7 @@ func TestOrchestratorReplayOld(t *testing.T) { // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) - host, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) + host, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() // force the connection to the DHT to start the orchestrator diff --git a/e2e/qgb_network.go b/e2e/qgb_network.go index 3618e5ea..a68704df 100644 --- a/e2e/qgb_network.go +++ b/e2e/qgb_network.go @@ -19,14 +19,14 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - qgbwrapper "github.com/celestiaorg/quantum-gravity-bridge/v2/wrappers/QuantumGravityBridge.sol" + blobstreamwrapper "github.com/celestiaorg/quantum-gravity-bridge/v2/wrappers/QuantumGravityBridge.sol" "github.com/celestiaorg/celestia-app/app" "github.com/celestiaorg/celestia-app/app/encoding" "github.com/celestiaorg/celestia-app/x/qgb/types" "github.com/celestiaorg/orchestrator-relayer/p2p" "github.com/celestiaorg/orchestrator-relayer/rpc" - qgbtypes "github.com/celestiaorg/orchestrator-relayer/types" + blobstreamtypes "github.com/celestiaorg/orchestrator-relayer/types" "github.com/ethereum/go-ethereum/accounts/abi/bind" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" @@ -36,7 +36,7 @@ import ( testcontainers "github.com/testcontainers/testcontainers-go/modules/compose" ) -type QGBNetwork struct { +type BlobstreamNetwork struct { ComposePaths []string Identifier string Instance *testcontainers.LocalDockerCompose @@ -53,7 +53,7 @@ type QGBNetwork struct { toStopChan chan<- struct{} } -func NewQGBNetwork() (*QGBNetwork, 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 NewQGBNetwork() (*QGBNetwork, 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 := &QGBNetwork{ + 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 *QGBNetwork) { +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 QGB 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 QGBNetwork) 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 QGBNetwork) StartAll() error { // StopAll stops the network and leaves the containers created. This allows to resume // execution from the point where they stopped. -func (network QGBNetwork) StopAll() error { +func (network BlobstreamNetwork) StopAll() error { err := network.Instance. WithCommand([]string{"stop"}). Invoke() @@ -152,7 +152,7 @@ func (network QGBNetwork) StopAll() error { } // DeleteAll deletes the containers, network and everything related to the cluster. -func (network QGBNetwork) DeleteAll() error { +func (network BlobstreamNetwork) DeleteAll() error { err := network.Instance. WithCommand([]string{"down"}). Invoke() @@ -163,7 +163,7 @@ func (network QGBNetwork) DeleteAll() error { } // KillAll kills all the containers. -func (network QGBNetwork) KillAll() error { +func (network BlobstreamNetwork) KillAll() error { err := network.Instance. WithCommand([]string{"kill"}). Invoke() @@ -175,7 +175,7 @@ func (network QGBNetwork) KillAll() error { // Start starts a service from the `Service` enum. Make sure to call `Stop`, in the // end, to release the resources. -func (network QGBNetwork) 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 QGBNetwork) Start(service Service) error { return nil } -// DeployQGBContract uses the Deployer service to deploy a new QGB 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 QGBNetwork) DeployQGBContract() error { +func (network BlobstreamNetwork) DeployBlobstreamContract() error { fmt.Println("building images...") err := network.Instance. WithCommand([]string{"build", "--quiet", DEPLOYER}). @@ -218,7 +218,7 @@ func (network QGBNetwork) DeployQGBContract() error { // StartMultiple start multiple services. Make sure to call `Stop`, in the // end, to release the resources. -func (network QGBNetwork) 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 QGBNetwork) StartMultiple(services ...Service) error { return nil } -func (network QGBNetwork) 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 QGBNetwork) Stop(service Service) error { // StopMultiple start multiple services. Make sure to call `Stop` or `StopMultiple`, in the // end, to release the resources. -func (network QGBNetwork) 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 QGBNetwork) StopMultiple(services ...Service) error { return nil } -func (network QGBNetwork) 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 QGBNetwork) ExecCommand(service Service, command []string) error { // StartMinimal starts a network containing: 1 validator, 1 orchestrator, 1 relayer // and a ganache instance. -func (network QGBNetwork) 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 QGBNetwork) 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 QGBNetwork) 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 QGBNetwork) StartBase() error { return nil } -func (network QGBNetwork) 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 QGBNetwork) WaitForNodeToStart(_ctx context.Context, rpcAddr strin } } -func (network QGBNetwork) 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 QGBNetwork) WaitForBlockWithCustomTimeout( +func (network BlobstreamNetwork) WaitForBlockWithCustomTimeout( _ctx context.Context, height int64, timeout time.Duration, @@ -415,7 +415,7 @@ func (network QGBNetwork) 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 QGBNetwork) WaitForOrchestratorToStart(_ctx context.Context, dht *p2p.QgbDHT, 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) @@ -473,7 +473,7 @@ func (network QGBNetwork) WaitForOrchestratorToStart(_ctx context.Context, dht * if err != nil { continue } - dataRootTupleRoot := qgbtypes.DataCommitmentTupleRootSignBytes(big.NewInt(int64(castedAtt.Nonce)), commitment) + dataRootTupleRoot := blobstreamtypes.DataCommitmentTupleRootSignBytes(big.NewInt(int64(castedAtt.Nonce)), commitment) dcConfirm, err := p2pQuerier.QueryDataCommitmentConfirmByEVMAddress(ctx, lastNonce-i, evmAddr, dataRootTupleRoot.Hex()) if err == nil && dcConfirm != nil { cancel() @@ -489,7 +489,7 @@ func (network QGBNetwork) WaitForOrchestratorToStart(_ctx context.Context, dht * // 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 QGBNetwork) 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,12 +530,12 @@ func (network QGBNetwork) GetValsetContainingVals(_ctx context.Context, number i // GetValsetConfirm Returns the valset confirm for nonce `nonce` // signed by orchestrator whose EVM address is `evmAddr`. -func (network QGBNetwork) GetValsetConfirm( +func (network BlobstreamNetwork) GetValsetConfirm( _ctx context.Context, - dht *p2p.QgbDHT, + dht *p2p.BlobstreamDHT, nonce uint64, evmAddr string, -) (*qgbtypes.ValsetConfirm, error) { +) (*blobstreamtypes.ValsetConfirm, error) { p2pQuerier := p2p.NewQuerier(dht, network.Logger) // create app querier appQuerier := rpc.NewAppQuerier(network.Logger, network.CelestiaGRPC, network.EncCfg) @@ -583,12 +583,12 @@ func (network QGBNetwork) GetValsetConfirm( // GetDataCommitmentConfirm Returns the data commitment confirm for nonce `nonce` // signed by orchestrator whose EVM address is `evmAddr`. -func (network QGBNetwork) GetDataCommitmentConfirm( +func (network BlobstreamNetwork) GetDataCommitmentConfirm( _ctx context.Context, - dht *p2p.QgbDHT, + dht *p2p.BlobstreamDHT, nonce uint64, evmAddr string, -) (*qgbtypes.DataCommitmentConfirm, error) { +) (*blobstreamtypes.DataCommitmentConfirm, error) { // create p2p querier p2pQuerier := p2p.NewQuerier(dht, network.Logger) @@ -629,7 +629,7 @@ func (network QGBNetwork) GetDataCommitmentConfirm( if err != nil { continue } - dataRootTupleRoot := qgbtypes.DataCommitmentTupleRootSignBytes(big.NewInt(int64(nonce)), commitment) + dataRootTupleRoot := blobstreamtypes.DataCommitmentTupleRootSignBytes(big.NewInt(int64(nonce)), commitment) resp, err := p2pQuerier.QueryDataCommitmentConfirmByEVMAddress(ctx, nonce, evmAddr, dataRootTupleRoot.Hex()) if err == nil && resp != nil { cancel() @@ -643,12 +643,12 @@ func (network QGBNetwork) GetDataCommitmentConfirm( // GetDataCommitmentConfirmByHeight Returns the data commitment confirm that commits // to height `height` signed by orchestrator whose EVM address is `evmAddr`. -func (network QGBNetwork) GetDataCommitmentConfirmByHeight( +func (network BlobstreamNetwork) GetDataCommitmentConfirmByHeight( _ctx context.Context, - dht *p2p.QgbDHT, + dht *p2p.BlobstreamDHT, height uint64, evmAddr string, -) (*qgbtypes.DataCommitmentConfirm, error) { +) (*blobstreamtypes.DataCommitmentConfirm, error) { // create app querier appQuerier := rpc.NewAppQuerier(network.Logger, network.CelestiaGRPC, network.EncCfg) err := appQuerier.Start() @@ -669,7 +669,7 @@ func (network QGBNetwork) GetDataCommitmentConfirmByHeight( } // GetLatestAttestationNonce Returns the latest attestation nonce. -func (network QGBNetwork) 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 QGBNetwork) GetLatestAttestationNonce(_ctx context.Context) (uint6 } // WasAttestationSigned Returns true if the attestation confirm exist. -func (network QGBNetwork) WasAttestationSigned( +func (network BlobstreamNetwork) WasAttestationSigned( _ctx context.Context, - dht *p2p.QgbDHT, + dht *p2p.BlobstreamDHT, nonce uint64, evmAddress string, ) (bool, error) { @@ -745,7 +745,7 @@ func (network QGBNetwork) WasAttestationSigned( if err != nil { continue } - dataRootTupleRoot := qgbtypes.DataCommitmentTupleRootSignBytes(big.NewInt(int64(castedAtt.Nonce)), commitment) + dataRootTupleRoot := blobstreamtypes.DataCommitmentTupleRootSignBytes(big.NewInt(int64(castedAtt.Nonce)), commitment) resp, err := p2pQuerier.QueryDataCommitmentConfirmByEVMAddress( ctx, castedAtt.Nonce, @@ -763,14 +763,14 @@ func (network QGBNetwork) WasAttestationSigned( } } -func (network QGBNetwork) GetLatestDeployedQGBContract(_ctx context.Context) (*qgbwrapper.Wrappers, error) { - return network.GetLatestDeployedQGBContractWithCustomTimeout(_ctx, 5*time.Minute) +func (network BlobstreamNetwork) GetLatestDeployedBlobstreamContract(_ctx context.Context) (*blobstreamwrapper.Wrappers, error) { + return network.GetLatestDeployedBlobstreamContractWithCustomTimeout(_ctx, 5*time.Minute) } -func (network QGBNetwork) GetLatestDeployedQGBContractWithCustomTimeout( +func (network BlobstreamNetwork) GetLatestDeployedBlobstreamContractWithCustomTimeout( _ctx context.Context, timeout time.Duration, -) (*qgbwrapper.Wrappers, error) { +) (*blobstreamwrapper.Wrappers, error) { client, err := ethclient.Dial(network.EVMRPC) if err != nil { return nil, err @@ -786,7 +786,7 @@ func (network QGBNetwork) GetLatestDeployedQGBContractWithCustomTimeout( case <-ctx.Done(): cancel() if errors.Is(ctx.Err(), context.DeadlineExceeded) { - return nil, fmt.Errorf("timeout. couldn't find deployed qgb contract") + return nil, fmt.Errorf("timeout. couldn't find deployed blobstream contract") } return nil, ctx.Err() default: @@ -820,8 +820,8 @@ func (network QGBNetwork) GetLatestDeployedQGBContractWithCustomTimeout( if receipt.ContractAddress == (ethcommon.Address{}) { continue } - // If the bridge is loaded, then it's the latest-deployed proxy QGB contract - bridge, err := qgbwrapper.NewWrappers(receipt.ContractAddress, client) + // 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 QGBNetwork) GetLatestDeployedQGBContractWithCustomTimeout( } } -func (network QGBNetwork) WaitForRelayerToStart(_ctx context.Context, bridge *qgbwrapper.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 QGBNetwork) WaitForRelayerToStart(_ctx context.Context, bridge *qg } } -func (network QGBNetwork) WaitForEventNonce(ctx context.Context, bridge *qgbwrapper.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,10 +889,10 @@ func (network QGBNetwork) WaitForEventNonce(ctx context.Context, bridge *qgbwrap } } -func (network QGBNetwork) 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( - "qgb-tests", + "blobstream-tests", "test", "celestia-app/core0", nil, @@ -901,13 +901,13 @@ func (network QGBNetwork) UpdateDataCommitmentWindow(ctx context.Context, newWin if err != nil { return err } - qgbGRPC, err := grpc.Dial("localhost:9090", grpc.WithTransportCredentials(insecure.NewCredentials())) + blobStreamGRPC, err := grpc.Dial("localhost:9090", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return err } - defer qgbGRPC.Close() + defer blobStreamGRPC.Close() - signer, err := user.SetupSingleSigner(ctx, kr, qgbGRPC, encoding.MakeConfig(app.ModuleEncodingRegisters...)) + signer, err := user.SetupSingleSigner(ctx, kr, blobStreamGRPC, encoding.MakeConfig(app.ModuleEncodingRegisters...)) if err != nil { return err } @@ -940,7 +940,7 @@ func (network QGBNetwork) UpdateDataCommitmentWindow(ctx context.Context, newWin } // query the proposal to get the id - gqc := v1.NewQueryClient(qgbGRPC) + gqc := v1.NewQueryClient(blobStreamGRPC) gresp, err := gqc.Proposals( ctx, &v1.QueryProposalsRequest{ @@ -983,13 +983,13 @@ func (network QGBNetwork) UpdateDataCommitmentWindow(ctx context.Context, newWin return nil } -func (network QGBNetwork) PrintLogs() { +func (network BlobstreamNetwork) PrintLogs() { _ = network.Instance. WithCommand([]string{"logs"}). Invoke() } -func (network QGBNetwork) 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,15 +1005,15 @@ func (network QGBNetwork) GetLatestValset(ctx context.Context) (*types.Valset, e return valset, nil } -func (network QGBNetwork) GetCurrentDataCommitmentWindow(ctx context.Context) (uint64, error) { +func (network BlobstreamNetwork) GetCurrentDataCommitmentWindow(ctx context.Context) (uint64, error) { var window uint64 queryFun := func() error { - qgbGRPC, err := grpc.Dial("localhost:9090", grpc.WithTransportCredentials(insecure.NewCredentials())) + blobStreamGRPC, err := grpc.Dial("localhost:9090", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return err } - defer qgbGRPC.Close() - bqc := types.NewQueryClient(qgbGRPC) + defer blobStreamGRPC.Close() + bqc := types.NewQueryClient(blobStreamGRPC) presp, err := bqc.Params(ctx, &types.QueryParamsRequest{}) if err != nil { return err diff --git a/e2e/relayer_test.go b/e2e/relayer_test.go index 22b87cce..f5101707 100644 --- a/e2e/relayer_test.go +++ b/e2e/relayer_test.go @@ -12,17 +12,17 @@ import ( "github.com/celestiaorg/orchestrator-relayer/evm" "github.com/celestiaorg/orchestrator-relayer/rpc" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/stretchr/testify/assert" ) func TestRelayerWithOneValidator(t *testing.T) { - if os.Getenv("QGB_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping QGB integration tests") + if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { + t.Skip("Skipping Blobstream integration tests") } - network, err := NewQGBNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -40,7 +40,7 @@ func TestRelayerWithOneValidator(t *testing.T) { // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) - host, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) + host, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() // force the connection to the DHT to start the orchestrator @@ -50,7 +50,7 @@ func TestRelayerWithOneValidator(t *testing.T) { _, _, err = network.WaitForOrchestratorToStart(ctx, dht, CORE0EVMADDRESS) HandleNetworkError(t, network, err, false) - bridge, err := network.GetLatestDeployedQGBContract(ctx) + bridge, err := network.GetLatestDeployedBlobstreamContract(ctx) HandleNetworkError(t, network, err, false) latestNonce, err := network.GetLatestAttestationNonce(ctx) @@ -69,11 +69,11 @@ func TestRelayerWithOneValidator(t *testing.T) { } func TestRelayerWithTwoValidators(t *testing.T) { - if os.Getenv("QGB_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping QGB integration tests") + if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { + t.Skip("Skipping Blobstream integration tests") } - network, err := NewQGBNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -100,7 +100,7 @@ func TestRelayerWithTwoValidators(t *testing.T) { // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) - host, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) + host, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() // force the connection to the DHT to start the orchestrator @@ -116,7 +116,7 @@ func TestRelayerWithTwoValidators(t *testing.T) { // give the orchestrators some time to catchup time.Sleep(time.Second) - bridge, err := network.GetLatestDeployedQGBContract(ctx) + bridge, err := network.GetLatestDeployedBlobstreamContract(ctx) HandleNetworkError(t, network, err, false) err = network.WaitForRelayerToStart(ctx, bridge) @@ -135,11 +135,11 @@ func TestRelayerWithTwoValidators(t *testing.T) { } func TestRelayerWithMultipleValidators(t *testing.T) { - if os.Getenv("QGB_INTEGRATION_TEST") != TRUE { - t.Skip("Skipping QGB integration tests") + if os.Getenv("BLOBSTREAM_INTEGRATION_TEST") != TRUE { + t.Skip("Skipping Blobstream integration tests") } - network, err := NewQGBNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -158,7 +158,7 @@ func TestRelayerWithMultipleValidators(t *testing.T) { // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) - host, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) + host, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() // force the connection to the DHT to start the orchestrator @@ -191,7 +191,7 @@ func TestRelayerWithMultipleValidators(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 4, len(latestValset.Members)) - bridge, err := network.GetLatestDeployedQGBContract(ctx) + bridge, err := network.GetLatestDeployedBlobstreamContract(ctx) HandleNetworkError(t, network, err, false) err = network.WaitForRelayerToStart(ctx, bridge) @@ -211,7 +211,7 @@ func TestUpdatingTheDataCommitmentWindow(t *testing.T) { t.Skip("Skipping Blobstream data commitment update integration test") } - network, err := NewQGBNetwork() + network, err := NewBlobstreamNetwork() HandleNetworkError(t, network, err, false) // to release resources after tests @@ -245,7 +245,7 @@ func TestUpdatingTheDataCommitmentWindow(t *testing.T) { // create dht for querying bootstrapper, err := helpers.ParseAddrInfos(network.Logger, BOOTSTRAPPERS) HandleNetworkError(t, network, err, false) - host, _, dht := qgbtesting.NewTestDHT(ctx, bootstrapper) + host, _, dht := blobstreamtesting.NewTestDHT(ctx, bootstrapper) defer dht.Close() // force the connection to the DHT to start the orchestrator @@ -278,7 +278,7 @@ func TestUpdatingTheDataCommitmentWindow(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 4, len(latestValset.Members)) - bridge, err := network.GetLatestDeployedQGBContract(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_blobstream_contract.sh similarity index 86% rename from e2e/scripts/deploy_qgb_contract.sh rename to e2e/scripts/deploy_blobstream_contract.sh index 12f025ef..b6270353 100644 --- a/e2e/scripts/deploy_qgb_contract.sh +++ b/e2e/scripts/deploy_blobstream_contract.sh @@ -1,11 +1,11 @@ #!/bin/bash -# This script deploys the QGB 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 QGB contract. exiting..." + echo "no need to deploy a new Blobstream contract. exiting..." exit 0 fi @@ -59,11 +59,11 @@ do done # import keys to deployer -/bin/qgb deploy keys evm import ecdsa "${PRIVATE_KEY}" --evm.passphrase=123 +/bin/blobstream deploy keys evm import ecdsa "${PRIVATE_KEY}" --evm.passphrase=123 -echo "deploying QGB contract..." +echo "deploying Blobstream contract..." -/bin/qgb deploy \ +/bin/blobstream deploy \ --evm.chain-id "${EVM_CHAIN_ID}" \ --evm.account "${EVM_ACCOUNT}" \ --core.grpc.host "${CORE_GRPC_HOST}" \ @@ -74,4 +74,4 @@ echo "deploying QGB contract..." echo $(cat /opt/output) -cat /opt/output | grep "deployed" | awk '{ print $5 }' | cut -f 2 -d = > /opt/qgb_address.txt +cat /opt/output | grep "deployed" | awk '{ print $5 }' | cut -f 2 -d = > /opt/blobstream_address.txt diff --git a/e2e/scripts/start_core0.sh b/e2e/scripts/start_core0.sh index 11b0d7b3..97a6d6b2 100644 --- a/e2e/scripts/start_core0.sh +++ b/e2e/scripts/start_core0.sh @@ -40,7 +40,7 @@ fi --home /opt \ --fees "30000utia" \ -b block \ - --chain-id="qgb-e2e" \ + --chain-id="blobstream-e2e" \ --yes } & diff --git a/e2e/scripts/start_node_and_create_validator.sh b/e2e/scripts/start_node_and_create_validator.sh index 8fd3c09d..cbdb5755 100644 --- a/e2e/scripts/start_node_and_create_validator.sh +++ b/e2e/scripts/start_node_and_create_validator.sh @@ -44,7 +44,7 @@ fi --amount="${AMOUNT}" \ --pubkey="$(celestia-appd tendermint show-validator --home "${CELESTIA_HOME}")" \ --moniker="${MONIKER}" \ - --chain-id="qgb-e2e" \ + --chain-id="blobstream-e2e" \ --commission-rate=0.1 \ --commission-max-rate=0.2 \ --commission-max-change-rate=0.01 \ @@ -70,7 +70,7 @@ fi --from "${MONIKER}" \ --home "${CELESTIA_HOME}" \ --fees "30000utia" -b block \ - --chain-id="qgb-e2e" \ + --chain-id="blobstream-e2e" \ --yes } & @@ -78,5 +78,5 @@ fi celestia-appd start \ --home="${CELESTIA_HOME}" \ --moniker="${MONIKER}" \ ---p2p.persistent_peers=40664e2a69d5557b0d35ec8b9d423785b12579b7@core0:26656 \ +--p2p.persistent_peers=de74a671b839639ed638fd4140f797ddadb3c2f1@core0:26656 \ --rpc.laddr=tcp://0.0.0.0:26657 diff --git a/e2e/scripts/start_orchestrator_after_validator_created.sh b/e2e/scripts/start_orchestrator_after_validator_created.sh index 930fd828..fbbf199c 100644 --- a/e2e/scripts/start_orchestrator_after_validator_created.sh +++ b/e2e/scripts/start_orchestrator_after_validator_created.sh @@ -36,18 +36,18 @@ do done # initialize orchestrator -/bin/qgb orch init +/bin/blobstream orch init # add keys to keystore -/bin/qgb orch keys evm import ecdsa "${PRIVATE_KEY}" --evm.passphrase 123 +/bin/blobstream orch keys evm import ecdsa "${PRIVATE_KEY}" --evm.passphrase 123 # start orchestrator if [[ -z "${P2P_BOOTSTRAPPERS}" ]] then # import the p2p key to use - /bin/qgb orchestrator keys p2p import key "${P2P_IDENTITY}" + /bin/blobstream orchestrator keys p2p import key "${P2P_IDENTITY}" - /bin/qgb orchestrator start \ + /bin/blobstream orchestrator start \ --evm.account="${EVM_ACCOUNT}" \ --core.rpc.host="${CORE_RPC_HOST}" \ --core.rpc.port="${CORE_RPC_PORT}" \ @@ -60,7 +60,7 @@ else # to give time for the bootstrappers to be up sleep 5s - /bin/qgb orchestrator start \ + /bin/blobstream orchestrator start \ --evm.account="${EVM_ACCOUNT}" \ --core.rpc.host="${CORE_RPC_HOST}" \ --core.rpc.port="${CORE_RPC_PORT}" \ diff --git a/e2e/scripts/start_relayer.sh b/e2e/scripts/start_relayer.sh index eac3017f..877946c0 100644 --- a/e2e/scripts/start_relayer.sh +++ b/e2e/scripts/start_relayer.sh @@ -1,7 +1,7 @@ #!/bin/bash -# This script runs the QGB relayer with the ability to deploy a new QGB contract or -# pass one as an environment variable QGB_CONTRACT +# 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 if [[ -z "${EVM_CHAIN_ID}" || -z "${PRIVATE_KEY}" ]] || \ @@ -34,26 +34,26 @@ done sleep 120s # check whether to deploy a new contract or use an existing one -if [[ -z "${QGB_CONTRACT}" ]] +if [[ -z "${BLOBSTREAM_CONTRACT}" ]] then export DEPLOY_NEW_CONTRACT=true export STARTING_NONCE=latest # expects the script to be mounted to this directory - /bin/bash /opt/deploy_qgb_contract.sh + /bin/bash /opt/deploy_blobstream_contract.sh fi -# get the address from the `qgb_address.txt` file -QGB_CONTRACT=$(cat /opt/qgb_address.txt) +# get the address from the `blobstream_address.txt` file +BLOBSTREAM_CONTRACT=$(cat /opt/blobstream_address.txt) # init the relayer -/bin/qgb relayer init +/bin/blobstream relayer init # import keys to relayer -/bin/qgb relayer keys evm import ecdsa "${PRIVATE_KEY}" --evm.passphrase 123 +/bin/blobstream relayer keys evm import ecdsa "${PRIVATE_KEY}" --evm.passphrase 123 # to give time for the bootstrappers to be up sleep 5s -/bin/qgb relayer start \ +/bin/blobstream relayer start \ --evm.account="${EVM_ACCOUNT}" \ --core.rpc.host="${CORE_RPC_HOST}" \ --core.rpc.port="${CORE_RPC_PORT}" \ @@ -61,7 +61,7 @@ sleep 5s --core.grpc.port="${CORE_GRPC_PORT}" \ --evm.chain-id="${EVM_CHAIN_ID}" \ --evm.rpc="${EVM_ENDPOINT}" \ - --evm.contract-address="${QGB_CONTRACT}" \ + --evm.contract-address="${BLOBSTREAM_CONTRACT}" \ --p2p.bootstrappers="${P2P_BOOTSTRAPPERS}" \ --p2p.listen-addr="${P2P_LISTEN}" \ --evm.passphrase=123 diff --git a/e2e/test_commons.go b/e2e/test_commons.go index 1826592c..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 *QGBNetwork, 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 *QGBNetwork, err error, expectErro } } -func ConnectToDHT(ctx context.Context, h host.Host, dht *p2p.QgbDHT, 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/ethereum_signature_test.go b/evm/ethereum_signature_test.go index 7f32be5b..9ddfcde4 100644 --- a/evm/ethereum_signature_test.go +++ b/evm/ethereum_signature_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -// The signatures in these tests are generated using the foundry setup in the quantum-gravity-bridge repository. +// The signatures in these tests are generated using the foundry setup in the blobstream-contracts repository. func TestNewEthereumSignature(t *testing.T) { digest, err := hexutil.Decode("0x078c42ff72a01b355f9d76bfeecd2132a0d3f1aad9380870026c56e23e6d00e5") diff --git a/evm/evm_client.go b/evm/evm_client.go index 309f8ea9..1bf41262 100644 --- a/evm/evm_client.go +++ b/evm/evm_client.go @@ -15,7 +15,7 @@ import ( "github.com/celestiaorg/celestia-app/x/qgb/types" proxywrapper "github.com/celestiaorg/quantum-gravity-bridge/v2/wrappers/ERC1967Proxy.sol" - qgbwrapper "github.com/celestiaorg/quantum-gravity-bridge/v2/wrappers/QuantumGravityBridge.sol" + blobstreamwrapper "github.com/celestiaorg/quantum-gravity-bridge/v2/wrappers/QuantumGravityBridge.sol" "github.com/ethereum/go-ethereum/accounts/abi/bind" ) @@ -24,19 +24,19 @@ const DefaultEVMGasLimit = uint64(2500000) type Client struct { logger tmlog.Logger - Wrapper *qgbwrapper.Wrappers + Wrapper *blobstreamwrapper.Wrappers Ks *keystore.KeyStore Acc *accounts.Account EvmRPC string GasLimit uint64 } -// NewClient Creates a new EVM Client that can be used to deploy the QGB 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( logger tmlog.Logger, - wrapper *qgbwrapper.Wrappers, + wrapper *blobstreamwrapper.Wrappers, ks *keystore.KeyStore, acc *accounts.Account, evmRPC string, @@ -62,21 +62,21 @@ func (ec *Client) NewEthClient() (*ethclient.Client, error) { return ethClient, nil } -// DeployQGBContract Deploys the QGB 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 DeployQGBContract 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) DeployQGBContract( +func (ec *Client) DeployBlobstreamContract( opts *bind.TransactOpts, contractBackend bind.ContractBackend, contractInitValset types.Valset, contractInitNonce uint64, initBridge bool, -) (gethcommon.Address, *coregethtypes.Transaction, *qgbwrapper.Wrappers, error) { - // deploy the QGB implementation contract +) (gethcommon.Address, *coregethtypes.Transaction, *blobstreamwrapper.Wrappers, error) { + // deploy the Blobstream implementation contract impAddr, impTx, _, err := ec.DeployImplementation(opts, contractBackend) if err != nil { return gethcommon.Address{}, nil, nil, err @@ -84,16 +84,16 @@ func (ec *Client) DeployQGBContract( ec.logger.Info("deploying QGB implementation contract...", "address", impAddr.Hex(), "tx_hash", impTx.Hash().Hex()) - // encode the QGB 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 } - qgbABI, err := qgbwrapper.WrappersMetaData.GetAbi() + blobStreamABI, err := blobstreamwrapper.WrappersMetaData.GetAbi() if err != nil { return gethcommon.Address{}, nil, nil, err } - initData, err := qgbABI.Pack("initialize", big.NewInt(int64(contractInitNonce)), big.NewInt(int64(contractInitValset.TwoThirdsThreshold())), ethVsHash) + initData, err := blobStreamABI.Pack("initialize", big.NewInt(int64(contractInitNonce)), big.NewInt(int64(contractInitValset.TwoThirdsThreshold())), ethVsHash) if err != nil { return gethcommon.Address{}, nil, nil, err } @@ -103,7 +103,7 @@ func (ec *Client) DeployQGBContract( opts.Nonce.Add(opts.Nonce, big.NewInt(1)) } - // deploy the ERC1967 proxy, link it to the QGB 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 @@ -111,7 +111,7 @@ func (ec *Client) DeployQGBContract( ec.logger.Info("deploying QGB proxy contract...", "address", proxyAddr, "tx_hash", tx.Hash().Hex()) - bridge, err := qgbwrapper.NewWrappers(proxyAddr, contractBackend) + bridge, err := blobstreamwrapper.NewWrappers(proxyAddr, contractBackend) if err != nil { return gethcommon.Address{}, nil, nil, err } @@ -128,7 +128,7 @@ func (ec *Client) UpdateValidatorSet( opts *bind.TransactOpts, newNonce, newThreshHold uint64, currentValset, newValset types.Valset, - sigs []qgbwrapper.Signature, + sigs []blobstreamwrapper.Signature, ) (*coregethtypes.Transaction, error) { // TODO in addition to the nonce, log more interesting information ec.logger.Info("relaying valset", "nonce", newNonce) @@ -171,7 +171,7 @@ func (ec *Client) SubmitDataRootTupleRoot( tupleRoot gethcommon.Hash, newNonce uint64, currentValset types.Valset, - sigs []qgbwrapper.Signature, + sigs []blobstreamwrapper.Signature, ) (*coregethtypes.Transaction, error) { ethVals, err := ethValset(currentValset) if err != nil { @@ -236,10 +236,10 @@ func (ec *Client) WaitForTransaction( func (ec *Client) DeployImplementation(opts *bind.TransactOpts, backend bind.ContractBackend) ( gethcommon.Address, *coregethtypes.Transaction, - *qgbwrapper.Wrappers, + *blobstreamwrapper.Wrappers, error, ) { - return qgbwrapper.DeployWrappers( + return blobstreamwrapper.DeployWrappers( opts, backend, ) @@ -259,14 +259,14 @@ func (ec *Client) DeployERC1867Proxy( ) } -func ethValset(valset types.Valset) ([]qgbwrapper.Validator, error) { - ethVals := make([]qgbwrapper.Validator, len(valset.Members)) +func ethValset(valset types.Valset) ([]blobstreamwrapper.Validator, error) { + ethVals := make([]blobstreamwrapper.Validator, len(valset.Members)) for i, v := range valset.Members { if ok := gethcommon.IsHexAddress(v.EvmAddress); !ok { return nil, errors.New("invalid ethereum address found in validator set") } addr := gethcommon.HexToAddress(v.EvmAddress) - ethVals[i] = qgbwrapper.Validator{ + ethVals[i] = blobstreamwrapper.Validator{ Addr: addr, Power: big.NewInt(int64(v.Power)), } diff --git a/evm/evm_client_test.go b/evm/evm_client_test.go index cbf30592..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.DeployQGBContract(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.DeployQGBContract(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/evm/suite_test.go b/evm/suite_test.go index 634c1778..411e4d9c 100644 --- a/evm/suite_test.go +++ b/evm/suite_test.go @@ -9,7 +9,7 @@ import ( celestiatypes "github.com/celestiaorg/celestia-app/x/qgb/types" "github.com/celestiaorg/orchestrator-relayer/evm" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" ethcmn "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/require" @@ -18,7 +18,7 @@ import ( type EVMTestSuite struct { suite.Suite - Chain *qgbtesting.EVMChain + Chain *blobstreamtesting.EVMChain Client *evm.Client InitVs *celestiatypes.Valset VsPrivateKey *ecdsa.PrivateKey @@ -29,7 +29,7 @@ func (s *EVMTestSuite) SetupTest() { testPrivateKey, err := crypto.HexToECDSA("64a1d6f0e760a8d62b4afdde4096f16f51b401eaaecc915740f71770ea76a8ad") s.VsPrivateKey = testPrivateKey require.NoError(t, err) - s.Chain = qgbtesting.NewEVMChain(testPrivateKey) + s.Chain = blobstreamtesting.NewEVMChain(testPrivateKey) ks := keystore.NewKeyStore(t.TempDir(), keystore.LightScryptN, keystore.LightScryptP) acc, err := ks.ImportECDSA(testPrivateKey, "123") @@ -37,7 +37,7 @@ func (s *EVMTestSuite) SetupTest() { err = ks.Unlock(acc, "123") require.NoError(t, err) - s.Client = qgbtesting.NewEVMClient(ks, &acc) + s.Client = blobstreamtesting.NewEVMClient(ks, &acc) s.InitVs, err = celestiatypes.NewValset( 1, 10, diff --git a/orchestrator/broadcaster.go b/orchestrator/broadcaster.go index 3fd2debc..f6d874c1 100644 --- a/orchestrator/broadcaster.go +++ b/orchestrator/broadcaster.go @@ -9,23 +9,23 @@ import ( ) type Broadcaster struct { - QgbDHT *p2p.QgbDHT + BlobstreamDHT *p2p.BlobstreamDHT } -func NewBroadcaster(qgbDHT *p2p.QgbDHT) *Broadcaster { - return &Broadcaster{QgbDHT: qgbDHT} +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.QgbDHT.RoutingTable().ListPeers()) == 0 { + if len(b.BlobstreamDHT.RoutingTable().ListPeers()) == 0 { return ErrEmptyPeersTable } - return b.QgbDHT.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.QgbDHT.RoutingTable().ListPeers()) == 0 { + if len(b.BlobstreamDHT.RoutingTable().ListPeers()) == 0 { return ErrEmptyPeersTable } - return b.QgbDHT.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 edc733bd..519cd694 100644 --- a/orchestrator/broadcaster_test.go +++ b/orchestrator/broadcaster_test.go @@ -17,7 +17,7 @@ import ( "github.com/celestiaorg/orchestrator-relayer/orchestrator" "github.com/celestiaorg/orchestrator-relayer/p2p" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" "github.com/celestiaorg/orchestrator-relayer/types" "github.com/stretchr/testify/assert" ) @@ -28,7 +28,7 @@ var ( ) func TestBroadcastDataCommitmentConfirm(t *testing.T) { - network := qgbtesting.NewDHTNetwork(context.Background(), 4) + network := blobstreamtesting.NewDHTNetwork(context.Background(), 4) defer network.Stop() ks := keystore.NewKeyStore(t.TempDir(), keystore.LightScryptN, keystore.LightScryptP) @@ -64,7 +64,7 @@ func TestBroadcastDataCommitmentConfirm(t *testing.T) { } func TestBroadcastValsetConfirm(t *testing.T) { - network := qgbtesting.NewDHTNetwork(context.Background(), 4) + network := blobstreamtesting.NewDHTNetwork(context.Background(), 4) defer network.Stop() ks := keystore.NewKeyStore(t.TempDir(), keystore.LightScryptN, keystore.LightScryptP) @@ -100,8 +100,8 @@ func TestBroadcastValsetConfirm(t *testing.T) { // TestEmptyPeersTable tests that values are not broadcasted if the DHT peers // table is empty. func TestEmptyPeersTable(t *testing.T) { - _, _, dht := qgbtesting.NewTestDHT(context.Background(), nil) - defer func(dht *p2p.QgbDHT) { + _, _, dht := blobstreamtesting.NewTestDHT(context.Background(), nil) + defer func(dht *p2p.BlobstreamDHT) { err := dht.Close() if err != nil { require.NoError(t, err) diff --git a/orchestrator/suite_test.go b/orchestrator/suite_test.go index 2d6155b7..bafba568 100644 --- a/orchestrator/suite_test.go +++ b/orchestrator/suite_test.go @@ -9,13 +9,13 @@ import ( "github.com/celestiaorg/celestia-app/test/util/testnode" "github.com/celestiaorg/celestia-app/x/qgb/types" "github.com/celestiaorg/orchestrator-relayer/orchestrator" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" "github.com/stretchr/testify/suite" ) type OrchestratorTestSuite struct { suite.Suite - Node *qgbtesting.TestNode + Node *blobstreamtesting.TestNode Orchestrator *orchestrator.Orchestrator } @@ -23,18 +23,18 @@ func (s *OrchestratorTestSuite) SetupSuite() { t := s.T() ctx := context.Background() codec := encoding.MakeConfig(app.ModuleEncodingRegisters...).Codec - s.Node = qgbtesting.NewTestNode( + s.Node = blobstreamtesting.NewTestNode( ctx, t, - qgbtesting.CelestiaNetworkParams{ + blobstreamtesting.CelestiaNetworkParams{ GenesisOpts: []testnode.GenesisOption{ testnode.ImmediateProposals(codec), - qgbtesting.SetDataCommitmentWindowParams(codec, types.Params{DataCommitmentWindow: 101}), + blobstreamtesting.SetDataCommitmentWindowParams(codec, types.Params{DataCommitmentWindow: 101}), }, TimeIotaMs: 1, }, ) - s.Orchestrator = qgbtesting.NewOrchestrator(t, s.Node) + s.Orchestrator = blobstreamtesting.NewOrchestrator(t, s.Node) } func (s *OrchestratorTestSuite) TearDownSuite() { diff --git a/p2p/dht.go b/p2p/dht.go index 9a4fbbdc..b9e4aeea 100644 --- a/p2p/dht.go +++ b/p2p/dht.go @@ -14,21 +14,21 @@ import ( ) const ( - ProtocolPrefix = "/qgb/0.1.0" // TODO "/qgb/" ? + ProtocolPrefix = "/blobstream/0.1.0" // TODO "/blobstream/" ? DataCommitmentConfirmNamespace = "dcc" ValsetConfirmNamespace = "vc" ) -// QgbDHT wrapper around the `IpfsDHT` implementation. +// BlobstreamDHT wrapper around the `IpfsDHT` implementation. // Used to add helper methods to easily handle the DHT. -type QgbDHT struct { +type BlobstreamDHT struct { *dht.IpfsDHT logger tmlog.Logger } -// NewQgbDHT create a new IPFS DHT using a suitable configuration for the QGB. +// 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 NewQgbDHT(ctx context.Context, h host.Host, store ds.Batching, bootstrappers []peer.AddrInfo, logger tmlog.Logger) (*QgbDHT, 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 NewQgbDHT(ctx context.Context, h host.Host, store ds.Batching, bootstrapper return nil, err } - return &QgbDHT{ + return &BlobstreamDHT{ IpfsDHT: router, logger: logger, }, nil @@ -57,7 +57,7 @@ func NewQgbDHT(ctx context.Context, h host.Host, store ds.Batching, bootstrapper // 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 QgbDHT) 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 QgbDHT) WaitForPeers(ctx context.Context, timeout time.Duration, rate ti // 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 QgbDHT) 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 QgbDHT) PutDataCommitmentConfirm(ctx context.Context, key string, dcc ty // 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 QgbDHT) 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 QgbDHT) GetDataCommitmentConfirm(ctx context.Context, key string) (types // 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 QgbDHT) 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 QgbDHT) PutValsetConfirm(ctx context.Context, key string, vc types.Valse // 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 QgbDHT) 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/dht_test.go b/p2p/dht_test.go index dac49c45..9ebfcecc 100644 --- a/p2p/dht_test.go +++ b/p2p/dht_test.go @@ -15,7 +15,7 @@ import ( ethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/celestiaorg/orchestrator-relayer/p2p" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" "github.com/celestiaorg/orchestrator-relayer/types" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" @@ -30,11 +30,11 @@ var ( func TestDHTBootstrappers(t *testing.T) { ctx := context.Background() // create first dht - h1, _, dht1 := qgbtesting.NewTestDHT(ctx, nil) + h1, _, dht1 := blobstreamtesting.NewTestDHT(ctx, nil) defer dht1.Close() // create second dht with dht1 being a bootstrapper - h2, _, dht2 := qgbtesting.NewTestDHT( + h2, _, dht2 := blobstreamtesting.NewTestDHT( ctx, []peer.AddrInfo{{ ID: h1.ID(), @@ -58,7 +58,7 @@ func TestDHTBootstrappers(t *testing.T) { } func TestPutDataCommitmentConfirm(t *testing.T) { - network := qgbtesting.NewDHTNetwork(context.Background(), 2) + network := blobstreamtesting.NewDHTNetwork(context.Background(), 2) defer network.Stop() ks := keystore.NewKeyStore(t.TempDir(), keystore.LightScryptN, keystore.LightScryptP) @@ -96,7 +96,7 @@ func TestPutDataCommitmentConfirm(t *testing.T) { } func TestNetworkPutDataCommitmentConfirm(t *testing.T) { - network := qgbtesting.NewDHTNetwork(context.Background(), 10) + network := blobstreamtesting.NewDHTNetwork(context.Background(), 10) defer network.Stop() ks := keystore.NewKeyStore(t.TempDir(), keystore.LightScryptN, keystore.LightScryptP) @@ -134,7 +134,7 @@ func TestNetworkPutDataCommitmentConfirm(t *testing.T) { } func TestNetworkGetNonExistentDataCommitmentConfirm(t *testing.T) { - network := qgbtesting.NewDHTNetwork(context.Background(), 10) + network := blobstreamtesting.NewDHTNetwork(context.Background(), 10) defer network.Stop() // generate a test key for the DataCommitmentConfirm @@ -147,7 +147,7 @@ func TestNetworkGetNonExistentDataCommitmentConfirm(t *testing.T) { } func TestPutValsetConfirm(t *testing.T) { - network := qgbtesting.NewDHTNetwork(context.Background(), 2) + network := blobstreamtesting.NewDHTNetwork(context.Background(), 2) defer network.Stop() ks := keystore.NewKeyStore(t.TempDir(), keystore.LightScryptN, keystore.LightScryptP) @@ -182,7 +182,7 @@ func TestPutValsetConfirm(t *testing.T) { } func TestNetworkPutValsetConfirm(t *testing.T) { - network := qgbtesting.NewDHTNetwork(context.Background(), 10) + network := blobstreamtesting.NewDHTNetwork(context.Background(), 10) defer network.Stop() ks := keystore.NewKeyStore(t.TempDir(), keystore.LightScryptN, keystore.LightScryptP) @@ -217,7 +217,7 @@ func TestNetworkPutValsetConfirm(t *testing.T) { } func TestNetworkGetNonExistentValsetConfirm(t *testing.T) { - network := qgbtesting.NewDHTNetwork(context.Background(), 10) + network := blobstreamtesting.NewDHTNetwork(context.Background(), 10) defer network.Stop() // generate a test key for the ValsetConfirm @@ -232,7 +232,7 @@ func TestNetworkGetNonExistentValsetConfirm(t *testing.T) { func TestWaitForPeers(t *testing.T) { ctx := context.Background() // create first dht - h1, _, dht1 := qgbtesting.NewTestDHT(ctx, nil) + h1, _, dht1 := blobstreamtesting.NewTestDHT(ctx, nil) defer dht1.Close() // wait for peers @@ -241,7 +241,7 @@ func TestWaitForPeers(t *testing.T) { assert.Error(t, err) // create second dht - h2, _, dht2 := qgbtesting.NewTestDHT(ctx, nil) + h2, _, dht2 := blobstreamtesting.NewTestDHT(ctx, nil) defer dht2.Close() // connect to first dht err = h2.Connect(ctx, peer.AddrInfo{ diff --git a/p2p/keys.go b/p2p/keys.go index ae543767..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 QGB 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 QGB 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 cab93f1d..3be409ee 100644 --- a/p2p/querier.go +++ b/p2p/querier.go @@ -16,14 +16,14 @@ import ( // Querier used to query the DHT for confirms. type Querier struct { - QgbDHT *QgbDHT - logger tmlog.Logger + BlobstreamDHT *BlobstreamDHT + logger tmlog.Logger } -func NewQuerier(qgbDht *QgbDHT, logger tmlog.Logger) *Querier { +func NewQuerier(blobStreamDht *BlobstreamDHT, logger tmlog.Logger) *Querier { return &Querier{ - QgbDHT: qgbDht, - logger: logger, + BlobstreamDHT: blobStreamDht, + logger: logger, } } @@ -246,7 +246,7 @@ func (q Querier) QueryValsetConfirmByEVMAddress( address string, signBytes string, ) (*types.ValsetConfirm, error) { - confirm, err := q.QgbDHT.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.QgbDHT.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.QgbDHT.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.QgbDHT.GetValsetConfirm( + confirm, err := q.BlobstreamDHT.GetValsetConfirm( ctx, GetValsetConfirmKey(nonce, member.EvmAddress, signBytes), ) diff --git a/p2p/querier_test.go b/p2p/querier_test.go index bd1c7070..fa2af3c9 100644 --- a/p2p/querier_test.go +++ b/p2p/querier_test.go @@ -14,7 +14,7 @@ import ( celestiatypes "github.com/celestiaorg/celestia-app/x/qgb/types" "github.com/celestiaorg/orchestrator-relayer/p2p" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" "github.com/celestiaorg/orchestrator-relayer/types" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" @@ -33,7 +33,7 @@ var ( func TestQueryTwoThirdsDataCommitmentConfirms(t *testing.T) { ctx := context.Background() - network := qgbtesting.NewDHTNetwork(ctx, 2) + network := blobstreamtesting.NewDHTNetwork(ctx, 2) defer network.Stop() vsNonce := uint64(2) @@ -152,7 +152,7 @@ func TestQueryTwoThirdsDataCommitmentConfirms(t *testing.T) { func TestQueryTwoThirdsValsetConfirms(t *testing.T) { ctx := context.Background() - network := qgbtesting.NewDHTNetwork(ctx, 2) + network := blobstreamtesting.NewDHTNetwork(ctx, 2) defer network.Stop() vsNonce := uint64(2) @@ -279,7 +279,7 @@ func TestQueryTwoThirdsValsetConfirms(t *testing.T) { func TestQueryValsetConfirmByEVMAddress(t *testing.T) { ctx := context.Background() - network := qgbtesting.NewDHTNetwork(ctx, 2) + network := blobstreamtesting.NewDHTNetwork(ctx, 2) defer network.Stop() vsNonce := uint64(10) @@ -320,7 +320,7 @@ func TestQueryValsetConfirmByEVMAddress(t *testing.T) { func TestQueryDataCommitmentConfirmByEVMAddress(t *testing.T) { ctx := context.Background() - network := qgbtesting.NewDHTNetwork(ctx, 2) + network := blobstreamtesting.NewDHTNetwork(ctx, 2) defer network.Stop() dcNonce := uint64(10) @@ -362,7 +362,7 @@ func TestQueryDataCommitmentConfirmByEVMAddress(t *testing.T) { func TestQueryValsetConfirms(t *testing.T) { ctx := context.Background() - network := qgbtesting.NewDHTNetwork(ctx, 2) + network := blobstreamtesting.NewDHTNetwork(ctx, 2) defer network.Stop() vsNonce := uint64(2) @@ -444,7 +444,7 @@ func TestQueryValsetConfirms(t *testing.T) { func TestQueryDataCommitmentConfirms(t *testing.T) { ctx := context.Background() - network := qgbtesting.NewDHTNetwork(ctx, 2) + network := blobstreamtesting.NewDHTNetwork(ctx, 2) defer network.Stop() dcNonce := uint64(2) diff --git a/relayer/relayer.go b/relayer/relayer.go index 2bb04d31..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 QGB 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 QGB 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/relayer_test.go b/relayer/relayer_test.go index e9fcb8ac..1b35a4fa 100644 --- a/relayer/relayer_test.go +++ b/relayer/relayer_test.go @@ -8,7 +8,7 @@ import ( "github.com/celestiaorg/orchestrator-relayer/p2p" "github.com/ipfs/go-datastore" - qgbtypes "github.com/celestiaorg/orchestrator-relayer/types" + blobstreamtypes "github.com/celestiaorg/orchestrator-relayer/types" "github.com/stretchr/testify/assert" @@ -27,7 +27,7 @@ func (s *RelayerTestSuite) TestProcessAttestation() { att := types.NewDataCommitment(latestValset.Nonce+1, 10, 100, time.Now()) commitment, err := s.Orchestrator.TmQuerier.QueryCommitment(ctx, att.BeginBlock, att.EndBlock) require.NoError(t, err) - dataRootTupleRoot := qgbtypes.DataCommitmentTupleRootSignBytes(big.NewInt(int64(att.Nonce)), commitment) + dataRootTupleRoot := blobstreamtypes.DataCommitmentTupleRootSignBytes(big.NewInt(int64(att.Nonce)), commitment) err = s.Orchestrator.ProcessDataCommitmentEvent(ctx, *att, dataRootTupleRoot) require.NoError(t, err) diff --git a/relayer/suite_test.go b/relayer/suite_test.go index 2b1fe630..22d87716 100644 --- a/relayer/suite_test.go +++ b/relayer/suite_test.go @@ -8,14 +8,14 @@ import ( "github.com/celestiaorg/orchestrator-relayer/orchestrator" "github.com/celestiaorg/orchestrator-relayer/relayer" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) type RelayerTestSuite struct { suite.Suite - Node *qgbtesting.TestNode + Node *blobstreamtesting.TestNode Orchestrator *orchestrator.Orchestrator Relayer *relayer.Relayer } @@ -26,15 +26,15 @@ func (s *RelayerTestSuite) SetupSuite() { t.Skip("skipping relayer tests in short mode.") } ctx := context.Background() - s.Node = qgbtesting.NewTestNode(ctx, t, qgbtesting.DefaultCelestiaNetworkParams()) + s.Node = blobstreamtesting.NewTestNode(ctx, t, blobstreamtesting.DefaultCelestiaNetworkParams()) _, err := s.Node.CelestiaNetwork.WaitForHeight(2) require.NoError(t, err) - s.Orchestrator = qgbtesting.NewOrchestrator(t, s.Node) - s.Relayer = qgbtesting.NewRelayer(t, s.Node) + s.Orchestrator = blobstreamtesting.NewOrchestrator(t, s.Node) + s.Relayer = blobstreamtesting.NewRelayer(t, s.Node) 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.DeployQGBContract(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 9b340b7a..a6397c5d 100644 --- a/rpc/app_querier.go +++ b/rpc/app_querier.go @@ -16,23 +16,23 @@ import ( // AppQuerier queries the application for attestations and unbonding periods. type AppQuerier struct { - qgbRPC string - clientConn *grpc.ClientConn - Logger tmlog.Logger - EncCfg encoding.Config + blobStreamRPC string + clientConn *grpc.ClientConn + Logger tmlog.Logger + EncCfg encoding.Config } -func NewAppQuerier(logger tmlog.Logger, qgbRPC string, encCft encoding.Config) *AppQuerier { - return &AppQuerier{Logger: logger, qgbRPC: qgbRPC, EncCfg: encCft} +func NewAppQuerier(logger tmlog.Logger, blobStreamRPC string, encCft encoding.Config) *AppQuerier { + return &AppQuerier{Logger: logger, blobStreamRPC: blobStreamRPC, EncCfg: encCft} } func (aq *AppQuerier) Start() error { // creating a grpc connection to Celestia-app - qgbGRPC, err := grpc.Dial(aq.qgbRPC, grpc.WithTransportCredentials(insecure.NewCredentials())) + blobStreamGRPC, err := grpc.Dial(aq.blobStreamRPC, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return err } - aq.clientConn = qgbGRPC + aq.clientConn = blobStreamGRPC return nil } @@ -106,7 +106,7 @@ func (aq *AppQuerier) QueryDataCommitmentForHeight(ctx context.Context, height u return resp.DataCommitment, nil } -// QueryLatestDataCommitment query the latest data commitment in QGB 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/rpc/suite_test.go b/rpc/suite_test.go index 380c4715..7180a633 100644 --- a/rpc/suite_test.go +++ b/rpc/suite_test.go @@ -11,13 +11,13 @@ import ( "github.com/stretchr/testify/require" - qgbtesting "github.com/celestiaorg/orchestrator-relayer/testing" + blobstreamtesting "github.com/celestiaorg/orchestrator-relayer/testing" "github.com/stretchr/testify/suite" ) type QuerierTestSuite struct { suite.Suite - Network *qgbtesting.CelestiaNetwork + Network *blobstreamtesting.CelestiaNetwork EncConf encoding.Config Logger tmlog.Logger } @@ -25,7 +25,7 @@ type QuerierTestSuite struct { func (s *QuerierTestSuite) SetupSuite() { t := s.T() ctx := context.Background() - s.Network = qgbtesting.NewCelestiaNetwork(ctx, t, qgbtesting.DefaultCelestiaNetworkParams()) + s.Network = blobstreamtesting.NewCelestiaNetwork(ctx, t, blobstreamtesting.DefaultCelestiaNetworkParams()) _, err := s.Network.WaitForHeightWithTimeout(400, 30*time.Second) s.EncConf = encoding.MakeConfig(app.ModuleEncodingRegisters...) s.Logger = tmlog.NewNopLogger() diff --git a/store/init.go b/store/init.go index 1d71c64c..afe36b23 100644 --- a/store/init.go +++ b/store/init.go @@ -35,7 +35,7 @@ type InitOptions struct { NeedP2PKeyStore bool } -// Init initializes the qgb 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 5e9b585c..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 QGB 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 qgb 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/celestia_network.go b/testing/celestia_network.go index 74c73ba6..5afa8c41 100644 --- a/testing/celestia_network.go +++ b/testing/celestia_network.go @@ -118,9 +118,9 @@ func NewCelestiaNetwork(ctx context.Context, t *testing.T, params CelestiaNetwor // SetDataCommitmentWindowParams will set the provided data commitment window as genesis state. func SetDataCommitmentWindowParams(codec codec.Codec, params types.Params) celestiatestnode.GenesisOption { return func(state map[string]json.RawMessage) map[string]json.RawMessage { - qgbGenState := types.DefaultGenesis() - qgbGenState.Params = ¶ms - state[types.ModuleName] = codec.MustMarshalJSON(qgbGenState) + blobStreamGenState := types.DefaultGenesis() + blobStreamGenState.Params = ¶ms + state[types.ModuleName] = codec.MustMarshalJSON(blobStreamGenState) return state } } diff --git a/testing/dht_network.go b/testing/dht_network.go index cbd42421..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.QgbDHT + 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.QgbDHT, 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.QgbDHT) { +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.NewQgbDHT(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.QgbDHT, 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 bceba6e0..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 QGB 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 03145af5..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 QGB 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.