Skip to content

Add set rate limits#22503

Open
agusaldasoro wants to merge 4 commits into
developfrom
feat/rate-limits
Open

Add set rate limits#22503
agusaldasoro wants to merge 4 commits into
developfrom
feat/rate-limits

Conversation

@agusaldasoro
Copy link
Copy Markdown
Contributor

@agusaldasoro agusaldasoro commented May 15, 2026

Create changeset to modify rate limits of an existing pool in solana

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

✅ No conflicts with other open PRs targeting develop

@agusaldasoro agusaldasoro marked this pull request as ready for review May 15, 2026 18:32
@agusaldasoro agusaldasoro requested a review from a team as a code owner May 15, 2026 18:32
Copilot AI review requested due to automatic review settings May 15, 2026 18:32
@agusaldasoro agusaldasoro requested review from a team as code owners May 15, 2026 18:32
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 15, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Comment on lines +3283 to +3288
if entry.PoolType == "" {
return errors.New("pool type must be defined")
}
if entry.RemoteChainSelector == 0 {
return errors.New("remote chain selector must be defined")
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we checking somewhere that they are also valid?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the remote chain selector you mean? Yes, in line 3296 isSup, _, err := isSupportedChain(chain, tokenPubKey, tokenPool, entry.PoolType, entry.RemoteChainSelector)

MCMS *proposalutils.TimelockConfig
}

func (cfg SetChainRateLimitConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be worth checking as well that our keys (deployer or timelock) are the RL admin? So that no one attempts to execute this on a pool that has been handed over to a customer, and gets their root committed to MCMS but cannot execute later the actual RL update.

Comment on lines +3328 to +3343
tokenPoolUsingMcms := solanastateview.IsSolanaProgramOwnedByTimelock(
&e,
chain,
chainState,
entry.PoolType,
tokenPubKey,
entry.Metadata,
)
authority := GetAuthorityForIxn(
&e,
chain,
chainState,
entry.PoolType,
tokenPubKey,
entry.Metadata,
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aren't both checks doing pretty much the same thing? At this point AFAIK there should be only 2 options, either deployer and not MCMS, or using MCMS and the authority is timelock, right?

Comment thread deployment/ccip/changeset/solana_v0_1_1/cs_token_pool.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Risk Rating: MEDIUM

Adds a Solana v0.1.1 changeset for updating rate limits on existing token pool remote-chain configs.

Changes:

  • Registers SetChainRateLimit as a changeset.
  • Adds config/validation types for per-chain token pool rate-limit updates.
  • Builds direct Solana instructions or MCMS proposal transactions, including a dummy-rate workaround.

Targeted Human Review Areas:

  • MCMS proposal generation and validation around cfg.MCMS.
  • Dummy-rate workaround logic for disabled-to-enabled rate-limit transitions.
  • Missing test coverage for the new changeset paths.


if len(mcmsTxs) > 0 {
proposal, err := BuildProposalsForTxns(
e, cfg.SolChainSelector, "proposal to SetChainRateLimit in Solana", cfg.MCMS.MinDelay, mcmsTxs)
Comment on lines +3352 to +3354
// If the account doesn't exist yet (e.g. during token expansion where MCMS batches
// init_chain_remote_config and set_chain_rate_limit in a single proposal), we treat
// both directions as uninitialized and always prepend the dummy instruction.
return nil
}

func SetChainRateLimit(e cldf.Environment, cfg SetChainRateLimitConfig) (cldf.ChangesetOutput, error) {
@cl-sonarqube-production
Copy link
Copy Markdown

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.

3 participants