Skip to content

Instantly share code, notes, and snippets.

@nicolasochem
Last active May 13, 2022
Embed
What would you like to do?
consensus key test

Build

These tests are done with tezos-k8s.

First build the tezos container (below are instructions with minikube or podman, but ymmv):

Start minikube with podman minikube start

Load podman-remote env vars eval $(minikube podman-env)

In tezos Makefile, replace docker or @docker commands with podman-remote in 4 places.

Build docker container with make docker-image

The containers will be built and accessible with minikube.

Checkout a reecent version of tezos-k8s and edit charts/tezos/scripts/baker.sh:

--- a/charts/tezos/scripts/baker.sh
+++ b/charts/tezos/scripts/baker.sh
@@ -10,10 +10,14 @@ proto_command="{{ .command_in_tpl }}"

 if [ "${proto_command}" == "012-Psithaca" ]; then
     extra_args=""
-else
+elif [ "${proto_command}" == "013-PtJakart" ]; then
     echo '{"liquidity_baking_toggle_vote": "pass"}' > /etc/tezos/per_block_votes.json
     # we pass both a vote argument and a votefile argument; vote argument is mandatory as a fallback
     extra_args="--liquidity-baking-toggle-vote on --votefile /etc/tezos/per_block_votes.json"
+else
+    echo '{"liquidity_baking_toggle_vote": "pass", "drain_toggle_vote": "on"}' > /etc/tezos/per_block_votes.json
+    # we pass both a vote argument and a votefile argument; vote argument is mandatory as a fallback
+    extra_args="--liquidity-baking-toggle-vote on --drain-toggle-vote on --votefile /etc/tezos/per_block_votes.json"
 fi

Use the values.yaml file provided with this gist (see bottom).

Test environment

2 tezos nodes: 1 baking for 3 addresses using 3 signature schemes (tz1, tz2, tz3), the other set up for 3 consensus keys, but unitialized at boot.

Very short block times (1 sec) and cycles length (32 blocks).

The chain starts with ithaca and updates to alpha after 2 cycles; this checks proper initialization of variables during migration.

Test CLI

  1. Observed that the baker requires the --drain-toggle argument.

  2. Observed that the protocol requires the drain_toggle_ema_threshold activation parameter to activate.

  3. observed the following help in cli for register as delegate

  register key <mgr> as delegate with consensus key <key> [--fee <amount>]
  set consensus key for <mgr> to <key> [--fee <amount>] [-D --dry-run]
  1. At first, the first node bakes for baker-0 and baker-1 and the second node bakes baker-0-consensus and baker-1-consensus. But, there are no consensus keys configured yet. Configure one by opening a shell on baking-node-0 and typing:
~ $ tezos-client set consensus key for baker-0 to baker-0-consensus
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Estimated gas: 1000 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'ooi9Uy7jcphzknDomZUkSTehNjtkmV5mcZiEm2ZrJExn4rDUFks'
Waiting for the operation to be included...
Operation found in block: BLckXQo9JhF8QTa1Lz2YPX3bnaNUVgTFUUfuu9kAr8QpiG91Qo9 (pass: 3, offset: 0)
This sequence of operations was run:
  Manager signed operations:
    From: tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv
    Fee to the baker: ꜩ0.000371
    Expected counter: 1
    Gas limit: 1100
    Storage limit: 0 bytes
    Balance updates:
      tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv ... -ꜩ0.000371
      payload fees(the block proposer) ....... +ꜩ0.000371
    Update_consensus_key:
      Cycle: 48
      Public key hash: tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX
      The consensus key was successfully udpated
      Consumed gas: 1000

The operation has only been included 0 blocks ago.
We recommend to wait more.
Use command
  tezos-client wait for ooi9Uy7jcphzknDomZUkSTehNjtkmV5mcZiEm2ZrJExn4rDUFks to be included --confirmations 1 --branch BMLbnEePmGFWGixXq374DB5emYjHAvbrX8YYPAKFkF7xz5XxCJc
and/or an external block explorer.

Then create accounts test and test2, send 6000 tez to test and try register key test as delegate with consensus key test2. It sent both operations in a batch:

tezos-client gen keys test
tezos-client transfer 6000 from baker-0 to test --burn-cap 0.06425
tezos-client gen keys test2
tezos-client -l register key test as delegate with consensus key test2
>>>>9: http://localhost:8732/chains/main/blocks/head/helpers/scripts/simulate_operation
  { "operation":
      { "branch": "BLqZm2x1unJSFaRRPD3THMYCwSPq3GXdsf9ckTwTtkoF3YLgR9r",
        "contents":
          [ { "kind": "delegation",
              "source": "tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK", "fee": "0",
              "counter": "9", "gas_limit": "1040000",
              "storage_limit": "60000",
              "delegate": "tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK" },
            { "kind": "update_consensus_key",
              "source": "tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK", "fee": "0",
              "counter": "10", "gas_limit": "1040000",
              "storage_limit": "60000",
              "pk": "edpkuh71CUUy7k1QreZXyo6Nzps6pUefUHMaNTma984eCYvhrMroYa" } ],
        "signature":
          "edsigtXomBKi5CTRf5cjATJWSyaRvhfYNHqSUGrn4SdbYRcGwQrUGjzEfQDTuqHhuA8b2d8NarZjz8TRf65WkpQmo423BtomS8Q" },
    "chain_id": "NetXjefMQvF7Wkm" }
<<<<9: 200 OK

Note that consensus key is unitialized and with zero balance. That's OK.

And the CLI output is OK:

