Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BABE specification (Relative Time, Consensus Message Digest, etc.) #168

Merged
merged 22 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b2662ef
host-spec: Update BABE clock adjustment
FlorianFranzen Apr 14, 2020
b984715
host-spec: Minor cleanup in Babe chapter
FlorianFranzen Jul 9, 2020
bbc98a4
host-spec: Move SCALE dictionary to own definition
FlorianFranzen Jul 10, 2020
18e1048
host-spec: Update Babe Consensus Messages
FlorianFranzen Jul 17, 2020
2ce2083
host-spec: Update babe relative time constants
FlorianFranzen Jul 17, 2020
2bd4ea4
host-spec: cosmetic cleanups
FlorianFranzen Sep 2, 2020
57cb639
host-spec: fix various typos in consensus chapter
FlorianFranzen Sep 15, 2020
66c4f9c
host-spec: small clarifications in consensus chapter
FlorianFranzen Sep 16, 2020
c43a7c3
host-spec: Move text into remarks
FlorianFranzen Nov 18, 2020
6876b95
changing sync epoch to sync period non-overlapping
drskalman Nov 18, 2020
94a33c5
host-spec: Use unified way to refer to definitions
FlorianFranzen Nov 19, 2020
95f0379
host-spec: Add note about current state of relative time algo
FlorianFranzen Nov 19, 2020
7a27385
host-spec: Update Babe relative time algorithm
FlorianFranzen Nov 24, 2020
aadac89
host-spec: Add note about incorrect naming in substrate
FlorianFranzen Nov 24, 2020
db142d7
host-spec: Add todo on how to collect block arrival times
FlorianFranzen Nov 24, 2020
cb06d5c
host-spec: Moving definitions and references
FlorianFranzen Nov 24, 2020
ff71da5
runtime-spec: use latexmk for builds
FlorianFranzen Nov 25, 2020
4601662
runtime-spec: algorithm2e -> algorithmicx
FlorianFranzen Nov 25, 2020
f3e4303
runtime-spec: Add Babe randomness computation
FlorianFranzen Nov 25, 2020
beaa5e9
runtime-spec: Def. -> Definition
FlorianFranzen Nov 25, 2020
98a2bdf
ci: add latexmk for runtime-spec builds
FlorianFranzen Nov 25, 2020
458d603
ci: migrate from ::set-env to GITHUB_ENV
FlorianFranzen Nov 25, 2020
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
8 changes: 4 additions & 4 deletions .github/workflows/specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y texlive texlive-luatex texlive-science texlive-latex-extra
sudo apt-get install -y latexmk texlive texlive-luatex texlive-science texlive-latex-extra
- name: Build runtime specification
run: make -C runtime-spec
- name: Upload runtime specification
Expand Down Expand Up @@ -103,13 +103,13 @@ jobs:
cd ~/.TeXmacs/packages
curl -OL https://raw.githubusercontent.com/w3f/algorithmacs/master/algorithmacs-style.ts
- name: Determine comparison target
run: echo "::set-env name=REV::HEAD~1"
run: echo "REV=HEAD~1" >> $GITHUB_ENV
if: github.event_name == 'push'
- name: Determine comparison target
run: echo "::set-env name=REV::origin/${GITHUB_BASE_REF}"
run: echo "REV=origin/${GITHUB_BASE_REF}" >> $GITHUB_ENV
if: github.event_name == 'pull_request'
- name: Determine comparison target
run: echo "::set-env name=REV::$(git describe --tags --abbrev=0 HEAD~1)"
run: echo "REV=$(git describe --tags --abbrev=0 HEAD~1)" >> $GITHUB_ENV
if: github.event_name == 'release'
- name: Compare host specification
run: make -C host-spec diff
Expand Down
21 changes: 5 additions & 16 deletions host-spec/ab-encodings.tm
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@
</equation*>

where <math|Enc<rsub|SC><rsup|Len>> is defined in Definition
<reference|defn-sc-len-encoding>.\
<reference|defn-sc-len-encoding>.
</definition>

<\definition>
SCALE codec for <strong|dictionary> or <strong|hashtable> D with
key-value pairs <math|<around*|(|k<rsub|i>,v<rsub|i>|)>>s such that:

Expand All @@ -157,10 +159,6 @@
<math|Enc<rsup|Size><rsub|SC>> is encoded the same way as
<math|Enc<rsup|Len><rsub|SC>> but argument <math|size> refers to the
number of key-value pairs rather than the length.

<\equation*>
\;
</equation*>
</definition>

