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 Feb 21, 2024
Merged
offchain - batch caller verbose errors and token pools fix#533dimkouv merged 14 commits intoccip-developfrom
dimkouv merged 14 commits intoccip-developfrom
Conversation
| 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 { |
Contributor
There was a problem hiding this comment.
Shouldn't we verify len(b) before calling call.abi.Unpack?
Contributor
There was a problem hiding this comment.
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.
core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go
Show resolved
Hide resolved
makramkd
reviewed
Feb 21, 2024
mateusz-sekara
approved these changes
Feb 21, 2024
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
1.0.0 Token pools do not have a
typeAndVersionmethod 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 tounpack errorsthat make the debugging process harder.Solution
1.0.0pools 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