Skip to content

fix pallet_subtensor_swap weight info#2752

Merged
sam0x17 merged 1 commit into
devnet-readyfrom
fix-pallet-subtensor-swap-weight-info
Jun 11, 2026
Merged

fix pallet_subtensor_swap weight info#2752
sam0x17 merged 1 commit into
devnet-readyfrom
fix-pallet-subtensor-swap-weight-info

Conversation

@JohnReedV

@JohnReedV JohnReedV commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes the runtime WeightInfo wiring for pallet_subtensor_swap.

The runtime previously configured pallet_subtensor_swap::weights::DefaultWeight<Runtime>, but the generated swap pallet weights module defines SubstrateWeight<T> and the fallback () implementation, not DefaultWeight. This change updates runtime/src/lib.rs to use pallet_subtensor_swap::weights::SubstrateWeight<Runtime> so the runtime points at the generated benchmark weight implementation.

Files of interest:

  • runtime/src/lib.rs: updates the pallet_subtensor_swap::Config WeightInfo associated type.

Behavioral impact:

  • No storage layout, extrinsic logic, origin checks, or economic formulas are changed.
  • The swap pallet runtime config now uses the generated swap pallet weight implementation.

Migration / spec_version implications:

  • No storage migration is required.
  • This touches runtime configuration; the devnet spec-version check should determine whether the existing local spec_version already exceeds the live devnet runtime version or needs a bump.

Testing performed:

  • Auditor static review verified that pallets/swap/src/weights.rs defines SubstrateWeight<T> implementing WeightInfo and does not define DefaultWeight<T>.
  • No build or test command was run during review.

@JohnReedV JohnReedV added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

BASELINE scrutiny: established opentensor contributor with repo write permission; branch fix-pallet-subtensor-swap-weight-info -> devnet-ready; no Gittensor allowlist hit found.

Reviewed the prefetched PR metadata, prior Skeptic sticky, contributor signals, and the full one-line runtime diff. The PR does not modify .github/ai-review/* or .github/copilot-instructions.md; the only change switches pallet_subtensor_swap from a nonexistent/default weight type to the pallet's generated SubstrateWeight<Runtime> implementation.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability was found in this diff. The change is narrowly scoped to runtime weight wiring and does not add dependencies, origin changes, executable tooling, or new attack surface.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor UNKNOWN; author is an established OpenTensor contributor with repo write permission and substantial recent Subtensor history.

PR body was empty/trivial; the Auditor has auto-filled it. Please review.

No domain findings. The one-line runtime change switches pallet_subtensor_swap from the nonexistent weights::DefaultWeight<Runtime> type to the generated weights::SubstrateWeight<Runtime> implementation present in pallets/swap/src/weights.rs.

Duplicate-work check found only broad runtime/src/lib.rs overlaps. The one potentially related PR, #2708, is a much larger ParityDb/runtime branch that includes the same weight-type direction incidentally; it is not a better candidate for this focused fix.

Spec-version auto-fix was not performed: local/base spec_version is 418, and the devnet runtime-version endpoint could not be resolved from this sandbox, so I could not make the required live-network comparison. No build or test command was run because static inspection was sufficient for this trait wiring change.

Findings

No findings.

Conclusion

The PR is narrowly scoped and correctly wires the swap pallet to its generated runtime weight implementation. I found no domain issue that should block merge.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@sam0x17 sam0x17 merged commit da677bf into devnet-ready Jun 11, 2026
29 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants