Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: Split up UpdateValidator into distinct state transitions applied only in EndBlock #2394

Merged
merged 70 commits into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
73292e0
Start of changes for TM 0.24
cwgoes Sep 3, 2018
14d5e68
More TM 0.24 updates
cwgoes Sep 3, 2018
532c9ee
Client updates for TM 0.24
cwgoes Sep 3, 2018
f45cfb2
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 6, 2018
8f6c9e1
Pin to Tendermint 0.24.0-rc0
cwgoes Sep 6, 2018
06adc69
Update testcases for TM 0.24.0-rc0
cwgoes Sep 6, 2018
c667c56
More testcase fixes
cwgoes Sep 6, 2018
1f5fe29
Ignore Go src in linter
cwgoes Sep 6, 2018
dd75cd3
Minor cleanup
cwgoes Sep 6, 2018
e013b9f
Check errors
cwgoes Sep 6, 2018
2245b07
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 7, 2018
897c381
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 7, 2018
9dd4303
Pin final release
cwgoes Sep 7, 2018
b144dc7
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 7, 2018
f95d26a
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 8, 2018
08d4f45
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 8, 2018
1d55673
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 8, 2018
d85eb98
make format
cwgoes Sep 8, 2018
19080d0
pulling in issue code
rigelrozanski Sep 25, 2018
6c78ac7
Merge remote-tracking branch 'origin/develop' into rigel/stake-refactor
rigelrozanski Sep 26, 2018
1aa65e4
replace ensureValidatorFound with mustGetValidator
rigelrozanski Sep 26, 2018
8d394f6
split up keeper/validator.go
rigelrozanski Sep 26, 2018
8373329
move validatorByPowerIndexExists from keeper to test file
rigelrozanski Sep 26, 2018
b6575bb
reorganizing
rigelrozanski Sep 26, 2018
52c413f
GetValidatorsByPower -> GetBondedValidatorsByPower
rigelrozanski Sep 26, 2018
7debae0
remove duplicate SetValidator in handleMsgEditValidator
rigelrozanski Sep 26, 2018
e838a02
Added missing by-power index at validator creation
rigelrozanski Sep 26, 2018
0e91227
removed codebase use of UpdateValidator
rigelrozanski Sep 26, 2018
cd9a9fb
SetParams now doesnt update validator set as happens at endblock
rigelrozanski Sep 26, 2018
76f18fd
got non-test code compiling
rigelrozanski Sep 26, 2018
e7c2a96
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 26, 2018
e931195
Remove unnecessary changes
cwgoes Sep 26, 2018
1013703
Update context.Verify
cwgoes Sep 26, 2018
da96e93
'make format'
cwgoes Sep 26, 2018
ecc06f4
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 26, 2018
f11ee67
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Sep 27, 2018
fd36abf
Use own directory, fix tx size test, remove parseCmnError
cwgoes Sep 27, 2018
f2422cd
Keep code, codespace
cwgoes Sep 27, 2018
eec5f42
Merge branch 'develop' into rigel/stake-refactor
cwgoes Sep 27, 2018
54098df
Remove old code, minor cleanup of existing work
cwgoes Sep 27, 2018
2fa6b1c
Merge branch 'develop' into rigel/stake-refactor
cwgoes Sep 27, 2018
b1d6384
Merge branch 'cwgoes/update-tendermint-upstream' into rigel/stake-ref…
cwgoes Sep 27, 2018
e2200a2
Fixes from merge
cwgoes Sep 27, 2018
174b321
Pseudocode to real-ish code
cwgoes Sep 27, 2018
715ad04
Remove cliff validator key (no longer used)
cwgoes Sep 27, 2018
ba3c1f5
GetTendermintUpdates continued
cwgoes Sep 28, 2018
ebc59ae
Works with simulation
cwgoes Sep 28, 2018
09c43d5
Merge branch 'develop' into rigel/stake-refactor
cwgoes Oct 1, 2018
cfb12da
Refactor testcases in progress
cwgoes Oct 1, 2018
77c2cc8
Testcase fixes in progress
cwgoes Oct 1, 2018
123bc06
Minor fixes
cwgoes Oct 1, 2018
6d4af75
Testcase fixes contd...
cwgoes Oct 1, 2018
d8f2656
Fix slashing tests (just adding stake.EndBlocker calls)
cwgoes Oct 1, 2018
a12cda1
Fix more testcases
cwgoes Oct 1, 2018
0c1ddec
Unit tests as far as the eye can see
cwgoes Oct 1, 2018
c7cac2d
Update PENDING.md
cwgoes Oct 1, 2018
3ed2c22
Merge branch 'develop' into cwgoes/update-tendermint-upstream
cwgoes Oct 1, 2018
de0decc
Merge branch 'cwgoes/update-tendermint-upstream' into rigel/stake-ref…
cwgoes Oct 1, 2018
7d82281
Address review comments, round one
cwgoes Oct 2, 2018
b96faf6
dep update, rename to clarify that function applies state changes
cwgoes Oct 2, 2018
dbd2c0a
Split up function for clarity
cwgoes Oct 2, 2018
54d5ce8
Remove jailed validators from the power store entirely
cwgoes Oct 2, 2018
413fa42
Remove redundant bonded validator store
cwgoes Oct 2, 2018
1c1183a
Fix simulator bug
cwgoes Oct 2, 2018
951cacc
Change key name to reflect usage
cwgoes Oct 2, 2018
8e67f6d
updateValidator -> testingUpdateValidator
cwgoes Oct 3, 2018
94b0ca9
'make format'
cwgoes Oct 3, 2018
5893e23
Address @rigelrozanski comments
cwgoes Oct 3, 2018
1ad577b
Merge branch 'develop' into rigel/stake-refactor
cwgoes Oct 3, 2018
8853f2b
Add descriptive comment
cwgoes Oct 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 44 additions & 34 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@

