From b345ae62dab3c74830fdf22b3b765d64a9b1a751 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Tue, 12 Mar 2024 13:46:25 +0100 Subject: [PATCH 1/3] Docs/Proto: balance updates have two different encodings for bakers deposits --- docs/alpha/token_management.rst | 9 +++++---- docs/paris/token_management.rst | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/alpha/token_management.rst b/docs/alpha/token_management.rst index 5752e5980187..30bdcabb7854 100644 --- a/docs/alpha/token_management.rst +++ b/docs/alpha/token_management.rst @@ -92,7 +92,8 @@ The field ``kind`` allows to identify the type of container account, it can have - just a ``"delegate"`` to designate collectively the deposits of all stakers delegating to the provided implicit account. - - a ``baker`` field to designate the delegate's own deposits + - a ``"baker_own_stake"`` field to designate the delegate's own deposits received from its own stake rewards. + - a ``"baker_edge"`` field to designate the delegate's own deposits received from the edge on its staker's rewards. - ``"unstaked_deposits"`` represents the accounts of unstaked frozen tokens. Accounts in this category are further identified by the following additional fields: @@ -187,9 +188,9 @@ the following balance updates are generated: [ {"kind": "accumulator", "category": "block fees", "change": "-1000", ...}, {"kind": "contract", "contract": "tz1a...", "change": "1000", ...} {"kind": "minted", "category": "baking rewards", "change": "-5", ...}, - {"kind": "freezer", "category": "deposits", "staker": { "baker": "tz1a..."}, "change": "5", ...}, + {"kind": "freezer", "category": "deposits", "staker": { "baker_edge": "tz1a..."}, "change": "5", ...}, {"kind": "minted", "category": "baking rewards", "change": "-10", ...}, - {"kind": "freezer", "category": "deposits", "staker": { "baker": "tz1a..."}, "change": "10", ...}, + {"kind": "freezer", "category": "deposits", "staker": { "baker_own_stake": "tz1a..."}, "change": "10", ...}, {"kind": "minted", "category": "baking rewards", "change": "-35", ...}, {"kind": "freezer", "category": "deposits", "staker": { "delegate": "tz1a..."}, "change": "35", ...}, {"kind": "minted", "category": "baking rewards", "change": "-450", ...}, @@ -207,7 +208,7 @@ baking bonus with 90% sent to spendable balance and 10% to bakers frozen deposit [ {"kind": "minted", "category": "baking bonus", "change": "-90", ...}, {"kind": "contract", "contract": "tz1b...", "change": "90", ...}, {"kind": "minted", "category": "baking bonus", "change": "-10", ...}, - {"kind": "freezer", "category": "deposits", "staker": { "baker": "tz1b..."}, "change": "10", ...}] + {"kind": "freezer", "category": "deposits", "staker": { "baker_own_stake": "tz1b..."}, "change": "10", ...}] Attesting, double signing evidence, and nonce revelation rewards ---------------------------------------------------------------- diff --git a/docs/paris/token_management.rst b/docs/paris/token_management.rst index df0b1e1eaf3a..d582b0bc350b 100644 --- a/docs/paris/token_management.rst +++ b/docs/paris/token_management.rst @@ -92,7 +92,8 @@ The field ``kind`` allows to identify the type of container account, it can have - just a ``"delegate"`` to designate collectively the deposits of all stakers delegating to the provided implicit account. - - a ``baker`` field to designate the delegate's own deposits + - a ``"baker_own_stake"`` field to designate the delegate's own deposits received from its own stake rewards. + - a ``"baker_edge"`` field to designate the delegate's own deposits received from the edge on its staker's rewards. - ``"unstaked_deposits"`` represents the accounts of unstaked frozen tokens. Accounts in this category are further identified by the following additional fields: @@ -187,9 +188,9 @@ the following balance updates are generated: [ {"kind": "accumulator", "category": "block fees", "change": "-1000", ...}, {"kind": "contract", "contract": "tz1a...", "change": "1000", ...} {"kind": "minted", "category": "baking rewards", "change": "-5", ...}, - {"kind": "freezer", "category": "deposits", "staker": { "baker": "tz1a..."}, "change": "5", ...}, + {"kind": "freezer", "category": "deposits", "staker": { "baker_edge": "tz1a..."}, "change": "5", ...}, {"kind": "minted", "category": "baking rewards", "change": "-10", ...}, - {"kind": "freezer", "category": "deposits", "staker": { "baker": "tz1a..."}, "change": "10", ...}, + {"kind": "freezer", "category": "deposits", "staker": { "baker_own_stake": "tz1a..."}, "change": "10", ...}, {"kind": "minted", "category": "baking rewards", "change": "-35", ...}, {"kind": "freezer", "category": "deposits", "staker": { "delegate": "tz1a..."}, "change": "35", ...}, {"kind": "minted", "category": "baking rewards", "change": "-450", ...}, @@ -207,7 +208,7 @@ baking bonus with 90% sent to spendable balance and 10% to bakers frozen deposit [ {"kind": "minted", "category": "baking bonus", "change": "-90", ...}, {"kind": "contract", "contract": "tz1b...", "change": "90", ...}, {"kind": "minted", "category": "baking bonus", "change": "-10", ...}, - {"kind": "freezer", "category": "deposits", "staker": { "baker": "tz1b..."}, "change": "10", ...}] + {"kind": "freezer", "category": "deposits", "staker": { "baker_own_stake": "tz1b..."}, "change": "10", ...}] Attesting, double signing evidence, and nonce revelation rewards ---------------------------------------------------------------- -- GitLab From 673640ee613369bf7ec986dd62743c7dedc84bb6 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Tue, 12 Mar 2024 13:49:07 +0100 Subject: [PATCH 2/3] Docs/Proto: delayed_operation is a new origin for balance updates --- docs/alpha/token_management.rst | 1 + docs/paris/token_management.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/alpha/token_management.rst b/docs/alpha/token_management.rst index 30bdcabb7854..1893d6790d7e 100644 --- a/docs/alpha/token_management.rst +++ b/docs/alpha/token_management.rst @@ -24,6 +24,7 @@ In the Json format, a balance update consists of three parts: * ``"block"`` means that the balance update originates from the application of a block * ``"migration"`` means that the balance update originates from migration * ``"subsidy"`` means that the balance update originates from subsidies for liquidity baking + * ``"delayed_operation"`` means that the balance update originates from the delayed application of the operation whose hash is given in the additional field ``"delayed_operation_hash"``. A transfer of tokens is represented by a continuous and ordered sequence of (balance) updates. diff --git a/docs/paris/token_management.rst b/docs/paris/token_management.rst index d582b0bc350b..362e589055cd 100644 --- a/docs/paris/token_management.rst +++ b/docs/paris/token_management.rst @@ -24,6 +24,7 @@ In the Json format, a balance update consists of three parts: * ``"block"`` means that the balance update originates from the application of a block * ``"migration"`` means that the balance update originates from migration * ``"subsidy"`` means that the balance update originates from subsidies for liquidity baking + * ``"delayed_operation"`` means that the balance update originates from the delayed application of the operation whose hash is given in the additional field ``"delayed_operation_hash"``. A transfer of tokens is represented by a continuous and ordered sequence of (balance) updates. -- GitLab From 97c3888e2de4d2eb35066a2938ce9e351c475a71 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Tue, 12 Mar 2024 13:50:28 +0100 Subject: [PATCH 3/3] Docs/Proto: add new receipt for pseudo operations --- docs/alpha/token_management.rst | 4 ++++ docs/paris/token_management.rst | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/alpha/token_management.rst b/docs/alpha/token_management.rst index 1893d6790d7e..4f5c8734ec25 100644 --- a/docs/alpha/token_management.rst +++ b/docs/alpha/token_management.rst @@ -121,6 +121,10 @@ The field ``kind`` allows to identify the type of container account, it can have Other categories may be added in the future. * ``"commitment"`` represents the accounts of commitments awaiting activation. This type of account is further identified by the additional field ``committer`` whose value is the encrypted public key hash of the user who has committed to provide funds. +* ``"staking"`` represents abstractions used for accounting staking by delegators, and comes with the additional field ``category`` that can have one of the following values: + + - ``"delegator numerator"`` abstracts the delegator's stake, and comes with the additional field ``"delegator"`` whose value is the public key hash of the delegator. + - ``"delegate denominator"`` abstracts the total stake of delegate's delegators, and comes with the additional field ``"delegate"`` whose value is the public key hash of the delegate. Sink accounts ------------- diff --git a/docs/paris/token_management.rst b/docs/paris/token_management.rst index 362e589055cd..ce045973cf94 100644 --- a/docs/paris/token_management.rst +++ b/docs/paris/token_management.rst @@ -121,6 +121,10 @@ The field ``kind`` allows to identify the type of container account, it can have Other categories may be added in the future. * ``"commitment"`` represents the accounts of commitments awaiting activation. This type of account is further identified by the additional field ``committer`` whose value is the encrypted public key hash of the user who has committed to provide funds. +* ``"staking"`` represents abstractions used for accounting staking by delegators, and comes with the additional field ``category`` that can have one of the following values: + + - ``"delegator numerator"`` abstracts the delegator's stake, and comes with the additional field ``"delegator"`` whose value is the public key hash of the delegator. + - ``"delegate denominator"`` abstracts the total stake of delegate's delegators, and comes with the additional field ``"delegate"`` whose value is the public key hash of the delegate. Sink accounts ------------- -- GitLab