Skip to content

Commit

Permalink
Merge in the OCC changes in seiv2 into main (#1398)
Browse files Browse the repository at this point in the history
* add some TODOs pointing to key areas to refactor for OCC work (#1049)

* Add occ to sei-chain (#1111)

* add occ to sei-chain

* don't run forward compatibility

* fix dependency

* update version to latest occ-main cosmos

* enable occ on process-proposal-handler

* fix enabled flag

* [occ] enable occ prefill estimates from sei chain (#1113)

* Enable dep prefills

* fix loadtest config

* bump go mod

* bump go mod

* bump go mod

* bump go mod

* bump go mod

* update sei-wasmd

* bump go mod

* fix lint and add todos

* [OCC] Add occ unit tests (#1124)

* add occ unit tests

* fix test to compare 1 vs 10 workers

* cleanup

* add comment

* move const

* optimize imports

* restructure test to avoid linter issues

* fix lint

* more lint

* fix tests and update sei-cosmos

* fix unrelated lint errors

* Revert "fix unrelated lint errors"

This reverts commit 0f9a03a.

* fix linting issues (#1125)

fix lint

---------

Co-authored-by: Uday Patil <[email protected]>

* [OCC] Add trace span for DeliverTxBatch (#1131)

* add trace span for DeliverTxBatch

* update sei-cosmos to latest occ-main

* split out the metric name

* [dex] Fix dex memstate to use KVstore instead of in memory structures (#1135)

* Refactor dex contracts to process memstate

* add mutexes and refactor contract deps struct

* fix initialization of mutex

* update go mod

* update go od

* update resource types

* update dex aclmappings

* update go mod

* add occ wasm testing functionality to loadtest (#1177)

* add occ wasm testing functionality to loadtest

* update loadtest

* revert loadtest config change

* update sei tester

* fix loadtest

* lint fixes

* add occ-enable config (#1256)

* OCC Remove block gas meter (#1286)

* remove block gas meter

* uncomment tests

* update go mod

* update go mod

* Add writeset estimation tracing + generate writesets concurrently (#1339)

* Add tracing spans

* add waitgroup for concurrent writeset estimation

* Rebase with latest loadtest client (#1352)

* Rebase with latest loadtest client

* Fix go version

* no lint

* Remove unsed field

* Fix lint

* update sei-tendermint

* Seiv2 ci (#1392)

Add seiv2 branch to github CI

* Update go mod with sei-cosmos tag (#1402)

update go mod with sei-cosmos tag

---------

Co-authored-by: Steven Landers <[email protected]>
Co-authored-by: Yiming Zang <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2024
1 parent b806f14 commit 2d7a3df
Show file tree
Hide file tree
Showing 48 changed files with 3,309 additions and 361 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
branches:
- main
- seiv2
- release/**
paths:
- "**.go"
Expand All @@ -25,7 +26,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down Expand Up @@ -54,4 +55,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v2
6 changes: 4 additions & 2 deletions .github/workflows/compatiblity_check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Compatibility Check
on:
pull_request:
branches:
- main
push:
branches:
- main
Expand All @@ -13,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

- name: Check Latest Dependencies
run: |
Expand All @@ -24,4 +26,4 @@ jobs:
go mod edit -replace github.com/tendermint/tendermint=./sei-tendermint
go mod edit -replace github.com/cosmos/cosmos-sdk=./sei-cosmos
go mod tidy
make install
make install
8 changes: 5 additions & 3 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: Fuzzing

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main

defaults:
run:
Expand All @@ -20,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.21

- name: Fuzz Place Order Msg
run: go test github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver -fuzz FuzzPlaceOrders -fuzztime 30s
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches:
- master
- main
- seiv2
pull_request:
permissions:
contents: read
Expand All @@ -18,11 +19,11 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
args: --timeout 10m0s
args: --timeout 10m0s
10 changes: 7 additions & 3 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ name: Docker Integration Test

on:
push:
branches: [ "main" ]
branches:
- main
- seiv2
pull_request:
branches: [ "main" ]
branches:
- main
- seiv2

defaults:
run:
Expand Down Expand Up @@ -117,7 +121,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

- name: Start 4 node docker cluster
run: make clean && INVARIANT_CHECK_INTERVAL=10 ${{matrix.test.env}} make docker-cluster-start &
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/proto-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
push:
branches:
- main
- seiv2
paths:
- "proto/**"

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "**.go"
branches:
- main
- seiv2
- release/**

jobs:
Expand All @@ -18,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.21"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down Expand Up @@ -53,7 +54,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

# Download all coverage reports from the 'tests' job
- name: Download coverage reports
Expand Down
32 changes: 32 additions & 0 deletions aclmapping/dex/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func GetLongShortOrderBookOps(contractAddr string, priceDenom string, assetDenom
}

func DexPlaceOrdersDependencyGenerator(keeper aclkeeper.Keeper, _ sdk.Context, msg sdk.Msg) ([]sdkacltypes.AccessOperation, error) {
// TODO: read + write downstream, write contracts to process
placeOrdersMsg, ok := msg.(*dextypes.MsgPlaceOrders)
if !ok {
return []sdkacltypes.AccessOperation{}, ErrPlaceOrdersGenerator
Expand Down Expand Up @@ -99,6 +100,22 @@ func DexPlaceOrdersDependencyGenerator(keeper aclkeeper.Keeper, _ sdk.Context, m
IdentifierTemplate: hex.EncodeToString(dextypes.MemOrderPrefix(contractAddr)),
},

{
AccessType: sdkacltypes.AccessType_READ,
ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS,
IdentifierTemplate: hex.EncodeToString(dextypes.MemDownstreamContractsKey(contractAddr)),
},
{
AccessType: sdkacltypes.AccessType_WRITE,
ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS,
IdentifierTemplate: hex.EncodeToString(dextypes.MemDownstreamContractsKey(contractAddr)),
},
{
AccessType: sdkacltypes.AccessType_WRITE,
ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_CONTRACTS_TO_PROCESS,
IdentifierTemplate: hex.EncodeToString(dextypes.MemContractsToProcessKey(contractAddr)),
},

// Checks balance of sender
{
AccessType: sdkacltypes.AccessType_READ,
Expand Down Expand Up @@ -183,6 +200,21 @@ func DexCancelOrdersDependencyGenerator(_ aclkeeper.Keeper, _ sdk.Context, msg s
ResourceType: sdkacltypes.ResourceType_KV_DEX_CONTRACT,
IdentifierTemplate: hex.EncodeToString([]byte(dexkeeper.ContractPrefixKey)),
},
{
AccessType: sdkacltypes.AccessType_READ,
ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS,
IdentifierTemplate: hex.EncodeToString(dextypes.MemDownstreamContractsKey(contractAddr)),
},
{
AccessType: sdkacltypes.AccessType_WRITE,
ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS,
IdentifierTemplate: hex.EncodeToString(dextypes.MemDownstreamContractsKey(contractAddr)),
},
{
AccessType: sdkacltypes.AccessType_WRITE,
ResourceType: sdkacltypes.ResourceType_KV_DEX_MEM_CONTRACTS_TO_PROCESS,
IdentifierTemplate: hex.EncodeToString(dextypes.MemContractsToProcessKey(contractAddr)),
},
}

for _, order := range cancelOrdersMsg.GetCancellations() {
Expand Down
136 changes: 133 additions & 3 deletions aclmapping/utils/resource_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ var StoreKeyToResourceTypePrefixMap = aclsdktypes.StoreKeyToResourceTypePrefixMa
},
dextypes.MemStoreKey: {
// mem
aclsdktypes.ResourceType_KV_DEX_MEM_ORDER: dextypes.KeyPrefix(dextypes.MemOrderKey),
aclsdktypes.ResourceType_KV_DEX_MEM_CANCEL: dextypes.KeyPrefix(dextypes.MemCancelKey),
aclsdktypes.ResourceType_KV_DEX_MEM_DEPOSIT: dextypes.KeyPrefix(dextypes.MemDepositKey),
aclsdktypes.ResourceType_KV_DEX_MEM_ORDER: dextypes.KeyPrefix(dextypes.MemOrderKey),
aclsdktypes.ResourceType_KV_DEX_MEM_CANCEL: dextypes.KeyPrefix(dextypes.MemCancelKey),
aclsdktypes.ResourceType_KV_DEX_MEM_DEPOSIT: dextypes.KeyPrefix(dextypes.MemDepositKey),
aclsdktypes.ResourceType_KV_DEX_MEM_CONTRACTS_TO_PROCESS: dextypes.KeyPrefix(dextypes.MemContractsToProcess),
aclsdktypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS: dextypes.KeyPrefix(dextypes.MemDownstreamContracts),
},
banktypes.StoreKey: {
aclsdktypes.ResourceType_KV_BANK: aclsdktypes.EmptyPrefix,
Expand Down Expand Up @@ -151,3 +153,131 @@ var StoreKeyToResourceTypePrefixMap = aclsdktypes.StoreKeyToResourceTypePrefixMa
aclsdktypes.ResourceType_KV_WASM_PINNED_CODE_INDEX: wasmtypes.PinnedCodeIndexPrefix,
},
}

// ResourceTypeToStoreKeyMap this maps between resource types and their respective storekey
var ResourceTypeToStoreKeyMap = aclsdktypes.ResourceTypeToStoreKeyMap{
// ANY, KV, and MEM are intentionally excluded because they don't map to a specific store key

// ~~~~ DEX Resource Types ~~~~
aclsdktypes.ResourceType_KV_DEX: dextypes.StoreKey,
aclsdktypes.ResourceType_DexMem: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_CONTRACT_LONGBOOK: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_CONTRACT_SHORTBOOK: dextypes.StoreKey,
// pricedenom and assetdenoms are the prefixes
aclsdktypes.ResourceType_KV_DEX_PAIR_PREFIX: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_TWAP: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_PRICE: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_SETTLEMENT_ENTRY: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_REGISTERED_PAIR: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_ORDER: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_CANCEL: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_ACCOUNT_ACTIVE_ORDERS: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_ASSET_LIST: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_NEXT_ORDER_ID: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_NEXT_SETTLEMENT_ID: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_MATCH_RESULT: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_CONTRACT: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_ORDER_BOOK: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_LONG_ORDER_COUNT: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_SHORT_ORDER_COUNT: dextypes.StoreKey,
// SETTLEMENT keys are prefixed with account and order id
aclsdktypes.ResourceType_KV_DEX_SETTLEMENT_ORDER_ID: dextypes.StoreKey,
aclsdktypes.ResourceType_KV_DEX_SETTLEMENT: dextypes.StoreKey,

// ~~~~ DEX MEM Resource Types ~~~~
aclsdktypes.ResourceType_KV_DEX_MEM_ORDER: dextypes.MemStoreKey,
aclsdktypes.ResourceType_KV_DEX_MEM_CANCEL: dextypes.MemStoreKey,
aclsdktypes.ResourceType_KV_DEX_MEM_DEPOSIT: dextypes.MemStoreKey,
aclsdktypes.ResourceType_KV_DEX_MEM_CONTRACTS_TO_PROCESS: dextypes.MemStoreKey,
aclsdktypes.ResourceType_KV_DEX_MEM_DOWNSTREAM_CONTRACTS: dextypes.MemStoreKey,

// ~~~~ BANK Resource Types ~~~~
aclsdktypes.ResourceType_KV_BANK: banktypes.StoreKey,
aclsdktypes.ResourceType_KV_BANK_BALANCES: banktypes.StoreKey,
aclsdktypes.ResourceType_KV_BANK_SUPPLY: banktypes.StoreKey,
aclsdktypes.ResourceType_KV_BANK_DENOM: banktypes.StoreKey,

// ~~~~ BANK DEFERRED Resource Types ~~~~
aclsdktypes.ResourceType_KV_BANK_DEFERRED: banktypes.DeferredCacheStoreKey,
aclsdktypes.ResourceType_KV_BANK_DEFERRED_MODULE_TX_INDEX: banktypes.DeferredCacheStoreKey,

// ~~~~ AUTH Resource Types ~~~~
aclsdktypes.ResourceType_KV_AUTH: authtypes.StoreKey,
aclsdktypes.ResourceType_KV_AUTH_ADDRESS_STORE: authtypes.StoreKey,
aclsdktypes.ResourceType_KV_AUTH_GLOBAL_ACCOUNT_NUMBER: authtypes.StoreKey,

// ~~~~ AUTHZ Resource Types ~~~~
aclsdktypes.ResourceType_KV_AUTHZ: authztypes.StoreKey,

// ~~~~ DISTRIBUTION Resource Types ~~~~
aclsdktypes.ResourceType_KV_DISTRIBUTION: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_FEE_POOL: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_PROPOSER_KEY: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_OUTSTANDING_REWARDS: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_DELEGATOR_WITHDRAW_ADDR: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_VAL_HISTORICAL_REWARDS: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_VAL_CURRENT_REWARDS: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_VAL_ACCUM_COMMISSION: distributiontypes.StoreKey,
aclsdktypes.ResourceType_KV_DISTRIBUTION_SLASH_EVENT: distributiontypes.StoreKey,

// ~~~~ FEEGRANT Resource Types ~~~~
aclsdktypes.ResourceType_KV_FEEGRANT: feegranttypes.StoreKey,
aclsdktypes.ResourceType_KV_FEEGRANT_ALLOWANCE: feegranttypes.StoreKey,

// ~~~~ ORACLE Resource Types ~~~~
aclsdktypes.ResourceType_KV_ORACLE: oracletypes.StoreKey,
aclsdktypes.ResourceType_KV_ORACLE_VOTE_TARGETS: oracletypes.StoreKey,
aclsdktypes.ResourceType_KV_ORACLE_AGGREGATE_VOTES: oracletypes.StoreKey,
aclsdktypes.ResourceType_KV_ORACLE_FEEDERS: oracletypes.StoreKey,
aclsdktypes.ResourceType_KV_ORACLE_PRICE_SNAPSHOT: oracletypes.StoreKey,
aclsdktypes.ResourceType_KV_ORACLE_EXCHANGE_RATE: oracletypes.StoreKey,
aclsdktypes.ResourceType_KV_ORACLE_VOTE_PENALTY_COUNTER: oracletypes.StoreKey,

// ~~~~ STAKING Resource Types ~~~~
aclsdktypes.ResourceType_KV_STAKING: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_VALIDATION_POWER: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_TOTAL_POWER: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_VALIDATOR: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_VALIDATORS_CON_ADDR: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_VALIDATORS_BY_POWER: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_DELEGATION: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_UNBONDING_DELEGATION: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_UNBONDING_DELEGATION_VAL: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_REDELEGATION: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_REDELEGATION_VAL_SRC: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_REDELEGATION_VAL_DST: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_UNBONDING: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_REDELEGATION_QUEUE: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_VALIDATOR_QUEUE: stakingtypes.StoreKey,
aclsdktypes.ResourceType_KV_STAKING_HISTORICAL_INFO: stakingtypes.StoreKey,

// ~~~~ SLASHING Resource Types ~~~~
aclsdktypes.ResourceType_KV_SLASHING: slashingtypes.StoreKey,
aclsdktypes.ResourceType_KV_SLASHING_VAL_SIGNING_INFO: slashingtypes.StoreKey,
aclsdktypes.ResourceType_KV_SLASHING_ADDR_PUBKEY_RELATION_KEY: slashingtypes.StoreKey,

// ~~~~ TOKENFACTORY Resource Types ~~~~
aclsdktypes.ResourceType_KV_TOKENFACTORY: tokenfactorytypes.StoreKey,
aclsdktypes.ResourceType_KV_TOKENFACTORY_DENOM: tokenfactorytypes.StoreKey,
aclsdktypes.ResourceType_KV_TOKENFACTORY_METADATA: tokenfactorytypes.StoreKey,
aclsdktypes.ResourceType_KV_TOKENFACTORY_ADMIN: tokenfactorytypes.StoreKey,
aclsdktypes.ResourceType_KV_TOKENFACTORY_CREATOR: tokenfactorytypes.StoreKey,

// ~~~~ EPOCH Resource Types ~~~~
aclsdktypes.ResourceType_KV_EPOCH: epochtypes.StoreKey,

// ~~~~ ACCESSCONTROL Resource Types ~~~~
aclsdktypes.ResourceType_KV_ACCESSCONTROL: acltypes.StoreKey,
aclsdktypes.ResourceType_KV_ACCESSCONTROL_WASM_DEPENDENCY_MAPPING: acltypes.StoreKey,

// ~~~~ WASM Resource Types ~~~~
aclsdktypes.ResourceType_KV_WASM: wasmtypes.StoreKey,
aclsdktypes.ResourceType_KV_WASM_CODE: wasmtypes.StoreKey,
aclsdktypes.ResourceType_KV_WASM_CONTRACT_ADDRESS: wasmtypes.StoreKey,
aclsdktypes.ResourceType_KV_WASM_CONTRACT_STORE: wasmtypes.StoreKey,
aclsdktypes.ResourceType_KV_WASM_SEQUENCE_KEY: wasmtypes.StoreKey,
aclsdktypes.ResourceType_KV_WASM_CONTRACT_CODE_HISTORY: wasmtypes.StoreKey,
aclsdktypes.ResourceType_KV_WASM_CONTRACT_BY_CODE_ID: wasmtypes.StoreKey,
aclsdktypes.ResourceType_KV_WASM_PINNED_CODE_INDEX: wasmtypes.StoreKey,
}
21 changes: 21 additions & 0 deletions aclmapping/utils/resource_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,24 @@ func TestAllResourcesInTree(t *testing.T) {
}

}

func TestAllResourcesInStoreKeyMap(t *testing.T) {
resourceToStoreKeyMap := aclutils.ResourceTypeToStoreKeyMap
resourceTree := sdkacltypes.ResourceTree

storeKeyAllResourceTypes := make(map[sdkacltypes.ResourceType]bool)
for resourceType := range resourceToStoreKeyMap {
storeKeyAllResourceTypes[resourceType] = true
}

for resourceType := range resourceTree {
// omit ANY, KV, and MEM
if resourceType == sdkacltypes.ResourceType_ANY || resourceType == sdkacltypes.ResourceType_KV || resourceType == sdkacltypes.ResourceType_Mem {
continue
}
if _, ok := storeKeyAllResourceTypes[resourceType]; !ok {
panic(fmt.Sprintf("Missing resourceType=%s in the storekey to resource type prefix mapping", resourceType))
}
}

}
12 changes: 12 additions & 0 deletions app/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ func (app *App) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTx) abci.Respo
return app.BaseApp.DeliverTx(ctx, req)
}

// DeliverTxBatch is not part of the ABCI specification, but this is here for code convention
func (app *App) DeliverTxBatch(ctx sdk.Context, req sdk.DeliverTxBatchRequest) (res sdk.DeliverTxBatchResponse) {
defer metrics.MeasureDeliverBatchTxDuration(time.Now())
// ensure we carry the initial context from tracer here
ctx = ctx.WithTraceSpanContext(app.GetBaseApp().TracingInfo.GetContext())
spanCtx, span := app.GetBaseApp().TracingInfo.StartWithContext("DeliverTxBatch", ctx.TraceSpanContext())
defer span.End()
// update context with trace span new context
ctx = ctx.WithTraceSpanContext(spanCtx)
return app.BaseApp.DeliverTxBatch(ctx, req)
}

func (app *App) Commit(ctx context.Context) (res *abci.ResponseCommit, err error) {
if app.GetBaseApp().TracingInfo.BlockSpan != nil {
defer (*app.GetBaseApp().TracingInfo.BlockSpan).End()
Expand Down
Loading

0 comments on commit 2d7a3df

Please sign in to comment.