-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OTE-456] FNS x OE: stage FinalizeBlock
events and emit in Precommit
#2253
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ( | ||
teddyding marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the missing import file.
The import statement
import "dydxprotocol/subaccounts/streaming.proto";
references a file that does not exist, according to the static analysis hints. This could lead to compilation errors.Please ensure that the file
dydxprotocol/subaccounts/streaming.proto
exists in the specified location. If you need assistance resolving this issue, I'd be happy to help. Let me know if you'd like me to open a GitHub issue to track this task.Tools
buf