Commit Graph

4 Commits

Author SHA1 Message Date
Marek 86d05c5e90
Update the documentation for value pools (#2919)
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2021-10-21 20:30:11 +00:00
teor a1cec27871
Update the signs in the value pools design to match the spec (#2576)
* Update the signs in the value pools design to match the spec

Also split the definitions and guide sections into transaction value balances
and chain value pools. And explain the sign differences between them in terms of
inputs and outputs.

* fix typo

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2021-08-06 22:00:02 +00:00
teor 7218aec19f
Design: Fix Transparent Value Sign and Definition (#2555)
* Design: Fix Transparent Value Sign and Definition

* make the transparent value pool the sum of unspent output values, like other pools
* swap the sign of the transparent value balance
* make the remaining transaction value balance the sum of unspent input values
* update the consensus rules based on recent spec changes
* explain why the transparent chain value pool balance can't be negative
* clarify the guide and consensus rules sections

* Use consistent notation for sprout value balances

* Fix typos

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2021-08-02 23:52:21 +00:00
Alfredo Garcia d1ab8a8946
Value pools design (#2430)
* add a draft for value pools design

* add some `ValueBalance` operators

* add `value_balance` methods to modules

* fix some minors

* finalize the last part of the implementation design

* replace wrong AllowNegative with correct NegativeAllowed

* add design PR to header

* update scope

* remove details from transaction `value_balance()`

* update definitions

* change method name

* return Result in operators

* fix the TODOs

* implement `UpdateWith<PreparedBlock>` for `ValueBalance`

* add details to `ValueBalance` serialization

* add a panic to block value balance

* fix `remaining_transaction_value()`

* add the block value balance into `FinalizedState`

* populate the `Chain` with the finalized tip value balance

* remove redundant text from definition

* add docs to `Chain` field

* trigger the `remaining_transaction_value()` check

* fix mistake

* add some tests, remove some not needed sections

* add a summary of the implementation

* do some minor fixes to consensus rules text

* clarify some names

* fix `UpdateWith`

* move the remaining transaction value consensus rule

* fix serialization bug

* fix typo

* Add a missing test

* typo

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
2021-07-09 09:53:14 +10:00