-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Reduce base proof size weight component to zero #7081
Reduce base proof size weight component to zero #7081
Conversation
I think even lowering the proof size might break some scenarios. A V2 XCM composed of
Total: 67Kb Since the default v2->v3 conversion makes I see xcm weights in Kusama and Westend runtimes do not account for any proof size. Is there a reason for accounting it here? |
The benchmarks really should be accounting for proof sizes. I'm not sure if the 0 you see there means it has already been accounted for and it's benchmarked as 0, or that the benchmarking infrastructure doesn't actually measure PoV sizes. Maybe @ggwpez can help in answering this? |
what are the other places? can we only modify the value for xcm executor? |
Indeed we can, I've pushed a commit introducing |
@KiChjang and what solution do you envisage for XCM v2 message with The
|
@librelois The Transact is using up all 64KiB of the PoV size because it is intended to, since we were not properly accounting for any proof size weights before, but now we do. The proper fix is on the sender side to upgrade to V3, as moving forwards, we should always be factoring in proof size weights, and is not optional. |
In this case it means that there is actually no full downward compatibility, which is a critical issue for moonbeam, as we have some smart contracts that regularly send XCM messages with Transact on relay, like Lido for DOT liquid staking for example. Is it possible to modify the V2->V3 conversion of BuyExecution to buy several times the default proof size (at least 2 or 3 times) ? |
Looks like something with the re-generation did not work. I just did it locally and they do report PoV. PS: we recently added a CI job to spot this earlier in the release process #6996 |
@librelois What you're asking for is forward compatibility, not backward or downward, since you're asking specifically for a V2 Transact to have a lower PoV weight when converting to a V3 Transact. In short, there is no forward compatibility for V2 weights in V3, as there's no way to specify the PoV weight component in V2. We must then treat the incoming XCM Transact in the worst case possible as we are not certain how much PoV it is going to consume. Unless you have some way of letting the destination know ahead of time just how much PoV weight that your V2 XCM is going to consume, I don't see how we can get around this limitation. |
@KiChjang We can nitpick on the terms, but the fact is that some currently functional V2 messages will not work anymore, and for us this is a blocking problem. What about converting BuyExecution v2 with Limited weights to Unlimited weights in v3? I think the design error comes from not allowing to limit weights by dimension, we are obliged to limit all dimensions or nothing. |
@librelois The real issue is that you should upgrade your chain to v3, and we should be talking about that. Could you please upgrade to v3 so that your applications will work as intended? |
There is no full compatibility between v3 and v2, and this is simply not possible since v2 does not contain information critical for weight specification. @KiChjang what about introducing a feature in the XCM crate Parachains which don't mind being unsafe (or don't care about the PoV components like Relays) can enable this feature. |
Just for the sake of clarifying, we have released a new runtime with support for XCM v3. Considering all the changes and the security issues that were introduced with this new version we are expecting to deploy to Moonbeam (on Polkadot) around May 18th. This is our standard delay (5 weeks) for deployment on Polkadot, for security reasons. Since we expect XCM V3 to be deployed in Polkadot sooner than that, there will be a period of time in which Moonbeam will be in XCM V2, while Polkadot will be in XCM V3. We have a usecase in Moonbeam in which we use the set of instructions:
If Polkadot upgrades to XCM V3 with a That being said, the PR is currently using Is the intention to go in Polkadot with |
Yes, the intention is to keep the inserted PoV weight component minimal to keep existing use-cases working during the transition period to XCMv3 with 2D weights and the new MQ system. Until the new MQ is merged (and the 2D weights are accurately calculated), we really don't need to enforce any PoV-weight component limits. Once the new MQ is merged and chains have accurate weights associated with their instructions, then we can begin placing and enforcing sensible PoV-weight limits. As we do this, we can lift the very low message-execution limits and restrictions we have as a workaround at present. |
Since we already have restrictive whitelists and message limits to guard against PoV weight exhaustion, I've set the |
Actually, once we have a full stack deployed for dealing with PoV weights (proper XCM weights, PoV-aware MQ, XCMv3) then we should simply disallow any XCMv2 1D-weight values into XCMv3 2D-weight values. This will make certain parts of XCMv2 untranslatable into XCMv3 but it's the only way to safely remove the limitations we have in place, so it's important for chains to move to XCMv3 promptly. |
bot merge |
If we set the Transact v2->v3 conversion to have 0 default proof-size,
I believe a V2 Transact for opening HRMP channels would fail, since the v2-> v3 polkadot/xcm/xcm-executor/src/lib.rs Line 554 in dd4e054
I think we should have set the default conversion to 64Kb proof size, which would cover most of the cases involving a message of the form:
|
Or we can also make the xcm-executor |
Note that as @girazoki mentioned, this won't allow for any parachain that is on XCM V2 to Accept or Propose HRMP channels which seems like a major problem |
* master: (30 commits) update rocksdb to 0.20.1 (#7113) Reduce base proof size weight component to zero (#7081) PVF: Move PVF workers into separate crate (#7101) Companion for #13923 (#7111) update safe call filter (#7080) PVF: Don't dispute on missing artifact (#7011) XCM: Properly set the pricing for the DMP router (#6843) pvf: Update docs for PVF artifacts (#6551) Bump syn from 2.0.14 to 2.0.15 (#7093) Companion for substrate#13771 (#6983) Added Dwellir Nigeria bootnodes. (#7097) Companion for Substrate #13889 (#7063) Switch to DNS name based bootnodes for Rococo (#7040) companion for substrate#13883 (#7059) [xcm] Added `UnpaidExecution` instruction to `UnpaidRemoteExporter` (#7091) Bump serde_json from 1.0.85 to 1.0.96 (#7072) Bump hex-literal from 0.3.4 to 0.4.1 (#7071) Small simplification (#7089) [XCM - UnpaidRemoteExporter] Remove unreachable code (#7088) sync versions with current release (#7083) ...
* master: (39 commits) malus: dont panic on missing validation data (#6952) Offences Migration v1: Removes `ReportsByKindIndex` (#7114) Fix stalling dispute coordinator. (#7125) Fix rolling session window (#7126) [ci] Update buildah command and version (#7128) Bump assigned_slots params (#6991) XCM: Remote account converter (#6662) Rework `dispute-coordinator` to use `RuntimeInfo` for obtaining session information instead of `RollingSessionWindow` (#6968) Revert default proof size back to 64 KB (#7115) update rocksdb to 0.20.1 (#7113) Reduce base proof size weight component to zero (#7081) PVF: Move PVF workers into separate crate (#7101) Companion for #13923 (#7111) update safe call filter (#7080) PVF: Don't dispute on missing artifact (#7011) XCM: Properly set the pricing for the DMP router (#6843) pvf: Update docs for PVF artifacts (#6551) Bump syn from 2.0.14 to 2.0.15 (#7093) Companion for substrate#13771 (#6983) Added Dwellir Nigeria bootnodes. (#7097) ...
* Reduce base proof size weight component to 1KiB * Create TempFixedXcmWeight and set PoV weight to 0 * Set DEFAULT_PROOF_SIZE to 0 * Fix comment * Update test expectations * Fix comment
* Reduce base proof size weight component to 1KiB * Create TempFixedXcmWeight and set PoV weight to 0 * Set DEFAULT_PROOF_SIZE to 0 * Fix comment * Update test expectations * Fix comment
* Reduce base proof size weight component to 1KiB * Create TempFixedXcmWeight and set PoV weight to 0 * Set DEFAULT_PROOF_SIZE to 0 * Fix comment * Update test expectations * Fix comment
It was found out that Polkadot still uses
FixedWeightBounds
for weighing XCM instructions, and as such is using aBaseXcmWeight
that has a proof size component that's too large for average use cases such as asset transfers. This PR reduces it to 1KiB instead of the previous 64KiB.While it's true that the relay chain doesn't require any PoV, the
Weigher
is being used in more places than just weighing incoming XCM instructions, so it does not seem wise to reduce it to 0.