Collator Staking

Rust Check & Build

check && build

make help
make fmt
make check
make test
make build

how to participant as candidate/collator

https://docs.moonbeam.network/node-operators/networks/collator/

apply as candidate

extrinsic

extrinsic

event

event

run collator node & map sessionKey

/home/bifrost/ronyang/parachain/bifrost/target/release/bifrost --ws-port=18850 --port=38850 --collator --base-path ./data --chain=bifrost-local --unsafe-ws-external --unsafe-rpc-external --rpc-cors=all --rpc-methods=Unsafe --rpc-port=28850 --wasm-execution=compiled --execution=wasm -- --chain=/home/bifrost/ronyang/parachain/polkadot-launch/rococo-local-raw.json --wasm-execution=compiled --execution=wasm --no-beefy

i9Zyphq

AMGQnJM

bond more by self

extrinsic

extrinsic

event

event

after 2 rounds the new collator begin produce blocks and receive Rewards

Rewards

Participate as Nominator/Delegator

https://docs.moonbeam.network/tokens/staking/stake/

delegate to some candidate

extrinsic

extrinsic

event

event

delegate more

we can delegate more any time

delegate_more

delegate less

to delegator less require schedule request first

delegate_less

then any one can execute the request after 36 rounds

request

revoke delegate

to revoke means unbond from specific collator

unbond

then any one can execute the request after 36 rounds

request

leave delegator

to leave means unbound from all collators and require schedule first

unbound

then execute the request after 36 rounds

request

Staking Reward

Rewards for collators and their delegators are calculated at the start of every round for their work prior to the reward payout delay(2 rounds).

https://docs.moonbeam.network/learn/features/staking/

Reward

Some Revamp

mainly reference moonbeam implementation while decouple nimbus from staking, implement traits to integrate with Session module

Decomple with Nimbus

https://github.com/bifrost-finance/moonbeam/commit/2e3f7dddad6294b661e08d17b45f42e853b4ecff

Benifit of Nimbus

https://docs.moonbeam.network/cn/learn/features/consensus/

actually we've prepared another branch with nimbus integration and we may try it later if required

https://github.com/bifrost-finance/bifrost/tree/collator-staking

api docs

https://purestake.github.io/moonbeam/parachain_staking/

runtime storage

candidate state

candidate

delegate state

delegate

unbounding/revoke request also in delegate state

candidate pool & topN selected

pool

after each round will choose candidate from selected pool as potential block producer

MinDelegation

there is a const value defines the min value to participant the staking

MinDelegation

but not all delegators for the collator will receive reward, only the top T::MaxDelegatorsPerCollator)(100 by default) will, so actually the MinDelegation will be dynamically calculated on fly