This sequence of operations was run:
  Manager signed operations:
    From: tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK
    Fee to the baker: ꜩ0.000346
    Expected counter: 9
    Gas limit: 1000
    Storage limit: 0 bytes
    Balance updates:
      tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK ... -ꜩ0.000346
      payload fees(the block proposer) ....... +ꜩ0.000346
    Delegation:
      Contract: tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK
      To: tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK
      This delegation was successfully applied
      Consumed gas: 1000
  Manager signed operations:
    From: tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK
    Fee to the baker: ꜩ0.000271
    Expected counter: 10
    Gas limit: 1100
    Storage limit: 0 bytes
    Balance updates:
      tz1Snj6DNi58B2UByqnjKgaHrdZ8MoT5P1iK ... -ꜩ0.000271
      payload fees(the block proposer) ....... +ꜩ0.000271
    Update_consensus_key:
      Public key hash: tz1dAQusbzKzBib4FPrRydcKJJ7dw61eUwoZ
      The consensus key was successfully udpated
      Consumed gas: 1000

Baking

3-4 cycles later after setting consensus key above, the output is visible on baking-node-1 baker output:

│ Apr 25 01:25:07.004 - alpha.baker: reading per block vote file path: /etc/tezos/per_block_votes.json                        
│ Apr 25 01:25:07.005 - alpha.baker: per block vote file found                                                                
│ Apr 25 01:25:07.005 - alpha.baker: per block vote file "JSON decoded"                                                       
│ Apr 25 01:25:07.005 - alpha.baker: reading liquidity baking toggle vote                                                     
│ Apr 25 01:25:07.006 - alpha.baker: liquidity baking toggle vote = pass                                                      
│ Apr 25 01:25:07.006 - alpha.baker.actions: Voting pass for liquidity baking toggle vote                                     
│ Apr 25 01:25:07.094 - alpha.baker.actions: block BLPzGNbq1vscFh9JqWbFmEdZ89bzya9m6tKm2TUEjcKri5UmZ2k at level 1418,         
│ Apr 25 01:25:07.094 - alpha.baker.actions:   round 0 injected for                                                           
│ Apr 25 01:25:07.094 - alpha.baker.actions:   baker-0-consensus (tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX)                       
│ Apr 25 01:25:07.094 - alpha.baker.actions:   on behalf of tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv                              
│ Apr 25 01:25:07.111 - alpha.baker.transitions: received new head BLPzGNbq1vscFh9JqWbFmEdZ89bzya9m6tKm2TUEjcKri5UmZ2k at     
│ Apr 25 01:25:07.111 - alpha.baker.transitions:   level 1418, round 0                                                        
│ Apr 25 01:25:07.144 - alpha.baker.actions: injected preendorsement opDs8bJ8WKFAGYW2BbdbN8nAwGeiLs5FjaviX9tJpRcf3e1bBsK      
│ Apr 25 01:25:07.144 - alpha.baker.actions:   for baker-0-consensus (tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX)                   
│ Apr 25 01:25:07.144 - alpha.baker.actions:   on behalf of tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv                              
│ Apr 25 01:25:07.260 - alpha.baker.actions: injected endorsement onkTM8BrSTuWRCKs1bC5347CQjzyKm8zCHYGK2JtpS43FuHJv7Y for     
│ Apr 25 01:25:07.260 - alpha.baker.actions:   baker-0-consensus (tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX)                       
│ Apr 25 01:25:07.260 - alpha.baker.actions:   on behalf of tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv                              

Indeed, the baker starts baking. The logs indicate on behalf of... and the delegate key is printed.

There are new fields in metadata for observing consensus keys of the block proposer and payload proposer:

~ $ curl -s http://localhost:8732/chains/main/blocks/1692/metadata |jq .proposer
"tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv"
~ $ curl -s http://localhost:8732/chains/main/blocks/1692/metadata |jq .proposer_consensus_key
"tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX"
~ $ curl -s http://localhost:8732/chains/main/blocks/1692/metadata |jq .baker
"tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv"
~ $ curl -s http://localhost:8732/chains/main/blocks/1692/metadata |jq .baker_consensus_key
"tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX"

Baker man page also explains that the consensus key alias should be passed:

Commands related to the baker daemon.:
  run with local node <node_data_path> [<baker>...] [-P --pidfile <filename>]
<snip>
    Launch the baker daemon.
    <node_data_path>: Path to the node data directory (e.g. $HOME/.tezos-node)
    <baker>: name of the delegate owning the endorsement/baking right or name of the consensus key signing on the delegate's behalf

Consensus key unicity

I verified that it's not possible to assign the same consensus key to 2 delegates. From baking-node-0:

~ $ tezos-client set consensus key for baker-1 to baker-0-consensus
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
This simulation failed:
  Manager signed operations:
    From: tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc
    Fee to the baker: ꜩ0
    Expected counter: 1
    Gas limit: 1040000
    Storage limit: 60000 bytes
    Update_consensus_key:
      Public key hash: tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX
      This operation FAILED.

Error:
  The delegate consensus key is already used by another delegate

Revert to a unique key

I was able to run

tezos-client set consensus key for baker-0 to baker-0

And 3 cycles later, the baker was back to signing consensus messages with the delegate's key.

Set to already set consensus key

Fails as expected (simulation failure, nothing written on-chain) when setting the consensus key to the delegate key:

~ $ tezos-client set consensus key for baker-1 to baker-1
Node is bootstrapped.
This simulation failed:
  Manager signed operations:
    From: tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc
    Fee to the baker: ꜩ0
    Expected counter: 1
    Gas limit: 1040000
    Storage limit: 60000 bytes
    Update_consensus_key:
      Cycle: 124
      Public key hash: tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc
      This operation FAILED.

