Skip to content

Instantly share code, notes, and snippets.

View rossbulat's full-sized avatar

Ross Bulat rossbulat

View GitHub Profile

Fast Unstake Market

This is a part of an effort to explore methods of fast unstaking.

Slashing is rare, but the mechanism must remain to incentivise validators behaving properly. Given a trusted validator, users should feel confident that funds will not get slashed in an unbonding period.

Idea: A fast unstake market whereby any user can aborb the risk associated with unlock chunks, and instantly transfer the bonded amount to the staker - for a small fee.

Scenario:

@rossbulat
rossbulat / fast_unstake.md
Last active August 15, 2022 21:19
Fast Unstake System

Fast Unstake with No Exposure

I’ve thought quite deeply about how a quick unstake system can be introduced in staking. Here are my findings.

A nominator should be able to immediately unstake if their nominations have not been exposed in the last BondingDuration eras. But it is extremely costly to check this. Instead of iterating the entirety of ErasStakers, we could just keep track of a nominator's nominees, and check whether that subset have been exposed in the last BondingDuration eras.

Such a feature will not be useful for everyone, so this should ideally be an opt-in feature.

We want to do this in a way that is easy to clean up stale era data. The most efficient way to do this is by calling a single remove_prefix with the expired era in question.

@rossbulat
rossbulat / carousel.jsx
Created January 25, 2020 13:30
Carousel Initialisation
@rossbulat
rossbulat / util.js
Last active September 20, 2018 07:36
my_async
module.exports = {
my_async: async (func, args = {}) => {
return (await (func(...args)));
}
};