<\definition>
Expand Down Expand Up @@ -244,17 +242,8 @@
\;
</body>

<\initial>
<\collection>
<associate|chapter-nr|6>
<associate|page-first|55>
<associate|page-height|auto>
<associate|page-type|letter>
<associate|page-width|auto>
<associate|section-nr|5<uninit>>
<associate|subsection-nr|5>
</collection>
</initial>
<initial|<\collection>
</collection>>

<\references>
<\collection>
Expand Down
8 changes: 4 additions & 4 deletions host-spec/ae-hostapi.tm
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@
<item><verbatim|offset>: an u32 integer containing the offset beyond the
value should be read from.

<item><verbatim|result>: a pointer-size (def.
<item><verbatim|result>: a pointer-size (Definition
<reference|defn-runtime-pointer>) pointing to a SCALE encoded
<verbatim|Option> (def. <reference|defn-option-type>) containing an
<verbatim|Option> (Definition <reference|defn-option-type>) containing an
unsinged 32-bit interger representing the number of bytes left at
supplied <verbatim|offset>. Returns <verbatim|None> if the entry does not
exists.
Expand Down Expand Up @@ -293,7 +293,7 @@
<subsection|<verbatim|ext_storage_next_key>>

Get the next key in storage after the given one in lexicographic order
(Def. <reference|defn-lexicographic-ordering>). The key provided to this
(Definition <reference|defn-lexicographic-ordering>). The key provided to this
function may or may not exist in storage.

<subsubsection|Version 1 - Prototype>
Expand Down Expand Up @@ -637,7 +637,7 @@
<subsection|<verbatim|ext_default_child_storage_next_key>>

Gets the next key in storage after the given one in lexicographic order
(Def. <reference|defn-lexicographic-ordering>). The key provided to this
(Definition <reference|defn-lexicographic-ordering>). The key provided to this
function may or may not exist in storage.

<subsubsection|Version 1 - Prototype>
Expand Down
17 changes: 7 additions & 10 deletions host-spec/ag-runtimeentries.tm
Original file line number Diff line number Diff line change
Expand Up @@ -271,21 +271,20 @@
future.>|<cell|>>|<row|<cell|EpochLength>|<cell|The duration of epochs in
slots.>|<cell|Unsigned 64bit>>|<row|<cell|>|<cell|>|<cell|integer>>|<row|<cell|Constant>|<cell|A
constant value that is used in the threshold calculation
formula.>|<cell|Tuple containing>>|<row|<cell|>|<cell|Expressed as a
rational where the first number of the tuple is the>|<cell|two
unsigned>>|<row|<cell|>|<cell|numerator and the seconds is the denominator.
The rational should>|<cell|64bit integers>>|<row|<cell|>|<cell|represent a
value between 0 and 1.>|<cell|>>|<row|<cell|Genesis>|<cell|The authority
list for the genesis epoch as defined in Definition
formula>|<cell|Tuple containing>>|<row|<cell|>|<cell|as defined in
definition <reference|defn-babe-constant>.>|<cell|two
unsigned>>|<row|<cell|>|<cell|>|<cell|64bit
integers>>|<row|<cell|>|<cell|>|<cell|>>|<row|<cell|Genesis>|<cell|The
authority list for the genesis epoch as defined in Definition
<reference|defn-authority-list>. >|<cell|Array of
tuples>>|<row|<cell|Authorities>|<cell|>|<cell|containing a
256-bit>>|<row|<cell|>|<cell|>|<cell|byte array and
a>>|<row|<cell|>|<cell|>|<cell|unsigned
64bit>>|<row|<cell|>|<cell|>|<cell|integer>>|<row|<cell|Randomness>|<cell|The
randomness for the genesis epoch>|<cell|32-byte
array>>|<row|<cell|SecondarySlot>|<cell|Whether this chain should run with
secondary slots, which are>|<cell|Boolean>>|<row|<cell|>|<cell|assigned in
a round-robin manner.>|<cell|>>>>>>
secondary slots and wether>|<cell|8bit enum>>|<row|<cell|>|<cell|they are
assigned in a round-robin manner or via a second VRF.>|<cell|>>>>>>
The tuple provided by <strong|BabeApi_configuration>.
</big-table>

Expand Down Expand Up @@ -622,8 +621,6 @@
<associate|page-height|auto>
<associate|page-type|letter>
<associate|page-width|auto>
<associate|section-nr|2<uninit>>
<associate|subsection-nr|0>
</collection>
</initial>

Expand Down
Loading