Сryptocurrency development analysis

Description

This document is not entirely complete. It contains a functional specification of most parts of the core blockchain logic of Cardano. As it is currently implemented. The main purpose of this document is to serve as a source for property tests, with the purpose of avoiding regression on future refactors.

I have spent very little time caring about formatting and such. If there are formatting constraints that you would like to see being applied before next release, don’t hesitate to say in the comments. Or directly at [CDEC-163](https://iohk.myjetbrains.com/youtrack/issue/CDEC-223).

(cc @nc6 @erikd )

## Linked issue

[CDEC-160](https://iohk.myjetbrains.com/youtrack/issue/CDEC-160)

## Type of change

— [~] 🐞 Bug fix (non-breaking change which fixes an issue)
— [~] 🛠 New feature (non-breaking change which adds functionality)
— [~] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
— [~] 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
— [~] 🔨 New or improved tests for existing code
— [~] ⛑ git-flow chore (backport, hotfix, etc)

## Developer checklist

— [~] I have read the [style guide](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/style-guide.md) document, and my code follows the code style of this project.
— [~] If my code deals with exceptions, it follows the [guidelines](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/exceptions.md).
— [~] I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on [cardanodocs.com](https://github.com/input-output-hk/cardanodocs.com), amending the inline [Haddock](https://www.haskell.org/haddock/) comments, any relevant README file or one of the document listed in the [docs](https://github.com/input-output-hk/cardano-sl/tree/develop/docs) directory.

## Testing checklist

— [~] I have added tests to cover my changes.
— [~] All new and existing tests passed.

## QA Steps

N/A
You can view, comment on, or merge this pull request online at:

https://github.com/input-output-hk/cardano-sl/pull/3027

— Commit Summary —

* Outline for cardano rules
* Clarification
* Skeleton of the maths
* Header validity
* Typography
* Grammar fixes
* Rendering of records
* Transaction validation for pay-to-public-key
* Make stateful transaction validation more precise
* Let’s not forget about transaction fees
* Readability
* Resolve todos
* Typos
* Specify the minimum fee
* README: fix typo
* A rule I had forgotten
* An error in a macro hadn’t been noticed
* Specifying the slot leader
* Making a note
* From binary numer generators to number generators
* Define list notations
* Define finite-support functions
* Define remainder notation
* Noticed a small mistake
* Place holders for derived functions
* More precise issuer check (incomplete)
* Typo
* Fix mistake
* Take note of an oversight
* Define current stake distribution
* Notation for the empty list
* Lists start at position 1
* Resolve todo
* Fix slot-leader-selection formula
* Few updates to clarify the spec.
* Model initial utxos
* Partial specification for bootstrap era stake delegation
* Definition of the blockchain data structure
* Strawman specification of the longest chain selection
* Add authors
* Add statut section
* Fix predecessor rules to include the empty chain case
* Define rules for heavyweight delegation checking
* Rules for determining the current delegation graph
* More parameters for bootstrap-era stake delegation
* Thoughts about lightweight delegation
* Resolve todos
* Small note
* Bootstrap era stake delegation validation
* Discussion on data validation vs validation rules
* Stake repartition formula
* Visual improvement + English description
* Cut draft version
* [CDEC-224] Started clarifying roles of parameters
* [CDEC-224] Put parameters in distinct subsections
* A note on empty outputs
* Explain what stake repartitions are for
* An extra word on finite support function
* Remove comment on unclear section.
* [CDEC-222] A specification of dynamic epoch length
* [CDEC-210] Replace richman terminology with bootstrap stakeholders
* Terminology: change weight to height
* [CDEC-215] Longest chain is chain of maximum length
* Add some forward links in parameters
* [CDEC-210] Clarifications around the stake distribution formula
* Add link
* Appendix on compatibility requirements
* [CDEC-171] Preliminary set of validation rules for the mempool
* Fix outdated description
* [CDC-172] An attempt at preventing forks more than k deep
* Todo: rules refreshing the mempool after a block has been received
* Fix compilation
* Resolve obsolete marginal notes
* Small fix: inputs and outputs were inverted in a formula
* Move a remark to the appendix
* [CDEC-172] Remarks on the longest chain selection
* Fix compilation
* Future change suggestion: stateless mempool
* [CDEC-305] Specify maximum mempool size
* Expand considerations on the mempool
* Cut draft version
* Make simple environment to hold spec-adjacent remarks
* Resolve todos
* Fix a compilation error
* Clean up the document
* [CDEC-332] Define VSS phases
* Hyperref configuration: link colours & bookmarks
* Hyperref configuration: metadata
* [CDEC-180] Seeds are a monoid
* [CDEC-170] Basic block issuance
* [CDEC-180] Some set up for shared seed computation
* Synctex support
* For partial function, use domain rather than support
* Difference of partial functions
* [CDEC-180] Block extension rules for shared seed computation
* A note
* Note on using fewer transactions in new blocks
* Partially fix the specification of cutting at epoch boundary
* [CDEC-180] A definition of the seed
* Improve precision
* [CDEC-180] Definition of the aggregation functions for SSC
* A note
* Cut draft version for merge

— File Changes —

A docs/rules/.gitignore (30)
A docs/rules/Makefile (19)
A docs/rules/README.md (36)
A docs/rules/latexmkrc (8)
A docs/rules/rules.tex (1434)
A docs/rules/shell.nix (25)

— Patch Links —

https://github.com/input-output-hk/cardano-sl/pull/3027.patch
https://github.com/input-output-hk/cardano-sl/pull/3027.diff

Добавить комментарий