Skip to content
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

Update default rate limit and cleanup comments #1558

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata/http"
)

// TODO: double check the validty of default values for lombard's API after checking docs
const (
apiVersion = "v1"
attestationPath = "deposits/getByHash"
Expand All @@ -35,8 +34,8 @@ const (
maxCoolDownDuration = 10 * time.Minute

// defaultRequestInterval defines the rate in requests per second that the attestation API can be called.
// this is set according to the APIs documentated 10 requests per second rate limit.
defaultRequestInterval = 100 * time.Millisecond
// this is set according to the APIs recommended 1 request per second rate limit.
defaultRequestInterval = 1000 * time.Millisecond
NourElRashidy marked this conversation as resolved.
Show resolved Hide resolved

// APIIntervalRateLimitDisabled is a special value to disable the rate limiting.
APIIntervalRateLimitDisabled = -1
Expand Down Expand Up @@ -74,10 +73,9 @@ type TokenDataReader struct {
type messageAttestationResponse struct {
MessageHash string `json:"message_hash"`
Status attestationStatus `json:"status"`
Attestation string `json:"attestation"` // Attestation represented by abi.encode(payload, proof)
Attestation string `json:"attestation,omitempty"` // Attestation represented by abi.encode(payload, proof)
}

// TODO: Adjust after checking API docs
type attestationRequest struct {
PayloadHashes []string `json:"messageHash"`
}
Expand All @@ -86,8 +84,6 @@ type attestationResponse struct {
Attestations []messageAttestationResponse `json:"attestations"`
}

// TODO: Implement encoding/decoding

type sourceTokenData struct {
SourcePoolAddress []byte
DestTokenAddress []byte
Expand Down
Loading