Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Decay V2 - Mev-commit portion #231

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Decay V2 - Mev-commit portion #231

wants to merge 10 commits into from

Conversation

ckartik
Copy link
Contributor

@ckartik ckartik commented Apr 4, 2024

  • Adds new interface to the provider RPC to send over the timestamp:
    Decay Overview - origin of timestamp
  • Adds a current timestamp to the commitment.

@ckartik
Copy link
Contributor Author

ckartik commented Apr 4, 2024

Still need to update the contract, but would appreciate if you could review what I've got so far @aloknerurkar, especially the RPC portion.

@ckartik ckartik requested a review from aloknerurkar April 4, 2024 17:29
@ckartik ckartik changed the title Decay V2 - Mev-commit part Decay V2 - Mev-commit portion Apr 4, 2024
@@ -181,6 +181,10 @@ definitions:
type: string
format: int64
description: Timestamp at which the bid ends decaying.
decayPublishTimestamp:
Copy link
Contributor

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

Copy link
Contributor Author

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}
Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@@ -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) = {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@ckartik ckartik requested a review from aloknerurkar April 9, 2024 18:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants