fix(lanes): route MsgPrivilegedExecuteContract through the default lane - #43
Open
rozhlas-org-agent wants to merge 1 commit into
Conversation
Author
|
cc @achilleas-kal @gorgos — small, self-contained change (16 LoC + tests) moving |
MsgPrivilegedExecuteContract executes arbitrary privileged CosmWasm logic rather than placing or cancelling orders, so it does not belong in the fee-prioritized exchange lane. Exclude it from the exchange lane matcher so a transaction carrying it is ordered in the default lane like any other contract execution. Covers both the v1beta1 and v2 message. Signed-off-by: rozhlas-org-agent <rozhlas-org-agent@users.noreply.github.com>
rozhlas-org-agent
force-pushed
the
fix/privileged-execute-default-lane
branch
from
August 7, 2026 09:43
452bdc1 to
8a84b18
Compare
|
@rozhlas-org-agent Thanks for the suggestion. |
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.
Summary
MsgPrivilegedExecuteContractis currently matched by the exchange lane, which is built ahead of the default lane in every block. Because this message executes arbitrary CosmWasm logic (it is not an order placement/cancellation message), its placement in the exchange lane lets any contract call be sequenced ahead of default-lane transactions. This PR excludes it from the exchange-lane matcher so it is ordered in the default lane like any other contract execution.Motivation
The exchange lane exists to sequence order-flow messages (
x/exchangeorder placement, cancellation, batch updates) ahead of the default lane.MsgPrivilegedExecuteContractis a generic privileged contract-execution entrypoint — its intended use is privileged contract flows (e.g. registered vault / Mito-style contracts), not lane placement.In practice it is being used to front-run ordinary default-lane transactions: an actor deploys a CosmWasm arbitrage contract and invokes it via
MsgPrivilegedExecuteContract, which then inherits the exchange lane's position and is sequenced ahead of every default-laneMsgExecuteContractin the block. This ordering advantage comes purely from the lane classification — lanes are processed in a fixed order (exchange before default), independent of fees (Injective does not order transactions by fee).Note that on mainnet
code_upload_accessis a fixed allow-list (AnyOfAddresses), so an actor holding one of those addresses can upload such a contract without a governance proposal, making the vector readily accessible.On-chain evidence: block
177523207— contractinj1tgp7e3559fm83xa7qqee4hhlvyj8e5fu83lzwninvoked viaMsgPrivilegedExecuteContractin the exchange lane.Change
Exclude
MsgPrivilegedExecuteContract(v1beta1 + v2) fromisExchangeMsg, so transactions carrying it are matched by the default lane instead.Backwards compatibility
Legitimate privileged-execute flows are unaffected in behavior — the message still executes exactly as before; it is simply ordered in the default lane instead of ahead of it. No state, API, or message change.
Tests
Adds
lane_test.gocovering the matcher: an exchange order matches;MsgPrivilegedExecuteContract(including authz-wrapped) does not; a mixed tx does not.