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 33 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
5 changes: 2 additions & 3 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
28 changes: 26 additions & 2 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,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 +229,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 +307,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 +476,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
15 changes: 7 additions & 8 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ import (
"github.com/line/lbm-sdk/x/auth/legacy/legacytx"
)

var (
_ abci.Application = (*BaseApp)(nil)
)
var _ abci.Application = (*BaseApp)(nil)

type (
// StoreLoader defines a customizable function to control how we load the CommitMultiStore
Expand All @@ -38,7 +36,7 @@ type (
)

// BaseApp reflects the ABCI application implementation.
type BaseApp struct { // nolint: maligned
type BaseApp struct { //nolint: maligned
// initialized on creation
logger log.Logger
name string // application name from abci.Info
Expand Down Expand Up @@ -132,6 +130,10 @@ type BaseApp struct { // nolint: maligned
// indexEvents defines the set of events in the form {eventType}.{attributeKey},
// which informs Tendermint what to index. If empty, all events will be indexed.
indexEvents map[string]struct{}

// abciListeners for hooking into the ABCI message processing of the BaseApp
// and exposing the requests and responses to external consumers
abciListeners []ABCIListener
}

// NewBaseApp returns a reference to an initialized BaseApp. It accepts a
Expand Down Expand Up @@ -272,11 +274,8 @@ func DefaultStoreLoader(ms sdk.CommitMultiStore) error {

// CommitMultiStore returns the root multi-store.
// App constructor can use this to access the `cms`.
// UNSAFE: only safe to use during app initialization.
// UNSAFE: must not be used during the abci life cycle.
func (app *BaseApp) CommitMultiStore() sdk.CommitMultiStore {
if app.sealed {
panic("cannot call CommitMultiStore() after baseapp is sealed")
}
return app.cms
}

Expand Down
5 changes: 2 additions & 3 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func useDefaultLoader(app *BaseApp) {
}

func initStore(t *testing.T, db dbm.DB, storeKey string, k, v []byte) {
rs := rootmulti.NewStore(db)
rs := rootmulti.NewStore(db, log.NewNopLogger())
rs.SetPruning(store.PruneNothing)
key := sdk.NewKVStoreKey(storeKey)
rs.MountStoreWithDB(key, store.StoreTypeIAVL, nil)
Expand All @@ -276,7 +276,7 @@ func initStore(t *testing.T, db dbm.DB, storeKey string, k, v []byte) {
}

func checkStore(t *testing.T, db dbm.DB, ver int64, storeKey string, k, v []byte) {
rs := rootmulti.NewStore(db)
rs := rootmulti.NewStore(db, log.NewNopLogger())
rs.SetPruning(store.PruneDefault)
key := sdk.NewKVStoreKey(storeKey)
rs.MountStoreWithDB(key, store.StoreTypeIAVL, nil)
Expand Down Expand Up @@ -1300,7 +1300,6 @@ func TestTxGasLimits(t *testing.T) {

return newCtx, nil
})

}

routerOpt := func(bapp *BaseApp) {
Expand Down
6 changes: 3 additions & 3 deletions baseapp/msg_service_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func (msr *MsgServiceRouter) HandlerByTypeURL(typeURL string) MsgServiceHandler
// service description, handler is an object which implements that gRPC service.
//
// This function PANICs:
// - if it is called before the service `Msg`s have been registered using
// RegisterInterfaces,
// - or if a service is being registered twice.
// - if it is called before the service `Msg`s have been registered using
// RegisterInterfaces,
// - or if a service is being registered twice.
func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) {
// Adds a top-level query handler based on the gRPC service name.
for _, method := range sd.Methods {
Expand Down
11 changes: 11 additions & 0 deletions baseapp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,14 @@ func MetricsProvider(prometheus bool) cache.MetricsProvider {
}
return cache.NopMetricsProvider()
}

// SetStreamingService is used to set a streaming service into the BaseApp hooks and load the listeners into the multistore
func (app *BaseApp) SetStreamingService(s StreamingService) {
// add the listeners for each StoreKey
for key, lis := range s.Listeners() {
app.cms.AddListeners(key, lis)
}
// register the StreamingService within the BaseApp
// BaseApp will pass BeginBlock, DeliverTx, and EndBlock requests and responses to the streaming services to update their ABCI context
app.abciListeners = append(app.abciListeners, s)
}
33 changes: 33 additions & 0 deletions baseapp/streaming.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package baseapp

import (
"io"
"sync"

abci "github.com/line/ostracon/abci/types"

store "github.com/line/lbm-sdk/store/types"
"github.com/line/lbm-sdk/types"
)

// ABCIListener interface used to hook into the ABCI message processing of the BaseApp
type ABCIListener interface {
// ListenBeginBlock updates the streaming service with the latest BeginBlock messages
ListenBeginBlock(ctx types.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error
// ListenEndBlock updates the steaming service with the latest EndBlock messages
ListenEndBlock(ctx types.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error
// ListenDeliverTx updates the steaming service with the latest DeliverTx messages
ListenDeliverTx(ctx types.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error
}

// StreamingService interface for registering WriteListeners with the BaseApp and updating the service with the ABCI messages using the hooks
type StreamingService interface {
// Stream is the streaming service loop, awaits kv pairs and writes them to some destination stream or file
Stream(wg *sync.WaitGroup) error
// Listeners returns the streaming service's listeners for the BaseApp to register
Listeners() map[store.StoreKey][]store.WriteListener
// ABCIListener interface for hooking into the ABCI messages from inside the BaseApp
ABCIListener
// Closer interface
io.Closer
}
1 change: 0 additions & 1 deletion client/broadcast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,4 @@ func TestBroadcastError(t *testing.T) {
require.Equal(t, txHash, resp.TxHash)
}
}

}
9 changes: 5 additions & 4 deletions client/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package config_test

import (
"bytes"
"fmt"
"io"

"os"
"testing"

"github.com/stretchr/testify/require"

"github.com/line/lbm-sdk/client"
"github.com/line/lbm-sdk/client/config"
"github.com/line/lbm-sdk/client/flags"
clitestutil "github.com/line/lbm-sdk/testutil/cli"
"github.com/line/lbm-sdk/x/staking/client/cli"
)
Expand Down Expand Up @@ -73,10 +74,10 @@ func TestConfigCmdEnvFlag(t *testing.T) {
args []string
expNode string
}{
//{"env var is set with no flag", testNode1, []string{"validators"}, testNode1},
//{"env var is set with a flag", testNode1, []string{"validators", fmt.Sprintf("--%s=%s", flags.FlagNode, testNode2)}, testNode2},
{"env var is set with no flag", testNode1, []string{"validators"}, testNode1},
{"env var is set with a flag", testNode1, []string{"validators", fmt.Sprintf("--%s=%s", flags.FlagNode, testNode2)}, testNode2},
{"env var is not set with no flag", "", []string{"validators"}, defaultNode},
//{"env var is not set with a flag", "", []string{"validators", fmt.Sprintf("--%s=%s", flags.FlagNode, testNode2)}, testNode2},
{"env var is not set with a flag", "", []string{"validators", fmt.Sprintf("--%s=%s", flags.FlagNode, testNode2)}, testNode2},
}

for _, tc := range tt {
Expand Down
2 changes: 1 addition & 1 deletion client/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func writeConfigToFile(configFilePath string, config *ClientConfig) error {
return err
}

return os.WriteFile(configFilePath, buffer.Bytes(), 0600)
return os.WriteFile(configFilePath, buffer.Bytes(), 0o600)
}

// ensureConfigPath creates a directory configPath if it does not exist
Expand Down
2 changes: 0 additions & 2 deletions client/debug/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ $ %s debug addr link19wgf6ymq2ur6r59st95e04e49m69z4al4fc982
`, version.AppName),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {

addrString := args[0]
var addr []byte

Expand All @@ -86,7 +85,6 @@ $ %s debug addr link19wgf6ymq2ur6r59st95e04e49m69z4al4fc982

if err3 != nil {
return fmt.Errorf("expected hex or bech32. Got errors: hex: %v, bech32 acc: %v, bech32 val: %v", err, err2, err3)

}
}
}
Expand Down
9 changes: 7 additions & 2 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading