-
Notifications
You must be signed in to change notification settings - Fork 104
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
1 parent
4fe6c7d
commit dddf6f8
Showing
17 changed files
with
1,118 additions
and
290 deletions.
There are no files selected for viewing
466 changes: 234 additions & 232 deletions
466
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 _117 from "./gogo"; | ||
export const gogoproto = { ..._117 | ||
import * as _118 from "./gogo"; | ||
export const gogoproto = { ..._118 | ||
}; |
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 _118 from "./api/annotations"; | ||
import * as _119 from "./api/http"; | ||
import * as _120 from "./protobuf/descriptor"; | ||
import * as _121 from "./protobuf/duration"; | ||
import * as _122 from "./protobuf/timestamp"; | ||
import * as _123 from "./protobuf/any"; | ||
import * as _119 from "./api/annotations"; | ||
import * as _120 from "./api/http"; | ||
import * as _121 from "./protobuf/descriptor"; | ||
import * as _122 from "./protobuf/duration"; | ||
import * as _123 from "./protobuf/timestamp"; | ||
import * as _124 from "./protobuf/any"; | ||
export namespace google { | ||
export const api = { ..._118, | ||
..._119 | ||
export const api = { ..._119, | ||
..._120 | ||
}; | ||
export const protobuf = { ..._120, | ||
..._121, | ||
export const protobuf = { ..._121, | ||
..._122, | ||
..._123 | ||
..._123, | ||
..._124 | ||
}; | ||
} |
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.