Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Changes from 1 commit
Commits
Show all changes
251 commits
Select commit Hold shift + click to select a range
48558a2
upgrade log crate version to 0.4.13 (#285)
atenjin Jan 13, 2021
7277f7a
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Jan 14, 2021
8976227
Update
cecton Jan 20, 2021
24a3b9c
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Jan 26, 2021
095f127
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Jan 26, 2021
4b69b8d
Update Substrate & Polkadot
bkchr Jan 27, 2021
bd3697d
Tag HRMP messages as sibling for executor (#309)
akru Feb 5, 2021
4710f71
Add call to XCM Handler (#319)
shawntabrizi Feb 8, 2021
5d230a9
Use correct relative path for a parachain (#322)
vgeddes Feb 9, 2021
a5df6c9
bring in author inherent from moonbeam
JoshOrndorff Feb 12, 2021
6dcd63e
Naively brin in author filter - doesn't compile yet
JoshOrndorff Feb 12, 2021
1a9855d
MAke author filter compile (has one nasty workaround regarding random…
JoshOrndorff Feb 12, 2021
e39e924
Make the runtime compile
JoshOrndorff Feb 12, 2021
0ed4be6
ughh that was rough
JoshOrndorff Feb 12, 2021
cd1e815
Start working on chain spec
JoshOrndorff Feb 12, 2021
5f82a35
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Feb 15, 2021
fad35c2
Update Substrate & Polkadot
bkchr Feb 16, 2021
0a0dc9b
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Feb 18, 2021
8e5ca06
bring in u32 fix
JoshOrndorff Feb 18, 2021
e5f8fd4
bump polkadot ref
rphmeier Feb 18, 2021
272b0ea
Something compiles. Only alice can supply author inherent atm
JoshOrndorff Feb 18, 2021
10dbedb
Merge branch 'master' into joshy-reproduce-stall
JoshOrndorff Feb 18, 2021
85e324b
Need two authors to reproduce it clearly.
JoshOrndorff Feb 18, 2021
f01f616
clean cargo toml
JoshOrndorff Feb 18, 2021
762fff0
try to fix test. Setting it aside for now.
JoshOrndorff Feb 18, 2021
42f86ff
Merge branch 'master' into nimbus
JoshOrndorff Feb 18, 2021
3e52825
clean logging
JoshOrndorff Feb 19, 2021
8c5b09b
Merge branch 'master' into nimbus
JoshOrndorff Feb 23, 2021
bf6cd96
use debug
JoshOrndorff Feb 23, 2021
11383b4
Add both height and slot-based filters
JoshOrndorff Feb 23, 2021
d4d30b6
start sketching toward prediction runtime API
JoshOrndorff Feb 23, 2021
6718e65
fill in some blanks
JoshOrndorff Feb 23, 2021
5de12bc
Prune debugging event
JoshOrndorff Feb 23, 2021
44deeea
Implemented runtime API compiles. But does it work?
JoshOrndorff Feb 23, 2021
4e192a9
mirror changes in height filter
JoshOrndorff Feb 23, 2021
ebada41
swap over to our consensus. Ready for hacking.
JoshOrndorff Feb 23, 2021
2bf5485
update to latest polkadot & substrate
rphmeier Feb 23, 2021
cd5f356
bump polkadot and substrate
rphmeier Feb 24, 2021
313bb04
Runtime API takes author as byte array for now
JoshOrndorff Feb 28, 2021
42ca6cb
use tracing::error!
JoshOrndorff Feb 28, 2021
e9f5f7e
Merge branch 'master' into nimbus
JoshOrndorff Feb 28, 2021
db26fed
Merge branch 'master' into nimbus
JoshOrndorff Feb 28, 2021
b44b1e3
call to runtime api compiles
JoshOrndorff Feb 28, 2021
5839850
Demonstrate basic slot prediction works!
JoshOrndorff Mar 1, 2021
e5b1d6a
Wire author id into filtering consensus (doesn't compile)
JoshOrndorff Mar 2, 2021
ca111d9
Finish using generic AuthorId type. But predictions are wrong. I wond…
JoshOrndorff Mar 2, 2021
feed233
Nicer logging and comments
JoshOrndorff Mar 2, 2021
b346d58
oops, where did these files come from?
JoshOrndorff Mar 2, 2021
2ca62ab
More debugging lines - Why don't these print when authoring?
JoshOrndorff Mar 2, 2021
992a543
No need to manually init randomness. That happes for us. Substrate is…
JoshOrndorff Mar 2, 2021
92be201
vocab: staked -> active
JoshOrndorff Mar 2, 2021
49cb8dc
idea about api return type in future
JoshOrndorff Mar 2, 2021
fed6dff
actually skip ineligible slots
JoshOrndorff Mar 2, 2021
25b10e7
minor cleanup
JoshOrndorff Mar 2, 2021
23f9d3a
Add account set pallet to mock staking solution
JoshOrndorff Mar 3, 2021
2f0392b
strip account set from indiviual filters
JoshOrndorff Mar 3, 2021
a76c707
Make it compile
JoshOrndorff Mar 3, 2021
832c684
Split author checking into two parts
JoshOrndorff Mar 3, 2021
99941d3
Add an aura style filter. This really helped me see what the trait ca…
JoshOrndorff Mar 3, 2021
9563149
Clean up log target
JoshOrndorff Mar 3, 2021
a0dd25a
Same procedure as every day (#345)
bkchr Feb 25, 2021
9b0c242
master.into() // Also debugging is busted now :eye_roll:
JoshOrndorff Mar 4, 2021
5d964fb
Fix logging
JoshOrndorff Mar 5, 2021
e013781
Attach a seal
JoshOrndorff Mar 5, 2021
c2aef53
Validators can import
JoshOrndorff Mar 5, 2021
2ded56e
emojify PoV message
JoshOrndorff Mar 5, 2021
193c78a
Verifier works. Multiple paranodes are now supported!
JoshOrndorff Mar 5, 2021
3aea792
comment
JoshOrndorff Mar 5, 2021
dc3caf0
docs
JoshOrndorff Mar 5, 2021
31a7192
typos
JoshOrndorff Mar 5, 2021
dd05793
typo
JoshOrndorff Mar 5, 2021
7151180
Merge branch 'master' into nimbus
JoshOrndorff Mar 8, 2021
c76d151
fix build
JoshOrndorff Mar 8, 2021
3628b5d
shelve the return reason idea
JoshOrndorff Mar 8, 2021
3da7868
Wire keystore into nimbus consensus
JoshOrndorff Mar 8, 2021
492c474
Notes on experimental success
JoshOrndorff Mar 8, 2021
54af784
Abstract over AuthorId type in runtime (client not yet done)
JoshOrndorff Mar 8, 2021
d44f294
Decisions, direction, thoughts after being stuck yesterday
JoshOrndorff Mar 9, 2021
4f2c058
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Mar 9, 2021
288f10c
Update chain specs
bkchr Mar 9, 2021
eb0932f
Use keystore to check for available keys (compiles, not yet tested)
JoshOrndorff Mar 10, 2021
4c2e286
Don't also use the old inherent provider.
JoshOrndorff Mar 10, 2021
c87ee2e
Idea and some minor docs
JoshOrndorff Mar 10, 2021
5c3a224
Change inherent data type to AuthorId. It now compiles and "works". B…
JoshOrndorff Mar 10, 2021
ab0609e
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Mar 10, 2021
24b1ee6
Update Substrate to include some commit
bkchr Mar 10, 2021
8771d94
Update Cargo.lock
bkchr Mar 18, 2021
c9b1fe3
Update Substrate & Polkadot
bkchr Mar 19, 2021
0b8b7fa
Update Substrate & Polkadot
bkchr Mar 22, 2021
33decd6
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Mar 23, 2021
90b1e18
Genesis time
bkchr Mar 23, 2021
10887b7
bump rococo-v1 polkadot
rphmeier Mar 24, 2021
b011122
bump rococo-v1 polkadot
rphmeier Mar 25, 2021
9d89ed6
update collator protocol to take full key
rphmeier Mar 25, 2021
0b4097c
Make it compile on rococo-v1
JoshOrndorff Mar 25, 2021
01752d1
Hook up XcmHandler to the system module (#381)
pepyakin Mar 30, 2021
d38fa53
Add spambot
gavofyork Mar 30, 2021
28f5ec2
Fixes
gavofyork Mar 30, 2021
2fc85fd
Add some extra functions to spambot, bump version
gavofyork Mar 30, 2021
9e09dd0
Fix build
bkchr Mar 31, 2021
7bea3f7
Aggregate HRMP (XCMP/HMP) messages. Payloads for spambot.
gavofyork Mar 31, 2021
8ce15c8
Merge branch 'rococo-v1' of github.com:paritytech/cumulus into rococo-v1
gavofyork Apr 1, 2021
deda3da
Fix tests, bump Polkadot.
gavofyork Apr 1, 2021
dfe1848
Fix HMP tests
gavofyork Apr 1, 2021
b9b9cbd
Rename Hrmp -> Xcmp for handler/sender
gavofyork Apr 1, 2021
b07e041
bump rococo-v1
rphmeier Apr 3, 2021
2d0aade
bump Polkadot and Substrate refs
rphmeier Apr 3, 2021
d7068cc
update polkadot commit ref
rphmeier Apr 4, 2021
3a205e3
bump polkadot ref
rphmeier Apr 5, 2021
85bc817
Update Substrate
bkchr Apr 6, 2021
fd007bb
Improve Storage and Add `set_upgrade_block` to Validation Function Up…
shawntabrizi Mar 31, 2021
2384c2e
bump refs
rphmeier Apr 6, 2021
ce8589a
Update Substrate & Polkadot (#387)
bkchr Apr 2, 2021
2a4769c
Merge branch 'rococo-v1' of https://github.com/paritytech/cumulus int…
rphmeier Apr 6, 2021
dc37cbf
bump spec version
rphmeier Apr 6, 2021
6a75df1
bump refs
rphmeier Apr 6, 2021
651abce
New genesis
bkchr Apr 6, 2021
c5be730
bump refs
rphmeier Apr 7, 2021
519403c
bump refs again
rphmeier Apr 8, 2021
72bcc4a
remove real-overseer and bump refs
rphmeier Apr 8, 2021
5b2393e
bump refs again
rphmeier Apr 8, 2021
aa0f10d
bump refs
rphmeier Apr 9, 2021
b225faf
make test-service compile
rphmeier Apr 9, 2021
8ecbe78
bump refs to include code compression
rphmeier Apr 9, 2021
67f973b
Approve block announcements of backed blocks
bkchr Apr 10, 2021
facd422
Approve block announcement if it comes from the best known block
bkchr Apr 11, 2021
dcf8dc9
Remove pov hash comparison when waiting on a block to announce
bkchr Apr 11, 2021
3db8a38
Fix compilation
bkchr Apr 11, 2021
6ed9632
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Apr 14, 2021
da4c3ba
Merge remote-tracking branch 'origin/master' into rococo-v1
bkchr Apr 27, 2021
fdc45a1
rococo-v1.into() // Doesn't compile yet, but geting close. This is a …
JoshOrndorff Apr 28, 2021
8b6f136
make it compile
JoshOrndorff Apr 28, 2021
80642e2
rebrand as nimbus consensus
JoshOrndorff Apr 28, 2021
9d2b145
start stripping colaltor key flag pathway
JoshOrndorff Apr 28, 2021
2d13f4a
finish stripping manually passed author id
JoshOrndorff Apr 28, 2021
9fcbd01
add polkadot launch config
JoshOrndorff Apr 28, 2021
8f78a4f
relax bounds on author_inherent::Config::AuthorId
JoshOrndorff May 4, 2021
53dd615
fix author inherent tests
JoshOrndorff May 4, 2021
b5a61b6
AuthorInherent: Add test for bad origin
JoshOrndorff May 4, 2021
3289b17
standardize sp-std dependency
JoshOrndorff May 4, 2021
1aebed7
Clean AURA docs for better community understanding
JoshOrndorff May 5, 2021
ded3b22
better trait bounds for inherent data provider
JoshOrndorff May 5, 2021
96b95c5
tiny spacing fixes
JoshOrndorff May 5, 2021
48b8bd8
Make runtime API generic
JoshOrndorff May 5, 2021
d099c83
better primitves crate
JoshOrndorff May 6, 2021
8ea2162
update readme
JoshOrndorff May 6, 2021
fdd6f60
comment about pre-validation possibility
JoshOrndorff May 6, 2021
9e4d721
fix polkadot launch config
JoshOrndorff May 6, 2021
4f287c7
clean up some outdated comments
JoshOrndorff May 6, 2021
0102d7a
remove stray println
JoshOrndorff May 6, 2021
b9a3fa3
clean up a bunch of warnings
JoshOrndorff May 6, 2021
cd68f7a
move executor into pallet author inherent for better reuse.
JoshOrndorff May 7, 2021
061a3aa
begin reworking CanAuthor trait
JoshOrndorff May 10, 2021
e57a477
Remove long-outdated todo
JoshOrndorff May 11, 2021
aea3072
update account-set
JoshOrndorff May 11, 2021
567baf1
runtime compiles
JoshOrndorff May 11, 2021
1a4f022
proper runtime api imp ready for 🖨️🍝
JoshOrndorff May 11, 2021
62d7ec8
sketch a height beacon thatobviates the author height filter
JoshOrndorff May 11, 2021
93d36bb
move SlotBeacon impls to library crate.
JoshOrndorff May 11, 2021
e62db11
move EventHandler to primitives
JoshOrndorff May 12, 2021
bb8fd65
oops missed tihs one
JoshOrndorff May 12, 2021
d3c8613
Note about how inherents are gong to change.
JoshOrndorff May 12, 2021
8f972e7
tiny renaming in primitives
JoshOrndorff May 12, 2021
9f16c89
Don't "check" author inherent
JoshOrndorff May 12, 2021
5e35708
Nicer logging when no keys are available
JoshOrndorff May 12, 2021
60863fb
Collators sign blocks (but don't include sign and nobody checks it)
JoshOrndorff May 12, 2021
c724635
shorten runtime line
JoshOrndorff May 12, 2021
43af6e8
Switch branches
bkchr May 13, 2021
95d81d4
Fix chain spec handling
bkchr May 13, 2021
8dec150
Blocks are now signed, but verifier fails to validate signatures.
JoshOrndorff May 13, 2021
d589570
Signatures now verify on parachain nodes, (not yet on validators)
JoshOrndorff May 13, 2021
0f6397d
checkpoint toward validators checking signatures
JoshOrndorff May 13, 2021
38aacdd
checkpoint
JoshOrndorff May 13, 2021
ac97775
clear outdated comment
JoshOrndorff May 14, 2021
9056a63
Signature verification seems working on validators (gotta make sure)
JoshOrndorff May 14, 2021
838c2b2
clean up custom executor
JoshOrndorff May 14, 2021
3a24da8
Move engine id to primitives
JoshOrndorff May 14, 2021
627210d
Sketch CompatibleDigestItem trait, but don't use it yet
JoshOrndorff May 14, 2021
95b0faa
cleanup percent handling
JoshOrndorff May 14, 2021
c6744d7
update comment
JoshOrndorff May 14, 2021
4b2c515
Introduce `CollectCollationInfo` runtime api (#443)
bkchr May 17, 2021
a25daae
Merge branch 'polkadot-v0.9.1' into nimbus
notlesh May 17, 2021
9c30e45
Fix a couple fallouts from merge
notlesh May 17, 2021
c0949ab
Use substrate's polkadot-v0.9.1 branch
notlesh May 18, 2021
5526fe8
Update Cargo.lock
notlesh May 18, 2021
12d3ddd
Remove duplicated code
notlesh May 18, 2021
25e1a91
`nimbus-consensus` crate compiles
JoshOrndorff May 19, 2021
da6c83f
pallet-author-inherent compiles, primitives kinda sketched
JoshOrndorff May 19, 2021
0881b2e
Rococo parachains runtime compiles
JoshOrndorff May 19, 2021
032170d
Fix some build-dependency weirdnes
JoshOrndorff May 19, 2021
33b4e07
rename to nimbus runtime
JoshOrndorff May 20, 2021
6382bf0
Restore original aura runtime, both compile
JoshOrndorff May 20, 2021
421cd78
Whole project checks again, still no nimbus service
JoshOrndorff May 20, 2021
c31fc93
add function get_nimbus_spec
JoshOrndorff May 20, 2021
1bda44b
sketch command.rs
JoshOrndorff May 20, 2021
7bfd973
sketch `build_import_queue` function
JoshOrndorff May 20, 2021
579d803
update `nimbus-consensus` crate for author inehrent
JoshOrndorff May 20, 2021
a228d02
update `nimbus-primitives`. Hoope the new Send + Sync bounds are okay
JoshOrndorff May 20, 2021
8106d06
everything compiles
JoshOrndorff May 20, 2021
f8c91f2
update launch config (but polkadot launch is not working so far)
JoshOrndorff May 20, 2021
3a136c3
Fix chain spec name and id
JoshOrndorff May 20, 2021
0c5deec
make signature line debug
JoshOrndorff May 20, 2021
aefa55a
Update from polkadot-v0.9.1 -> polkadot-v0.9.2
notlesh May 20, 2021
4b71206
Update branch
bkchr May 21, 2021
cd50542
Merge branch 'polkadot-v0.9.2' into notlesh-nimbus-merge-polkadot-v0.9.2
notlesh May 21, 2021
5635eb7
Add XcmReserveTransferFilter
notlesh May 21, 2021
0877d5e
slap another runtime_version on
JoshOrndorff May 21, 2021
01c2c1e
Associated type for AccoutnLookup.
JoshOrndorff May 24, 2021
c14fd33
Fix genesis config
JoshOrndorff May 24, 2021
e1cdc0c
Remove unused PreliminaryCanAuthor
JoshOrndorff May 24, 2021
00deb5d
Merge branch 'master' into nimbus
JoshOrndorff Jun 7, 2021
eee182f
ParachainBlockImport
JoshOrndorff Jun 7, 2021
f7e2da9
MAke it build
JoshOrndorff Jun 7, 2021
e04181f
fix function naming
JoshOrndorff Jun 7, 2021
4af429e
restore accidentally removed line
JoshOrndorff Jun 7, 2021
7b2c27e
clean outdated comment
JoshOrndorff Jun 7, 2021
0e97258
prune accidentally-added old code
JoshOrndorff Jun 7, 2021
ad58a6f
fix licenses
JoshOrndorff Jun 7, 2021
1771700
cleanup stray commetn
JoshOrndorff Jun 7, 2021
7ccae4e
prune more accidentally re-added code
JoshOrndorff Jun 7, 2021
a5a1c8f
restore standard parachain system lib.rs
JoshOrndorff Jun 7, 2021
9bd4b0d
restore more accidentally-modified files
JoshOrndorff Jun 7, 2021
ea6d132
update commetn
JoshOrndorff Jun 7, 2021
678110f
more cleaning
JoshOrndorff Jun 7, 2021
bc29491
Clean outdated todo
JoshOrndorff Jun 7, 2021
128bbde
cleanup the primitives
JoshOrndorff Jun 7, 2021
20c0e89
Readme in proper place
JoshOrndorff Jun 8, 2021
3815bc4
move account_set to runtime because it should not be copied.
JoshOrndorff Jun 8, 2021
f47d019
Merge commit 'd935b81e7010fcf5c5639e238c78d865c1d6ed67' into nimbus
JoshOrndorff Jun 8, 2021
fb44a30
Merge branch 'master' into nimbus
JoshOrndorff Jun 8, 2021
c2c0b06
remove outdated comment
JoshOrndorff Jun 8, 2021
e640c58
Remove unnecessary hooks and calls
JoshOrndorff Jun 9, 2021
27ba896
Merge branch 'master' into nimbus
JoshOrndorff Jun 14, 2021
730801c
Sketch `CheckInherents`
JoshOrndorff Jun 14, 2021
43d9613
fix warning
JoshOrndorff Jun 14, 2021
65cc3f2
fix and expand long-neglected tests
JoshOrndorff Jun 14, 2021
d2d5af8
Merge branch 'master' into nimbus
JoshOrndorff Jun 18, 2021
6fb9cb3
fix build
JoshOrndorff Jun 22, 2021
3ea480e
Merge branch 'master' into nimbus
JoshOrndorff Jun 22, 2021
6e1dc41
Merge branch 'master' into nimbus
JoshOrndorff Jul 6, 2021
fc7c3ec
impl<T: BlockNumberProvider> SlotBeacon for T
JoshOrndorff Jul 7, 2021
37c38f2
Merge branch 'master' into nimbus
JoshOrndorff Jul 8, 2021
6e4f2b3
Fix prediction initialization from Substrate#8953
JoshOrndorff Jul 9, 2021
8dc44a8
Actually fix prediction properly
JoshOrndorff Jul 9, 2021
0b44d91
`AuthorFilterAPI` versioning
tgmichel Jul 19, 2021
11a4f8a
Fix error handling
tgmichel Jul 19, 2021
9218cef
Fix `ApiRef` re-use
tgmichel Jul 20, 2021
50302c5
Merge commit '4f936689ef3bb503c60694561bddac1db11b2181' into nimbus
JoshOrndorff Aug 21, 2021
7c5c282
Make it build
JoshOrndorff Aug 21, 2021
c0ae4a1
skip_prediction feature.
JoshOrndorff Aug 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update readme
  • Loading branch information
JoshOrndorff committed May 6, 2021
commit 8ea21625fb3de1307bf20e3371c70fa4f2810e1f
71 changes: 34 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cumulo -- Nimbus ⛈️

Nimbus is a set of tools for building and testing parachain consensus systems on [cumulus](https://github.com/paritytech/cumulus)-based parachains.
Nimbus is a framework for building slot-based parachain consensus systems on [cumulus](https://github.com/paritytech/cumulus)-based parachains.

Given the regular six-second pulse-like nature of the relay chain, it is natural to think about slot-
based consensus algorithms for parachains. The parachain network is responsible for liveness and
Expand All @@ -18,8 +18,8 @@ along with helpful traits for implementing the parts that researchers and develo

## Try the Demo

While Nimbus is primarily a developer toolkit meant to be included in other projects, it is useful
to see a basic node in action. An example node is included in the `rococo-parachains` directory. You
While Nimbus is primarily a development framework meant to be included in other projects, it is useful
to see a basic network in action. An example node is included in the `rococo-parachains` directory. You
can build it with `cargo build --release` and launch it like any other cumulus parachian.

Rather than reiterate how to start a relay-para network here, I'll simply recommend you use the
Expand Down Expand Up @@ -54,14 +54,14 @@ using Nimbus in your project, it is worth reading this.

### Author Inherent

The Author inherent pallet provides an inherent in which block authors can insert their identity into
The Author inherent pallet allows block authors to insert their identity into
the runtime. It also includes an inherent data provider for the client-side node to create the appropriate
inherents. This feature alone is useful in many blockchains and can be used for things like block rewards.
This piece can be used alone without any other parts of nimbus if all you desire is authoring information
in the runtime.

The author inherent provides two hooks called `PreliminaryCanAuthor` and `FullCanAuthor`. The
preliminary check will be run by non-authoring nodes before importing a block to quickly rule out some
The author inherent provides two validation hooks called `PreliminaryCanAuthor` and `FullCanAuthor`. The
preliminary check will be run before importing a block to quickly rule out some
invalid authors. This check should be cheap and should not depend on other runtime state. The full
check will be called during the inherent execution and is the final say for whether an author is eligible.
The preliminary check may rule out authors, but does not guarantee eligibility. Said another way, it
Expand All @@ -83,15 +83,19 @@ someone else's identity via the author inherent. In some cases (famously bitcoin
desired. When used in this mode it is more common to use the term "beneficiary" than "author". If you
want your authorship information to be proven, you will need to use more parts of Nimbus; read on.

**Feedback Requested** I've occasionally heard and wondered myself whether this would work better as a
pre-runtime digest than an inherent. I'm open to that change. I build it as an inherent because I don't
clearly understand the distinction between the two, and I'm more familiar with inherents.

### Author Filters

Many consensus engines will want to restrict which authors can author. Some may have a static set, others
A primary job of a consensus engine is deciding who can author each block. Some may have a static set, others
may rotate the set each era, others may elect an always-changing subset of all potential authors. There
is much space for creativity, research, and design, and Nimbus strives to provide a flexible interface
for this creative work. In the majority of cases, you can express all the interesting parts of your
consensus engine simply by implementing the correct filters. The rest of Nimubs will #JustWork for you.

The repository comes with a few example filters already. The examples are:
The repository comes with a few example filters already, and additional examples are welcome. The examples are:
* Height filter - This filter takes a finite set (eg a staked set) and filters it down to a pseudo-random
subset at each height. The eligible ratio is configurable in the pallet. This is a good learning example
but not secure, because the authors only rotate at each parachain block. Therefore a small colluding
Expand All @@ -101,39 +105,40 @@ but in the future the relay randomness beacon) to change the elected subset each
authors a block even if the parachain doesn't author. This avoids the stall mentioned previously.
* Aura - The authority round consensus engine is popular in the Substrate ecosystem because it was one
of the first (and simplest!) engines implemented in Substrate. Aura can be expressed in the Nimbus
filter framework and is included as an example filter.
filter framework and is included as an example filter. If you are considering using aura, that crate
has good documentation on how it differs from `sc-consensus-aura`.

### Author Filter Runtime API

Nimbus makes the design choice to include the final author checking logic in the runtime. This makes
it relatively straight forward (but still not entirely straight forward; read on) for relay chain validators
to check the authorship information. This is in contrast to the existing implementation of Aura and Babe
where the authorship checks are offchain. Because the checks happen in the runtime, authoring nodes would
need to author complete blocks to learn whether they are eligible. This is inefficient, and leads to
confusing logs for users.
Nimbus makes the design choice to include the author checking logic in the runtime. This makes
it relatively straight forward (but still not entirely straight forward; at least until
https://github.com/paritytech/polkadot/issues/2888 is resolved) for relay chain validators
to check the authorship information. This is in contrast to the existing implementations of Aura
and Babe where the authorship checks are offchain.

Authoring nodes (collators) should be smart enough to predict whether they will be eligible, and not
author at all if they are ineligible. To achieve this, we provide a runtime API that will allow collator
nodes to call into the runtime, and make the minimal calculation necessary to determine whether they will
be eligible. If they aren't they skip the slot saving energy and keeping the logs free of confusing errors.
While moving the check in-runtime simplifies interfacing with validators, it makes in impossible
for authoring nodes to predict whether they will be eligible without calling into the runtime.
To achieve this, we provide a runtime API that makes the minimal calculation necessary to determine
whether a specified author will be eligible at the specified slot.

### Nimbus Consensus
### Nimbus Consensus Worker

Nimbus consensus is the primary client-side consensus worker. It implements the shiny new `ParachainConsensus`
trait introduced to cumulus in https://github.com/paritytech/cumulus/pull/329 It is not likely that
trait introduced to cumulus in https://github.com/paritytech/cumulus/pull/329. It is not likely that
you will need to change this code directly to implement your engine as it is entirely abstracted over
the filters you use. The consensus engine performs these tasks:

* Slot prediction - it calls the runtime API mentioned previously to determine whether ti is eligible. If not, it returns early.
* Authorship - It calls into a standard Substrate proposer to construct a block (probably including the author inherent).
* Self import - it imports the block that the proposer created (called the pre-block) into the node's local database.
* Sealing - It adds a seal digest to the block - This is what is used by other nodes to verify the authorship information.

**Warning, the seal does not yet contain a cryptographic signature; it is just mocked. That is one of the next tasks.**

### Verifier and Import Queue

For a parachain node to import a sealed block authored by one of its peers, it needs to remove the post-
runtime seal digest and check it (same in a standalone blockchain). This is the job of the verifier. It
runtime seal digest and check its signature (same in a standalone blockchain). This is the job of the verifier. It
will remove the nimbus seal and compare it to the nimbus consensus digest from the runtime. If that process fails,
the block is immediately thrown away before the expensive execution even begins. If it succeeds, then
the pre-block (the part that's left after the seal is stripped) is passed into the
Expand Down Expand Up @@ -189,26 +194,18 @@ The gist: One node authors the block, then it is processed in three different wa

## Roadmap

The Nimbus tools are intended to be standalone and loosely coupled with Cumulus. That goal is realistic
in the medium term (~ a month or two) but during the initial development, it is easier to work as a fork
of the upstream cumulus repository.

Once the core features are complete, and the line is more clear between what belongs in cumulus vs
nimbus, the repos can be separated.
The Nimbus framework is intended to be loosely coupled with Cumulus. It remains to be
seen whether it should live with Cumulus or in its own repository.

### Core Features Needed
* Author info in seal, and basic seal checking
* Keystore integration
* Cryptographic block signatures
* Filter pallet refactor -- What is common and what needs re-implemented by each author.
* Cryptographic block signatures and checking
* Update the CanAuthor trait to take a slot number, and make a seperate trait for a slot beacon

### Additional features for maybe someday
* Share code between verifier and wrapper executive
* Maybe moonbeam's dev service should live with nimbus??
* Aurand as an example of composing filters?
* Two different filter traits?
* Current one: Propositional logic style (good for unbounded sets)
* New one: Returns concrete author sets (good for index-based stuff like aura)
* Client-side worker for standalone (non para) blockchain
* Aurand as an example of composing filters
* Second filter trait for exhaustive sets (As opposed to current propositional approach)

## Contributions Welcome

Expand Down