Skip to content

Conversation

@Reinis-FRP
Copy link
Contributor

@Reinis-FRP Reinis-FRP commented Dec 2, 2024

Adds scripts that allows to test pool rebalancing from HubPool to Solana SpokePool. Tested in these tx:

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
@Reinis-FRP Reinis-FRP changed the title fix: script to propose rebalance to spoke fix: scripts to rebalance funds from hub to spoke Dec 2, 2024
@Reinis-FRP Reinis-FRP marked this pull request as ready for review December 2, 2024 14:40
@Reinis-FRP Reinis-FRP requested review from chrismaree and md0x December 2, 2024 14:40
Comment on lines +170 to +177
.getNoncePda({
nonce: new BN(nonce.toString()),
sourceDomain: remoteDomain,
})
.accounts({
messageTransmitter: messageTransmitterState,
})
.view()) as PublicKey;
Copy link
Member

Choose a reason for hiding this comment

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

is this optimally linted?

Comment on lines +190 to +239
remainingAccounts.push({
isSigner: false,
isWritable: false,
pubkey: tokenMessengerAccount,
});
remainingAccounts.push({
isSigner: false,
isWritable: false,
pubkey: remoteTokenMessengerKey,
});
remainingAccounts.push({
isSigner: false,
isWritable: true,
pubkey: tokenMinterAccount,
});
remainingAccounts.push({
isSigner: false,
isWritable: true,
pubkey: localToken,
});
remainingAccounts.push({
isSigner: false,
isWritable: false,
pubkey: tokenPair,
});
remainingAccounts.push({
isSigner: false,
isWritable: true,
pubkey: vault,
});
remainingAccounts.push({
isSigner: false,
isWritable: true,
pubkey: custodyTokenAccount,
});
remainingAccounts.push({
isSigner: false,
isWritable: false,
pubkey: TOKEN_PROGRAM_ID,
});
remainingAccounts.push({
isSigner: false,
isWritable: false,
pubkey: tokenMessengerEventAuthority,
});
remainingAccounts.push({
isSigner: false,
isWritable: false,
pubkey: tokenMessengerMinterProgram.programId,
});
Copy link
Member

Choose a reason for hiding this comment

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

same with this. I think it can be linted to be much shorter.

@@ -0,0 +1,293 @@
// This script executes root bundle on HubPool that rebalances tokens to Solana Spoke Pool. Required environment:
// - ETHERS_PROVIDER_URL: Ethereum RPC provider URL.
Copy link
Contributor

Choose a reason for hiding this comment

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

As part of the tech debt task we can update this env vars to be consistent across the scripts so this comment is just an observation

Copy link
Contributor

@md0x md0x left a comment

Choose a reason for hiding this comment

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

Looks good.
There might be some changes to improve environment variable consistency with other scripts, move some hardcoded values to the constants file, and relocate some reused functions to a common library as well. However, that can be part of the tech debt task.

@Reinis-FRP Reinis-FRP merged commit 0785cf2 into master Dec 4, 2024
9 checks passed
@Reinis-FRP Reinis-FRP deleted the reinis-frp/rebalance-to-spoke branch December 4, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants