- 
                Notifications
    You must be signed in to change notification settings 
- Fork 75
feat: EVM changes required to support Solana #672
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
Conversation
* feat(chain-adapters): add solana adapter Signed-off-by: Reinis Martinsons <reinis@umaproject.org> * fix: comments Signed-off-by: Reinis Martinsons <reinis@umaproject.org> * test: solana adapter Signed-off-by: Reinis Martinsons <reinis@umaproject.org> * Update contracts/chain-adapters/Solana_Adapter.sol Co-authored-by: Chris Maree <christopher.maree@gmail.com> * fix: do not hash bytes32 svm address Signed-off-by: Reinis Martinsons <reinis@umaproject.org> --------- Signed-off-by: Reinis Martinsons <reinis@umaproject.org> Co-authored-by: Chris Maree <christopher.maree@gmail.com>
* feat: add address to bytes32 contract changes Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * refactor: remove todos Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * refactor: imports Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * Update contracts/SpokePool.sol Co-authored-by: Reinis Martinsons <77973553+Reinis-FRP@users.noreply.github.com> * feat: bytes 32 comparisons Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * refactor: format code Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * fix: tests Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: bytes 32 check Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * fix: ts Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: reuse lib in cctp adapter Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: _preExecuteLeafHook Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * refactor: comments Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: _verifyUpdateV3DepositMessage Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: backward compatibility Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: backwards compatibility tests Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: change comparison casting address bytes32 Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * fix: test Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: merkle tree leaf to bytes32 Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * test: leaf type update fixes Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: remove helper Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> --------- Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> Co-authored-by: Reinis Martinsons <77973553+Reinis-FRP@users.noreply.github.com>
* WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> --------- Signed-off-by: chrismaree <christopher.maree@gmail.com>
* WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> --------- Signed-off-by: chrismaree <christopher.maree@gmail.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is very clean, amazing work that you all should be very happy with. I left some questions and will take a second pass once we go through them all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome! Left a few questions to start. Still working my way through
| */ | ||
|  | ||
| // solhint-disable-next-line contract-name-camelcase | ||
| contract Solana_Adapter is AdapterInterface, CircleCCTPAdapter { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much of this contract is specific to Solana vs could be used with any chain we connect to via CCTP?
I haven't gone deep on the specifics, but, for instance, can we build an adapter that could be used just as well with an EVM chain like BSC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is quite specific in a sense that it must be aware of Solana token model where recipient SpokePool address needs to be translated to its corresponding vault token address.
| return | ||
| abi.encodeWithSignature( | ||
| "setEnableRoute(bytes32,uint64,bool)", | ||
| SOLANA_USDC_BYTES32, | ||
| uint64(destinationChainId), | ||
| enable | ||
| ); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOC, why not do this mapping on the Solana side?
In theory, could we not have a mapping (from truncated address to full address) exist on the Solana side that could be modified by an admin call. Then, the flow to add a new token would require no contract changes:
- Send admin call to update the mapping with a new element.
- Add the route to use the newly added element.
Side note: this is somewhat similar to something we have to do on arbitrum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to map truncated USDC address to Solana spoke pool vault here to support relayTokens method used when rebalancing from HubPool to Solana spoke via CCTP token bridge. So if we were to add new token we would anyways need to redeploy the adapter, hence it is easier to keep all related aliasing contained in this contract.
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
…873) * fix: update legacy event to match old event signature Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * WIP Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * WIP Signed-off-by: Matt Rice <matthewcrice32@gmail.com> --------- Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
) * fix: hash entire message when calculating relay hash for evm chains Signed-off-by: bennett <bennett@umaproject.org> * make getV3RelayHash public Signed-off-by: bennett <bennett@umaproject.org> * update fixture with relay hash change Signed-off-by: bennett <bennett@umaproject.org> --------- Signed-off-by: bennett <bennett@umaproject.org>
* feat(SpokePool): Permit historical fillDeadline on deposit This removes a sharp edge for pre-fill deposits, where the deposit comes after the fill. Permitting a historical fillDeadline gives more flexibility to the relayer around when they submit the deposit on the origin chain. * fix test * restore test * Bump approvals
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
* fix: L02 _destinationSettler Can Return Zero Address * updated implementation to be in internal function Signed-off-by: Chris Maree <christopher.maree@gmail.com> --------- Signed-off-by: Chris Maree <christopher.maree@gmail.com> Co-authored-by: Chris Maree <christopher.maree@gmail.com> Co-authored-by: nicholaspai <npai.nyc@gmail.com>
* fix: hash entire message when calculating relay hash for evm chains Signed-off-by: bennett <bennett@umaproject.org> * make getV3RelayHash public Signed-off-by: bennett <bennett@umaproject.org> * update fixture with relay hash change Signed-off-by: bennett <bennett@umaproject.org> * improve: Verify relay hashes are the same pre and post upgrade Adds a simple unit test to check that the same data hash is constructed * fix * Update test/evm/hardhat/MerkleLib.Proofs.ts * Update test/evm/hardhat/SpokePool.Relay.ts * Update SpokePool.Relay.ts --------- Signed-off-by: bennett <bennett@umaproject.org> Co-authored-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
| No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request | 
This is a feature branch where we will place all changes needed to be applied to the EVM to support Solana within across.
This branch contains 4 main categories of changes (each of which was originally a separate PR before moving them into this feature branch):
fillmethod. As a relayer will now have a separate address on EVM & SVM, they need the ability to inform the data worker where to be re-paid on the new domain.relayerRefundis added that stores refunds that could not be executed due to reverting transfers. Relayers can then claim these separately, provided they can prove they own the original blocked address.