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

feat: bump up cosmos [email protected] #783

Merged
merged 62 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
dd303f4
fix: update x/mint parameter validation (backport #12384) (#12396)
mergify[bot] Jun 30, 2022
f79440f
chore: optimize get last completed upgrade (#12268)
robert-zaremba Jul 3, 2022
8400625
fix: Simulation is not deterministic due to GenTx (backport #12374) (…
adu-web3 Jul 4, 2022
cd576d7
fix: use go install instead of go get in makefile (#12435)
julienrbrt Jul 4, 2022
abfb005
chore: fumpt sdk v45 series #12442
faddat Jul 5, 2022
e0179be
feat: Move AppModule.BeginBlock and AppModule.EndBlock to extension i…
mergify[bot] Jul 19, 2022
e41d7cd
feat: add message index event attribute to authz message execution (b…
mergify[bot] Jul 22, 2022
bee2746
chore(store): upgrade iavl to v0.19.0 (backport #12626) (#12697)
mergify[bot] Jul 23, 2022
081106a
feat: Add `GetParamSetIfExists` to prevent panic on breaking param ch…
fedekunze Jul 26, 2022
ac4886e
feat: Add convenience method for constructing key to access account's…
mergify[bot] Aug 2, 2022
e17c69a
chore: bump tm in 0.45.x (#12784)
tac0turtle Aug 4, 2022
dc1ceb6
chore: 0.45.7 changelog prep (#12821)
tac0turtle Aug 4, 2022
263ef5e
docs(staking): typo in staking/state (backport #12834) (#12836)
mergify[bot] Aug 7, 2022
4f852dd
chore: fee payer event (backport #12850) (#12856)
mergify[bot] Aug 8, 2022
4362a52
chore: changelog update (backport #12859) (#12862)
mergify[bot] Aug 8, 2022
2df8bc6
fix: Use fixed length hex for pointer at FwdCapabilityKey (backport #…
yihuang Aug 9, 2022
49bf1ee
feat: deterministic map iteration (backport #12781) (#12944)
mergify[bot] Aug 18, 2022
f140302
chore: bump tendermint to `0.34.21` and iavl to `0.19.1` (#12970)
julienrbrt Aug 19, 2022
d477274
fix: proper error when parsing telemetry configuration (backport #129…
mergify[bot] Aug 23, 2022
17f314c
ci: fix release notes not populated by goreleaser (#13019)
mergify[bot] Aug 24, 2022
0efebd9
fix: missing return statement in BaseApp.Query (backport #13046) (#13…
mergify[bot] Aug 25, 2022
6ea09cb
chore: v0.45.8 release changelog (#13053)
julienrbrt Aug 25, 2022
21f2b6b
fix: call `SetIAVLCacheSize` with the configured value in simapp (bac…
mergify[bot] Aug 31, 2022
a02979d
feat: Add a cli cmd to prune old states according to current settings…
mergify[bot] Sep 2, 2022
d32022d
fix: rollback command don't actually delete multistore versions (back…
yihuang Sep 5, 2022
a276eda
fix: make linting work on 45 (#13185)
faddat Sep 8, 2022
5dc8b40
feat: configurable fastnode (backport #13321) (#13338)
mergify[bot] Sep 20, 2022
c37d9c8
fix: ensure withdraw_rewards events are always emitted on reward with…
mergify[bot] Sep 20, 2022
49cb9f4
imp(keyring): improve UX for keyring.List (#13369)
fedekunze Sep 27, 2022
c0e06d0
feat: ADR-038 Part 2: StreamingService interface, file writing implem…
yihuang Oct 3, 2022
819ee4d
feat: gRPC query for operator and chain configuration (backport #1348…
mergify[bot] Oct 11, 2022
8eb0635
chore: CHANGELOG update (backport #13536) (#13538)
mergify[bot] Oct 13, 2022
44f279c
refactor: Improve AllocateTokens (backport #13524) (#13527)
mergify[bot] Oct 13, 2022
822ecf5
chore: make iavl fast node migration off by default (#13540)
tac0turtle Oct 13, 2022
24f54b0
Merge pull request from GHSA-3qp7-gj37-g9rx
ebuchman Oct 14, 2022
4ad3a21
fix: move ics23 to correct folder (#13549)
aaronc Oct 14, 2022
191c8d8
fix: fix liveness tests #13551
ValarDragon Oct 14, 2022
08eafce
feat: add `GenSignedMockTx` (#13557)
julienrbrt Oct 16, 2022
1a8b7f1
fix: fix `make proto-gen` (#13564)
julienrbrt Oct 17, 2022
8563283
feat: [REDO] gRPC query for operator and chain configuration (backpor…
alexanderbez Oct 18, 2022
9fab156
chore: bump tendermint to `0.34.22` (#13585)
julienrbrt Oct 19, 2022
9a562b2
fix: (v0.45.x) regression in return value of WithdrawDelegationReward…
nddeluca Oct 20, 2022
ced46b3
fix(server): v0.45.x Populate the PruningKeepEvery config entry in Ge…
SpicyLemon Oct 21, 2022
3b4afa3
feat(cli): add module-account cli cmd and grpc get api (backport #136…
mergify[bot] Oct 24, 2022
c0b3a4e
chore: prepare 0.45.10 changelog (#13624)
julienrbrt Oct 24, 2022
db50658
update proto
dudong2 Nov 2, 2022
b071e7f
fix build
dudong2 Nov 2, 2022
fc22bb2
fix test
dudong2 Nov 3, 2022
44e57d8
chore: change default value of iavl-disable-fastnode to true
dudong2 Nov 3, 2022
ef6d4c4
test: remove TestCacheKVConcurrency
dudong2 Nov 7, 2022
fdbcc4b
chore: fix test build
dudong2 Nov 7, 2022
121a43e
docs: add changelog
dudong2 Nov 7, 2022
d550c31
Merge branch 'rc9/v0.46.0' into dudong2/feat/[email protected]
dudong2 Nov 8, 2022
b9ac7df
chore: apply pr reviews
dudong2 Nov 10, 2022
a9f3751
chore: remove awkward new line in comment
dudong2 Nov 10, 2022
92112b8
fix: lint error
dudong2 Nov 10, 2022
725aaad
chore: add cosmos.base.node.v1beta1.Service/Config for REST api
dudong2 Nov 16, 2022
7576587
chore: apply pr reviews
dudong2 Nov 16, 2022
f0aacab
Merge branch 'rc9/v0.46.0' into dudong2/feat/[email protected]
dudong2 Nov 16, 2022
f188296
chore: fix lint files
dudong2 Nov 16, 2022
b733391
feat: revert ostracon/abci/types.proto
dudong2 Nov 16, 2022
8686cc6
Merge remote-tracking branch 'lbm-sdk-upstream/rc9/v0.46.0' into dudo…
dudong2 Nov 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ name: Lint
env:
GOPRIVATE: "github.com/line/*"
on:
pull_request:
loin3 marked this conversation as resolved.
Show resolved Hide resolved
push:
tags:
- v*
branches:
- main
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: go version
- name: install tparse
run: |
export GO111MODULE="on" && go install github.com/mfridman/[email protected]
go install github.com/mfridman/[email protected]
- uses: actions/[email protected]
with:
path: ~/go/bin
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.swm
*.swn
*.pyc
.dccache

# private files
private[.-]*
Expand Down
10 changes: 1 addition & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ linters:
- prealloc
- scopelint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
Expand All @@ -39,12 +38,6 @@ issues:
- text: "Use of weak random number generator"
linters:
- gosec
- text: "comment on exported var"
linters:
- golint
- text: "don't use an underscore in package name"
linters:
- golint
- text: "ST1003:"
linters:
- stylecheck
Expand All @@ -70,6 +63,5 @@ linters-settings:
suggest-new: true
nolintlint:
allow-unused: false
allow-leading-space: true
require-explanation: false
require-specific: false
require-specific: false
0Tech marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new line at the end of file. Mind the indent.

2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ snapshot:
name_template: SNAPSHOT-{{ .Commit }}

changelog:
skip: true
skip: false
loin3 marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,8 @@ lint-fix:
.PHONY: lint lint-fix

format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs goimports -w -local github.com/line/lbm-sdk
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name "*.pb.go" -not -name "*.pb.gw.go" -not -name "*.pulsar.go" -not -path "./crypto/keys/secp256k1/*" | xargs gofumpt -w -l
golangci-lint run --fix
.PHONY: format

###############################################################################
Expand Down Expand Up @@ -411,8 +410,9 @@ proto-all: proto-format proto-lint proto-gen

proto-gen:
@echo "Generating Protobuf files"
@if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then $(DOCKER) start -a $(containerProtoGen); else $(DOCKER) run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protocgen.sh; fi
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protocgen.sh; fi
@go mod tidy

# This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
proto-gen-any:
Expand All @@ -437,7 +437,7 @@ proto-lint:
proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main

TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.22/proto/tendermint
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.6.3
Expand Down
92 changes: 43 additions & 49 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package baseapp

import (
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
"os"
Expand Down Expand Up @@ -122,24 +123,6 @@ func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOp
return
}

// FilterPeerByAddrPort filters peers by address/port.
func (app *BaseApp) FilterPeerByAddrPort(info string) abci.ResponseQuery {
if app.addrPeerFilter != nil {
return app.addrPeerFilter(info)
}

return abci.ResponseQuery{}
}

// FilterPeerByID filters peers by node ID.
func (app *BaseApp) FilterPeerByID(info string) abci.ResponseQuery {
if app.idPeerFilter != nil {
return app.idPeerFilter(info)
}

return abci.ResponseQuery{}
}

// BeginBlock implements the ABCI application interface.
func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock) {
defer telemetry.MeasureSince(time.Now(), "abci", "begin_block")
Expand Down Expand Up @@ -199,6 +182,15 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
res = app.beginBlocker(app.deliverState.ctx, req)
res.Events = sdk.MarkEventsToIndex(res.Events, app.indexEvents)
}
// set the signed validators for addition to context in deliverTx
app.voteInfos = req.LastCommitInfo.GetVotes()

// call the hooks with the BeginBlock messages
for _, streamingListener := range app.abciListeners {
if err := streamingListener.ListenBeginBlock(app.deliverState.ctx, req, res); err != nil {
app.logger.Error("BeginBlock listening hook failed", "height", req.Header.Height, "err", err)
}
}

return res
}
Expand All @@ -220,6 +212,13 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc
res.ConsensusParamUpdates = cp
}

// call the streaming service hooks with the EndBlock messages
for _, streamingListener := range app.abciListeners {
if err := streamingListener.ListenEndBlock(app.deliverState.ctx, req, res); err != nil {
app.logger.Error("EndBlock listening hook failed", "height", req.Height, "err", err)
}
}

return res
}

Expand Down Expand Up @@ -291,9 +290,17 @@ func (app *BaseApp) EndRecheckTx(req abci.RequestEndRecheckTx) abci.ResponseEndR
// Otherwise, the ResponseDeliverTx will contain releveant error information.
// Regardless of tx execution outcome, the ResponseDeliverTx will contain relevant
// gas execution context.
func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx {
func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) {
defer telemetry.MeasureSince(time.Now(), "abci", "deliver_tx")

defer func() {
for _, streamingListener := range app.abciListeners {
if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil {
app.logger.Error("DeliverTx listening hook failed", "err", err)
}
}
}()

gInfo := sdk.GasInfo{}
resultStr := "successful"

Expand Down Expand Up @@ -452,7 +459,7 @@ func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery) {

path := splitPath(req.Path)
if len(path) == 0 {
sdkerrors.QueryResultWithDebug(sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no query path provided"), app.trace)
return sdkerrors.QueryResultWithDebug(sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no query path provided"), app.trace)
}

switch path[0] {
Expand Down Expand Up @@ -813,6 +820,22 @@ func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) abci.Res
Value: []byte(app.version),
}

case "snapshots":
var responseValue []byte

response := app.ListSnapshots(abci.RequestListSnapshots{})

responseValue, err := json.Marshal(response)
if err != nil {
sdkerrors.QueryResult(sdkerrors.Wrap(err, fmt.Sprintf("failed to marshal list snapshots response %v", response)))
}

return abci.ResponseQuery{
Codespace: sdkerrors.RootCodespace,
Height: req.Height,
Value: responseValue,
}

default:
return sdkerrors.QueryResultWithDebug(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown query: %s", path), app.trace)
}
Expand Down Expand Up @@ -848,35 +871,6 @@ func handleQueryStore(app *BaseApp, path []string, req abci.RequestQuery) abci.R
return resp
}

func handleQueryP2P(app *BaseApp, path []string) abci.ResponseQuery {
// "/p2p" prefix for p2p queries
if len(path) < 4 {
return sdkerrors.QueryResultWithDebug(
sdkerrors.Wrap(
sdkerrors.ErrUnknownRequest, "path should be p2p filter <addr|id> <parameter>",
), app.trace)
}

var resp abci.ResponseQuery

cmd, typ, arg := path[1], path[2], path[3]
switch cmd {
case "filter":
switch typ {
case "addr":
resp = app.FilterPeerByAddrPort(arg)

case "id":
resp = app.FilterPeerByID(arg)
}

default:
resp = sdkerrors.QueryResultWithDebug(sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "expected second parameter to be 'filter'"), app.trace)
}

return resp
}

func handleQueryCustom(app *BaseApp, path []string, req abci.RequestQuery) abci.ResponseQuery {
// path[0] should be "custom" because "/custom" prefix is required for keeper
// queries.
Expand Down
38 changes: 38 additions & 0 deletions baseapp/abci_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package baseapp

import (
"encoding/json"
"testing"

abci "github.com/line/ostracon/abci/types"
Expand Down Expand Up @@ -205,3 +206,40 @@ func TestBaseAppBeginBlockConsensusParams(t *testing.T) {
newCtx := app.getContextForTx(app.checkState, []byte{})
require.Equal(t, maxGas, newCtx.ConsensusParams().Block.MaxGas)
}

type paramStore struct {
db *dbm.MemDB
}

func (ps *paramStore) Set(_ sdk.Context, key []byte, value interface{}) {
bz, err := json.Marshal(value)
if err != nil {
panic(err)
}

ps.db.Set(key, bz)
}

func (ps *paramStore) Has(_ sdk.Context, key []byte) bool {
ok, err := ps.db.Has(key)
if err != nil {
panic(err)
}

return ok
}

func (ps *paramStore) Get(_ sdk.Context, key []byte, ptr interface{}) {
bz, err := ps.db.Get(key)
if err != nil {
panic(err)
}

if len(bz) == 0 {
return
}

if err := json.Unmarshal(bz, ptr); err != nil {
panic(err)
}
}
Loading