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

chore(backport): Backport Tenderdash 0.7 to 0.8 #246

Merged
merged 72 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
0f1fc8c
feat: improve logging for better elasticsearch compatibility (#220)
lklimek Dec 16, 2021
bb60d7b
fix: fix the most of the compile errors
shotonoff Dec 21, 2021
344f7ac
chore: update import section
shotonoff Dec 22, 2021
c1fc093
feat(abci): InitChain can set initial core lock height (#222)
lklimek Dec 22, 2021
b6ddf8c
fix: regenerate remote_client.go mock, some fixes by feedback
shotonoff Dec 22, 2021
6fb9728
fix: remove unused global variables
shotonoff Dec 22, 2021
0fda010
build(deps): bump github.com/rs/cors from 1.8.0 to 1.8.2
dependabot[bot] Dec 22, 2021
6ec70a9
Merge branch 'tendermint35-merge-intov8' into fix-compile-errors-2
shotonoff Dec 23, 2021
9b77434
fix: some fixes for 0.35 backport
shotonoff Dec 23, 2021
d395f8a
fix: some fixes for 0.35 backport
shotonoff Dec 30, 2021
0b87850
feat(consensus): add empty block on h-1 and h-2 apphash change (#241)
lklimek Dec 31, 2021
8a10184
fix(evidence): fix all failed tests in evidence package
shotonoff Jan 5, 2022
3e002f7
fix(store): fix unit tests for internal/store package
shotonoff Jan 6, 2022
b040105
fix(blocksync): fix unit tests for internal/blocksync package
shotonoff Jan 6, 2022
8598ed0
fix(p2p): remove redundant sleep from TestMConnTransport_Listen
shotonoff Jan 6, 2022
442b7f6
fix(blocksync): fic blocksync/v2 test
shotonoff Jan 6, 2022
750e13b
fix(rpc): allow reading "request_quorum_info" param for rpc "validato…
shotonoff Jan 6, 2022
7e794fc
fix(state): fix internal/state package
shotonoff Jan 6, 2022
4313c82
fix(state): fix internal/statesync package
shotonoff Jan 6, 2022
a8d8cd1
fix(test): fix internal/test/factory package
shotonoff Jan 6, 2022
6f80f27
fix(privval): some fixes for unit tests
shotonoff Jan 6, 2022
8118e47
fix(privval): fix tests TestPrivvalVectors, TestStateSyncVectors
shotonoff Jan 6, 2022
2e77c10
fix(consensus): fix consensus logic and tests
shotonoff Jan 7, 2022
cec698b
fix: remove generating AppHash from genesis
shotonoff Jan 7, 2022
8737f2a
fix: remove debug printing
shotonoff Jan 7, 2022
6a17736
fix(mempool): fix TestSerialReap
shotonoff Jan 7, 2022
1ed6b63
fix(rpc): fix TestBroadcastEvidence_DuplicateVoteEvidence
shotonoff Jan 7, 2022
919e4ac
feat: inter-validator set communication (#187)
lklimek Jan 7, 2022
954c301
fix: don't disconnect already disconnected validators
lklimek Jan 7, 2022
8acb1d0
feat(consensus): add create_proof_block_range config option (#243)
lklimek Jan 7, 2022
f80f0bf
fix: cycle dependency in "types" package
shotonoff Jan 8, 2022
71f7556
fix(types): modify and remove some test in types package
shotonoff Jan 10, 2022
d5b7306
refactor: remove unnecessary type conversion, update comment docs
shotonoff Jan 10, 2022
8a6ec52
Merge remote-tracking branch 'origin/v0.7-dev' into backport-0.7-to-0.8
lklimek Jan 11, 2022
5de5135
fix: light client package
shotonoff Jan 11, 2022
975021d
refactor: improve validator-set generator
shotonoff Jan 11, 2022
e4707f7
fix: some modification to ber able to run unit tests
shotonoff Jan 11, 2022
e46b0ed
fix: increase MaxHeaderBytes till 646 bytes
shotonoff Jan 11, 2022
ae4841b
fix: TestTxFilter unit test at tx_filter_test.go
shotonoff Jan 12, 2022
fb79c61
fix: TestGCFifo, TestGCRandom, reduce a size of elements to 100
shotonoff Jan 12, 2022
4f2653f
wip: backport 0.7 on top of 0.8
lklimek Jan 12, 2022
93b415c
Merge remote-tracking branch 'origin/fix-unit-test-fails' into backpo…
lklimek Jan 12, 2022
38c65ef
fix: Fix issues in 0.7 to 0.8 backport
lklimek Jan 12, 2022
7c059f8
fix: e2e generator, remove UnmixedP2P and Legacy test cases
shotonoff Jan 12, 2022
20264cf
refactor: remove a few unused variables and functions, clean up the code
shotonoff Jan 13, 2022
c7a6596
Merge remote-tracking branch 'origin/fix-unit-test-fails' into backpo…
lklimek Jan 14, 2022
0bd5bec
test(quorum): fix validar conn tests
lklimek Jan 14, 2022
7b5cc1c
refactor: modification after PR feedback
shotonoff Jan 14, 2022
18d2e55
refactor: self-review of 0.7 -> 0.8 backport
lklimek Jan 14, 2022
cba145a
fix: validator address string should contain protocol
lklimek Jan 14, 2022
c10a481
fix: modify a light client to use default height as 0
shotonoff Jan 20, 2022
cdfdbe4
fix: update code style
shotonoff Jan 20, 2022
c85bcd2
build(deps): bump github.com/prometheus/client_golang (#249)
dependabot[bot] Jan 21, 2022
7d3995e
build(deps): bump github.com/BurntSushi/toml from 0.4.1 to 1.0.0
dependabot[bot] Jan 12, 2022
79a748b
chore(consensus): create only 1 proof block by default
lklimek Jan 21, 2022
fe7d1b4
chore(release): release script and initial changelog (#250)
lklimek Jan 24, 2022
5f55b4b
chore(release)!: bump ABCI version and update release.sh to change TM…
lklimek Jan 24, 2022
1b69cb5
fix(node): change TestMaxProposalBlockSize test to support tenderdash…
shotonoff Jan 24, 2022
90ff0ef
fix(ci): modify coverage.yml
shotonoff Jan 24, 2022
016f90d
Merge remote-tracking branch 'origin/fix-unit-test-fails' into backpo…
lklimek Jan 25, 2022
16bc4ba
feat(quorum): port validator set connectivity to 0.8 (WIP)
lklimek Jan 19, 2022
31d0620
test(dash/quorum): Adjust unit tests for Tenderdash 0.8
lklimek Jan 24, 2022
49435d7
test(node): update node test to new data structures
lklimek Jan 25, 2022
148a4f3
refactor(dash/quorum): rename Switch to DashConnectionManager
lklimek Jan 25, 2022
cad42f2
refactor(p2p): remove unused code introduced in 0.7
lklimek Jan 25, 2022
ec77f96
refactor(quorum): Code cleanup and renames for consistency
lklimek Jan 25, 2022
cdcf5a5
Merge remote-tracking branch 'origin/v0.7-dev' into backport-0.7-to-0.8
lklimek Jan 25, 2022
1cdda70
refactor(dash/quorum): code comments and whitespace
lklimek Jan 25, 2022
53211e5
chore(release): update changelog and version to 0.7.0
lklimek Jan 27, 2022
c041150
Merge pull request #259 from dashevo/release_0.7.0
lklimek Jan 27, 2022
009ced9
Merge remote-tracking branch 'origin/v0.8-dev' into backport-0.7-to-0.8
lklimek Feb 15, 2022
34d231f
Merge remote-tracking branch 'origin/master' into backport-0.7-to-0.8
lklimek Feb 15, 2022
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
6,424 changes: 2,995 additions & 3,429 deletions CHANGELOG.md

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions abci/example/kvstore/helpers.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package kvstore

import (
types2 "github.com/tendermint/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"

"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/bls12381"
cryptoenc "github.com/tendermint/tendermint/crypto/encoding"
)

func ValUpdate(pubKey crypto.PubKey, proTxHash crypto.ProTxHash) types.ValidatorUpdate {
return types.UpdateValidator(proTxHash, pubKey.Bytes(), types2.DefaultDashVotingPower)
func ValUpdate(
pubKey crypto.PubKey, proTxHash crypto.ProTxHash, address tmtypes.ValidatorAddress) types.ValidatorUpdate {
return types.UpdateValidator(proTxHash, pubKey.Bytes(), tmtypes.DefaultDashVotingPower, address.String())
}

// RandValidatorSetUpdate returns a list of cnt validators for initializing
Expand All @@ -21,7 +22,7 @@ func RandValidatorSetUpdate(cnt int) types.ValidatorSetUpdate {

privKeys, proTxHashes, thresholdPublicKey := bls12381.CreatePrivLLMQDataDefaultThreshold(cnt)
for i := 0; i < cnt; i++ {
res[i] = ValUpdate(privKeys[i].PubKey(), proTxHashes[i])
res[i] = ValUpdate(privKeys[i].PubKey(), proTxHashes[i], tmtypes.RandValidatorAddress())
}
thresholdPublicKeyABCI, err := cryptoenc.PubKeyToProto(thresholdPublicKey)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions abci/example/kvstore/kvstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ func makeApplyBlock(
}

kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header})
for _, tx := range txs {
for i, tx := range txs {
if r := kvstore.DeliverTx(types.RequestDeliverTx{Tx: tx}); r.IsErr() {
t.Fatal(r)
t.Fatal(fmt.Sprintf("i=%d, tx=%s, err=%s", i, tx, r.String()))
}
}
resEndBlock := kvstore.EndBlock(types.RequestEndBlock{Height: header.Height})
Expand Down
17 changes: 11 additions & 6 deletions abci/example/kvstore/persistent_kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (app *PersistentKVStoreApplication) Query(reqQuery types.RequestQuery) (res

return resQuery
case "/val":
key := []byte("val:" + string(reqQuery.Data))
key := []byte(valSetTxKey(string(reqQuery.Data)))
value, err := app.app.state.db.Get(key)
if err != nil {
panic(err)
Expand Down Expand Up @@ -233,6 +233,12 @@ func (app *PersistentKVStoreApplication) ValidatorSet() (validatorSet types.Vali
return validatorSet
}

// valSetTxKey generates a key for validator set change transaction, like:
// `val:BASE64ENCODINGOFPROTXHASH`
func valSetTxKey(proTxHashBase64 string) string {
return ValidatorSetChangePrefix + proTxHashBase64
}

func MakeValSetChangeTx(proTxHash []byte, pubkey *cryptoproto.PublicKey, power int64) []byte {
pubStr := ""
if pubkey != nil {
Expand All @@ -243,12 +249,11 @@ func MakeValSetChangeTx(proTxHash []byte, pubkey *cryptoproto.PublicKey, power i
pubStr = base64.StdEncoding.EncodeToString(pk.Bytes())
}
proTxHashStr := base64.StdEncoding.EncodeToString(proTxHash)
return []byte(fmt.Sprintf("val:%s!%s!%d", proTxHashStr, pubStr, power))
return []byte(valSetTxKey(proTxHashStr) + "!" + pubStr + "!" + strconv.FormatInt(power, 10))
}

func MakeValSetRemovalTx(proTxHash []byte) []byte {
proTxHashStr := base64.StdEncoding.EncodeToString(proTxHash)
return []byte(fmt.Sprintf("val:%s!!%d", proTxHashStr, 0))
return MakeValSetChangeTx(proTxHash, nil, 0)
}

func MakeThresholdPublicKeyChangeTx(thresholdPublicKey cryptoproto.PublicKey) []byte {
Expand Down Expand Up @@ -317,7 +322,7 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.Respon
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Power (%s) is not an int", powerS)}
}
return app.updateValidatorSet(types.UpdateValidator(proTxHash, pubkey, power))
return app.updateValidatorSet(types.UpdateValidator(proTxHash, pubkey, power, ""))
}

// format is "tpk:pubkey"
Expand Down Expand Up @@ -364,7 +369,7 @@ func (app *PersistentKVStoreApplication) updateValidatorSet(v types.ValidatorUpd
if v.ProTxHash == nil {
panic(fmt.Errorf("proTxHash can not be nil"))
}
key := []byte("val:" + string(v.ProTxHash))
key := []byte(valSetTxKey(string(v.ProTxHash)))

if v.Power == 0 {
// remove validator
Expand Down
2 changes: 1 addition & 1 deletion abci/tests/server/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func InitChain(client abcicli.Client) error {
pubkey := privKeys[i].PubKey().Bytes()
proTxHash := proTxHashes[i]
power := 100
vals[i] = types.UpdateValidator(proTxHash, pubkey, int64(power))
vals[i] = types.UpdateValidator(proTxHash, pubkey, int64(power), "")
}
abciThresholdPublicKey, err := encoding.PubKeyToProto(thresholdPublicKey)
if err != nil {
Expand Down
12 changes: 7 additions & 5 deletions abci/types/pubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import (
crypto2 "github.com/tendermint/tendermint/proto/tendermint/crypto"
)

func UpdateValidator(proTxHash []byte, pk []byte, power int64) ValidatorUpdate {
func UpdateValidator(proTxHash crypto.ProTxHash, pubkeyBytes []byte, power int64, nodeAddress string) ValidatorUpdate {
valUpdate := ValidatorUpdate{
Power: power,
ProTxHash: proTxHash,
Power: power,
ProTxHash: proTxHash,
NodeAddress: nodeAddress,
}
if len(pk) > 0 {
pke := bls12381.PubKey(pk)

if len(pubkeyBytes) > 0 {
pke := bls12381.PubKey(pubkeyBytes)
pkp, err := cryptoenc.PubKeyToProto(pke)
if err != nil {
panic(err)
Expand Down
Loading