Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

offchain - batch caller verbose errors and token pools fix#533

Merged
dimkouv merged 14 commits intoccip-developfrom
dk/batch-call-and-token-pools
Feb 21, 2024
Merged

offchain - batch caller verbose errors and token pools fix#533
dimkouv merged 14 commits intoccip-developfrom
dk/batch-call-and-token-pools

Conversation

@dimkouv
Copy link
Contributor

@dimkouv dimkouv commented Feb 20, 2024

Motivation

  • 1.0.0 Token pools do not have a typeAndVersion method which leaded to rpc call failures.

  • Also in this scenario the rpc does not reply with an error but with an empty response "" or "0x" which leads to unpack errors that make the debugging process harder.

Solution

  • Detect 1.0.0 pools by proper error handling of the empty response errors.

This PR introduces wETH transfers via a LockUnlock 1.0.0 token pool in the integration test. While implementing this, we cleaned up a lot of code that wasn't needed like manual price updates on the destination chain. The commit plugin will update the prices. This PR improves the coverage of our integration test by adding

  • multiple token tx
  • 1.0.0 token pools
  • dest price updates through commitStore
  • multiple priced assets
  • lockUnlock token pools

@dimkouv dimkouv requested a review from a team as a code owner February 20, 2024 14:05
@dimkouv dimkouv requested a review from RensR February 20, 2024 14:05
@dimkouv dimkouv requested a review from makramkd February 21, 2024 11:11
unpackedOutputs, err := call.abi.Unpack(call.methodName, b)
if err != nil {
return nil, fmt.Errorf("unpack result %s: %w", call, err)
if len(b) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we verify len(b) before calling call.abi.Unpack?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we ever call such functions but I think technically this may not be correct, e.g if you had a function like:

function emptyView() external view {
    // do nothing
}

This compiles just fine - basically a view function that will legitimately return 0x. The abi unpack will not error out in this case.

@dimkouv dimkouv merged commit f219100 into ccip-develop Feb 21, 2024
@dimkouv dimkouv deleted the dk/batch-call-and-token-pools branch February 21, 2024 17:03
asoliman92 pushed a commit that referenced this pull request Jul 31, 2024
## Motivation

- 1.0.0 Token pools do not have a `typeAndVersion` method which leaded
to rpc call failures.

- Also in this scenario the rpc does not reply with an error but with an
empty response `""` or `"0x"` which leads to `unpack errors` that make
the debugging process harder.

## Solution

- Detect `1.0.0` pools by proper error handling of the empty response
errors.



This PR introduces wETH transfers via a LockUnlock 1.0.0 token pool in
the integration test. While implementing this, we cleaned up a lot of
code that wasn't needed like manual price updates on the destination
chain. The commit plugin will update the prices. This PR improves the
coverage of our integration test by adding

- multiple token tx
- 1.0.0 token pools
- dest price updates through commitStore
- multiple priced assets
- lockUnlock token pools

---------

Co-authored-by: Rens Rooimans <github@rensrooimans.nl>
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.

4 participants