From eea93b8904ef8afd4564d97968b4bb5c03a03d3a Mon Sep 17 00:00:00 2001 From: Adrian Brink Date: Wed, 28 Mar 2018 12:37:42 +0200 Subject: [PATCH 1/4] Upgrade to Circle 2.0 --- .circleci/config.yml | 121 +++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + circle.yml | 21 -------- 3 files changed, 122 insertions(+), 21 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..fd22668a4 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,121 @@ +version: 2 + +defaults: &defaults + working_directory: /go/src/github.com/tendermint/abci + docker: + - image: circleci/golang:1.10.0 + environment: + GOBIN: /tmp/workspace/bin + +jobs: + setup_dependencies: + <<: *defaults + steps: + - run: mkdir -p /tmp/workspace/bin + - run: mkdir -p /tmp/workspace/profiles + - checkout + - restore_cache: + keys: + - v1-pkg-cache + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: + name: binaries + command: | + export PATH="$GOBIN:$PATH" + make install + - persist_to_workspace: + root: /tmp/workspace + paths: + - bin + - profiles + - save_cache: + key: v1-pkg-cache + paths: + - /go/pkg + - save_cache: + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} + paths: + - /go/src/github.com/tendermint/abci + + test_integration: + <<: *defaults + steps: + - attach_workspace: + at: /tmp/workspace + - restore_cache: + key: v1-pkg-cache + - restore_cache: + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} + - run: + name: Run integration tests + command: | + find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; + bash tests/test.sh + + test_cover: + <<: *defaults + parallelism: 4 + steps: + - attach_workspace: + at: /tmp/workspace + - restore_cache: + key: v1-pkg-cache + - restore_cache: + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} + - run: + name: Run test cover + command: | + for pkg in $(go list github.com/tendermint/abci/... | grep -v /vendor/ | circleci tests split --split-by=timings); do + id=$(basename "$pkg") + go test -timeout 5m -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic "$pkg" + done + - persist_to_workspace: + root: /tmp/workspace + paths: + - "profiles/*" + + upload_coverage: + <<: *defaults + steps: + - attach_workspace: + at: /tmp/workspace + - restore_cache: + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} + - run: + name: gather + command: | + set -ex + + echo "mode: atomic" > coverage.txt + for prof in $(ls /tmp/workspace/profiles/); do + tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt + done + - run: + name: upload + command: bash <(curl -s https://codecov.io/bash) -f coverage.txt + +workflows: + version: 2 + test-suite: + jobs: + - setup_dependencies + - test_cover: + requires: + - setup_dependencies + - test_integration: + requires: + - setup_dependencies + - upload_coverage: + requires: + - test_integrations + + diff --git a/.gitignore b/.gitignore index f1fa5d414..8c2b367cd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ vendor types/types.pb.go *.sw[op] abci-cli +coverage.txt diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 8e7373395..000000000 --- a/circle.yml +++ /dev/null @@ -1,21 +0,0 @@ -machine: - environment: - GOPATH: /home/ubuntu/.go_workspace - REPO: $GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME - hosts: - circlehost: 127.0.0.1 - localhost: 127.0.0.1 - -checkout: - post: - - rm -rf $REPO - - mkdir -p $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME - - mv $HOME/$CIRCLE_PROJECT_REPONAME $REPO - - go version - -test: - override: - - cd $REPO && make get_tools check get_vendor_deps install test_integrations - post: - - cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt - - cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}" From 44a8a23932cd16eb19ba49ef2b809a169e99ddb8 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 16 Apr 2018 13:40:19 +0200 Subject: [PATCH 2/4] [docs/Commit] all application instances must return the same hash Refs https://github.com/tendermint/tendermint/issues/1422 --- specification.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification.rst b/specification.rst index 4b2704637..f98a46f49 100644 --- a/specification.rst +++ b/specification.rst @@ -284,3 +284,6 @@ Commit - Persist the application state. - Return a Merkle root hash of the application state. + - It's critical that all application instances return the same hash. If not, + they will not be able to agree on the next block, because the hash is + included in the next block! From a6fe2a9854d605e8a2bbcd9fd82b92158074ae29 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 25 Apr 2018 22:52:11 +0200 Subject: [PATCH 3/4] specify DeliverTx/CheckTx Tags format --- specification.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification.rst b/specification.rst index f98a46f49..5bfe8f777 100644 --- a/specification.rst +++ b/specification.rst @@ -228,6 +228,8 @@ CheckTx After ``Commit``, the mempool will rerun CheckTx on all remaining transactions, throwing out any that are no longer valid. + Keys and values in Tags must be UTF-8 encoded strings (e.g. "account.owner": "Bob", "balance": "100.0", "date": "2018-01-02") + DeliverTx ^^^^^^^^^ @@ -251,6 +253,7 @@ DeliverTx - Deliver a transaction to be executed in full by the application. If the transaction is valid, returns CodeType.OK. + - Keys and values in Tags must be UTF-8 encoded strings (e.g. "account.owner": "Bob", "balance": "100.0", "time": "2018-01-02T12:30:00Z") EndBlock ^^^^^^^^ From 52d6dfe074c6dbb67c420d78bff32b26dcb7a8e9 Mon Sep 17 00:00:00 2001 From: Zach Date: Mon, 14 May 2018 12:27:29 -0400 Subject: [PATCH 4/4] Update specification.rst --- specification.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification.rst b/specification.rst index 5bfe8f777..8ebe8892e 100644 --- a/specification.rst +++ b/specification.rst @@ -1,5 +1,5 @@ -Specification -============= +ABCI Specification +================== Message Types ~~~~~~~~~~~~~