Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR is mainly focussed on the CCIP side of self serve token pools. Some additional contracts had to be written/changed, but in review, please focus on the CCIP & token pool side of self serve, not on the TokenAdminRegistry. Considerations - Token pools are now considered hostile - This goes for both in- and output - Source side - Call to `sourcePool.lockOrBurn` from the onRamp - Does not strictly have to be through a callWithExactGas call, as CCIP is not paying for gas used here - Same for return data bomb - It returns the destPool and optional extraData - DestPool has to be checked for length to mitigate the risk of return data bombs through this field - Since the onRamp is EVM2EVM, we can assume the address is an abi.encoded(address) and therefore 32 bytes - ExtraData is checked like it was before - Dest side - We used to make a call to `getToken` - Since this would be a hostile call, and require the full callWithExactGas protection, we opted to fold this getter into the `releaseOrMint` call. This saves a significant amount of gas, and makes sure we only have to do a single call to the hostile contract. - We call `releaseOrMint` on the `pool` provided on the source side - The pool data is considered hostile, as it came from an untrusted source - We need to ensure the address is valid and it contains a contract - The releaseOrMint call was already done through callWithExactGas This brings the number of onchain calls to token pools to 2 per transferred token: one on the source chain and one on the destination. This is the absolute minimum possible. Reviews for this PR should focus on - Hostile token pool interactions - DoS - Unusual reverts - Gas bombs - Return data bombs - The changes to CCIP and their impact on the security and availability of the protocol Please do not focus on - The TokenAdminRegistry, except for things that would impact the changed CCIP design # TODO Onchain: - Add the tag to the return data and check for it (next PR) - Use default price for tokens that don't have a config (next PR) Offchain - Add 1.4 lane logic to integration test? --------- Co-authored-by: Anindita Ghosh <[email protected]>
- Loading branch information