diff --git a/.github/workflows/e2e-nightly-34x.yml b/.github/workflows/e2e-nightly-34x.yml index 944ba13ef..8d89a20da 100644 --- a/.github/workflows/e2e-nightly-34x.yml +++ b/.github/workflows/e2e-nightly-34x.yml @@ -30,8 +30,7 @@ jobs: - name: Capture git repo info id: git-info run: | - echo "::set-output name=branch::`git branch --show-current`" - echo "::set-output name=commit::`git rev-parse HEAD`" + echo "branch=`git branch --show-current`" >> $GITHUB_OUTPUT - name: Build working-directory: test/e2e @@ -49,7 +48,6 @@ jobs: outputs: git-branch: ${{ steps.git-info.outputs.branch }} - git-commit: ${{ steps.git-info.outputs.commit }} e2e-nightly-fail: needs: e2e-nightly-test @@ -63,7 +61,7 @@ jobs: SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK BRANCH: ${{ needs.e2e-nightly-test.outputs.git-branch }} RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - COMMIT_URL: "${{ github.server_url }}/${{ github.repository }}/commit/${{ needs.e2e-nightly-test.outputs.git-commit }}" + COMMITS_URL: "${{ github.server_url }}/${{ github.repository }}/commits/${{ needs.e2e-nightly-test.outputs.git-branch }}" with: payload: | { @@ -72,7 +70,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": ":skull: Nightly E2E tests for `${{ env.BRANCH }}` failed. See the <${{ env.RUN_URL }}|run details> and the <${{ env.COMMIT_URL }}|commit> related to the failure." + "text": ":skull: Nightly E2E tests for `${{ env.BRANCH }}` failed. See the <${{ env.RUN_URL }}|run details> and the <${{ env.COMMITS_URL }}|latest commits> possibly related to the failure." } } ] diff --git a/.github/workflows/e2e-nightly-37x.yml b/.github/workflows/e2e-nightly-37x.yml index 769a316b2..ebcc4a3fb 100644 --- a/.github/workflows/e2e-nightly-37x.yml +++ b/.github/workflows/e2e-nightly-37x.yml @@ -30,8 +30,7 @@ jobs: - name: Capture git repo info id: git-info run: | - echo "::set-output name=branch::`git branch --show-current`" - echo "::set-output name=commit::`git rev-parse HEAD`" + echo "branch=`git branch --show-current`" >> $GITHUB_OUTPUT - name: Build working-directory: test/e2e @@ -49,7 +48,6 @@ jobs: outputs: git-branch: ${{ steps.git-info.outputs.branch }} - git-commit: ${{ steps.git-info.outputs.commit }} e2e-nightly-fail: needs: e2e-nightly-test @@ -63,7 +61,7 @@ jobs: SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK BRANCH: ${{ needs.e2e-nightly-test.outputs.git-branch }} RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - COMMIT_URL: "${{ github.server_url }}/${{ github.repository }}/commit/${{ needs.e2e-nightly-test.outputs.git-commit }}" + COMMITS_URL: "${{ github.server_url }}/${{ github.repository }}/commits/${{ needs.e2e-nightly-test.outputs.git-branch }}" with: payload: | { @@ -72,7 +70,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": ":skull: Nightly E2E tests for `${{ env.BRANCH }}` failed. See the <${{ env.RUN_URL }}|run details> and the <${{ env.COMMIT_URL }}|commit> related to the failure." + "text": ":skull: Nightly E2E tests for `${{ env.BRANCH }}` failed. See the <${{ env.RUN_URL }}|run details> and the <${{ env.COMMITS_URL }}|latest commits> possibly related to the failure." } } ] diff --git a/.github/workflows/e2e-nightly-main.yml b/.github/workflows/e2e-nightly-main.yml index dd8b7abbb..7f734367d 100644 --- a/.github/workflows/e2e-nightly-main.yml +++ b/.github/workflows/e2e-nightly-main.yml @@ -52,7 +52,7 @@ jobs: SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK BRANCH: ${{ github.ref_name }} RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - COMMIT_URL: "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" + COMMITS_URL: "${{ github.server_url }}/${{ github.repository }}/commits/${{ github.ref_name }}" with: payload: | { @@ -61,7 +61,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": ":skull: Nightly E2E tests for `${{ env.BRANCH }}` failed. See the <${{ env.RUN_URL }}|run details> and the <${{ env.COMMIT_URL }}|commit> related to the failure." + "text": ":skull: Nightly E2E tests for `${{ env.BRANCH }}` failed. See the <${{ env.RUN_URL }}|run details> and the <${{ env.COMMITS_URL }}|latest commits> possibly related to the failure." } } ] diff --git a/.github/workflows/fuzz-nightly.yml b/.github/workflows/fuzz-nightly.yml index 0209501a1..e6c71db08 100644 --- a/.github/workflows/fuzz-nightly.yml +++ b/.github/workflows/fuzz-nightly.yml @@ -64,7 +64,7 @@ jobs: - name: Set crashers count working-directory: test/fuzz - run: echo "::set-output name=count::$(find . -type d -name 'crashers' | xargs -I % sh -c 'ls % | wc -l' | awk '{total += $1} END {print total}')" + run: echo "count=$(find . -type d -name 'crashers' | xargs -I % sh -c 'ls % | wc -l' | awk '{total += $1} END {print total}')" >> $GITHUB_OUTPUT id: set-crashers-count outputs: diff --git a/.github/workflows/docker.yml b/.github/workflows/tendermint-docker.yml similarity index 97% rename from .github/workflows/docker.yml rename to .github/workflows/tendermint-docker.yml index e1f38d1a6..721a2717b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/tendermint-docker.yml @@ -33,7 +33,7 @@ jobs: if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}" fi - echo ::set-output name=tags::${TAGS} + echo "tags=${TAGS}" >> $GITHUB_OUTPUT - name: Set up QEMU uses: docker/setup-qemu-action@master diff --git a/.github/workflows/testapp-docker.yml b/.github/workflows/testapp-docker.yml new file mode 100644 index 000000000..9e8e59a47 --- /dev/null +++ b/.github/workflows/testapp-docker.yml @@ -0,0 +1,60 @@ +name: Testapp Docker +# Build & Push rebuilds the Testapp docker image on every push to main and creation of tags +# and pushes the image to https://hub.docker.com/r/tendermint/testapp +on: + push: + branches: + - main + tags: + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 + - "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" # e.g. v0.37.0-alpha.1, v0.38.0-alpha.10 + - "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" # e.g. v0.37.0-beta.1, v0.38.0-beta.10 + - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # e.g. v0.37.0-rc1, v0.38.0-rc10 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Prepare + id: prep + run: | + DOCKER_IMAGE=tendermint/testapp + VERSION=noop + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/} + elif [[ $GITHUB_REF == refs/heads/* ]]; then + VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') + if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then + VERSION=latest + fi + fi + TAGS="${DOCKER_IMAGE}:${VERSION}" + if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}" + fi + echo "tags=${TAGS}" >> $GITHUB_OUTPUT + + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + + - name: Set up Docker Build + uses: docker/setup-buildx-action@v2.2.1 + + - name: Login to DockerHub + if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Publish to Docker Hub + uses: docker/build-push-action@v3.2.0 + with: + context: . + file: ./test/e2e/docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'beep_boop' }} + tags: ${{ steps.prep.outputs.tags }} diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index 4a4201943..ab0d52156 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -460,11 +460,14 @@ func cmdUnimplemented(cmd *cobra.Command, args []string) error { fmt.Println("Available commands:") fmt.Printf("%s: %s\n", echoCmd.Use, echoCmd.Short) - fmt.Printf("%s: %s\n", infoCmd.Use, infoCmd.Short) fmt.Printf("%s: %s\n", checkTxCmd.Use, checkTxCmd.Short) - fmt.Printf("%s: %s\n", deliverTxCmd.Use, deliverTxCmd.Short) - fmt.Printf("%s: %s\n", queryCmd.Use, queryCmd.Short) fmt.Printf("%s: %s\n", commitCmd.Use, commitCmd.Short) + fmt.Printf("%s: %s\n", deliverTxCmd.Use, deliverTxCmd.Short) + fmt.Printf("%s: %s\n", infoCmd.Use, infoCmd.Short) + fmt.Printf("%s: %s\n", queryCmd.Use, queryCmd.Short) + fmt.Printf("%s: %s\n", prepareProposalCmd.Use, prepareProposalCmd.Short) + fmt.Printf("%s: %s\n", processProposalCmd.Use, processProposalCmd.Short) + fmt.Println("Use \"[command] --help\" for more information about a command.") return nil diff --git a/state/execution.go b/state/execution.go index 234d81c0f..4ba630db7 100644 --- a/state/execution.go +++ b/state/execution.go @@ -93,7 +93,7 @@ func (blockExec *BlockExecutor) SetEventBus(eventBus types.BlockEventPublisher) // CreateProposalBlock calls state.MakeBlock with evidence from the evpool // and txs from the mempool. The max bytes must be big enough to fit the commit. -// Up to 1/10th of the block space is allcoated for maximum sized evidence. +// Up to 1/10th of the block space is allocated for maximum sized evidence. // The rest is given to txs, up to the max gas. // // Contract: application will not return more bytes than are sent over the wire. diff --git a/test/e2e/Makefile b/test/e2e/Makefile index 8bafe7ca9..7a82f8236 100644 --- a/test/e2e/Makefile +++ b/test/e2e/Makefile @@ -1,7 +1,7 @@ all: docker generator runner docker: - docker build --tag tendermint/e2e-node -f docker/Dockerfile ../.. + docker build --tag tendermint/e2e-node --tag tendermint/e2e-node:local-version -f docker/Dockerfile ../.. # We need to build support for database backends into the app in # order to build a binary with a Tendermint node in it (for built-in diff --git a/test/e2e/pkg/infra/docker/docker.go b/test/e2e/pkg/infra/docker/docker.go index a17700298..d5c37a524 100644 --- a/test/e2e/pkg/infra/docker/docker.go +++ b/test/e2e/pkg/infra/docker/docker.go @@ -72,7 +72,7 @@ services: labels: e2e: true container_name: {{ .Name }} - image: tendermint/e2e-node + image: tendermint/e2e-node:{{ .Version }} {{- if eq .ABCIProtocol "builtin" }} entrypoint: /usr/bin/entrypoint-builtin {{- end }} diff --git a/test/e2e/pkg/manifest.go b/test/e2e/pkg/manifest.go index 814ae61c7..0a9a1da5f 100644 --- a/test/e2e/pkg/manifest.go +++ b/test/e2e/pkg/manifest.go @@ -81,6 +81,13 @@ type ManifestNode struct { // is generated), and seed nodes run in seed mode with the PEX reactor enabled. Mode string `toml:"mode"` + // Version specifies which version of Tendermint this node is. Specifying different + // versions for different nodes allows for testing the interaction of different + // node's compatibility. Note that in order to use a node at a particular version, + // there must be a docker image of the test app tagged with this version present + // on the machine where the test is being run. + Version string `toml:"version"` + // SyncApp specifies whether this node should use a synchronized application // with an unsynchronized local client. By default this is `false`, meaning // that the node will run an unsynchronized application with a synchronized diff --git a/test/e2e/pkg/testnet.go b/test/e2e/pkg/testnet.go index e273cc1a3..9d9288908 100644 --- a/test/e2e/pkg/testnet.go +++ b/test/e2e/pkg/testnet.go @@ -79,6 +79,7 @@ type Testnet struct { // Node represents a Tendermint node in a testnet. type Node struct { Name string + Version string Testnet *Testnet Mode Mode SyncApp bool // Should we use a synchronized app with an unsynchronized local client? @@ -174,8 +175,13 @@ func LoadTestnet(manifest Manifest, fname string, ifd InfrastructureData) (*Test if ifd.Provider != "docker" { extIP = ind.IPAddress } + v := nodeManifest.Version + if v == "" { + v = "local-version" + } node := &Node{ Name: name, + Version: v, Testnet: testnet, PrivvalKey: keyGen.Generate(manifest.KeyType), NodeKey: keyGen.Generate("ed25519"), diff --git a/test/e2e/runner/load.go b/test/e2e/runner/load.go index 735af4821..b4478bf6d 100644 --- a/test/e2e/runner/load.go +++ b/test/e2e/runner/load.go @@ -26,6 +26,7 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error { ctx, cancel := context.WithCancel(ctx) defer cancel() + logger.Info("load", "msg", log.NewLazySprintf("Starting transaction load (%v workers)...", workerPoolSize)) started := time.Now() u := [16]byte(uuid.New()) // generate run ID on startup @@ -38,11 +39,7 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error { } for w := 0; w < testnet.LoadTxConnections; w++ { - cli, err := n.Client() - if err != nil { - return err - } - go loadProcess(ctx, txCh, chSuccess, cli) + go loadProcess(ctx, txCh, chSuccess, n) } } @@ -95,10 +92,12 @@ func loadGenerate(ctx context.Context, txCh chan<- types.Tx, testnet *e2e.Testne // is canceled. func createTxBatch(ctx context.Context, txCh chan<- types.Tx, testnet *e2e.Testnet, id []byte) { wg := &sync.WaitGroup{} + genCh := make(chan struct{}) for i := 0; i < workerPoolSize; i++ { wg.Add(1) go func() { - for i := 0; i < testnet.LoadTxBatchSize; i++ { + defer wg.Done() + for range genCh { tx, err := payload.NewBytes(&payload.Payload{ Id: id, Size: uint64(testnet.LoadTxSizeBytes), @@ -115,18 +114,33 @@ func createTxBatch(ctx context.Context, txCh chan<- types.Tx, testnet *e2e.Testn return } } - wg.Done() }() } + for i := 0; i < testnet.LoadTxBatchSize; i++ { + select { + case genCh <- struct{}{}: + case <-ctx.Done(): + break + } + } + close(genCh) wg.Wait() } // loadProcess processes transactions by sending transactions received on the txCh // to the client. -func loadProcess(ctx context.Context, txCh <-chan types.Tx, chSuccess chan<- struct{}, client *rpchttp.HTTP) { +func loadProcess(ctx context.Context, txCh <-chan types.Tx, chSuccess chan<- struct{}, n *e2e.Node) { + var client *rpchttp.HTTP var err error s := struct{}{} for tx := range txCh { + if client == nil { + client, err = n.Client() + if err != nil { + logger.Info("non-fatal error creating node client", "error", err) + continue + } + } if _, err = client.BroadcastTxSync(ctx, tx); err != nil { continue }