Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix the surplus weight calculation of the Transact XCM instruction #7620

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions xcm/xcm-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@ impl<Config: config::Config> XcmExecutor<Config> {
},
};
let actual_weight = maybe_actual_weight.unwrap_or(weight);
let surplus = weight.saturating_sub(actual_weight);
// We assume that the `Config::Weigher` will counts the `require_weight_at_most`
let surplus = require_weight_at_most.saturating_sub(actual_weight);
// We assume that the `Config::Weigher` will count the `require_weight_at_most`
// for the estimate of how much weight this instruction will take. Now that we know
// that it's less, we credit it.
//
Expand Down