feat(solana): runtime config setters#483
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports ink!'s owner config setters into the Solana contract and promotes the new Phase 9/10 tunables to runtime-tunable Config fields.
ink! parity setters (6)
set_min_collateralset_max_collateralset_fulfillment_timeout>= 60set_min_swap_amount0 || >= 1000set_max_swap_amountset_reservation_ttl> 0set_consensus_threshold+set_haltedalready existed.transfer_ownershipintentionally 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 disablespool_window_secs(set_pool_window) —> 0weights_update_min_interval_secs(set_weights_update_min_interval) —>= 0Consts now seed the defaults at
initialize;open_or_requestandvote_set_weightsread 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 usemsg!only, matching the existingset_consensus_thresholdconvention (no events).CONFIG_VERSION5 → 6. Library type-checks clean.