Skip to content

Commit

Permalink
Move in instructions from inherent transactions to unsigned transactions
Browse files Browse the repository at this point in the history
The original intent was to use inherent transactions to prevent needing to vote
on-chain, which would spam the chain with worthless votes. Inherent
transactions, and our Tendermint library, would use the BFT's processs voting
to also vote on all included transactions. This perfectly collapses integrity
voting creating *no additional on-chain costs*.

Unfortunately, this led to issues such as #6, along with questions of validator
scalability when all validators are expencted to participate in consensus (in
order to vote on if the included instructions are valid). This has been
summarized in #241.

With this change, we can remove Tendermint from Substrate. This greatly
decreases our complexity. While I'm unhappy with the amount of time spent on
it, just to reach this conclusion, thankfully tendermint-machine itself is
still usable for #163. This also has reached a tipping point recently as the
polkadot-v0.9.40 branch of substrate changed how syncing works, requiring
further changes to sc-tendermint. These have no value if we're just going to
get rid of it later, due to fundamental design issues, yet I would like to
keep Substrate updated.

This should be followed by moving back to GRANDPA, enabling closing most open
Tendermint issues.

Please note the current in-instructions-pallet does not actually verify the
included signature yet. It's marked TODO, despite this bing critical.
  • Loading branch information
kayabaNerve committed Mar 26, 2023
1 parent 9157f8d commit c182b80
Show file tree
Hide file tree
Showing 26 changed files with 310 additions and 486 deletions.
16 changes: 1 addition & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ members = [

"substrate/in-instructions/primitives",
"substrate/in-instructions/pallet",
"substrate/in-instructions/client",

"substrate/validator-sets/primitives",
"substrate/validator-sets/pallet",
Expand Down
1 change: 0 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ exceptions = [
{ allow = ["AGPL-3.0"], name = "tokens-pallet" },

{ allow = ["AGPL-3.0"], name = "in-instructions-pallet" },
{ allow = ["AGPL-3.0"], name = "in-instructions-client" },

{ allow = ["AGPL-3.0"], name = "validator-sets-pallet" },

Expand Down
32 changes: 0 additions & 32 deletions docs/protocol/Consensus.md

This file was deleted.

8 changes: 8 additions & 0 deletions docs/protocol/In Instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# In Instructions

In Instructions are included onto the Serai blockchain via unsigned
transactions. In order to ensure the integrity of the included instructions, the
validator set responsible for the network in question produces a threshold
signature of their authenticity.

This lets all other validators verify the instructions with an O(1) operation.
24 changes: 0 additions & 24 deletions substrate/in-instructions/client/Cargo.toml

This file was deleted.

15 changes: 0 additions & 15 deletions substrate/in-instructions/client/LICENSE

This file was deleted.

47 changes: 0 additions & 47 deletions substrate/in-instructions/client/src/lib.rs

This file was deleted.

4 changes: 1 addition & 3 deletions substrate/in-instructions/pallet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "in-instructions-pallet"
version = "0.1.0"
description = "Execute calls via In Instructions from inherent transactions"
description = "Execute calls via In Instructions from unsigned transactions"
license = "AGPL-3.0-only"
authors = ["Luke Parker <[email protected]>"]
edition = "2021"
Expand All @@ -17,7 +17,6 @@ thiserror = { version = "1", optional = true }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "2", default-features = false, features = ["derive"] }

sp-inherents = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false }

frame-system = { git = "https://github.com/serai-dex/substrate", default-features = false }
Expand All @@ -35,7 +34,6 @@ std = [
"scale/std",
"scale-info/std",

"sp-inherents/std",
"sp-runtime/std",

"frame-system/std",
Expand Down
Loading

0 comments on commit c182b80

Please sign in to comment.