Skip to content

CCIP-5109 Add LBTC tokendata #801

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

Merged
merged 4 commits into from
May 12, 2025
Merged

CCIP-5109 Add LBTC tokendata #801

merged 4 commits into from
May 12, 2025

Conversation

bukata-sa
Copy link
Contributor

No description provided.

@bukata-sa bukata-sa requested a review from a team as a code owner April 4, 2025 14:34
@bukata-sa bukata-sa force-pushed the feature/tokendata_add_lbtc branch from b0b9439 to 879c8a3 Compare April 4, 2025 14:43
Copy link
Contributor

@dimkouv dimkouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly minor improvements and probably one performance issue.

@@ -39,6 +40,7 @@ type HTTPClient interface {
// https://developers.circle.com/stablecoins/reference/getattestation
// https://developers.circle.com/stablecoins/docs/transfer-usdc-on-testnet-from-ethereum-to-avalanche
Get(ctx context.Context, path string) (cciptypes.Bytes, HTTPStatus, error)
Post(ctx context.Context, path string, requestData cciptypes.Bytes) (cciptypes.Bytes, HTTPStatus, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this httpClient be part of tokenData/ package? isn't it a generic http lib? maybe as a followup / create a ticket to move it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This client is still coupled to attestation calls. More than that, Get - for USDC, Post - for LBTC
Need additional refactoring to generalize it away from token data

@@ -130,6 +132,27 @@ func (h *httpClient) Get(ctx context.Context, requestPath string) (cciptypes.Byt
return response, httpStatus, err
}

func (h *httpClient) Post(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general note: Would be nice to create separate PRs (e.g. to introduce Post/ in httpClient) to reduce review scope.

attestationStatusFailed AttestationStatus = "NOTARIZATION_STATUS_FAILED"
attestationStatusPending AttestationStatus = "NOTARIZATION_STATUS_PENDING"
attestationStatusSubmitted AttestationStatus = "NOTARIZATION_STATUS_SUBMITTED"
_ AttestationStatus = "NOTARIZATION_STATUS_SESSION_APPROVED"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this blank because compiler complains that it's not used?
Maybe include a link to docs here? and mention that there are more status that we don't use

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 not aware of any Lombard documentation with this API
With this const list, we have all statuses that Lombard produces, removing it from here brings uncertainty, don't you agree?

@@ -106,6 +106,19 @@ func (e *ExecuteOffchainConfig) IsUSDCEnabled() bool {
return false
}

func (e *ExecuteOffchainConfig) IsLBTCEnabled() bool {
for _, ob := range e.TokenDataObservers {
if ob.WellFormed() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe more simple to do:

if ob.WellFormed() != nil && ob.IsLBTC() {
   return true
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, but it should be

if ob.WellFormed() == nil && ob.IsLBTC() {
   return true
}

@dimkouv
Copy link
Contributor

dimkouv commented Apr 8, 2025

Is there a plan for e2e integration tests? can we have e2e integ tests?

@bukata-sa bukata-sa force-pushed the feature/tokendata_add_lbtc branch 2 times, most recently from e25ece3 to 73de19a Compare April 22, 2025 16:31
@bukata-sa bukata-sa force-pushed the feature/tokendata_add_lbtc branch from 73de19a to fde9ae3 Compare April 22, 2025 16:33
@bukata-sa
Copy link
Contributor Author

Is there a plan for e2e integration tests? can we have e2e integ tests?

https://smartcontract-it.atlassian.net/browse/CCIP-5745

@bukata-sa bukata-sa requested a review from dimkouv April 23, 2025 10:19
Copy link
Contributor

@dimkouv dimkouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving but I recommend getting another ✅
Also let's make sure the E2E tests properly cover this changes as a followup and include performance related tests.

@bukata-sa bukata-sa enabled auto-merge (squash) May 12, 2025 10:33
Copy link

Metric feature/tokendata_add_lbtc main
Coverage 72.7% 72.5%

@bukata-sa bukata-sa merged commit 9bb0640 into main May 12, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants