Skip to content

feat(solana): runtime config setters#483

Merged
entrius merged 1 commit into
feat/solana-haltfrom
feat/solana-config-setters
Jun 18, 2026
Merged

feat(solana): runtime config setters#483
entrius merged 1 commit into
feat/solana-haltfrom
feat/solana-config-setters

Conversation

@LandynDev

Copy link
Copy Markdown
Collaborator

Ports ink!'s owner config setters into the Solana contract and promotes the new Phase 9/10 tunables to runtime-tunable Config fields.

Stacked on #482 (halt). Base is feat/solana-halt; retarget to contract-v2 once #482 merges. Version chains 5→6.

ink! parity setters (6)

ink! Solana Floor
set_min_collateral none (0 ok)
set_max_collateral none (0 = no cap)
set_fulfillment_timeout ✅ (secs) >= 60
set_min_swap_amount 0 || >= 1000
set_max_swap_amount none (0 = unbounded)
set_reservation_ttl ✅ (secs) > 0

set_consensus_threshold + set_halted already existed. transfer_ownership intentionally dropped.

New tunables promoted to runtime (3)

Per review, the Phase 9/10 deployment-static consts become Config fields + setters:

  • reservation_fee_lamports (set_reservation_fee) — 0 disables
  • pool_window_secs (set_pool_window) — > 0
  • weights_update_min_interval_secs (set_weights_update_min_interval) — >= 0

Consts now seed the defaults at initialize; open_or_request and vote_set_weights read from Config.

Validation

ink!'s block/rao floors translated to sensible secs/lamports (chosen over literal numbers). All guard failures reuse InvalidAmount, mirroring ink!. Setters use msg! only, matching the existing set_consensus_threshold convention (no events).

CONFIG_VERSION 5 → 6. Library type-checks clean.

Ports the six ink! owner config setters absent from the port:
set_min_collateral, set_max_collateral, set_fulfillment_timeout,
set_min_swap_amount, set_max_swap_amount, set_reservation_ttl.
(set_consensus_threshold + set_halted already existed.)

Also promotes the three Phase 9/10 deployment-static tunables to
runtime Config fields with setters: reservation_fee_lamports,
pool_window_secs, weights_update_min_interval_secs. Consts now seed
the defaults at initialize; handlers read from Config.

Floors translated to sensible secs/lamports (timeout >= 60s,
min_swap 0 or >= 1000, ttl/window > 0). Bumps CONFIG_VERSION to 6.
@entrius entrius merged commit 4bb476d into feat/solana-halt Jun 18, 2026
@entrius entrius deleted the feat/solana-config-setters branch June 18, 2026 18:21
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.

2 participants