From acd976ad5b64e3952459353cb84b14af86d85bf9 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 26 Jun 2018 23:42:00 -0700 Subject: [PATCH 1/8] bump circle --- bump | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 bump diff --git a/bump b/bump new file mode 100644 index 000000000..e69de29bb From 19fc4ac47c40f12567652abee3afe70cd5c5970c Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 26 Jun 2018 23:58:47 -0700 Subject: [PATCH 2/8] remove abci from gopkg.toml --- Gopkg.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Gopkg.toml b/Gopkg.toml index dc56ae29d..18e2767a9 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -69,10 +69,6 @@ name = "github.com/stretchr/testify" version = "~1.2.1" -[[constraint]] - name = "github.com/tendermint/abci" - version = "~0.12.0" - [[constraint]] name = "github.com/tendermint/go-amino" version = "~0.10.1" From 835c2ee74a07814d690166bae3ee0bbc81b02f3e Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 00:09:04 -0700 Subject: [PATCH 3/8] Print --- test/p2p/basic/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/p2p/basic/test.sh b/test/p2p/basic/test.sh index caf665122..423b5b017 100755 --- a/test/p2p/basic/test.sh +++ b/test/p2p/basic/test.sh @@ -56,6 +56,7 @@ for i in `seq 1 $N`; do # - assert block height is greater than 1 BLOCK_HEIGHT=`curl -s $addr/status | jq .result.sync_info.latest_block_height | jq fromjson` COUNT=0 + echo "$$BLOCK_HEIGHT IS $BLOCK_HEIGHT" while [ "$BLOCK_HEIGHT" -le 1 ]; do echo "Waiting for node $i to commit a block ..." sleep 1 From 8163b99a75f34a3eefc19bf0449405a701b82378 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 00:37:53 -0700 Subject: [PATCH 4/8] print docker output to console to debug circle --- test/p2p/kill_all/check_peers.sh | 4 ++-- test/p2p/peer.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/p2p/kill_all/check_peers.sh b/test/p2p/kill_all/check_peers.sh index 87a768110..95da7484e 100644 --- a/test/p2p/kill_all/check_peers.sh +++ b/test/p2p/kill_all/check_peers.sh @@ -23,7 +23,7 @@ set -e # get the first peer's height addr=$(test/p2p/ip.sh 1):26657 -h1=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height) +h1=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height | sed -e "s/^\"\(.*\)\"$/\1/g") echo "1st peer is on height $h1" echo "Waiting until other peers reporting a height higher than the 1st one" @@ -33,7 +33,7 @@ for i in $(seq 2 "$NUM_OF_PEERS"); do while [[ $hi -le $h1 ]] ; do addr=$(test/p2p/ip.sh "$i"):26657 - hi=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height) + hi=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height | sed -e "s/^\"\(.*\)\"$/\1/g") echo "... peer $i is on height $hi" diff --git a/test/p2p/peer.sh b/test/p2p/peer.sh index 15d44ff33..59b55b1e6 100644 --- a/test/p2p/peer.sh +++ b/test/p2p/peer.sh @@ -14,7 +14,7 @@ echo "starting tendermint peer ID=$ID" # start tendermint container on the network # NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be # treated as one flag. -docker run -d \ +docker run \ --net="$NETWORK_NAME" \ --ip=$(test/p2p/ip.sh "$ID") \ --name "local_testnet_$ID" \ @@ -24,4 +24,4 @@ docker run -d \ --log-opt syslog-address=udp://127.0.0.1:5514 \ --log-opt syslog-facility=daemon \ --log-opt tag="{{.Name}}" \ - "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" & From ad1b722898aa435bb022b1641ebbc25365a17fac Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 00:41:50 -0700 Subject: [PATCH 5/8] bump for circle --- bump | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bump b/bump index e69de29bb..729353f73 100644 --- a/bump +++ b/bump @@ -0,0 +1,2 @@ + +booop From 363146dacf803a065d7bbe35994b145fae746ef3 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 02:03:15 -0700 Subject: [PATCH 6/8] just print node1 --- test/p2p/peer.sh | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/test/p2p/peer.sh b/test/p2p/peer.sh index 59b55b1e6..a718fd49f 100644 --- a/test/p2p/peer.sh +++ b/test/p2p/peer.sh @@ -14,14 +14,33 @@ echo "starting tendermint peer ID=$ID" # start tendermint container on the network # NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be # treated as one flag. -docker run \ - --net="$NETWORK_NAME" \ - --ip=$(test/p2p/ip.sh "$ID") \ - --name "local_testnet_$ID" \ - --entrypoint tendermint \ - -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ - --log-driver=syslog \ - --log-opt syslog-address=udp://127.0.0.1:5514 \ - --log-opt syslog-facility=daemon \ - --log-opt tag="{{.Name}}" \ - "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" & + + + +if [[ "$ID" == "1" ]]; then + docker run \ + --net="$NETWORK_NAME" \ + --ip=$(test/p2p/ip.sh "$ID") \ + --name "local_testnet_$ID" \ + --entrypoint tendermint \ + -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ + -e GOMAXPROCS=1 \ + --log-driver=syslog \ + --log-opt syslog-address=udp://127.0.0.1:5514 \ + --log-opt syslog-facility=daemon \ + --log-opt tag="{{.Name}}" \ + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" & +else + docker run -d \ + --net="$NETWORK_NAME" \ + --ip=$(test/p2p/ip.sh "$ID") \ + --name "local_testnet_$ID" \ + --entrypoint tendermint \ + -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ + -e GOMAXPROCS=1 \ + --log-driver=syslog \ + --log-opt syslog-address=udp://127.0.0.1:5514 \ + --log-opt syslog-facility=daemon \ + --log-opt tag="{{.Name}}" \ + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" +fi From 9184733261efc20d9c4b5328df03c8da8f2ff1ec Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 02:34:11 -0700 Subject: [PATCH 7/8] try it with new consensus? --- consensus/state.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/consensus/state.go b/consensus/state.go index 7c18d8b09..19c17f333 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1587,7 +1587,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, if prevotes.HasTwoThirdsMajority() { cs.enterPrecommit(height, vote.Round) } else { - cs.enterPrevote(height, vote.Round) // if the vote is ahead of us + cs.enterPropose(height, vote.Round) // we can't prevote until we wait for the proposal. cs.enterPrevoteWait(height, vote.Round) } } else if cs.Proposal != nil && 0 <= cs.Proposal.POLRound && cs.Proposal.POLRound == vote.Round { @@ -1621,7 +1621,8 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, } } else if cs.Round <= vote.Round && precommits.HasTwoThirdsAny() { cs.enterNewRound(height, vote.Round) - cs.enterPrecommit(height, vote.Round) + cs.enterPrevote(height, vote.Round) + cs.enterPrevoteWait(height, vote.Round) cs.enterPrecommitWait(height, vote.Round) } default: From cfcbc614498b5c16e49e064eacb8dba168cb78c3 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 04:04:33 -0700 Subject: [PATCH 8/8] oops --- consensus/state.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/consensus/state.go b/consensus/state.go index 19c17f333..e3c9054a0 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1021,9 +1021,11 @@ func (cs *ConsensusState) enterPrevoteWait(height int64, round int) { logger.Debug(cmn.Fmt("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } - if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { - cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) - } + /* + if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { + cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) + } + */ logger.Info(cmn.Fmt("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) defer func() {