-
Notifications
You must be signed in to change notification settings - Fork 104
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
enable sending BpMevMatches and ProposalReceiveTime to MEV indexer #840
Conversation
WalkthroughThe updates across various files indicate an expansion of the Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (1)
- protocol/x/clob/types/mev.pb.go
Files selected for processing (2)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/mev.ts (6 hunks)
- proto/dydxprotocol/clob/mev.proto (1 hunks)
Additional comments: 7
indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/mev.ts (6)
94-99: The addition of
bpMevMatches
andproposalReceiveTime
to theMevNodeToNodeMetrics
interface aligns with the PR objectives to include these properties for MEV indexing.105-110: The addition of
bp_mev_matches
andproposal_receive_time
to theMevNodeToNodeMetricsSDKType
interface aligns with the PR objectives to include these properties for MEV indexing.452-458: The
createBaseMevNodeToNodeMetrics
function has been correctly updated to initialize the new propertiesbpMevMatches
andproposalReceiveTime
.468-477: The encoding logic for
MevNodeToNodeMetrics
has been correctly updated to include the new propertiesbpMevMatches
andproposalReceiveTime
.496-504: The decoding logic for
MevNodeToNodeMetrics
has been correctly updated to include the new propertiesbpMevMatches
andproposalReceiveTime
.517-522: The
fromPartial
method forMevNodeToNodeMetrics
has been correctly updated to handle the new propertiesbpMevMatches
andproposalReceiveTime
.proto/dydxprotocol/clob/mev.proto (1)
- 57-62: The changes from lines 57 to 62 correctly introduce the new fields
bp_mev_matches
andproposal_receive_time
to theMevNodeToNodeMetrics
message as described in the PR objectives and the AI-generated summaries. Ensure that all dependent systems that consume or produceMevNodeToNodeMetrics
messages are updated to handle these new fields.
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.
MevNodeToNode: types.MevNodeToNodeMetrics{ | ||
ValidatorMevMatches: validatorMevMatches, | ||
ClobMidPrices: mevClobMidPrices, | ||
BpMevMatches: blockProposerMevMatches, | ||
ProposalReceiveTime: uint64(time.Now().Second()), | ||
}, |
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.
The ProposalReceiveTime
is being set to the current second using time.Now().Second()
. This may not provide a granular enough timestamp for some use cases, as it will only capture the second part of the current time, not the full timestamp. Consider using time.Now().UnixNano()
to capture a more precise timestamp in nanoseconds since the Unix epoch.
- ProposalReceiveTime: uint64(time.Now().Second()),
+ ProposalReceiveTime: uint64(time.Now().UnixNano()),
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
MevNodeToNode: types.MevNodeToNodeMetrics{ | |
ValidatorMevMatches: validatorMevMatches, | |
ClobMidPrices: mevClobMidPrices, | |
BpMevMatches: blockProposerMevMatches, | |
ProposalReceiveTime: uint64(time.Now().Second()), | |
}, | |
MevNodeToNode: types.MevNodeToNodeMetrics{ | |
ValidatorMevMatches: validatorMevMatches, | |
ClobMidPrices: mevClobMidPrices, | |
BpMevMatches: blockProposerMevMatches, | |
ProposalReceiveTime: uint64(time.Now().UnixNano()), | |
}, |
Changelist
Duplicate of #832, but committed from my account so that the commits are signed.
Also updated indexer protos to fix indexer proto verification workflow.
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.