This is a follow-up on the ‘Subnet Rental & Swiss Subnet’ post. The goal of this post is to provide an update on some changes in the design of the subnet rental feature, and to give you, the community, a chance to discuss them before submitting a motion proposal. Note that this post is about the general subnet rental feature, not the Swiss subnet specifically.
Summary of the previous post
We propose to create a feature which allows users to rent a subnet.
Renting a subnet gives the tenant exclusive access to the subnet’s resources.
Instead of topping up canisters with cycles, the tenant pays for the whole subnet by transferring ICP to the Subnet Rental Canister (SRC). The ICP are converted to cycles and burned over time.
A rental agreement is entered by the tenant and the NNS community via a proposal of a new type. This proposal is executed by the SRC, a new canister under NNS control which is responsible for the whole rental agreement lifecycle and for the payment flow.
If the funds the user provides to the SRC run out, the subnet’s services can be (reversibly) suspended, and later, the rental agreement can be (irreversibly) terminated.
The main change is that the subnet creation process becomes part of the rental setup.
There may not yet exist a subnet with a suitable topology at the time when a prospective tenant wishes to enter an agreement with the NNS. The tenant can therefore propose to create a subnet for the purpose of renting and specify the desired topology in that same proposal. This is advantageous for the community, because they can accept or reject a special-topology subnet based on the knowledge that it will be used for rental and that there already exists an entity that is willing to pay for it for a minimum amount of time.
Subnet rental setup process
The user pays a deposit of ICP to a subaccount of an ICP Ledger account controlled by the SRC. The amount is expressed in XDR and covers six months worth of node provider rewards, scaled by the subnet size and including an exclusivity surcharge. The cost for a typical subnet size can be queried from the SRC.
The user creates a proposal of type “Rental Subnet Request”, which contains the user’s principal and a description of the desired topology (or alternatively, an existing subnet id). If the community accepts this proposal, the given topology is considered an addendum to the official target topology. This should facilitate the creation of the necessary new nodes, even in regions that otherwise would be considered saturated. If the proposal is rejected, the deposit is refunded.
In the next weeks or months, new node providers are onboarded and nodes created in order to fill the specified topology. If this process takes overly long, the tenant can cancel the process by requesting a refund of their deposit by calling a method on the SRC. Initially, 90% of the deposit is refundable, but every 30d, another 10% become non-refundable. This is considered to be compensation for the work that is being done by the network in the meantime and will be burned for deflation. If no refund is requested and the subnet ends up being created, the full deposit is counted towards the first six months of rent.
When the necessary nodes exist, a subnet creation proposal must be submitted. This proposal type is extended with an optional field “initial_proposal_id”, which should refer to the initial subnet rental request proposal. On execution, the subnet is created and associated with the principal in the initial proposal. The SRC whitelists the user’s principal and transitions into the billing phase.
Please share your thoughts on these changes. Other aspects, such as the billing phase, remain unchanged from the previous post.
Next steps
Discussion of the updated proposal (in this post)
Reaching a rough consensus on the proposal
Submission of a motion proposal: Does the community agree that the subnet rental feature should be implemented?
We have submitted an NNS proposal to install the subnet rental canister on the NNS subnet. Please participate in the vote!
The first version of the subnet rental canister will implement a set of features which enable the first phase of the rental process, i.e.,
Users can fetch the (daily) cost of a rental subnet.
They can request the destination subaccount for their initial payment.
They can submit a subnet rental request to the NNS and have the community vote on it.
If the proposal is rejected, they can call a refund method on the subnet rental canister.
If it is adopted, the subnet rental canister locks 10% of their funds at execution and every 30d afterwards. The locked funds will ultimately be used to pay for the initial period.
The refund can also be initiated after the proposal was adopted, but from then on only partial refunds are possible.
Before the initial period begins, the renter is responsible for onboarding enough node providers and nodes to form the new subnet. This will take some time, in which we will finalize the second version of the subnet rental canister, which will enable the following steps:
Connecting a newly created subnet with a rental request, resulting in a rental agreement.
Billing an active rental agreement regularly and burning cycles.
Whitelisting the user’s principal for canister installations on the subnet.
Suspension triggers if payments stop and gets rolled back if payments resume in a timely manner.
Once the first version of the subnet rental canister is installed, the community can observe its state by calling its public endpoints, e.g., list_rental_requests or get_history_page. The concrete candid interface of the subnet rental canister can be found, for example, on the ICP dashboard.
If you have any questions, feel free to ask them here.
Proposal #137190 for Subnet Rental v 0.2.0 — Zack | CodeGov
Vote: Adopted
Reason: The build is reproducible and the wasm hash is a match.
The canister id qvhpv-4qaaa-aaaaa-aaagq-cai is correct and the install mode is upgrade.
CodeGov has a team of developers who review and vote independently on the following proposal topics: IC-OS Version Election, Protocol Canister Management, Subnet Management, Node Admin, and Participant Management. The CodeGov NNS known neuron is configured to follow our reviewers on these technical topics. We also have a group of Followees who vote independently on the Governance and the SNS & Neuron’s Fund topics. We strive to be a credible and reliable Followee option that votes on every proposal and every proposal topic in the NNS. We also support decentralization of SNS projects such as WaterNeuron, KongSwap, and Alice with a known neuron and credible Followees.
Learn more about CodeGov and its mission at codegov.org.
Upgraded and refactored the CI workflow. Rust/PocketIC build and download steps have been replaced by Docker-based build, now that PocketIC is part of latest DFX, consolidated wasm fetching via get_wasms.sh, and deployment/release now uses dfx canister install of a gzipped wasm.
Upgraded rust version rust:1.87.0. Makes use of candid-extractor. Lots of deps upgrades.
Refactored get_payment_subaccount to pass user principal as arg.
Refactors locking function that runs through all rental requests and, for any that haven’t had a lockup in the past 30 days and aren’t already fully locked, converts and locks an additional 10 % of the initial ICP cost into cycles and updates the request.
Refactors canister refund function that grabs a per‐request lock, checks and refunds the caller’s entire subaccount balance (minus fee) in one call, then, if a rental request exists, burns its locked cycles and removes it.
Similar proposal was last executed 2024-05-13.
About CodeGov
CodeGov has a team of developers who review and vote independently on the following proposal topics: IC-OS Version Election, Protocol Canister Management, Subnet Management, Node Admin, and Participant Management. The CodeGov NNS known neuron is configured to follow our reviewers on these technical topics. We also have a group of Followees who vote independently on the Governance and the SNS & Neuron’s Fund topics. We strive to be a credible and reliable Followee option that votes on every proposal and every proposal topic in the NNS. We also support decentralization of SNS projects such as WaterNeuron, KongSwap, and Alice with a known neuron and credible Followees.
Learn more about CodeGov and its mission at codegov.org.
Reason: Build is successful, hashes match, commits match descriptions and the reasoning behind the changes is sound. There are 11 commits in the proposal as listed here. Main changes are as follows:
The transfer fee to the cycles minting canister is deducted only once instead of twice.
Two if/else sequences are combined into one within the build script.
Within get_rental_conditions_history_page the payment account is returned as a hex string rather than a ByteBuf.
The cycles minting canister is now downloaded rather than reproduced within this repo.
Fixed an issue in which extra funds could be transferred after making a rental request but could not be subsequently withdrawn.
Added a distinction between user ID and subnet ID so that the check as to whether the user already has a rental agreement returns an accurate result.
Crate version updates and dependency changes.
Updates to documentation.
About CodeGov
CodeGov has a team of developers who review and vote independently on the following proposal topics: IC-OS Version Election, Protocol Canister Management, Subnet Management, API Boundary Node Management, Node Admin and Participant Management. The CodeGov NNS known neuron is configured to follow our reviewers on these technical topics. We also have a group of Followees who vote independently on the Governance and the SNS & Neurons’ Fund topics. We strive to be a credible and reliable Followee option that votes on every proposal and every proposal topic in the NNS. We also support decentralisation of SNS projects such as WaterNeuron, KongSwap, and Alice with a known neuron and credible Followees.
Learn more about CodeGov and its mission at codegov.org.
[chore: Fix check if user has rental agreement and cleanup]: Refactors the locking function that checks if days_since_last_locking is 30 days or more, and if 100% of the initial hasn’t been already locked it locks an additional 10% of that initial cost and converts it into cycles.
[fix: Unwithdrawable funds on SRC]: Refactors the refund function removing the locking mechanism CallerGuard from locking refund calls so only one is possible at a time, and changes the locking on rental_request be one at a time instead of one per caller (this will be addressed in a later PR). Subtracts the DEFAULT_FEE from the subbacount balance and refunds the caller. If the user has a rental request, burns the locked cycles and then removes the request.
[chore: Bump versions]: Fixes PocketIC tests by updating the match on pic.query_call. Bumps versions. Refactos imports to be alphabetically ordered. Refactors code.
[Make getting the subaccount easier]: Renames query function get_payment_subaccount to get_payment_account which now takes a principal and returns the AccountIdentifier as an hex string.
[chore: Update docs]: Updates dfx and docker versions referenced in docs
[fix: Fix build script on macOS]: Simplifies the build script by setting URL_CANDID_EXTRACTOR in a previous if statement therefore removing another if statement that wasn’t needed.
[fix: amount of ICP transferred to CMC]: Fixes the amount being transferred from the SRC to the CMC from amount - DEFAULT_FEE - DEFAULT_FEE to amount - DEFAULT_FEE.
About CodeGov - reliable, credible, and sensible NNS governance CodeGov has a team of developers who review and vote independently on the following proposal topics: IC-OS Version Election, Protocol Canister Management, Subnet Management, Node Admin, and Participant Management. The CodeGov NNS known neuron is configured to follow our reviewers on these technical topics. We also have a group of Followees who vote independently on the Governance and the SNS & Neuron's Fund topics. We strive to be a credible and reliable Followee option that votes on every proposal and every proposal topic in the NNS. We also support decentralization of SNS projects such as WaterNeuron, KongSwap, and Alice with a known neuron and credible Followees.
Learn more about CodeGov and its mission at codegov.org.
Switched to a Docker-based build with the latest DFX, ditched the old Rust/PocketIC setup, and consolidated wasm fetching with get_wasms.sh. Bumped Rust to 1.87.0, integrated candid-extractor, and updated deps like ic-stable-structures to 0.6.4. Refactored get_payment_subaccount to get_payment_account for cleaner principal handling and hex string output. The locking function now incrementally converts 10% of ICP to cycles every 30 days, and the refund logic got a slick overhaul to fix unwithdrawable funds and burn cycles properly.