[[override]]
name = "github.com/tendermint/go-amino"
version = "=v0.12.0-rc0"
version = "=v0.12.0"

[[override]]
name = "github.com/tendermint/iavl"
version = "=v0.11.0"

[[override]]
name = "github.com/tendermint/tendermint"
version = "=v0.23.1-rc0"
version = "=0.24.0"

[[constraint]]
name = "github.com/bartekn/go-bip39"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ test_cover:

test_lint:
gometalinter.v2 --config=tools/gometalinter.json ./...
!(gometalinter.v2 --disable-all --enable='errcheck' --vendor ./... | grep -v "client/")
!(gometalinter.v2 --exclude /usr/lib/go/src/ --disable-all --enable='errcheck' --vendor ./... | grep -v "client/")
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
dep status >> /dev/null
!(grep -n branch Gopkg.toml)
Expand Down
5 changes: 5 additions & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ BREAKING CHANGES
* [simulation] \#2162 Added back correct supply invariants

* SDK
* [core] \#2219 Update to Tendermint 0.24.0
* Validator set updates delayed by one block
* BFT timestamp that can safely be used by applications
* Fixed maximum block size enforcement
* [core] [\#1807](https://github.com/cosmos/cosmos-sdk/issues/1807) Switch from use of rational to decimal
* [types] [\#1901](https://github.com/cosmos/cosmos-sdk/issues/1901) Validator interface's GetOwner() renamed to GetOperator()
* [x/slashing] [#2122](https://github.com/cosmos/cosmos-sdk/pull/2122) - Implement slashing period
Expand All @@ -60,6 +64,7 @@ BREAKING CHANGES
* [x/auth] \#2377 auth.StdSignMsg -> txbuilder.StdSignMsg
* [x/staking] \#2244 staking now holds a consensus-address-index instead of a consensus-pubkey-index
* [x/staking] \#2236 more distribution hooks for distribution
* [x/stake] \#2394 Split up UpdateValidator into distinct state transitions applied only in EndBlock

* Tendermint

Expand Down
12 changes: 6 additions & 6 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ type BaseApp struct {
// checkState is set on initialization and reset on Commit.
// deliverState is set in InitChain and BeginBlock and cleared on Commit.
// See methods setCheckState and setDeliverState.
checkState *state // for CheckTx
deliverState *state // for DeliverTx
signedValidators []abci.SigningValidator // absent validators from begin block
checkState *state // for CheckTx
deliverState *state // for DeliverTx
voteInfos []abci.VoteInfo // absent validators from begin block

// minimum fees for spam prevention
minimumFees sdk.Coins
Expand Down Expand Up @@ -435,7 +435,7 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg

// set the signed validators for addition to context in deliverTx
// TODO: communicate this result to the address to pubkey map in slashing
app.signedValidators = req.LastCommitInfo.GetValidators()
app.voteInfos = req.LastCommitInfo.GetVotes()
return
}

Expand Down Expand Up @@ -509,12 +509,12 @@ func validateBasicTxMsgs(msgs []sdk.Msg) sdk.Error {
}

// retrieve the context for the ante handler and store the tx bytes; store
// the signing validators if the tx runs within the deliverTx() state.
// the vote infos if the tx runs within the deliverTx() state.
func (app *BaseApp) getContextForAnte(mode runTxMode, txBytes []byte) (ctx sdk.Context) {
// Get the context
ctx = getState(app, mode).ctx.WithTxBytes(txBytes)
if mode == runTxModeDeliver {
ctx = ctx.WithSigningValidators(app.signedValidators)
ctx = ctx.WithVoteInfos(app.voteInfos)
}
return
}
Expand Down
14 changes: 7 additions & 7 deletions client/config.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package client

import (
"github.com/spf13/cobra"
"github.com/mitchellh/go-homedir"
"bufio"
"path"
"os"
"io/ioutil"
"github.com/pelletier/go-toml"
"fmt"
"github.com/cosmos/cosmos-sdk/types"
"github.com/mitchellh/go-homedir"
"github.com/pelletier/go-toml"
"github.com/spf13/cobra"
"io/ioutil"
"os"
"path"
)

type cliConfig struct {
Expand All @@ -34,7 +34,7 @@ func ConfigCmd() *cobra.Command {
return cfg
}

func runConfigCmd(cmd *cobra.Command, args [] string) error {
func runConfigCmd(cmd *cobra.Command, args []string) error {
home, err := homedir.Dir()
if err != nil {
return err
Expand Down
Loading