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

backport: tendermint v0.36 #446

Merged
merged 206 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
37287ea
p2p: remove message type from channel implementation (#8452)
tychoish May 2, 2022
9a028b7
build(deps): Bump github.com/creachadair/atomicfile from 0.2.5 to 0.2…
dependabot[bot] May 4, 2022
c8e336f
docs: minor fixups to pbts overview (#8454)
williambanfield May 4, 2022
dd4fee8
keymigrate: improve filtering for legacy transaction hashes (#8466)
May 4, 2022
e980e14
RFC-018: initial research of BLS signature aggregation (#8358)
williambanfield May 5, 2022
ce40697
build(deps): Bump github.com/vektra/mockery/v2 from 2.12.1 to 2.12.2 …
dependabot[bot] May 6, 2022
ef44460
Convert explicit zero comparison to a method. (#8475)
May 6, 2022
97f2944
Reintegrate docs deployment into the main TM repo (#8468)
May 6, 2022
694ab2c
test/fuzz: replace outdated reference to go-fuzz in README (#8477)
elias-orijtech May 6, 2022
cec0a97
RFC017: ABCI++ Vote Extension Propagation (#8317)
sergio-mena May 9, 2022
494c5cd
build(deps): Bump docker/setup-buildx-action from 1.7.0 to 2.0.0 (#8483)
dependabot[bot] May 9, 2022
083716b
build(deps): Bump docker/build-push-action from 2.10.0 to 3.0.0 (#8482)
dependabot[bot] May 9, 2022
b52b8f2
build(deps): Bump docker/login-action from 1.14.1 to 2.0.0 (#8481)
dependabot[bot] May 9, 2022
4b36fea
scripts/metricsgen: add the initial version of metricsgen (#8479)
williambanfield May 9, 2022
412a779
build(deps): Bump github.com/golangci/golangci-lint (#8490)
dependabot[bot] May 10, 2022
9dae97d
RFC 016: Node Architecture (#8285)
cmwaters May 10, 2022
a4c3b5c
validate block before we persist it (#8493)
cmwaters May 10, 2022
c052181
consensus: add additional metrics for abci++ data (#8480)
williambanfield May 10, 2022
735a1a5
Fixed math notation in ABCI++ app requirements (#8499)
sergio-mena May 10, 2022
06b1812
abci++: Propagate vote extensions (RFC 017) (#8433)
thanethomson May 11, 2022
b0fe38c
build(deps): Bump github.com/creachadair/tomledit from 0.0.19 to 0.0.…
dependabot[bot] May 11, 2022
0130a8c
scripts/metricsgen: add metricsdiff tool (#8501)
williambanfield May 11, 2022
b5550b0
rpc: make block.height visible to event subscription (#8508)
May 12, 2022
92811b9
metrics: transition all metrics to using metricsgen generated constru…
williambanfield May 12, 2022
f9fa0a3
docs: update event subscription documentation for new API (#8509)
May 12, 2022
f094fd2
update protos (#8515)
cmwaters May 13, 2022
81e5bf8
Consolidate Dependabot checks for GitHub Actions deps. (#8518)
May 13, 2022
c29d1b3
build(deps): Bump golangci/golangci-lint-action from 3.1.0 to 3.2.0 (…
dependabot[bot] May 13, 2022
7da9746
Fix protobuf generated code. (#8545)
May 13, 2022
9c9a414
chore: update generated mocks (#8546)
May 13, 2022
2d9a379
build: add CI check that generated files are up-to-date (#8521)
May 13, 2022
bdca727
build(deps): Bump github.com/prometheus/client_golang (#8540)
dependabot[bot] May 13, 2022
42e5924
mempool: do not continue checking transactions if context was cacnele…
tychoish May 14, 2022
c780619
Fix typo (#8550)
Elenchev May 14, 2022
d004638
build(deps): Bump github.com/prometheus/common from 0.32.1 to 0.34.0 …
dependabot[bot] May 16, 2022
fb72291
build(deps): Bump google.golang.org/grpc from 1.46.0 to 1.46.2 (#8559)
dependabot[bot] May 16, 2022
7f79661
rfc: onboarding projects (#8413)
tychoish May 16, 2022
5a42479
build(deps): Bump github.com/lib/pq from 1.10.5 to 1.10.6 (#8567)
dependabot[bot] May 17, 2022
2897b75
p2p: remove unused get height methods (#8569)
tychoish May 17, 2022
66c4c82
rpc: rework timeouts to be per-method instead of global (#8570)
May 17, 2022
21f1404
rpc: enable the ADR 075 event log by default in new configs (#8572)
May 17, 2022
c620900
rpc: fix plumbing of broadcast_tx_commit timeout (#8573)
May 17, 2022
2e20b82
Adapted `apps.md` from ABCI directory (#8506)
sergio-mena May 19, 2022
850ae93
Adapted `client-server.md` from ABCI directory (#8510)
sergio-mena May 19, 2022
b4bf74b
abci: serialize semantics of abci client (#8578)
tychoish May 19, 2022
4a9bbe0
Fix lock sequencing in socket client request tracking. (#8581)
May 19, 2022
ad73e6d
consensus: update state from store before use in reactor (#8576)
williambanfield May 19, 2022
4786a5f
Remove the periodically-scheduled Markdown link check. (#8580)
May 19, 2022
0cceadf
abci++: add consensus parameter logic to control vote extension requi…
williambanfield May 20, 2022
3bf2875
build(deps): Bump goreleaser/goreleaser-action from 2 to 3 (#8590)
dependabot[bot] May 23, 2022
6ff77ee
light/http: added check for err == nil (#8579)
jmalicevic May 23, 2022
43313e9
abci++: add proto fields for enabling vote extensions (#8587)
williambanfield May 23, 2022
8e0d004
rpc: fix encoding of block_results responses (#8593)
May 23, 2022
1a52b7c
Removed redundant params in FinalizeBlock (#8598)
sergio-mena May 24, 2022
d59a53b
p2p: reduce ability of SendError to disconnect peers (#8597)
tychoish May 24, 2022
10ce3d4
rpc: fix OpenAPI docs for /events filter argument (#8599)
May 25, 2022
5d1bffe
build(deps): Bump github.com/vektra/mockery/v2 from 2.12.2 to 2.12.3 …
dependabot[bot] May 25, 2022
4cb0ec5
makefile: update buf commands to use tools.go (#8609)
williambanfield May 25, 2022
a988cef
Update generated mocks after #8607. (#8612)
May 25, 2022
f33722b
migrate: reorder collection ordering (#8613)
tychoish May 25, 2022
4c857a7
abci: remove unused fields from CheckTXResponse (part 1) (#8605)
jmalicevic May 25, 2022
b0ec8a0
mempool: migrate rechecktx to be a consensus parameter (#8514)
cmwaters May 25, 2022
cb9722c
abci: strip mempoolerror from responsechectx (#8620)
jmalicevic May 26, 2022
bc24ae4
rpc: deprecate/updates to broadcast tx (#8624)
tychoish May 26, 2022
a3a06cd
build(deps): Bump github.com/bufbuild/buf from 1.3.1 to 1.4.0 (#8622)
dependabot[bot] May 26, 2022
eb3b488
build: simplify the proto generated check in CI (#8617)
May 26, 2022
9027401
Forward-port changelogs from v0.35.5 to master (#8627)
May 27, 2022
844a5fd
build(deps): Bump github.com/spf13/viper from 1.11.0 to 1.12.0 (#8630)
dependabot[bot] May 28, 2022
571f26b
Remove obsolete abci methods, no longer called by ABCI++ Tendermint (…
sergio-mena May 30, 2022
3dec4a4
docs: add documentation for undocumented p2p metrics (#8640)
williambanfield May 30, 2022
fefce8d
e2e: programmable ABCI method times (#8638)
cmwaters May 31, 2022
7422f7b
build(deps): Bump github.com/bufbuild/buf from 1.4.0 to 1.5.0 (#8650)
dependabot[bot] May 31, 2022
b7805e9
build(deps): Bump eventsource from 1.1.0 to 1.1.1 in /docs (#8663)
dependabot[bot] Jun 1, 2022
d2ca0b8
consensus: gossip catchup sleeping protocol (#8652)
tychoish Jun 1, 2022
7ffc872
config: complete removal of seed addresses in config (#8654)
cmwaters Jun 1, 2022
bf67682
Revert buf tools upgrade requiring Go 1.18 (#8658)
Jun 1, 2022
9a8c334
build(deps): Bump google.golang.org/grpc from 1.46.2 to 1.47.0 (#8667)
dependabot[bot] Jun 1, 2022
56fc80d
abci: Move `app_hash` parameter from `Commit` to `FinalizeBlock` (#8664)
sergio-mena Jun 1, 2022
d529988
migrate: provide function for database production (#8614)
tychoish Jun 2, 2022
30bfe51
cmd: add tool for compaction of goleveldb (#8564)
cmwaters Jun 2, 2022
666d933
p2p: shed peers from store from other networks (#8678)
tychoish Jun 2, 2022
08099ff
privval: restrict listeners to TCP and Unix domain sockets (#8670)
Jun 2, 2022
ce6485f
Remove the abci responses type - prune legacy responses (#8673)
sergio-mena Jun 2, 2022
a0f3107
e2e: fix initialization of light client (#8682)
cmwaters Jun 3, 2022
db168ca
test/fuzz: fix OSS-Fuzz build (#8669)
elias-orijtech Jun 3, 2022
30929cf
p2p: pass maxConns for MaxPeers during node setup (#8684)
evan-forbes Jun 3, 2022
75a12ea
consensus: switch timeout message to be debug and clarify meaning (#8…
williambanfield Jun 3, 2022
48ec78e
Update how Mockery mocks are checked for currency. (#8697)
Jun 3, 2022
6b2a6ed
build(deps-dev): Bump watchpack from 2.3.1 to 2.4.0 in /docs (#8700)
dependabot[bot] Jun 6, 2022
85d1946
build(deps): Bump bufbuild/buf-setup-action from 1.4.0 to 1.5.0 (#8701)
dependabot[bot] Jun 6, 2022
3e97479
Fix a "broken" markdown link. (#8706)
Jun 7, 2022
618b841
build(deps): Bump github.com/stretchr/testify from 1.7.1 to 1.7.2 (#8…
dependabot[bot] Jun 7, 2022
3bb68b4
ci(fuzz): remove Go 1.18 workaround for OSS-Fuzz (#8711)
elias-orijtech Jun 7, 2022
931c98f
rpc: always close http bodies (#8712)
tychoish Jun 7, 2022
e84ca61
Set up automation settings for the v0.36.x backport branch. (#8714)
Jun 7, 2022
bb0737e
build(deps): Bump github.com/rs/zerolog from 1.26.1 to 1.27.0 (#8724)
dependabot[bot] Jun 8, 2022
6983885
Update config migration test data for v0.36.x (#8727)
Jun 8, 2022
8d9d19a
e2e/generator: enlarge nightly test suite (#8731)
tychoish Jun 9, 2022
b0e48ca
remove unused config variables (#8738)
cmwaters Jun 10, 2022
7172862
e2e: split test cases to avoid hitting timeouts (#8741)
tychoish Jun 11, 2022
0617512
abci-cli: added `PrepareProposal` command to cli (#8656)
jmalicevic Jun 13, 2022
82907c8
sink/psql: json marshal instead of proto (#8637)
tac0turtle Jun 13, 2022
21bbbe3
mempool: fix typos in test (#8746)
conr2d Jun 14, 2022
a4cf893
mempool: fix error message check in test (#8750)
conr2d Jun 14, 2022
a2908c2
build(deps): Bump github.com/vektra/mockery/v2 from 2.12.3 to 2.13.0 …
dependabot[bot] Jun 14, 2022
7971f4a
p2p: self-add node should not error (#8753)
tychoish Jun 14, 2022
bf1cb89
Revert "p2p: self-add node should not error (tendermint#8753)" (#8757)
tychoish Jun 14, 2022
979a6a1
p2p: accept should not abort on first error (#8759)
tychoish Jun 14, 2022
51b3f11
p2p: fix mconn transport accept test (#8762)
tychoish Jun 14, 2022
f0b0f34
refactor: improve string representation for a vote against the propos…
p0mvn Jun 15, 2022
134bfef
build(deps): Bump github.com/vektra/mockery/v2 from 2.13.0 to 2.13.1 …
dependabot[bot] Jun 15, 2022
1062ae7
e2e/ci: add extra split to 0.36 (#8770)
tychoish Jun 15, 2022
56e329a
cmd/tendermint/commands/debug: guard against PID int overflows (#8764)
odeke-em Jun 16, 2022
8854ce4
e2e: reactivate network test (#8635)
cmwaters Jun 16, 2022
7cf0939
Fix typo in Using Tendermint section (#8780)
oliverasistemas Jun 16, 2022
a4f29bf
Don't check PBTS-timeliness when in replay mode (#8774)
sergio-mena Jun 16, 2022
9e5b137
p2p: peer store and dialing changes (#8737)
tychoish Jun 17, 2022
0ac0346
p2p: track peers stored on startup (#8787)
tychoish Jun 17, 2022
82c1372
abci+test/e2e/app: add mutex for new methods (#8577)
tychoish Jun 17, 2022
4d820ff
p2p: peer score should not wrap around (#8790)
tychoish Jun 17, 2022
e3e162f
p2p: fix typo (#8793)
code0xff Jun 19, 2022
2382b5c
build(deps): Bump github.com/adlio/schema from 1.3.0 to 1.3.3 (#8798)
dependabot[bot] Jun 20, 2022
acf9712
build(deps): Bump github.com/prometheus/common from 0.34.0 to 0.35.0 …
dependabot[bot] Jun 20, 2022
28d3239
p2p: wake dialing thread after sleep (#8803)
tychoish Jun 20, 2022
6f168df
build(deps): Bump github.com/spf13/cobra from 1.4.0 to 1.5.0 (#8812)
dependabot[bot] Jun 21, 2022
cfd1382
p2p: add eviction metrics and cleanup dialing error handling (#8819)
tychoish Jun 21, 2022
8860e02
p2p: more dial routines (#8827)
williambanfield Jun 22, 2022
2e11760
p2p: fix typo (#8836)
code0xff Jun 22, 2022
52b2efb
e2e: report peer heights in error message (#8843)
tychoish Jun 23, 2022
436a38f
p2p: track peers by address (#8841)
tychoish Jun 23, 2022
fb20913
e2e: add tolerance to peer discovery test (#8849)
cmwaters Jun 23, 2022
5f5e747
p2p: set empty timeouts to small values. (#8847)
williambanfield Jun 23, 2022
6b50530
build(deps): Bump github.com/stretchr/testify from 1.7.2 to 1.7.5 (#8…
dependabot[bot] Jun 24, 2022
409e057
fix light client select statement (#8871)
williambanfield Jun 24, 2022
c4d24ee
e2e: disable another network test (#8862)
cmwaters Jun 24, 2022
52b6dc1
p2p: remove dial sleep and provide disconnect cooldown (#8839)
tychoish Jun 24, 2022
27ff2f4
Add @sergio-mena and @jmalicevic to list of spec reviewers (#8870)
sergio-mena Jun 24, 2022
463cff4
build(deps): Bump bufbuild/buf-setup-action from 1.5.0 to 1.6.0 (#8883)
dependabot[bot] Jun 27, 2022
373b262
build(deps): Bump styfle/cancel-workflow-action from 0.9.1 to 0.10.0 …
dependabot[bot] Jun 27, 2022
013b46a
libs/strings: move to internal (#8890)
tychoish Jun 27, 2022
37f9d59
log: do not pre-process log results (#8895)
tychoish Jun 28, 2022
3bec166
e2e: Extract Docker-specific functionality (#8754)
thanethomson Jun 29, 2022
60881f1
p2p: stop mconn channel sends without timeout (#8906)
tychoish Jun 30, 2022
5c26db7
build(deps): Bump github.com/stretchr/testify from 1.7.5 to 1.8.0 (#8…
dependabot[bot] Jun 30, 2022
47cb30f
p2p: set outgoing connections to around 20% of total connections (#8913)
williambanfield Jun 30, 2022
5274f80
p2p: fix flakey test due to disconnect cooldown (#8917)
williambanfield Jun 30, 2022
921530c
p2p: use correct context error (#8916)
williambanfield Jun 30, 2022
1d96faa
p2p: fix typo (#8922)
code0xff Jul 1, 2022
6d80795
build(deps): Bump github.com/vektra/mockery/v2 from 2.13.1 to 2.14.0 …
dependabot[bot] Jul 1, 2022
331860c
Restore `Commit` to the ABCI++ spec, and other late modifications (#8…
sergio-mena Jul 4, 2022
d8de2d8
build(deps): Bump github.com/libp2p/go-buffer-pool from 0.0.2 to 0.1.…
dependabot[bot] Jul 5, 2022
3cde9a0
abci-cli: Add `process_proposal` command to abci-cli (#8901)
hvanz Jul 5, 2022
2b5329a
Typos in spec (#8939)
sergio-mena Jul 5, 2022
70e7372
added name to CO (#8947)
samricotta Jul 6, 2022
be6d74e
Work around indexing problem for duplicate transactions (forward port…
yihuang Jul 6, 2022
27c523d
mempool: return error when mempool is full and inbound tx is rejected…
cmwaters Jul 6, 2022
d1a16e8
p2p: simpler priority queue (#8929)
tychoish Jul 7, 2022
636320f
p2p: delete cruft (#8958)
tychoish Jul 7, 2022
61ce384
p2p: make peer gossiping coinflip safer (#8949)
tychoish Jul 8, 2022
6902fa9
Fix punctuation (#8972)
rootulp Jul 11, 2022
d5fb82e
p2p: make p2p.Channel an interface (#8967)
tychoish Jul 11, 2022
136b627
build(deps): Bump github.com/prometheus/common from 0.35.0 to 0.36.0 …
dependabot[bot] Jul 12, 2022
e9239e9
p2p: switch default queue implementation (#8976)
tychoish Jul 12, 2022
b421138
build(deps): Bump google.golang.org/grpc from 1.47.0 to 1.48.0 (#8993)
dependabot[bot] Jul 13, 2022
b71ec8c
doc: fix typos in quick-start.md. (#8990)
brizenchi Jul 13, 2022
c1c501e
config: update config to reflect simple-priority queue (#9007)
williambanfield Jul 14, 2022
4214d99
Forward-port point release changelogs from v0.35.x. (#9011)
Jul 15, 2022
31457ad
typo (#9001)
sergio-mena Jul 15, 2022
d2db54a
build(deps): Bump pgregory.net/rapid from 0.4.7 to 0.4.8 (#9014)
dependabot[bot] Jul 15, 2022
18b5a50
Extract a library from the confix command-line tool. (#9012)
Jul 15, 2022
503ddf1
build(deps): Bump github.com/prometheus/common from 0.36.0 to 0.37.0 …
dependabot[bot] Jul 15, 2022
cc07318
migration: scope key migration to stores (#9005)
tychoish Jul 16, 2022
48f3062
Updated potential errors in abci.md (#9003)
Coder-RG Jul 18, 2022
066b7a9
build(deps): Bump github.com/golangci/golangci-lint from 1.46.0 to 1.…
dependabot[bot] Jul 19, 2022
8a81541
RFC 021: The Future of the Socket Protocol (#8584)
Jul 19, 2022
525624f
Fix a typo in the RFC ToC (#9047)
Jul 20, 2022
fc3a24a
Disable upload-coverage-report workflow in CI. (#9056)
Jul 20, 2022
fa32078
Fix unbounded heap growth in the priority mempool. (#9052)
Jul 20, 2022
e33635a
build(deps): Bump terser from 4.8.0 to 4.8.1 in /docs (#9051)
dependabot[bot] Jul 21, 2022
d320b30
build(deps): Bump github.com/golangci/golangci-lint from 1.47.0 to 1.…
dependabot[bot] Jul 21, 2022
87708b8
Forward-port changelog for v0.35.9 to master. (#9059)
Jul 21, 2022
65c0fba
build(deps): Bump github.com/BurntSushi/toml from 1.1.0 to 1.2.0 (#9061)
dependabot[bot] Jul 21, 2022
023c21f
build(deps): Bump github.com/golangci/golangci-lint from 1.47.1 to 1.…
dependabot[bot] Jul 22, 2022
6c30221
Documentation: update go tutorials (#9048)
stevenferrer Jul 25, 2022
89246e9
build(deps): Bump docker/build-push-action from 3.0.0 to 3.1.0 (#9082)
dependabot[bot] Jul 25, 2022
488e1d4
build(deps): Bump github.com/creachadair/tomledit from 0.0.22 to 0.0.…
dependabot[bot] Jul 25, 2022
7a84425
update dependabot frequencies (#9087)
cmwaters Jul 26, 2022
b9d6bb4
RELEASES: add a set of pre-release steps for Tendermint versions (#8786)
williambanfield Jul 27, 2022
48147e1
logging: implement lazy sprinting (#8898)
tychoish Jul 27, 2022
d433ebe
Improve handling of -short flag in tests (#9075)
mark-rushakoff Jul 29, 2022
4f604ef
Merge branch 'tm/master' into backport-tm-v0.36
shotonoff Aug 8, 2022
7fd94a4
fix: make a code compilable
shotonoff Aug 11, 2022
467e268
fix: blocksync tests
shotonoff Aug 11, 2022
03a1415
fix: some missed stuff during merging
shotonoff Aug 12, 2022
5f3a1bb
fix: stability fixes
shotonoff Aug 18, 2022
ca2c31e
fix: lint issues, code style, abci test
shotonoff Aug 18, 2022
10fc6be
fix: validator_conn_executor_test.go TestFinalizeBlock
shotonoff Aug 18, 2022
aea1fe3
fix: rollback.go
shotonoff Aug 18, 2022
5424e5e
fix: rollback.go
shotonoff Aug 18, 2022
ce86b72
fix: unit tests
shotonoff Aug 18, 2022
3f18c31
refactor: remove redundant log
shotonoff Aug 18, 2022
6e86d15
fix: mempool_test.go TestMempoolTxConcurrentWithCommit
shotonoff Aug 19, 2022
ddf18b1
refactor: remove redundant TestPop
shotonoff Aug 19, 2022
80e5a64
refactor: changes by feedback
shotonoff Sep 2, 2022
6a9212d
Merge branch 'v0.9-dev' into backport-tm-v0.36
shotonoff Sep 2, 2022
57ed54e
Merge branch 'v0.9-dev' into backport-tm-v0.36
shotonoff Sep 2, 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
4 changes: 2 additions & 2 deletions abci/client/mocks/client.go

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

10 changes: 3 additions & 7 deletions abci/example/counter/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func (app *Application) CheckTx(_ context.Context, req *types.RequestCheckTx) (*
if len(req.Tx) > 8 {
return &types.ResponseCheckTx{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(req.Tx)),
}, nil
}
tx8 := make([]byte, 8)
Expand All @@ -44,7 +43,6 @@ func (app *Application) CheckTx(_ context.Context, req *types.RequestCheckTx) (*
if txValue < uint64(app.txCount) {
return &types.ResponseCheckTx{
Code: code.CodeTypeBadNonce,
Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue),
}, nil
}
}
Expand All @@ -56,11 +54,9 @@ func (app *Application) Commit(_ context.Context) (*types.ResponseCommit, error)
if app.txCount == 0 {
return &types.ResponseCommit{}, nil
}
hash := make([]byte, 24)
endHash := make([]byte, 8)
binary.BigEndian.PutUint64(endHash, uint64(app.txCount))
hash = append(hash, endHash...)
return &types.ResponseCommit{Data: hash}, nil
hash := make([]byte, 32)
binary.BigEndian.PutUint64(hash[24:], uint64(app.txCount))
return &types.ResponseCommit{}, nil
}

func (app *Application) Query(_ context.Context, reqQuery *types.RequestQuery) (*types.ResponseQuery, error) {
Expand Down
1 change: 1 addition & 0 deletions abci/example/kvstore/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ func (app *Application) FinalizeBlock(_ context.Context, req *types.RequestFinal
return &types.ResponseFinalizeBlock{
TxResults: respTxs,
ValidatorSetUpdate: proto.Clone(&app.valSetUpdate).(*types.ValidatorSetUpdate),
AppHash: appHash,
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion abci/tests/test_cli/ex1.abci
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ process_proposal "preparedef"
prepare_proposal
process_proposal
finalize_block
commit
commit
2 changes: 1 addition & 1 deletion abci/tests/test_cli/ex1.abci.out
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

> finalize_block
-> code: OK
-> data.hex: 0x0600000000000000
-> data.hex: 0x0600000000000000000000000000000000000000000000000000000000000000

> commit
-> code: OK
Expand Down
14 changes: 7 additions & 7 deletions abci/tests/test_cli/ex2.abci.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
> finalize_block 0x00
-> code: OK
-> code: OK
-> data.hex: 0x0200000000000000
-> data.hex: 0x0200000000000000000000000000000000000000000000000000000000000000

> commit
> commit
-> code: OK

> check_tx 0x00
Expand All @@ -18,20 +18,20 @@
> finalize_block 0x01
-> code: OK
-> code: OK
-> data.hex: 0x0400000000000000
-> data.hex: 0x0400000000000000000000000000000000000000000000000000000000000000

> commit
> commit
-> code: OK

> finalize_block 0x04
-> code: OK
-> code: OK
-> data.hex: 0x0600000000000000
-> data.hex: 0x0600000000000000000000000000000000000000000000000000000000000000

> commit
> commit
-> code: OK

> info
> info
-> code: OK
-> data: {"size":3}
-> data.hex: 0x7B2273697A65223A337D
Expand Down
4 changes: 2 additions & 2 deletions abci/types/mocks/application.go

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

53 changes: 51 additions & 2 deletions abci/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"

"github.com/gogo/protobuf/jsonpb"

"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/encoding"
"github.com/tendermint/tendermint/internal/jsontypes"
Expand Down Expand Up @@ -148,7 +149,10 @@ type validatorUpdateJSON struct {
}

func (v *ValidatorUpdate) MarshalJSON() ([]byte, error) {
key, err := encoding.PubKeyFromProto(v.PubKey)
if v.PubKey == nil {
return nil, nil
}
key, err := encoding.PubKeyFromProto(*v.PubKey)
if err != nil {
return nil, err
}
Expand All @@ -175,11 +179,56 @@ func (v *ValidatorUpdate) UnmarshalJSON(data []byte) error {
if err != nil {
return err
}
v.PubKey = pkey
v.PubKey = &pkey
v.Power = vu.Power
return nil
}

type validatorSetUpdateJSON struct {
ValidatorUpdates []ValidatorUpdate `json:"validator_updates"`
ThresholdPubKey json.RawMessage `json:"threshold_public_key"`
QuorumHash []byte `json:"quorum_hash,omitempty"`
}

func (m *ValidatorSetUpdate) MarshalJSON() ([]byte, error) {
ret := validatorSetUpdateJSON{
ValidatorUpdates: m.ValidatorUpdates,
QuorumHash: m.QuorumHash,
}
if m.ThresholdPublicKey.Sum != nil {
key, err := encoding.PubKeyFromProto(m.ThresholdPublicKey)
if err != nil {
return nil, err
}
ret.ThresholdPubKey, err = jsontypes.Marshal(key)
if err != nil {
return nil, err
}
}
return json.Marshal(ret)
}

func (m *ValidatorSetUpdate) UnmarshalJSON(data []byte) error {
var vsu validatorSetUpdateJSON
err := json.Unmarshal(data, &vsu)
if err != nil {
return err
}
var key crypto.PubKey
if err := jsontypes.Unmarshal(vsu.ThresholdPubKey, &key); err != nil {
return err
}
if key != nil {
m.ThresholdPublicKey, err = encoding.PubKeyToProto(key)
if err != nil {
return err
}
}
m.ValidatorUpdates = vsu.ValidatorUpdates
m.QuorumHash = vsu.QuorumHash
return nil
}

// Some compile time assertions to ensure we don't
// have accidental runtime surprises later on.

Expand Down
Loading