Conversation
…tensions Replace the single ProxyCall dispatcher (FunctionId 16) with 12 typed Proxy* chain extensions (FunctionIds 34-45) that verify proxy authorization via pallet_proxy::Proxies storage and dispatch as the delegated account. Each handler reads an on_behalf_of AccountId, verifies the contract is an authorized zero-delay proxy (with is_superset support for ProxyType::Any), and dispatches the pallet call with RawOrigin::Signed(on_behalf_of). ProxyTransferStakeV1 requires ProxyType::Transfer; all others require ProxyType::Staking. IDs 16-19 reserved for recycle/burn, 20-33 for Junius's Caller* variants (PR opentensor#2550).
…st coverage - Renumber Proxy* FunctionIds to 16-27 (no gaps after existing IDs) - Move verify_proxy to module-level free function (matches convert_origin pattern from PR opentensor#2550) - Restructure proxy tests into nested proxy_dispatch_tests module with shared setup helpers and per-operation success tests - Coverage: 5 proxy verification tests (staking, any/superset, no proxy, wrong type, delayed) + 8 per-operation tests covering all input shapes
camfairchild
left a comment
There was a problem hiding this comment.
Waiting on response on the issue about using delegate_call instead
shamil-gadelshin
left a comment
There was a problem hiding this comment.
Can we use pallet-subtensor WeightInfo implementation for weights?
| Env: SubtensorExtensionEnv<T>, | ||
| <<T as SysConfig>::Lookup as StaticLookup>::Source: From<<T as SysConfig>::AccountId>, | ||
| { | ||
| let weight = Weight::from_parts(196_800_000, 0) |
There was a problem hiding this comment.
Can we use <T as crate::pallet::Config>::WeightInfo::remove_stake_limit instead?
There was a problem hiding this comment.
Yes, we should use weights from subtensor pallet.
I did some research in try-delegate-call branch
In Ink, we must delegate call with the contract codehash like follows.
let my_return_value = build_call::<CustomEnvironment>()
.delegate(ink::primitives::Hash::from(code_hash))
.exec_input(ExecutionInput::new(Selector::new(ink::selector_bytes!(
"dummy"
))))
.returns::<Result<(), ReadWriteErrorCode>>()
.invoke(); |
Description
Add the origin in the Ink, use can choose the contract add as signed account or real origin as account
Related Issue(s)
Type of Change
Breaking Change
If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
Please provide any additional information or context that may be helpful for reviewers.