Skip to content

Commit

Permalink
Merge pull request #30 from initia-labs/bump/block-sdk
Browse files Browse the repository at this point in the history
bump: block sdk to latest
  • Loading branch information
beer-1 authored Dec 8, 2023
2 parents 51d5bcc + 3ee0f76 commit 3eea7c8
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 141 deletions.
13 changes: 7 additions & 6 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -987,9 +987,11 @@ func NewInitiaApp(
MaxTxs: 100,
SignerExtractor: signerExtractor,
}
factor := mev.NewDefaultAuctionFactory(app.txConfig.TxDecoder(), signerExtractor)
mevLane := mev.NewMEVLane(
mevConfig,
mev.NewDefaultAuctionFactory(app.txConfig.TxDecoder(), signerExtractor),
factor,
factor.MatchHandler(),
)

freeConfig := blockbase.LaneConfig{
Expand Down Expand Up @@ -1018,13 +1020,12 @@ func NewInitiaApp(
priorityLane := applanes.NewPriorityLane(priorityLaneConfig)

lanes := []block.Lane{mevLane, freeLane, priorityLane}
mempool := block.NewLanedMempool(app.Logger(), true, lanes...)
mempool, err := block.NewLanedMempool(app.Logger(), lanes)
if err != nil {
panic(err)
}
app.SetMempool(mempool)

anteHandler := app.setAnteHandler(mevLane, freeLane)
for _, lane := range lanes {
lane.SetAnteHandler(anteHandler)
}

// override the base-app's ABCI methods (CheckTx, PrepareProposal, ProcessProposal)
proposalHandlers := blockabci.NewProposalHandler(
Expand Down
13 changes: 10 additions & 3 deletions app/lanes/priority.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ type PriorityLane struct {

// NewPriorityLane returns a new default lane.
func NewPriorityLane(cfg blockbase.LaneConfig) *PriorityLane {
lane := blockbase.NewBaseLane(
lane, err := blockbase.NewBaseLane(
cfg,
LaneName,
NewMempool(blockbase.NewDefaultTxPriority(), cfg.SignerExtractor, cfg.MaxTxs),
blockbase.DefaultMatchHandler(),
)
if err != nil {
panic(err)
}
lane.LaneMempool = NewMempool(blockbase.NewDefaultTxPriority(), cfg.SignerExtractor, cfg.MaxTxs)

if err := lane.ValidateBasic(); err != nil {
panic(err)
Expand Down Expand Up @@ -88,6 +90,11 @@ func NewMempool[C comparable](txPriority blockbase.TxPriority[C], extractor sign
}
}

// Priority returns the priority of the transaction.
func (cm *Mempool[C]) Priority(ctx sdk.Context, tx sdk.Tx) any {
return 1
}

// CountTx returns the number of transactions in the mempool.
func (cm *Mempool[C]) CountTx() int {
return cm.index.CountTx()
Expand Down
39 changes: 0 additions & 39 deletions app/params/config.go

This file was deleted.

2 changes: 1 addition & 1 deletion app/params/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func MakeEncodingConfig() EncodingConfig {
amino := codec.NewLegacyAmino()
interfaceRegistry := types.NewInterfaceRegistry()
marshaler := codec.NewProtoCodec(interfaceRegistry)
txCfg := NewTxConfig(marshaler, tx.DefaultSignModes)
txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes)

return EncodingConfig{
InterfaceRegistry: interfaceRegistry,
Expand Down
60 changes: 30 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ require (
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.47.6
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/ibc-go/v7 v7.3.1
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/initia-labs/OPinit v0.1.0-beta.2
github.com/initia-labs/OPinit v0.1.0-beta.3
// we also need to update `LIBINITIAVM_VERSION` of images/private/Dockerfile#5
github.com/initia-labs/initiavm v0.1.2-beta.4
github.com/novifinancial/serde-reflection/serde-generate/runtime/golang v0.0.0-20220519162058-e5cd3c3b3f3a
github.com/pelletier/go-toml v1.9.5
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/skip-mev/block-sdk v1.1.0
github.com/skip-mev/block-sdk v1.3.0-alpha.0
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.16.0
github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230523193151-73dea436e53f
github.com/stretchr/testify v1.8.4
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d
golang.org/x/crypto v0.14.0
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97
golang.org/x/crypto v0.16.0
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -50,10 +50,10 @@ require (
)

require (
cloud.google.com/go v0.110.8 // indirect
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go v0.110.9 // indirect
cloud.google.com/go/compute v1.23.2 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.2 // indirect
cloud.google.com/go/iam v1.1.4 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
Expand Down Expand Up @@ -84,7 +84,7 @@ require (
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
github.com/creachadair/taskgroup v0.4.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
Expand All @@ -104,11 +104,11 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -130,7 +130,7 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.9 // indirect
Expand All @@ -146,9 +146,9 @@ require (
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
Expand All @@ -158,28 +158,28 @@ require (
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.128.0 // indirect
google.golang.org/api v0.143.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
nhooyr.io/websocket v1.8.6 // indirect
Expand All @@ -191,7 +191,7 @@ replace (
// use cosmos fork of keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

github.com/cosmos/cosmos-sdk => github.com/initia-labs/cosmos-sdk v0.47.7-0.20231207065559-392af573c249
github.com/cosmos/cosmos-sdk => github.com/initia-labs/cosmos-sdk v0.47.7-0.20231208073210-fb40c1c811cb

// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
Expand Down
Loading

0 comments on commit 3eea7c8

Please sign in to comment.