Skip to content

Commit

Permalink
[STAB-32] Push CheckTx concurrency into protocol
Browse files Browse the repository at this point in the history
This pushes locking slightly closer to the CLOB ante decorator hopefully allowing for protocol to control parallelism more finely in the future.
  • Loading branch information
lcwik committed Jan 31, 2024
1 parent e06aea3 commit 19e4784
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions protocol/app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app

import (
errorsmod "cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
Expand Down Expand Up @@ -68,6 +69,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
// NewAnteDecoratorChain returns a list of AnteDecorators in the expected application chain ordering
func NewAnteDecoratorChain(options HandlerOptions) []sdk.AnteDecorator {
return []sdk.AnteDecorator{
baseapp.NewLockAndCacheContextAnteDecorator(),
// Note: app-injected messages, and clob transactions don't require Gas fees.
libante.NewAppInjectedMsgAnteWrapper(
clobante.NewSingleMsgClobTxAnteWrapper(
Expand Down
1 change: 1 addition & 0 deletions protocol/app/ante_whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func TestAnteHandlerChainOrder_Valid(t *testing.T) {
decoratorTypes := humanReadableDecoratorTypes(decoratorChain)

expectedDecoratorTypes := []string{
"baseapp.lockAndCacheContextDecorator",
"ante.AppInjectedMsgAnteWrapper(ante.SingleMsgClobTxAnteWrapper(ante.SetUpContextDecorator))",
"ante.FreeInfiniteGasDecorator",
"ante.RejectExtensionOptionsDecorator",
Expand Down
2 changes: 1 addition & 1 deletion protocol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ replace (
// Use dYdX fork of CometBFT
github.com/cometbft/cometbft => github.com/dydxprotocol/cometbft v0.38.3-0.20231204185009-5e6c4b6d67b8
// Use dYdX fork of Cosmos SDK
github.com/cosmos/cosmos-sdk => github.com/dydxprotocol/cosmos-sdk v0.50.4-0.20240126201553-f1da3a9865bb
github.com/cosmos/cosmos-sdk => github.com/dydxprotocol/cosmos-sdk v0.50.4-0.20240131213748-50ac18b7938f
)

replace (
Expand Down
4 changes: 2 additions & 2 deletions protocol/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQx
github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/dydxprotocol/cometbft v0.38.3-0.20231204185009-5e6c4b6d67b8 h1:zmH6go7DRhFcQHoiN/rQ1INaAelp01VUPUTSqSDJsAU=
github.com/dydxprotocol/cometbft v0.38.3-0.20231204185009-5e6c4b6d67b8/go.mod h1:KQ8mOea6U2satQbGe2WjxBopa8mGgHatMKS9sQsJ6uY=
github.com/dydxprotocol/cosmos-sdk v0.50.4-0.20240126201553-f1da3a9865bb h1:pL998nZ1vEbER/66yiCjoFFoYDeWNyKbSoR481eHU/I=
github.com/dydxprotocol/cosmos-sdk v0.50.4-0.20240126201553-f1da3a9865bb/go.mod h1:y+5fRLbztsvx6GHBVXPlgM51ZpuNd8M7y4YEAQNnTPU=
github.com/dydxprotocol/cosmos-sdk v0.50.4-0.20240131213748-50ac18b7938f h1:FbOi21JZ2fe+GaT2xmcMq7hgLLcy6t0nZ/R0/GQ3N0I=
github.com/dydxprotocol/cosmos-sdk v0.50.4-0.20240131213748-50ac18b7938f/go.mod h1:y+5fRLbztsvx6GHBVXPlgM51ZpuNd8M7y4YEAQNnTPU=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-resiliency v1.3.0 h1:RRL0nge+cWGlxXbUzJ7yMcq6w2XBEr19dCN6HECGaT0=
github.com/eapache/go-resiliency v1.3.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho=
Expand Down

0 comments on commit 19e4784

Please sign in to comment.