Add signals pallet

Resolves #353

Implements code such that:

- 80% of validators (by stake) must be in favor of a signal for the network to
  be
- 80% of networks (by stake) must be in favor of a signal for it to be locked
  in
- After a signal has been locked in for two weeks, the network halts

The intention is to:

1) Not allow validators to unilaterally declare new consensus rules.

No method of declaring new consensus rules is provided by this pallet. Solely a
way to deprecate the current rules, with a signaled for successor. All nodes
must then individually decide whether or not to download and run a new node
which has new rules, and if so, which rules.

2) Not place blobs on chain.

Even if they'd be reproducible, it's just a lot of data to chuck on the
blockchain.
This commit is contained in:
Luke Parker
2023-10-21 20:06:53 -04:00
parent b66203ae3f
commit 1bff2a0447
10 changed files with 556 additions and 38 deletions

View File

@@ -48,8 +48,10 @@ pallet-transaction-payment = { git = "https://github.com/serai-dex/substrate", d
coins-pallet = { package = "serai-coins-pallet", path = "../coins/pallet", default-features = false }
in-instructions-pallet = { package = "serai-in-instructions-pallet", path = "../in-instructions/pallet", default-features = false }
staking-pallet = { package = "serai-staking-pallet", path = "../staking/pallet", default-features = false }
validator-sets-pallet = { package = "serai-validator-sets-pallet", path = "../validator-sets/pallet", default-features = false }
staking-pallet = { package = "serai-staking-pallet", path = "../staking/pallet", default-features = false }
signals-pallet = { package = "serai-signals-pallet", path = "../signals/pallet", default-features = false }
pallet-session = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-babe = { git = "https://github.com/serai-dex/substrate", default-features = false }
@@ -100,8 +102,10 @@ std = [
"coins-pallet/std",
"in-instructions-pallet/std",
"staking-pallet/std",
"validator-sets-pallet/std",
"staking-pallet/std",
"signals-pallet/std",
"pallet-session/std",
"pallet-babe/std",