Error:
  Invalid key while updating a consensus key (active since 120).

Also tried when delegate key != consensus key: same error, same output.

Drain

There is a new CLI command:

  drain delegate <mgr> to <key> [--fee <amount>] [-D --dry-run]
      [--verbose-signing] [--minimal-fees <amount>]
      [--minimal-nanotez-per-byte <amount>]
      [--minimal-nanotez-per-gas-unit <amount>] [--force-low-fee]
      [--fee-cap <amount>] [--burn-cap <amount>]
    Drain all funds from a delegate.
    <mgr>: the delegate key
    <key>: the consensus key

Tried it:

~ $ tezos-client get balance for baker-0-consensus
4000000 ꜩ
~ $ tezos-client get balance for baker-0
3603684.656268 ꜩ
~ $ tezos-client drain delegate baker-0 to baker-0-consensus
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Operation successfully injected in the node.
Operation hash is 'onkawGjmzGJSxnGJw27zLPkmFgx87JkzLTHyj5C1HbAhFvPj5Jv'
Waiting for the operation to be included...
Operation found in block: BL4TBYDfn8XV6auPDQcRzkxDRf4KJRGYe6fCi28npzz1B8UYEcY (pass: 2, offset: 0)
This sequence of operations was run:
  Drain delegate:
    Consensus key hash: tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45
    Delegate: tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx
    Destination: tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45 (allocated)
    Balance updates:
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ0.06425
      storage fees ........................... +ꜩ0.06425
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ3629093.377311
      tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45 ... +ꜩ3629093.377311
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ1
      tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv ... +ꜩ1

The operation has only been included 0 blocks ago.
We recommend to wait more.
Use command
  tezos-client wait for onkawGjmzGJSxnGJw27zLPkmFgx87JkzLTHyj5C1HbAhFvPj5Jv to be included --confirmations 1 --branch BLFyBgjZtGxqTk6Xb6Cnrp6tuL9qGPAayFRrwJ4ejyPQaoxs4jy
and/or an external block explorer.
~ $ tezos-client get balance for baker-0
259.991047 ꜩ
~ $ tezos-client get balance for baker-0-consensus
7603744.653366 ꜩ

It drained, and it gave 1 tez to the baker.

It also revealed the public key of the consensus account.

Special case: drain when the baker is also the delegate being drained. It works:

~ $ tezos-client drain delegate baker-1 to baker-1-consensus
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Operation successfully injected in the node.
Operation hash is 'ooTwpEN9ttWgghEkLrb44QkC3ULjKtsbEM89tkEEAuycDqmKcuC'
Waiting for the operation to be included...
Operation found in block: BM66fsb9CGjstD3NUZp7y2zvwA3FDBVCkXKSQKtR5T8xD8Q9hch (pass: 2, offset: 0)
This sequence of operations was run:
  Drain delegate:
    Consensus key hash: tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45
    Delegate: tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx
    Destination: tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45
    Balance updates:
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ3242857.533758
      tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45 ... +ꜩ3242857.533758
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ1
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... +ꜩ1

The operation has only been included 0 blocks ago.
We recommend to wait more.
Use command
  tezos-client wait for ooTwpEN9ttWgghEkLrb44QkC3ULjKtsbEM89tkEEAuycDqmKcuC to be included --confirmations 1 --branch BM2wdQA8pMJCXAsHK9gxrZWEMbbvKFM8DeRAuWGqYR9c1e22e52
and/or an external block explorer.

** Drain to third address**

There is a new CLI.

drain delegate <mgr> to <key> with <key> [-D --dry-run] [--verbose-signing]
  Drain all funds from a delegate.
  <mgr>: the delegate key
  <key>: the detination key
  <key>: the consensus key
  -D --dry-run: don't inject the operation, just display it
  --verbose-signing: display extra information before signing the operation

Here is the result:

~ $ tezos-client drain delegate baker-0 to test with baker-0-consensus
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Operation successfully injected in the node.
Operation hash is 'ooiDjfLgfEpYEjZ2RWDJczsu8Lw88uAcRjb5JqTEs3MD6NTmts9'
Waiting for the operation to be included...
Operation found in block: BMLWKP7gvXYVaE9JpC2pZNeVaAbW3BNFGCGWYju1MLkksCS55So (pass: 2, offset: 0)
This sequence of operations was run:
  Drain delegate:
    Consensus key hash: tz2Jn36ZVn99RqqJZZ2ckLrdZ9XJVQCARxJx
    Delegate: tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv
    Destination: tz1S738JyQ8UYx6ugzjXZjxMq1YmajaMFfkA
    Balance updates:
      tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv ... -ꜩ1998870.179334
      tz1S738JyQ8UYx6ugzjXZjxMq1YmajaMFfkA ... +ꜩ1998870.179334
      tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv ... -ꜩ1
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... +ꜩ1

The operation has only been included 0 blocks ago.
We recommend to wait more.
Use command
  tezos-client wait for ooiDjfLgfEpYEjZ2RWDJczsu8Lw88uAcRjb5JqTEs3MD6NTmts9 to be included --confirmations 1 --branch BL29d6sEJBBKQAxwUaePD227zEyW1wwigUch2sjde2fUxYPVkoa
and/or an external block explorer.

Drain to wrong account

As expected:

Node is bootstrapped.
Error:
  Cannot drain delegate tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv with an inactive consensus key tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45. The active consensus key is tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv.

It used to be:

Error:
  The drain operation is invalid: not signed by the active consensus key

I prefered the old version.

Drain operation in the block

