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

Staging/07-22 #491

Merged
merged 8 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,15 @@ func (app *BaseApp) Commit() abci.ResponseCommit {
// Write the DeliverTx state into branched storage and commit the MultiStore.
// The write to the DeliverTx state writes all state transitions to the root
// MultiStore (app.cms) so when Commit() is called is persists those values.
startWriteTime := time.Now()
app.deliverState.ms.Write()
app.logger.Debug("ms.Write", "height", header.Height, "cost of time",
fmt.Sprintf(" %.2fms", float64(time.Since(startWriteTime).Microseconds())/1000))

startCommitTime := time.Now()
commitID := app.cms.Commit()
app.logger.Debug("cms.Commit", "height", header.Height, "cost of time",
fmt.Sprintf(" %.2fms", float64(time.Since(startCommitTime).Microseconds())/1000))

res := abci.ResponseCommit{
Data: commitID.Hash,
Expand Down Expand Up @@ -488,11 +495,22 @@ func (app *BaseApp) Commit() abci.ResponseCommit {
app.halt()
}

go app.forceCompact(header.Height)
go app.snapshotManager.SnapshotIfApplicable(header.Height)

return res
}

func (app *BaseApp) forceCompact(height int64) {
if app.forceCompactInterval > 0 && height > 0 && height%app.forceCompactInterval == 0 {
app.logger.Debug("db force compact")
err := app.db.ForceCompact(nil, nil)
if err != nil {
app.logger.Error("db force compact", "err", err)
}
}
}

// halt attempts to gracefully shutdown the node via SIGINT and SIGTERM falling
// back on os.Exit if both fail.
func (app *BaseApp) halt() {
Expand Down
2 changes: 2 additions & 0 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
var _ abci.Application = (*BaseApp)(nil)

// BaseApp reflects the ABCI application implementation.
type BaseApp struct { // nolint: maligned

Check failure on line 50 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / golangci-lint

directive `// nolint: maligned` should be written without leading space as `//nolint: maligned` (nolintlint)
// initialized on creation
logger log.Logger
name string // application name from abci.Info
Expand Down Expand Up @@ -148,6 +148,8 @@

// for artela aspect
aspect *djpm.Aspect

forceCompactInterval int64
}

// NewBaseApp returns a reference to an initialized BaseApp. It accepts a
Expand Down
4 changes: 4 additions & 0 deletions baseapp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ func SetChainID(chainID string) func(*BaseApp) {
return func(app *BaseApp) { app.chainID = chainID }
}

func SetForceCompactInterval(interval int64) func(*BaseApp) {
return func(app *BaseApp) { app.forceCompactInterval = interval }
}

func (app *BaseApp) SetName(name string) {
if app.sealed {
panic("SetName() on sealed BaseApp")
Expand Down
34 changes: 19 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
cosmossdk.io/tools/rosetta v0.2.1
github.com/99designs/keyring v1.2.1
github.com/armon/go-metrics v0.4.1
github.com/artela-network/aspect-core v0.4.7-rc7
github.com/artela-network/aspect-core v0.4.8-rc8
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/chzyer/readline v1.5.1
Expand Down Expand Up @@ -49,15 +49,15 @@ require (
github.com/prometheus/common v0.42.0
github.com/rakyll/statik v0.1.7
github.com/rs/zerolog v1.29.1
github.com/spf13/cast v1.5.0
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.14.0
github.com/stretchr/testify v1.8.4
github.com/tendermint/go-amino v0.16.0
github.com/tidwall/btree v1.6.0
golang.org/x/crypto v0.11.0
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529
google.golang.org/grpc v1.56.2
google.golang.org/protobuf v1.31.0
Expand All @@ -75,39 +75,39 @@ require (
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/artela-network/aspect-runtime v0.4.7-rc7 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/artela-network/aspect-runtime v0.4.8-rc8 // indirect
github.com/aws/aws-sdk-go v1.44.203 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bufbuild/protocompile v0.4.0 // indirect
github.com/bytecodealliance/wasmtime-go/v20 v20.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.0 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/ethereum/go-ethereum v1.12.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gin-gonic/gin v1.8.1 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
Expand All @@ -129,10 +129,12 @@ require (
github.com/holiman/uint256 v1.2.2 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.8.12 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
Expand All @@ -149,21 +151,20 @@ require (
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.0 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
Expand All @@ -180,6 +181,9 @@ require (
replace (
// use cosmos fork of keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
github.com/bytecodealliance/wasmtime-go/v20 => github.com/artela-network/wasmtime-go/v20 v20.0.3
github.com/cometbft/cometbft-db => github.com/artela-network/cosmos-db v1.0.2-048-rc8
github.com/cosmos/iavl => github.com/artela-network/iavl v0.20.0-048-rc8
// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
Expand Down
Loading
Loading