-
Notifications
You must be signed in to change notification settings - Fork 75
feat(chain-adapters): add solana adapter #641
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
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
| error InvalidRelayMessageTarget(address target); | ||
| error InvalidOriginToken(address originToken); | ||
| error InvalidDestinationChainId(uint256 destinationChainId); | ||
|
|
||
| // Custom errors for relayTokens validation. | ||
| error InvalidL1Token(address l1Token); | ||
| error InvalidL2Token(address l2Token); | ||
| error InvalidAmount(uint256 amount); | ||
| error InvalidTokenRecipient(address to); |
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.
I used these for debugging, though HubPool does not bubble up revert data on delegatecall. Shall we still keep custom errors or revert with empty data at the adapter?
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.
I think they are ok to have adapter specific errors? if there are other errors that other adapters re-use we should cleary use them but things like InvalidCctpTokenMessenger only apply in this context.
| * @dev Posted officially here: https://developers.circle.com/stablecoins/docs/evm-smart-contracts | ||
| */ | ||
| // solhint-disable-next-line immutable-vars-naming | ||
| IMessageTransmitter public immutable cctpMessageTransmitter; |
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 more belongs to CircleCCTPAdapter, though that would require passing it in constructor for all other adapters that don't use CCTP for general message transmission.
| */ | ||
|
|
||
| // 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.
nit: is this a "Solana_Adapter" or it is better called "Cctp_Adapter"?
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 includes logic specific to Solana, e.g. how setEnableRoute is translated. I was though considering to move cctpMessageTransmitter to base CircleCCTPAdapter, but that would have required adding it to constructor for all other adapters that don't use CCTP for general message transmission.
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.
that's fair enough. given we already have the CircleCCTPAdapter within this repo I agree this naming structure makes the most sence.
| bytes32 solanaSpokePool, | ||
| bytes32 solanaUsdc, | ||
| bytes32 solanaSpokePoolUsdcVault |
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.
nit: it might be easier/cleaner/simpler/more consistant to just have these hard coded as constants, as done in some of the other adapters.
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.
I left them as immutables so that its easier to test integration flow on testnets that would have different USDC and we don't have a proper authority for the spoke yet.
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.
right. I dont think we're going to be doing too much testnet work (mainly better for a lot of these flows to test directly on mainnet) but fair enough that it makes it easier to change.
| * @param message Data to send to target. | ||
| */ | ||
| function relayMessage(address target, bytes calldata message) external payable override { | ||
| if (target != SOLANA_SPOKE_POOL_ADDRESS) { |
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.
what is the downside with letting this target non spoke pool address?
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.
Having it hardcoded potentially limits flexibility for future updates or use cases. Maybe we can add a setter or remove the check if not strictly required as @chrismaree is exploring.
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 accepts target address that must be translated to bytes32, but since we don't have translation mapping for any other target then obviously the caller has been misconfigured.
As for updates, I understand the general pattern for these adapters is to have them immutable and upgrade by redeploying and updating the instance in HubPool.
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.
@Reinis-FRP that's a good point. this is not a generic adapter as a result of the encoding so there is no situation where you should ever be passing in anything other than a known target address. if you are, you're doing something wrong and it should error. I agree with leaving it like this.
| } | ||
|
|
||
| bytes4 selector = bytes4(message[:4]); | ||
| if (selector == SpokePoolInterface.setEnableRoute.selector) { |
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 is great. it's nice that we only need to worry about one selector as the others are bool.
| if (amount > type(uint64).max) { | ||
| revert InvalidAmount(amount); | ||
| } | ||
| if (to != SOLANA_SPOKE_POOL_ADDRESS) { |
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.
similar comment to before: if the to is not the spoke address, it in theory is ok?
I agree constraining the execution flow is properly better but in theory there is no issue not having this require, right?
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 don't have recipient ATA for any other than spoke. If this does not match then the caller has been misconfigured, so better to block it here.
| const solanaChainId = 1234567890; // TODO: Decide how to represent Solana in Across as it does not have a chainId. | ||
| const solanaDomainId = 5; | ||
|
|
||
| describe("Solana Chain Adapter", function () { |
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 is great
| solanaSpokePoolAddress: string, | ||
| solanaUsdcAddress: string; | ||
|
|
||
| const solanaChainId = 1234567890; // TODO: Decide how to represent Solana in Across as it does not have a chainId. |
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.
ye, we likely should decide this now.
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 should not clash with any future EVM we might need to support and should fit in u64 as max supported on Solana. So one option is to use 8 bytes from the hashed cluster name. E.g. uint64(uint256(keccak256(abi.encodePacked("solana-mainnet")))) is 11938232455623604379
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.
uint64(uint256(keccak256(abi.encodePacked("solana-mainnet"))) is great. this is pretty much exactly what we've wanted from the start and I think is a good structure to use.
it's a bit irritating that we've got two notions of "chainId" now; the "across-standard" which is EVM first and then our own definition of non-evm chains (such as this solana chainId) and then internal CCTP chain IDs, where solana is 5.
| * @param target Program on Solana (translated as EVM address) that will receive message. | ||
| * @param message Data to send to target. | ||
| */ | ||
| function relayMessage(address target, bytes calldata message) external payable override { |
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.
Do we need permission checks here?
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 is delegatecalled, so we check CCTP sender on Solana side matches HubPool
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.
One driveby comment
| * @return Ethereum address representation of the Solana address. | ||
| */ | ||
| function _mapSolanaAddress(bytes32 solanaAddress) internal pure returns (address) { | ||
| return address(uint160(uint256(keccak256(abi.encodePacked(solanaAddress))))); |
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.
Why do you need to hash the bytes32 string?
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.
Initially I added hash just to be on the safe side to avoid collisions, but we only here have couple of addresses and they already should be pretty homogeneous. The only case where this would matter is native system programs that have zeros in their trailing bytes. But we need to represent only key or seed derived addresses on EVM, so their bytes32 representation should be pretty homogeneous.
Pushed a commit to drop the hashing and only trim off the first 12 bytes.
Co-authored-by: Chris Maree <christopher.maree@gmail.com>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
* feat(chain-adapters): add solana adapter (#641) * 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: address to bytes32 contract changes (#650) * 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> * feat: Add relayer repayment address (#653) * 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> * fix: clean up cast utilities (#676) * 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> * feat: update spokepool relayer refund to handle blocked transfers (#675) Co-authored-by: Matt Rice <matthewcrice32@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * fix(evm): merkle tree tests bytes32 Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * feat(svm): svm-dev fixes from review (#727) * refactor(svm): reuse bytes32 to address lib in svm adapter Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: custom errors Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * feat: fix test Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> --------- Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * test: fix forge tests Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * proposal: ensure that EVM errors are always consistant on underflows (#720) * feat: revert bytes32 conversion for internal functions (#755) * Discard changes to contracts/Ovm_SpokePool.sol * fix: stack too deep (#766) * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * Revert "feat: update depositor to bytes32" (#764) This reverts commit 85f0001. * Discard changes to contracts/PolygonZkEVM_SpokePool.sol * Discard changes to contracts/Polygon_SpokePool.sol * fix: make event case consistant between evm & svm (#760) * feat(SpokePool): Remove depositExclusive (#642) This function was used to express exclusivity as a period but its no longer useful since depositV3 now allows caller to express exclusivityPeriod instead of exclusivityDeadline * feat: Introduce opt-in deterministic relay data hashes (again) (#639) * Revert "feat(SpokePool): Introduce opt-in deterministic relay data hashes (#583)" This reverts commit 9d21d1b. * Reapply "feat(SpokePool): Introduce opt-in deterministic relay data hashes (#583)" This reverts commit d363bf0. * add deposit nonces to 7683 Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * fix Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * WIP Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * feat(SpokePool): Introduce opt-in deterministic relay data hashes (#583) * fix(SpokePool): Apply exclusivity consistently The new relative exclusivity check has not been propagated to fillV3RelayWithUpdatedDeposit(). Identified via test case failures in the relayer. Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com> * Also check on slow fill requests * Update contracts/SpokePool.sol * lint * Update * Add pure * Fix * Add tests * improve(SpokePool): _depositV3 interprets `exclusivityParameter` as 0, an offset, or a timestamp There should be a way for the deposit transaction to remove chain re-org risk affecting the block.timestamp by allowing the caller to set a fixed `exclusivityDeadline` value. This supports the existing behavior where the `exclusivityDeadline` is always emitted as its passed in. The new behavior is that if the `exclusivityParameter`, which replaces the `exclusivityDeadlineOffset` parameter, is 0 or greater than 1 year in seconds, then the `exclusivityDeadline` is equal to this parameter. Otherwise, its interpreted by `_depositV3()` as an offset. The offset would be useful in cases where the origin chain will not re-org, for example. * Update SpokePool.sol * Update SpokePool.Relay.ts * Update SpokePool.SlowRelay.ts * Update contracts/SpokePool.sol Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com> * Update SpokePool.sol * Update contracts/SpokePool.sol * rebase * Update SpokePool.sol * Revert "Merge branch 'npai/exclusivity-switch' into mrice32/deterministic-new" This reverts commit 2432944, reversing changes made to 6fe3534. * Revert "Merge branch 'npai/exclusivity-switch' into mrice32/deterministic-new" This reverts commit 2432944, reversing changes made to 6fe3534. * revert * Update SpokePool.sol * Fix * Update SpokePool.sol Co-authored-by: Chris Maree <christopher.maree@gmail.com> * WIP * WIP * wip * Update SpokePool.Relay.ts * Fix * Update SpokePool.sol * Update SpokePool.sol --------- Signed-off-by: Matt Rice <matthewcrice32@gmail.com> Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com> Co-authored-by: nicholaspai <npai.nyc@gmail.com> Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com> Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com> Co-authored-by: Chris Maree <christopher.maree@gmail.com> * docs: fix comment duplication (#775) Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> * fix: emit hashed message in evm fill events (#772) * fix: emit hashed message in evm fill events Signed-off-by: Reinis Martinsons <reinis@umaproject.org> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * fix: linting Signed-off-by: Reinis Martinsons <reinis@umaproject.org> --------- Signed-off-by: Reinis Martinsons <reinis@umaproject.org> Signed-off-by: chrismaree <christopher.maree@gmail.com> Co-authored-by: chrismaree <christopher.maree@gmail.com> * fix: linting Signed-off-by: Reinis Martinsons <reinis@umaproject.org> * feat: improve _getV3RelayHash method (#779) * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * WIP Signed-off-by: chrismaree <christopher.maree@gmail.com> * fix: Address Storage layout issue in CI (#836) * add new storage layout Signed-off-by: Chris Maree <christopher.maree@gmail.com> * Discard changes to storage-layouts/PolygonZkEVM_SpokePool.json * Discard changes to storage-layouts/Redstone_SpokePool.json * Discard changes to storage-layouts/Scroll_SpokePool.json * Discard changes to storage-layouts/Zora_SpokePool.json * Discard changes to storage-layouts/WorldChain_SpokePool.json * add new storage layout Signed-off-by: Chris Maree <christopher.maree@gmail.com> --------- Signed-off-by: Chris Maree <christopher.maree@gmail.com> * fix(evm): C01 - Address incorrect use of relayerRefund over msg.sender in claimRelayerRefund function (#826) Signed-off-by: Chris Maree <christopher.maree@gmail.com> * fix(evm): L01 - Update function from public to external (#827) Signed-off-by: Chris Maree <christopher.maree@gmail.com> * fix(evm): L03 - Address incorrect Right Shift in AddressConverters Lib (#828) Signed-off-by: Chris Maree <christopher.maree@gmail.com> * fix(evm): L04 - Remove repeated function (#829) Signed-off-by: Chris Maree <christopher.maree@gmail.com> * fix(evm): N01 - Add missing docstring for repaymentAddress (#830) Signed-off-by: Chris Maree <christopher.maree@gmail.com> * fix(evm): N02 - Address typographical Errors in spoke pool (#831) * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * Update contracts/SpokePool.sol --------- Signed-off-by: Chris Maree <christopher.maree@gmail.com> Co-authored-by: Matt Rice <matthewcrice32@gmail.com> * feat: update function and event naming for backwards compatibility (#805) * WIP Signed-off-by: Chris Maree <chris@mac.speedport.ip> * WIP Signed-off-by: Chris Maree <chris@mac.speedport.ip> * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * refined overfloaded function structure Signed-off-by: Chris Maree <christopher.maree@gmail.com> * Discard changes to test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * WIP 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> * WIP Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * update event names Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * fix tests Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * update function Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * update naming Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * drop unintended svm changes Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> * feat: extend current add-legacy-fill-method-svm-dev (#864) * WIP Signed-off-by: Chris Maree <christopher.maree@gmail.com> --------- Signed-off-by: Chris Maree <chris@mac.speedport.ip> Signed-off-by: Chris Maree <christopher.maree@gmail.com> Signed-off-by: Matt Rice <matthewcrice32@gmail.com> Co-authored-by: Chris Maree <chris@mac.speedport.ip> Co-authored-by: Matt Rice <matthewcrice32@gmail.com> * fix: update legacy FilledV3Relay event to match old event signature (#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: use entire message when calculating relay hash for evm chains (#867) * 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 (#870) * 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 * fix: add check to ensure depositor is a valid EVM address (#874) Signed-off-by: Matt Rice <matthewcrice32@gmail.com> * fix(evm): L02 _destinationSettler Can Return Zero Address (#834) * 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> * improve: Verify relay hashes are the same pre and post upgrade (#878) * 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> * Fix merge conflict that removed exclusivity parameter * Fix SwapAndBridge merge conflict * reorder stack variables Signed-off-by: bennett <bennett@umaproject.org> * export test functions Signed-off-by: bennett <bennett@umaproject.org> * bump package Signed-off-by: bennett <bennett@umaproject.org> * fix: simpler solution to stack too deep --------- Signed-off-by: Reinis Martinsons <reinis@umaproject.org> Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> Signed-off-by: chrismaree <christopher.maree@gmail.com> Signed-off-by: Matt Rice <matthewcrice32@gmail.com> Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com> Signed-off-by: Chris Maree <christopher.maree@gmail.com> Signed-off-by: Chris Maree <chris@mac.speedport.ip> Signed-off-by: bennett <bennett@umaproject.org> Co-authored-by: Reinis Martinsons <77973553+Reinis-FRP@users.noreply.github.com> Co-authored-by: Pablo Maldonado <pablomaldonadoturci@gmail.com> Co-authored-by: Matt Rice <matthewcrice32@gmail.com> Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com> Co-authored-by: nicholaspai <npai.nyc@gmail.com> Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com> Co-authored-by: Reinis Martinsons <reinis@umaproject.org> Co-authored-by: Chris Maree <chris@mac.speedport.ip> Co-authored-by: bmzig <57361391+bmzig@users.noreply.github.com> Co-authored-by: bennett <bennett@umaproject.org>
Adds adapter for HubPool being able to relay messages and tokens to Solana SpokePool.
Solana adapter maps Solana bytes32 addresses to EVM address representation by trimming it to keep its lowest 20 byte part. This same conversion must be done by the HubPool owner when adding Solana spoke pool and setting the corresponding pool rebalance and deposit routes, so that the adapter can translate them back correctly.
When setting deposit route, this also translates setEnableRoute call to use bytes32 token address and uint64 chainId as expected by SVM spoke pool program.