This process is gas intensive and a Merkle Tree based solution is currently being worked on that would only require an update + approval of the tree root, drastically reducing the gas cost to add keys.
Now that we have the exact address of the vPool and its vWithdrawalRecipient, we can start creating validation keys for its withdrawal credentials and upload them to the vFactory.
Withdrawal Channels
The vFactory stores keys in separated Withdrawal Channels. Only two types of Withdrawal Channels exist:
Withdrawal Channel != 0: The withdrawal channel value is the actual withdrawal credential of the keys inside the channel. In the case of the vPool, keys are added on a withdrawal channel that is equal to the withdrawal credential of the vWithdrawalRecipient
Withdrawal Channel == 0: This special withdrawal channel holds keys with each its own withdrawal recipient, handled by the vFactory. This means that the generation of these keys is a bit different as the address of the withdrawal recipient is deterministic and based on the validator public. We won't use this channel for the vPool.
Retrieving the withdrawal credential of the vPool
TheGraph: Retrieve the withdrawal credential of the vPool
And once done, you can check the generated deposit_data file to make sure that all keys:
have the same withdrawal credential
the value is the proper one
Verifying our 10 keys before submission
We can now verify our deposit data to make sure it's valid. The tool we're going to use ensures that the key has no duplicates inside the vFactory and ensures that the signature associated with the public key is valid.
You should retrieve the vsuite-utils repository, and have golang installed for the next step.
When keys are approved, authorized depositors on the withdrawal channel will be able to fund them. This means that it is a very critical action, that only the ADMIN of the vFactory can perform. We suggest using a multisig where a quorum of members will be able to run the verification script on their end to ensure that the current keys of the channel are valid.
The approve method of the vFactory is able to change the staking limit of several withdrawal channels at once.
The parameters are the following ones:
withdrawalChannels: The list of withdrawal channels that we will approve
limits: The staking limits of the withdrawal channels, at the same indexes
snapshots: This parameter will ensure that the approval only passes if there has been no modification to the channel since the provided snapshot block number. When perform the off-chain verifications, quorum members should use the same snapshot block number to perform their verifications.
vsuite-utils: Verifying all the keys on a channel before an approve call
Starting analysis of withdrawal channel WITHDRAWAL_CHANNEL
Starting withdrawal channel analysis at finalized block 9244029
Loaded withdrawal channel details: total=10, limit=0, funded=0
All keys are ok
In the case where you have a quorum that needs to vote on an approval, the proposal creator can run this script with --block-tag finalized to craft a finalized report. Then, the block number at which the report was made can be used as the snapshots value for the verified withdrawal channel
Quorum members can run the same command, but should replace --block-tag finalized by --block-tag <snapshot block number>
Once we know all the keys are valid, we can approve them ! In the following example we use cast but only as illustration for testnet, we strongly recommend using a strong multisig on mainnet for this purpose.