Skip to content

Commit

Permalink
squash aspect commits (#373)
Browse files Browse the repository at this point in the history
* fix: add BlockByHash

* fix: add BlockResults to TendermintRPC

* feat: add ConsensusParams interface

* temporary disable dependabot.yml

* feat: migration aspect

* feat: migration aspect

* feat: publish tag

* feat: publish tag

* fix: change  aspect-core version

* feat: implemented stuffs for on-tx-verify

* fix: fix dep

* chore: bump dep versions

* chore: bump aspect-core version to v0.4.3-beta

* chore: bump aspect core version to v0.4.4-beta (#183)

* fix: call of FilterTx

* fix: update artela tag

* clean: removed some unused code (#211)

* chore: clean unused code and add chain id method for base app

* fix: fix build issues

* dep: bump aspect-core to v0.4.7-beta

* dep: bump aspect-core to v0.4.7-rc1 (#228)

* refactor: update tag

* refactor: update tag (#236)

* update: v0.47-rc5

* chore: bump version v0.4.7-rc6

---------

Co-authored-by: Yuan <[email protected]>
Co-authored-by: Luke <[email protected]>
Co-authored-by: zhanjun <[email protected]>
Co-authored-by: Gene <[email protected]>
Co-authored-by: Jack Li <[email protected]>
Co-authored-by: Yuan <[email protected]>
Co-authored-by: No-Brainer <[email protected]>
  • Loading branch information
8 people authored Apr 16, 2024
1 parent 3b509c1 commit 09dade8
Show file tree
Hide file tree
Showing 21 changed files with 195 additions and 122 deletions.
208 changes: 104 additions & 104 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,109 +1,109 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
#version: 2
#updates:
# - package-ecosystem: github-actions
# directory: "/"
# schedule:
# interval: daily

- package-ecosystem: npm
directory: "/docs"
schedule:
interval: weekly
# DevRel should review docs updates
assignees:
- "julienrbrt"
# - package-ecosystem: npm
# directory: "/docs"
# schedule:
# interval: weekly
# # DevRel should review docs updates
# assignees:
# - "julienrbrt"

- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/simapp"
schedule:
interval: daily
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tests"
schedule:
interval: daily
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/api"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/orm"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/core"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tools/cosmovisor"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/depinject"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/errors"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/math"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/client/v2"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tx"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tools/rosetta"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
# - package-ecosystem: gomod
# directory: "/"
# schedule:
# interval: daily
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/simapp"
# schedule:
# interval: daily
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/tests"
# schedule:
# interval: daily
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/api"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/orm"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/core"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/tools/cosmovisor"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/depinject"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/errors"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/math"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/client/v2"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/tx"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
# - package-ecosystem: gomod
# directory: "/tools/rosetta"
# schedule:
# interval: weekly
# labels:
# - "A:automerge"
# - dependencies
4 changes: 4 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ func (app *BaseApp) ProcessProposal(req abci.RequestProcessProposal) (resp abci.
}
}()

// chainID := app.chainID
// nonce := uint64(req.Height) // use height as nonce
// scheduler.NewTaskManager(req.Height, nonce, chainID)

resp = app.processProposal(app.processProposalState.ctx, req)
return resp
}
Expand Down
33 changes: 32 additions & 1 deletion baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sort"
"strings"

"github.com/artela-network/aspect-core/djpm"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/crypto/tmhash"
Expand Down Expand Up @@ -46,7 +47,7 @@ const (
var _ abci.Application = (*BaseApp)(nil)

// 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 @@ -144,6 +145,9 @@ type BaseApp struct { //nolint: maligned
abciListeners []ABCIListener

chainID string

// for artela aspect
aspect *djpm.Aspect
}

// NewBaseApp returns a reference to an initialized BaseApp. It accepts a
Expand Down Expand Up @@ -208,6 +212,10 @@ func (app *BaseApp) Version() string {
return app.version
}

func (app *BaseApp) ChainId() string {
return app.chainID
}

// Logger returns the logger of the BaseApp.
func (app *BaseApp) Logger() log.Logger {
return app.logger
Expand Down Expand Up @@ -405,6 +413,10 @@ func (app *BaseApp) setIndexEvents(ie []string) {
}
}

func (app *BaseApp) Aspect() *djpm.Aspect {
return app.aspect
}

// Seal seals a BaseApp. It prohibits any further modifications to a BaseApp.
func (app *BaseApp) Seal() { app.sealed = true }

Expand Down Expand Up @@ -637,6 +649,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re

defer func() {
if r := recover(); r != nil {
app.logger.Debug("runTx panic recovered", "mode", mode, "error", r)
recoveryMW := newOutOfGasRecoveryMiddleware(gasWanted, ctx, app.runTxRecoveryMiddleware)
err, result = processRecovery(r, recoveryMW), nil
}
Expand Down Expand Up @@ -1047,3 +1060,21 @@ func NoOpProcessProposal() sdk.ProcessProposalHandler {
func (app *BaseApp) Close() error {
return nil
}

// artela aspect add -----

// DeliverStateCtx exports the ctx of deliverState for aspect local call
func (app *BaseApp) DeliverStateCtx() (sdk.Context, error) {
if app.deliverState == nil {
return sdk.Context{}, errors.New("block not begin")
}
return app.deliverState.ctx, nil
}

// CheckStateCtx exports the ctx of checkState for aspect local call
func (app *BaseApp) CheckStateCtx() (sdk.Context, error) {
if app.checkState == nil {
return sdk.Context{}, errors.New("checkState is nil")
}
return app.checkState.ctx, nil
}
4 changes: 1 addition & 3 deletions baseapp/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

var (
ParamStoreKey = []byte("paramstore")
)
var ParamStoreKey = []byte("paramstore")

func defaultLogger() log.Logger {
if testing.Verbose() {
Expand Down
4 changes: 4 additions & 0 deletions client/tendermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type TendermintRPC interface {
Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error)
Status(context.Context) (*coretypes.ResultStatus, error)
Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)
BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error)
BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error)
BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error)
Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error)
Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error)
Expand All @@ -25,4 +27,6 @@ type TendermintRPC interface {
page, perPage *int,
orderBy string,
) (*coretypes.ResultTxSearch, error)

ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error)
}
10 changes: 8 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +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-rc6
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 @@ -74,10 +75,12 @@ 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-rc6 // 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/v14 v14.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
Expand All @@ -93,17 +96,20 @@ require (
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/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.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
Expand All @@ -120,6 +126,7 @@ require (
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
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
Expand All @@ -135,7 +142,6 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/gomega v1.20.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
Expand Down
Loading

0 comments on commit 09dade8

Please sign in to comment.