Skip to content

Commit

Permalink
Revert "feat: make PML compatible with OE by staging in-memory CLOB s…
Browse files Browse the repository at this point in the history
…ide effects (backport #2447)" (#2469)
  • Loading branch information
teddyding authored Oct 3, 2024
1 parent e905175 commit 4e2925f
Show file tree
Hide file tree
Showing 28 changed files with 412 additions and 1,029 deletions.
516 changes: 257 additions & 259 deletions indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts

Large diffs are not rendered by default.

This file was deleted.

4 changes: 2 additions & 2 deletions indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import * as _129 from "./gogo";
export const gogoproto = { ..._129
import * as _128 from "./gogo";
export const gogoproto = { ..._128
};
22 changes: 11 additions & 11 deletions indexer/packages/v4-protos/src/codegen/google/bundle.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import * as _130 from "./api/annotations";
import * as _131 from "./api/http";
import * as _132 from "./protobuf/descriptor";
import * as _133 from "./protobuf/duration";
import * as _134 from "./protobuf/timestamp";
import * as _135 from "./protobuf/any";
import * as _129 from "./api/annotations";
import * as _130 from "./api/http";
import * as _131 from "./protobuf/descriptor";
import * as _132 from "./protobuf/duration";
import * as _133 from "./protobuf/timestamp";
import * as _134 from "./protobuf/any";
export namespace google {
export const api = { ..._130,
..._131
export const api = { ..._129,
..._130
};
export const protobuf = { ..._132,
export const protobuf = { ..._131,
..._132,
..._133,
..._134,
..._135
..._134
};
}
16 changes: 0 additions & 16 deletions proto/dydxprotocol/clob/finalize_block.proto

This file was deleted.

17 changes: 2 additions & 15 deletions protocol/mocks/MemClob.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions protocol/testutil/keeper/clob.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func CreateTestClobPairs(
clobPairs []types.ClobPair,
) {
for _, clobPair := range clobPairs {
_, err := clobKeeper.CreatePerpetualClobPairAndMemStructs(
_, err := clobKeeper.CreatePerpetualClobPair(
ctx,
clobPair.Id,
clobPair.MustGetPerpetualId(),
Expand Down Expand Up @@ -341,7 +341,7 @@ func CreateNClobPair(
),
).Return()

_, err := keeper.CreatePerpetualClobPairAndMemStructs(
_, err := keeper.CreatePerpetualClobPair(
ctx,
items[i].Id,
clobtest.MustPerpetualId(items[i]),
Expand Down
6 changes: 0 additions & 6 deletions protocol/x/clob/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ func Precommit(
ctx sdk.Context,
keeper keeper.Keeper,
) {
// Process all staged finalize block events, and apply necessary side effects
// (e.g. MemClob orderbook creation) that could not be done during FinalizeBlock.
// Note: this must be done in `Precommit` which is prior to `PrepareCheckState`, when
// MemClob could access the new orderbooks.
keeper.ProcessStagedFinalizeBlockEvents(ctx)

if streamingManager := keeper.GetFullNodeStreamingManager(); !streamingManager.Enabled() {
return
}
Expand Down
6 changes: 3 additions & 3 deletions protocol/x/clob/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func TestEndBlocker_Success(t *testing.T) {
),
),
).Once().Return()
_, err = ks.ClobKeeper.CreatePerpetualClobPairAndMemStructs(
_, err = ks.ClobKeeper.CreatePerpetualClobPair(
ctx,
constants.ClobPair_Btc.Id,
clobtest.MustPerpetualId(constants.ClobPair_Btc),
Expand Down Expand Up @@ -563,7 +563,7 @@ func TestEndBlocker_Success(t *testing.T) {
),
),
).Once().Return()
_, err = ks.ClobKeeper.CreatePerpetualClobPairAndMemStructs(
_, err = ks.ClobKeeper.CreatePerpetualClobPair(
ctx,
constants.ClobPair_Eth.Id,
clobtest.MustPerpetualId(constants.ClobPair_Eth),
Expand Down Expand Up @@ -1170,7 +1170,7 @@ func TestPrepareCheckState(t *testing.T) {

// Create all CLOBs.
for _, clobPair := range tc.clobs {
_, err = ks.ClobKeeper.CreatePerpetualClobPairAndMemStructs(
_, err = ks.ClobKeeper.CreatePerpetualClobPair(
ctx,
clobPair.Id,
clobtest.MustPerpetualId(clobPair),
Expand Down
2 changes: 1 addition & 1 deletion protocol/x/clob/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func InitGenesis(ctx sdk.Context, k *keeper.Keeper, genState types.GenesisState)
if err != nil {
panic(errorsmod.Wrap(types.ErrInvalidClobPairParameter, err.Error()))
}
_, err = k.CreatePerpetualClobPairAndMemStructs(
_, err = k.CreatePerpetualClobPair(
ctx,
elem.Id,
perpetualId,
Expand Down
Loading

0 comments on commit 4e2925f

Please sign in to comment.