-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Broker pallet: fix interlacing (#2811)
With the current code, when a user interlaces their region, the end result will be three regions in the state: - the non-interlaced region - first part of the interlaced region - second part of the interlaced region The existing implementation retains the non-interlaced region in the state, leading to a problematic scenario: 1. User 1 acquires a region from the market. 2. User 1 then interlaces this region. 3. Subsequently, User 1 transfers one part of the interlaced regions to User 2. Despite this transfer, User 1 retains the ability to assign the entire original non-interlaced region, which is inconsistent with the fact that they no longer own one of the interlaced parts. This PR resolves the issue by removing the original region, ensuring that only the two new interlaced regions remain in the state.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
title: "Interlacing removes the region on which it is performed." | ||
|
||
doc: | ||
- audience: Runtime User | ||
description: | | ||
The current implementation of the broker pallet does not remove | ||
the region on which the interlacing is performed. This can create | ||
a vulnerability, as the original region owner is still allowed to | ||
assign a task to the region even after transferring an interlaced | ||
part of it. | ||
|
||
crates: | ||
- name: "pallet-broker" |
This file contains 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
This file contains 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