fix(runtime): allow transfer_stake through the contracts CallFilter - #3139
Closed
masterdubs wants to merge 1 commit into
Closed
masterdubs wants to merge 1 commit into
masterdubs wants to merge 1 commit into
Conversation
The proxy origin-filter inheritance fix in release 453 (do_proxy now
propagates the caller's call filter into the proxied call) closed a real
filter-laundering loophole — but it also broke contracts that legitimately
execute transfer_stake through an explicit user proxy delegation.
An escrow contract deployed on this chain performs deposits as:
call_runtime(Proxy::proxy(real = depositor, TransferStake { .. }))
where the depositor has registered the contract as a proxy beforehand.
Pre-453 the inner TransferStake ran on a freshly authenticated origin and
succeeded; post-453 it must pass ContractCallFilter, which only whitelists
Proxy::proxy, so the inner call fails with CallFiltered inside
ProxyExecuted and every deposit reverts.
Whitelist the single inner call the flow needs. Security posture is
preserved: the transfer still requires the user's explicit proxy
delegation, and the inherited-filter mechanism keeps every other nested
call blocked.
|
@masterdubs is attempting to deploy a commit to the RaoFoundation Team on Vercel. A member of the Team first needs to authorize it. |
Merged
Contributor
|
Closing: already on main as 4b92d4b (identical diff). |
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.
Context
Release 453's proxy fix (origin-filter inheritance in
do_proxy) rightly closed the filter-laundering loophole — but it also broke a production escrow contract on this chain that executes deposits as:with an explicit proxy delegation registered by the depositor. Pre-453 the inner
transfer_stakeran on a freshly authenticated origin; post-453 it must also passContractCallFilter, which only whitelistsProxy::proxy— so the inner call fails withCallFilteredinsideProxyExecutedand every deposit reverts (TransferNotVerifiedat the contract level). All inbound bridging has been down since the upgrade.Change
Whitelist the single inner call the flow needs:
SubtensorModule::transfer_stake.Security
transfer_stakedispatched by a contract as itself only moves the contract's own stake.Happy to adjust scope (e.g. gate it further) if you prefer a narrower shape.