Looks good:

      {
        "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
        "chain_id": "NetXjefMQvF7Wkm",
        "hash": "oohDXWdaaTBUvwu34pxur2UTuaCC55iW257RaeQgWxF1bRsVziK",
        "branch": "BMeKttZJvim3cyyfcayV4Lod7F2Ft4VRwvrzQcFpF4ueponUgC9",
        "contents": [
          {
            "kind": "drain_delegate",
            "consensus_key": "tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45",
            "delegate": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx",
            "destination": "tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45",
            "metadata": {
              "balance_updates": [
                {
                  "kind": "contract",
                  "contract": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx",
                  "change": "-2894896269621",
                  "origin": "block"
                },
                {
                  "kind": "contract",
                  "contract": "tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45",
                  "change": "2894896269621",
                  "origin": "block"
                },
                {
                  "kind": "contract",
                  "contract": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx",
                  "change": "-1000000",
                  "origin": "block"
                },
                {
                  "kind": "contract",
                  "contract": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
                  "change": "1000000",
                  "origin": "block"
                }
              ]
            }
          }
        ],
        "signature": "sigji5kuzzUyxdCcnPt6vzeb9H7dJGuEx6YKHLX6fibNZnBGsdtf7t2kc4tw1scPBqWFFE9zrcfF5PAhmn1CnBcbTsx1kZUP"
      }

More drain testing

Drain when there is nothing to drain

It fails.

~ $ tezos-client drain delegate baker-1 to baker-1-consensus
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Error:
  Error while applying operation onh7RvJRMH3oK4kay8ri3R4YgbRG18ReRE3ohZoMgU9GaGxXz6M:
  Error:
    Cannot drain delegate tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx to tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45. The destination is not allocated and there is not enough funds to pay for the allocation burn.

Drain when there is less than 100 tez to drain

In this case, it only takes 1%:

~ $ tezos-client drain delegate baker-1 to baker-1-consensus
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Operation successfully injected in the node.
Operation hash is 'ooCZ9nVKEdGGdh63axt1hFdkfR5UDrPJiu75f2KR5B2KBz11XHJ'
Waiting for the operation to be included...
Operation found in block: BLb1NZXZDVvLVA9fUYFPqU1dQqynKrP19GLjcJia45UysgwtTmj (pass: 2, offset: 0)
This sequence of operations was run:
  Drain delegate:
    Consensus key hash: tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45
    Delegate: tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx
    Destination: tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45
    Balance updates:
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ19.799246
      tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45 ... +ꜩ19.799246
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ0.199992
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... +ꜩ0.199992

The operation has only been included 0 blocks ago.
We recommend to wait more.
Use command
  tezos-client wait for ooCZ9nVKEdGGdh63axt1hFdkfR5UDrPJiu75f2KR5B2KBz11XHJ to be included --confirmations 1 --branch BKtXpSP9owyEEHFnX5ci4NnZgyFaTMPXrsCyS7n5uzutNuzuHCu
and/or an external block explorer.

Drain when consensus key == delegate key

It fails. That's fine. The error message is misleading, though:

~ $ tezos-client drain delegate baker-2 to baker-2
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Error:
  Cannot drain delegate tz2KbFzJa32HcHs5AKNxHjDqf5ws8fKnmwtz, there is no active consensus key.

There is an active consensus key and it's the delegate key?

Concurrent drain and withdraw

In baking-node-1, run the following:

# Note - this assumes a fresh helm deployment
tezos-client gen keys test
# do transfers to make sure every address is revealed
tezos-client transfer 1 from baker-0 to test --burn-cap 0.1
tezos-client transfer 0.5 from test to baker-0
tezos-client transfer 1 from baker-0-consensus to baker-0
sudo apk add python3 curl jq
# import secret key of baker-0 to baking-node-1
tezos-client import secret key baker-0 unencrypted:edsk4X99zYzn5TLCbARNqggTxaCpJTma6k5j9VTXddwCktytV2q24R -f
# set consensus key
tezos-client set consensus key for baker-0 to baker-0-consensus
# wait 3 cycles

Then we issue two concurrent commands to drain the free balance of baker-0 to baker-0-consensus and transfer it to test at the same time.

 balance=$(python3 -c "print(round($(tezos-client get balance for baker-0 2>/dev/null | sed 's/ ꜩ//') - 0.5,6))") && echo $balance && tezos-client transfer $balance from baker-0 to test --fee 0.5 & tezos-client drain delegate baker-0 to baker-0-consensus

Observation: when adding --fee to the drain operation, I get a misleading error msg.

The transfer operation gets rejected, Drain takes precedence, as expected.

Error:
  Only one manager operation per manager per block allowed (found Drain_delegate operation ooA45BQ3uWc9ShW9waXekSnXMSxA9aVTArLspahwbtNQ7rv8PQZ which takes precedence)

When drain has a higher fee than transfer, drain is executed immediately and the transfer is put in branch_delayed. After a few blocks, it is included and failing in the block because of low balance. I tried in a topology with just one node baking every block, and also in a topology with a third node that was not related to baker-0 and baker-0-consensus to prove both operations got propagated.

