-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
TokenPool split and other QOL #16472
Conversation
yashnevatia
commented
Feb 19, 2025
•
edited
Loading
edited
- Modularising Billing and calling it during chain setup
- Making onRampByte part of CCIPOnChainState
- Renaming GetOffRampAddress to GetOffRampAddressBytes
- Adding solRouter.NewAddOfframpInstruction instruction during remote chain setup
- calling AddBillingTokenForRemoteChain when setting up transferable token for solana <-> evm
- Token pool split
- use solana specific config for cs_deploy_chain
- abstract deployToken for tests
- take in TokenSymbol input
- consistent package naming
if err != nil { | ||
return fmt.Errorf("failed to generate instructions: %w", err) | ||
} | ||
|
||
err = chain.Confirm([]solana.Instruction{routerIx, feeQuoterIx, offRampIx}) | ||
err = chain.Confirm([]solana.Instruction{routerIx, routerOfframpIx, feeQuoterIx, offRampIx}) |
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.
just a mental note that I believe we'll have to split this up when we support MCMS. On the initial deploy this will be fine because we will not have transferred ownership yet. However, when we do an upgrade, by that point router and fee quoter will be owned by timelock and we'll have to wrap these. We don't have to solve this here, but it's something to think about
|
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.
LGTM, left some comments but nothing blocking
case chainsel.FamilyEVM: | ||
addressBytes, _ = s.Chains[remoteChainSel].OnRampBytes() | ||
} | ||
addressBytes, _ := s.GetOnRampAddressBytes(remoteChainSel) |
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: maybe worth renaming to onRampBytes
to make it more explicit?
var poolConfigAccount interface{} | ||
|
||
switch cfg.PoolType { | ||
case solTestTokenPool.BurnAndMint_PoolType: | ||
tokenPool = chainState.BurnMintTokenPool | ||
poolConfigAccount = solBurnMintTokenPool.State{} | ||
case solTestTokenPool.LockAndRelease_PoolType: | ||
tokenPool = chainState.LockReleaseTokenPool | ||
poolConfigAccount = solLockReleaseTokenPool.State{} | ||
default: | ||
return fmt.Errorf("invalid pool type: %s", cfg.PoolType) |
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.
maybe worth to move this to a small helper similar to validatePoolDeployment
, like initPoolStateType
?
chainState := state.SolChains[cfg.ChainSelector] | ||
authorityPubKey := solana.MustPublicKeyFromBase58(cfg.Authority) | ||
tokenPubKey := solana.MustPublicKeyFromBase58(cfg.TokenPubKey) | ||
tokenPool := solana.PublicKey{} | ||
|
||
if cfg.PoolType == solTestTokenPool.BurnAndMint_PoolType { |
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.
Wondering if it might be worth just creating 2 separate helpers for addBurnAndMintTokenPool
and addLockAndReleaseTokenPool
and just do an initial switch at the beginning of this function instead of adding multiple switches on this larger function? It' s just for making it a bit easier to follow but not blocking anything
@@ -179,6 +188,12 @@ func LoadChainStateSolana(chain deployment.SolChain, addresses map[string]deploy | |||
case FeeAggregator: | |||
pub := solana.MustPublicKeyFromBase58(address) | |||
state.FeeAggregator = pub | |||
case BurnMintTokenPool: | |||
pub := solana.MustPublicKeyFromBase58(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.
maybe use pub, err := PublicKeyFromBase58()
to avoid panics here?
* modularising billing to be reused in cs_deploy * adding offramp instruction * adding remote billing for token transfers * loading bytes * Adding tp types to state * deploy and preload tps * bug fix * adding spltokens array and func to map tokenaddress to program * token pool split in changesets * deprecating old token pool, just commenting first * lint * adding wsol to spltokens * removing consts * using same type * changes * removing token program name from billinh * removing old consts * changing type and using index 1 * renaming and adding config * cascading changes * removing redundant const * cascading changes and adding billing through config * adding validate * renaming packages * linting * include spltokens in validation * abstract deployToken in test * fix logging * dont add link and wsol to token array * use token symbol as input * lint and bug * bug * lint * fix