-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OTE-456] FNS x OE: stage
FinalizeBlock
events and emit in `Precomm…
…it` (#2253)
- Loading branch information
Showing
17 changed files
with
1,132 additions
and
304 deletions.
There are no files selected for viewing
494 changes: 248 additions & 246 deletions
494
indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
Large diffs are not rendered by default.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/streaming.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { StreamOrderbookFill, StreamOrderbookFillSDKType } from "./query"; | ||
import { StreamSubaccountUpdate, StreamSubaccountUpdateSDKType } from "../subaccounts/streaming"; | ||
import * as _m0 from "protobufjs/minimal"; | ||
import { DeepPartial } from "../../helpers"; | ||
/** StagedFinalizeBlockEvent is an event staged during `FinalizeBlock`. */ | ||
|
||
export interface StagedFinalizeBlockEvent { | ||
orderFill?: StreamOrderbookFill; | ||
subaccountUpdate?: StreamSubaccountUpdate; | ||
} | ||
/** StagedFinalizeBlockEvent is an event staged during `FinalizeBlock`. */ | ||
|
||
export interface StagedFinalizeBlockEventSDKType { | ||
order_fill?: StreamOrderbookFillSDKType; | ||
subaccount_update?: StreamSubaccountUpdateSDKType; | ||
} | ||
|
||
function createBaseStagedFinalizeBlockEvent(): StagedFinalizeBlockEvent { | ||
return { | ||
orderFill: undefined, | ||
subaccountUpdate: undefined | ||
}; | ||
} | ||
|
||
export const StagedFinalizeBlockEvent = { | ||
encode(message: StagedFinalizeBlockEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.orderFill !== undefined) { | ||
StreamOrderbookFill.encode(message.orderFill, writer.uint32(10).fork()).ldelim(); | ||
} | ||
|
||
if (message.subaccountUpdate !== undefined) { | ||
StreamSubaccountUpdate.encode(message.subaccountUpdate, writer.uint32(18).fork()).ldelim(); | ||
} | ||
|
||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): StagedFinalizeBlockEvent { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseStagedFinalizeBlockEvent(); | ||
|
||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
|
||
switch (tag >>> 3) { | ||
case 1: | ||
message.orderFill = StreamOrderbookFill.decode(reader, reader.uint32()); | ||
break; | ||
|
||
case 2: | ||
message.subaccountUpdate = StreamSubaccountUpdate.decode(reader, reader.uint32()); | ||
break; | ||
|
||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
|
||
return message; | ||
}, | ||
|
||
fromPartial(object: DeepPartial<StagedFinalizeBlockEvent>): StagedFinalizeBlockEvent { | ||
const message = createBaseStagedFinalizeBlockEvent(); | ||
message.orderFill = object.orderFill !== undefined && object.orderFill !== null ? StreamOrderbookFill.fromPartial(object.orderFill) : undefined; | ||
message.subaccountUpdate = object.subaccountUpdate !== undefined && object.subaccountUpdate !== null ? StreamSubaccountUpdate.fromPartial(object.subaccountUpdate) : undefined; | ||
return message; | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import * as _127 from "./gogo"; | ||
export const gogoproto = { ..._127 | ||
import * as _128 from "./gogo"; | ||
export const gogoproto = { ..._128 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import * as _128 from "./api/annotations"; | ||
import * as _129 from "./api/http"; | ||
import * as _130 from "./protobuf/descriptor"; | ||
import * as _131 from "./protobuf/duration"; | ||
import * as _132 from "./protobuf/timestamp"; | ||
import * as _133 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 = { ..._128, | ||
..._129 | ||
export const api = { ..._129, | ||
..._130 | ||
}; | ||
export const protobuf = { ..._130, | ||
..._131, | ||
export const protobuf = { ..._131, | ||
..._132, | ||
..._133 | ||
..._133, | ||
..._134 | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
package dydxprotocol.clob; | ||
|
||
import "dydxprotocol/subaccounts/streaming.proto"; | ||
import "dydxprotocol/clob/query.proto"; | ||
|
||
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; | ||
|
||
// StagedFinalizeBlockEvent is an event staged during `FinalizeBlock`. | ||
message StagedFinalizeBlockEvent { | ||
// Contains one of StreamOrderbookFill, StreamSubaccountUpdate. | ||
oneof event { | ||
StreamOrderbookFill order_fill = 1; | ||
dydxprotocol.subaccounts.StreamSubaccountUpdate subaccount_update = 2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package streaming | ||
|
||
// Constants for FullNodeStreamingManager. | ||
const ( | ||
// Transient store key for storing staged events. | ||
StreamingManagerTransientStoreKey = "tmp_streaming" | ||
|
||
// Key for storing the count of staged events. | ||
StagedEventsCountKey = "EvtCnt" | ||
|
||
// Key prefix for staged events. | ||
StagedEventsKeyPrefix = "Evt:" | ||
) |
Oops, something went wrong.