~ $ curl 'localhost:8732/chains/main/mempool/pending_operations?applied=false&outdated=false' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   782  100   782    0     0   808k      0 --:--:-- --:--:-- --:--:--  763k
{
  "applied": [],
  "refused": [],
  "outdated": [],
  "branch_refused": [],
  "branch_delayed": [
    [
      "ooRmG1ysprQvFdjPSdn4rdpUB3EVBr3p9HLvacbK3AYTtvUpsPW",
      {
        "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
        "branch": "BLs1rTGwz3EYELvQawdVTYLBT8ZJjh8mSpT9yjUcGcRXX95ZHmv",
        "contents": [
          {
            "kind": "transaction",
            "source": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
            "fee": "500000",
            "counter": "5",
            "gas_limit": "1451",
            "storage_limit": "0",
            "amount": "3964039083630",
            "destination": "tz1N4JzwQR2ZU36aBSy3SzddxhoJ1YXjsazs"
          }
        ],
        "signature": "sigRNtD5WqxJdERFqZ3LEhbMiSwc34nkZzYr2LNUDnW7disE31yZfSaVMn3CYJrhFbhcRdusvcEydFbParWkTvhBGSaE7VeJ",
        "error": [
          {
            "kind": "temporary",
            "id": "proto.alpha.contract.balance_too_low",
            "contract": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
            "balance": "0",
            "amount": "500000"
          }
        ]
      }
    ]
  ],
  "unprocessed": []
}
~ $ Operation found in block: BMW19dsPvvY5rArn5jHbm7v6ZrfVpduYhz3tuBgRFbCrLiHCZCU (pass: 3, offset: 0)
This sequence of operations was run:
  Manager signed operations:
    From: tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv
    Fee to the baker: ꜩ0.5
    Expected counter: 5
    Gas limit: 1451
    Storage limit: 0 bytes
    Balance updates:
      tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv ... -ꜩ0.5
      payload fees(the block proposer) ....... +ꜩ0.5
    Transaction:
      Amount: ꜩ3964039.08363
      From: tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv
      To: tz1N4JzwQR2ZU36aBSy3SzddxhoJ1YXjsazs
      This operation FAILED.

Balance of contract tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv too low (19.499238) to spend 3964039.08363
Fatal error:
  transfer simulation failed

