-
Notifications
You must be signed in to change notification settings - Fork 3
Decay V2 - Mev-commit portion #231
base: main
Are you sure you want to change the base?
Conversation
ckartik
commented
Apr 4, 2024
- Adds new interface to the provider RPC to send over the timestamp:
- Adds a current timestamp to the commitment.
Still need to update the contract, but would appreciate if you could review what I've got so far @aloknerurkar, especially the RPC portion. |
@@ -181,6 +181,10 @@ definitions: | |||
type: string | |||
format: int64 | |||
description: Timestamp at which the bid ends decaying. | |||
decayPublishTimestamp: |
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.
decayPublishTimestamp doesnt seem to be a good name. I cannot understand anything from the name. It think it might be better to call it just ProviderTimestamp or ProviderCommitmentTimestamp
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.
we can chat about naming in slack
statusC <- t.status | ||
) (chan providerapi.ProcessedBidResponse, error) { | ||
statusC := make(chan providerapi.ProcessedBidResponse, 1) | ||
statusC <- providerapi.ProcessedBidResponse{t.status, t.timestamp} |
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.
This govet issue needs to be handled
case providerapiv1.BidResponse_STATUS_REJECTED: | ||
return status.Errorf(codes.Internal, "bid rejected") | ||
case providerapiv1.BidResponse_STATUS_ACCEPTED: | ||
preConfirmation, err := p.signer.ConstructPreConfirmation(bid) | ||
preConfirmation, err := p.signer.ConstructPreConfirmation(bid, st.PublishedTimestamp) |
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 timestamp is being used just for generating signature, but is not sent to the contract. How is it going to be used for calculating decay in oracle?
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.
I still need to update the contracts to take in the decay commitment timestamp.
rpc/bidderapi/v1/bidderapi.proto
Outdated
@@ -159,4 +159,7 @@ message Commitment { | |||
int64 decay_end_timestamp = 10 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | |||
description: "Timestamp at which the bid ends decaying." | |||
}]; | |||
int64 decay_publish_timestamp = 11 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { |
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.
Again, I dont like this name. Decay is not being published.
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.
I'm going to change it to dispatch timestamp.