~ $ curl -s localhost:8732/chains/main/blocks/BMW19dsPvvY5rArn5jHbm7v6ZrfVpduYhz3tuBgRFbCrLiHCZCU/operations | jq .[3]
[
  {
    "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
    "chain_id": "NetXjefMQvF7Wkm",
    "hash": "ooRmG1ysprQvFdjPSdn4rdpUB3EVBr3p9HLvacbK3AYTtvUpsPW",
    "branch": "BLs1rTGwz3EYELvQawdVTYLBT8ZJjh8mSpT9yjUcGcRXX95ZHmv",
    "contents": [
      {
        "kind": "transaction",
        "source": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
        "fee": "500000",
        "counter": "5",
        "gas_limit": "1451",
        "storage_limit": "0",
        "amount": "3964039083630",
        "destination": "tz1N4JzwQR2ZU36aBSy3SzddxhoJ1YXjsazs",
        "metadata": {
          "balance_updates": [
            {
              "kind": "contract",
              "contract": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
              "change": "-500000",
              "origin": "block"
            },
            {
              "kind": "accumulator",
              "category": "block fees",
              "change": "500000",
              "origin": "block"
            }
          ],
          "operation_result": {
            "status": "failed",
            "errors": [
              {
                "kind": "temporary",
                "id": "proto.alpha.contract.balance_too_low",
                "contract": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
                "balance": "19499238",
                "amount": "3964039083630"
              }

Upgrade && EMA testing

After upgrade, I verified that the drain toggle EMA is initially set to 0. When vote set to pass I see:

~ $ curl -s http://localhost:8732/chains/main/blocks/686/metadata | jq  .drain_toggle_ema
0

But when for set to off for all bakers I see it going up:

nochem@fedora ~/workspace/tezos () $ curl -s http://localhost:8732/chains/main/blocks/33/metadata | jq .drain_toggle_ema
1000000
nochem@fedora ~/workspace/tezos () $ curl -s http://localhost:8732/chains/main/blocks/head/metadata | jq .drain_toggle_ema
94708476
nochem@fedora ~/workspace/tezos () $ curl -s http://localhost:8732/chains/main/blocks/head/metadata | jq .drain_toggle_ema
95661122

Indeed, drain works.

Then I waited for the ema to go over 1 billion, then the operation didn't work anymore:

~ $ tezos-client drain delegate baker-0 to baker-0-consensus && tezos-client get balance for baker-0-consensus
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
This simulation failed:
  Manager signed operations:
    From: tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX
    Fee to the baker: ꜩ0
    Expected counter: 15
    Gas limit: 1040000
    Storage limit: 60000 bytes
    Drain delegate:
      Consensus key hash: tz1hEvLfSAkPJXZXsNKpRT6SRG1dGnDSE3wX
      Delegate: tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv
      This operation FAILED.

Error:
  The drain operation is deactivated.

RPC tests

context/delegates shows only delegate keys, not consensus keys, as expected:

~ $ curl -s http://localhost:8732/chains/main/blocks/head/context/delegates | jq
[
  "tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc",
  "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv"
]

Query per delegate shows the consensus key hash:

~ $ curl -s http://localhost:8732/chains/main/blocks/head/context/delegates/tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc | jq
{
  "full_balance": "4017792778309",
  "current_frozen_deposits": "401747947658",
  "frozen_deposits": "401747947658",
  "staking_balance": "4017792778309",
  "delegated_contracts": [
    "tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc"
  ],
  "delegated_balance": "0",
  "deactivated": false,
  "grace_period": 55,
  "voting_power": "4016592883034",
  "active_consensus_key": "tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc"
}

The consensus key is here.

And for a delegate that has its consensus key set to itself, it shows the same key as expected:

~ $ curl -s http://localhost:8732/chains/main/blocks/head/context/delegates/tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc | jq .consensus_key
"tz1THLWsNuricp4y6fCCXJk5pYazGY1e7vGc"

Blocks contain the drain toggle vote:

~ $ curl -s localhost:8732/chains/main/blocks/head/header | jq .drain_toggle_vote
"off"

Constant is set correctly to 0 (on by default) when migrating from ithaca:

~ $ curl -s localhost:8732/chains/main/blocks/head/context/constants | jq .drain_toggle_ema_threshold
1000000000

Drain toggle EMA is present in the constants:

~ $ curl -s localhost:8732/chains/main/blocks/head/metadata | jq .drain_toggle_ema
594969951

Baking rights show consensus keys:

~ $ curl -s localhost:8732/chains/main/blocks/head/helpers/baking_rights?cycle=55  | jq
[
  {
    "level": 881,
    "delegate": "tz2KbFzJa32HcHs5AKNxHjDqf5ws8fKnmwtz",
    "round": 0,
    "estimated_time": "2022-04-25T04:22:29Z",
    "consensus_key": "tz1XeAxFB7RophB2x7vD4ZYMAw5VRv78Yk8k"
  },
  {
    "level": 881,
    "delegate": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx",
    "round": 1,
    "estimated_time": "2022-04-25T04:22:30Z",
    "consensus_key": "tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45"
  },
  {
    "level": 881,
    "delegate": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
    "round": 2,
    "estimated_time": "2022-04-25T04:22:33Z",
    "consensus_key": "tz2Jn36ZVn99RqqJZZ2ckLrdZ9XJVQCARxJx"
  },

And I can query by consensus key:

~ $ curl -s 'localhost:8732/chains/main/blocks/head/helpers/baking_rights?cycle=60&consensus_key=tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45'  | jq
[
  {
    "level": 961,
    "delegate": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx",
    "round": 1,
    "estimated_time": "2022-04-25T04:23:50Z",
    "consensus_key": "tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45"
  },
  {
    "level": 962,
    "delegate": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx",
    "round": 2,
    "estimated_time": "2022-04-25T04:23:54Z",
    "consensus_key": "tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45"
  },

Same for endorsing rights:

~ $ curl -s 'localhost:8732/chains/main/blocks/head/helpers/endorsing_rights?cycle=64'  | jq
[
  {
    "level": 1025,
    "delegates": [
      {
        "delegate": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx",
        "first_slot": 5,
        "endorsing_power": 2361,
        "consensus_key": "tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45"
      },
      {
        "delegate": "tz2KbFzJa32HcHs5AKNxHjDqf5ws8fKnmwtz",
        "first_slot": 2,
        "endorsing_power": 2334,
        "consensus_key": "tz1XeAxFB7RophB2x7vD4ZYMAw5VRv78Yk8k"
      },
      {
        "delegate": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
        "first_slot": 0,
        "endorsing_power": 2305,
        "consensus_key": "tz2Jn36ZVn99RqqJZZ2ckLrdZ9XJVQCARxJx"
      }
    ],
    "estimated_time": "2022-04-25T04:24:53Z"
  },

I can query endorsing rights as well by consensus key:

]
~ $ curl -s 'localhost:8732/chains/main/blocks/head/helpers/endorsing_rights?cycle=1016&consensus_key=tz2Jn36ZVn99RqqJZZ2ckLrdZ9XJVQCARxJx'  | jq
[
  {
    "level": 16257,
    "delegates": [
      {
        "delegate": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
        "first_slot": 1,
        "endorsing_power": 3738,
        "consensus_key": "tz2Jn36ZVn99RqqJZZ2ckLrdZ9XJVQCARxJx"
      }
    ],
    "estimated_time": "2022-05-13T04:57:14Z"
  },
  {
    "level": 16258,
    "delegates": [
      {
        "delegate": "tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv",
        "first_slot": 0,
        "endorsing_power": 3723,
        "consensus_key": "tz2Jn36ZVn99RqqJZZ2ckLrdZ9XJVQCARxJx"
      }
    ],
    "estimated_time": "2022-05-13T04:57:15Z"

Pending

After setting a consensus key, it is visible as pending:

~ $ curl -s http://localhost:8732/chains/main/blocks/head/context/delegates/tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed | jq
{
  "full_balance": "11999999022",
  "current_frozen_deposits": "1199999939",
  "frozen_deposits": "1199999939",
  "staking_balance": "11999999022",
  "delegated_contracts": [
    "tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed"
  ],
  "delegated_balance": "0",
  "deactivated": true,
  "grace_period": 84,
  "voting_power": "11999999393",
  "active_consensus_key": "tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed",
  "pending_consensus_keys": [
    {
      "cycle": 90,
      "pkh": "tz1bcQKsowAkkJBWNWzN1jukX4GYg1eFdd3b"
    }
  ]
}

It is possible to have several pending consensus keys:

~ $ curl -s http://localhost:8732/chains/main/blocks/head/context/delegates/tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed | jq
{
  "full_balance": "11999999022",
  "current_frozen_deposits": "1199999939",
  "frozen_deposits": "1199999939",
  "staking_balance": "11999999022",
  "delegated_contracts": [
    "tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed"
  ],
  "delegated_balance": "0",
  "deactivated": true,
  "grace_period": 84,
  "voting_power": "11999999393",
  "active_consensus_key": "tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed",
  "pending_consensus_keys": [
    {
      "cycle": 90,
      "pkh": "tz1bcQKsowAkkJBWNWzN1jukX4GYg1eFdd3b"
    }
  ]
}

Note: when setting a consensus key, then setting it again to its previous pending value, the pending field is still present, which has no effect:

~ $ curl -s http://localhost:8732/chains/main/blocks/head/context/delegates/tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed | jq
{
  "full_balance": "11999993828",
  "current_frozen_deposits": "0",
  "frozen_deposits": "0",
  "staking_balance": "11999993828",
  "delegated_contracts": [
    "tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed"
  ],
  "delegated_balance": "0",
  "deactivated": true,
  "grace_period": 84,
  "voting_power": "0",
  "active_consensus_key": "tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed",
  "pending_consensus_keys": [
    {
      "cycle": 119,
      "pkh": "tz1bcQKsowAkkJBWNWzN1jukX4GYg1eFdd3b"
    },
    {
      "cycle": 120,
      "pkh": "tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed"
    },
    {
      "cycle": 121,
      "pkh": "tz1cE83SBDig2qGLQiMk5yM5b5EMu1UqWmed"
    }
  ]
}

Verify that change takes effect in PRESERVED_CYCLES + 1

Print current cycle and change consensus key:

~ $ curl -s localhost:8732/chains/main/blocks/head/metadata | jq .level_info.cycle && tezos-client set consensus key for baker-1 to baker-1
367
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.

Check pending consensus key

~ $ curl localhost:8732/chains/main/blocks/head/context/delegates/tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx  | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   446  100   446    0     0  51035      0 --:--:-- --:--:-- --:--:-- 55750
{
  "full_balance": "4079198145401",
  "current_frozen_deposits": "407901147949",
  "frozen_deposits": "407901147949",
  "staking_balance": "4079198145401",
  "delegated_contracts": [
    "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx"
  ],
  "delegated_balance": "0",
  "deactivated": false,
  "grace_period": 372,
  "voting_power": "4078991480259",
  "active_consensus_key": "tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45",
  "pending_consensus_keys": [
    {
      "cycle": 371,
      "pkh": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx"
    }
  ]
}

Change pushed during cycle 367 will be effective at cycle 371. On our private test network, PRESERVED_CYCLES=3 so it works as expected.

At cycle 372 check again. Indeed, the change has been applied:

~ $ curl -s localhost:8732/chains/main/blocks/head/metadata | jq .level_info.cycle
372
~ $ curl localhost:8732/chains/main/blocks/head/context/delegates/tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx  | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   360  100   360    0     0   170k      0 --:--:-- --:--:-- --:--:--  351k
{
  "full_balance": "4080025067397",
  "current_frozen_deposits": "407983839863",
  "frozen_deposits": "407983839863",
  "staking_balance": "4080025067397",
  "delegated_contracts": [
    "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx"
  ],
  "delegated_balance": "0",
  "deactivated": false,
  "grace_period": 377,
  "voting_power": "4078991480259",
  "active_consensus_key": "tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx"
}

Set consensus key by mistake and then revert to previous

It works, immediately in the same cycle:

~ $ tezos-client set consensus key for baker-1 to baker-1-consensus && tezos-client set consensus key for baker-1 to baker-1
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Estimated gas: 1000 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'opRZsquXH7TTbBob9pokipAoKFQG75xzdrftuAeDUaw9rb35taP'
Waiting for the operation to be included...
Operation found in block: BMF1MHCoCsoxN3YGt2F8vN7hsBzpBBAi9ysYmFkfBL1PxjSLCd9 (pass: 3, offset: 0)
This sequence of operations was run:
  Manager signed operations:
    From: tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx
    Fee to the baker: ꜩ0.000372
    Expected counter: 3
    Gas limit: 1100
    Storage limit: 0 bytes
    Balance updates:
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ0.000372
      payload fees(the block proposer) ....... +ꜩ0.000372
    Update_consensus_key:
      Cycle: 105
      Public key hash: tz3T2DJPrdCB4AvTgeAPHb1FpfYvt7foAF45
      The consensus key was successfully udpated
      Consumed gas: 1000

The operation has only been included 0 blocks ago.
We recommend to wait more.
Use command
  tezos-client wait for opRZsquXH7TTbBob9pokipAoKFQG75xzdrftuAeDUaw9rb35taP to be included --confirmations 1 --branch BLmXdfhcoTDkmxqR5tKna2Ra4syLRt23pFGQPSmyFv9u3TxkmH2
and/or an external block explorer.
Warning:

                 This is NOT the Tezos Mainnet.

           Do NOT use your fundraiser keys on this network.

Node is bootstrapped.
Estimated gas: 1000 units (will add 100 for safety)
Estimated storage: no bytes added
Operation successfully injected in the node.
Operation hash is 'oow16M8YeVkn6oFnQaXFew3HRSmrENH5XvhQTAxf3zVVypnUX8E'
Waiting for the operation to be included...
Operation found in block: BMDGkmw4Dcv4bJymGAqv1tEjTML4uUeZ85W5u2jtLdfB9jTr8wW (pass: 3, offset: 0)
This sequence of operations was run:
  Manager signed operations:
    From: tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx
    Fee to the baker: ꜩ0.000372
    Expected counter: 4
    Gas limit: 1100
    Storage limit: 0 bytes
    Balance updates:
      tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx ... -ꜩ0.000372
      payload fees(the block proposer) ....... +ꜩ0.000372
    Update_consensus_key:
      Cycle: 105
      Public key hash: tz3ZJEBEPEkG1av8yykQC4mp6uieU3ghjdfx
      The consensus key was successfully udpated
      Consumed gas: 1000

The operation has only been included 0 blocks ago.
We recommend to wait more.
Use command
  tezos-client wait for oow16M8YeVkn6oFnQaXFew3HRSmrENH5XvhQTAxf3zVVypnUX8E to be included --confirmations 1 --branch BM24U4NeH7Gi8ZyJpA7DAFS9opZg63v3gLWV7ovU5NiVt4MzZVo
and/or an external block explorer.

accounts:
baker-0:
bootstrap_balance: '4000000000000'
is_bootstrap_baker_account: true
key: edsk4X99zYzn5TLCbARNqggTxaCpJTma6k5j9VTXddwCktytV2q24R
type: secret
baker-1:
bootstrap_balance: '4000000000000'
is_bootstrap_baker_account: true
key: p2sk3AGwvKpXmK2nj5PNR8E4mSVy22daMo3tYM36jqUAnrrwu968ZQ
type: secret
baker-2:
bootstrap_balance: '4000000000000'
is_bootstrap_baker_account: true
key: spsk27obC8bnjSAgzzVbTFBftTFvqw79CfMBmSm7HU4DeRKevrffxq
type: secret
baker-0-consensus:
bootstrap_balance: '4000000000000'
is_bootstrap_baker_account: false
key: spsk2qnbLv55GQcU2bvtU7TZVqbDeGcUzXxsEo19QQ6nMtRc7b13rn
type: secret
baker-1-consensus:
bootstrap_balance: '0'
is_bootstrap_baker_account: false
key: p2sk3YaQojXBXPLLbd2yjWjp6mSpPPiiiaVCNxsfTNsD1fiFt6PkA4
type: secret
baker-2-consensus:
bootstrap_balance: '0'
is_bootstrap_baker_account: false
key: edsk4Nzk9UFDHgfE5zR5mHHgYcEHvj6UzFHx3MmcN3oNiTVvzMby4Y
type: secret
activation:
protocol_hash: PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY
protocol_parameters:
preserved_cycles: 3
blocks_per_cycle: 16
blocks_per_commitment: 8
blocks_per_stake_snapshot: 8
cycles_per_voting_period: 2
hard_gas_limit_per_operation: '1040000'
hard_gas_limit_per_block: '5200000'
proof_of_work_threshold: '-1'
tokens_per_roll: '8000000000'
seed_nonce_revelation_tip: '125000'
baking_reward_fixed_portion: '10000000'
baking_reward_bonus_per_slot: '4286'
endorsing_reward_per_slot: '2857'
hard_storage_limit_per_operation: '60000'
origination_size: 257
cost_per_byte: '250'
quorum_max: 7000
quorum_min: 2000
min_proposal_quorum: 500
liquidity_baking_subsidy: '2500000'
liquidity_baking_sunset_level: 10000000
liquidity_baking_toggle_ema_threshold: 100000
max_operations_time_to_live: 120
minimal_block_delay: "1"
delay_increment_per_round: "1"
consensus_committee_size: 7000
consensus_threshold: 4667
minimal_participation_ratio:
numerator: 2
denominator: 3
max_slashing_period: 2
frozen_deposits_percentage: 10
double_baking_punishment: "640000000"
ratio_of_frozen_deposits_slashed_per_double_endorsement:
numerator: 1
denominator: 2
cache_script_size: 100000000
cache_stake_distribution_cycles: 8
cache_sampler_state_cycles: 8
tx_rollup_enable: true
tx_rollup_origination_size: 60000
tx_rollup_hard_size_limit_per_inbox: 100000
tx_rollup_hard_size_limit_per_message: 5000
tx_rollup_max_withdrawals_per_batch: 255
tx_rollup_commitment_bond: "10000000000"
tx_rollup_finality_period: 2000
tx_rollup_max_inboxes_count: 2101
tx_rollup_withdraw_period: 60000
tx_rollup_max_messages_per_inbox: 1010
tx_rollup_max_commitments_count: 4100
tx_rollup_cost_per_byte_ema_factor: 120
tx_rollup_max_ticket_payload_size: 10240
tx_rollup_rejection_max_proof_size: 30000
tx_rollup_sunset_level: 10000000
sc_rollup_enable: true
sc_rollup_origination_size: 6314
sc_rollup_challenge_window_in_blocks: 20160
sc_rollup_max_available_messages: 1000000
archive_tarball_url: null
bootstrap_peers: []
expected_proof_of_work: 0
full_snapshot_url: null
tezos_k8s_images:
utils: oxheadalpha/tezos-k8s-utils:6.6.1
images:
octez: localhost/tezos:latest
is_invitation: false
node_config_network:
activation_account_name: baker-0
chain_name: nico
genesis:
block: BL3YCVQat6LT58pPqksa1vRE5ux8MgSHEjVnXKT1DgXXeznQWeP
protocol: Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P
timestamp: '2022-02-18T00:46:30.511911+00:00'
user_activated_upgrades:
- level: 32
replacement_protocol: ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK
nodes:
baking-node:
instances:
- bake_using_accounts:
- baker-0
- baker-1
- baker-2
config:
shell:
history_mode: archive
is_bootstrap_node: true
- bake_using_accounts:
- baker-0-consensus
- baker-1-consensus
config:
shell:
history_mode: archive
is_bootstrap_node: true
identity:
peer_id: idtHfozBsuCyYFrAhSu9MnDzcj4kHC
public_key: 04ace2cd862bcd8f3d5da8f768f757fe79b43b859f40fa012942844a42bfc216
secret_key: 51007841a2ffb943a9de807773149fe395a685eaf84fcd9a68e5d20a2114a5dd
proof_of_work_stamp: 6482e775ecf93ac9cf6c9a3f86b873bfb5ce2c6997a104ec
- bake_using_accounts:
- baker-2-consensus
config:
shell:
history_mode: archive
is_bootstrap_node: true
runs:
- octez_node
- baker
storage_size: 15Gi
rolling-node: null
rolling_snapshot_url: null
rolling_tarball_url: null
should_generate_unsafe_deterministic_data: false
zerotier_config:
zerotier_network: null
zerotier_token: null
protocols:
- command: 013-PtJakart
- command: alpha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment