Skip to content

Instantly share code, notes, and snippets.

@obycode
Last active March 8, 2024 14:12
Show Gist options
  • Save obycode/6d7414cb4d1ec1bcd34f89f581b1934b to your computer and use it in GitHub Desktop.
Save obycode/6d7414cb4d1ec1bcd34f89f581b1934b to your computer and use it in GitHub Desktop.
Epoch 3 testnet boot up
  1. The stacks-node mines blocks up to epoch 2.5 height at which point, pox-4 is deployed (along with other new boot contracts)
  • Look for:
    Applying epoch transition, new_epoch_id: 2.5, old_epoch_id: 2.4
    
  • Note: This happens during reward cycle 6 with the default test config (20 block cycles with 5 block prepare phases)
  1. Before the prepare phase starts, stackers must successfully call stack-stx
  • Look for something similar to:
    Contract-call successfully processed, txid: adc91171be4f7edb614f80d3707f75f3cc29650f88ff791133f55ebd71e24108, origin: STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP, origin_nonce: 0, contract_name: ST000000000000000000002AMW42H.pox-4, function_name: stack-stx, function_args: [u1000080000000000, (tuple (hashbytes 0x31ef5ee9a226a792b93f2bfbfbc54f523eba7818) (version 0x00)), u109, u2, (some 0x331cb6e41dcb335f6851bb42e6dc39816ad4a2fe3bda4c8836f43e51fec9c2e401a35ef7b676af27214716ce8e22e57fdc60b1a29f087b031a6486e2989d5fcc01), 0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d], return_value: (ok (tuple (lock-amount u1000080000000000) (signer-key 0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d) (stacker STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP) (unlock-burn-height u160))), cost: ExecutionCost { write_length: 973, write_count: 8, read_length: 74229, read_count: 26, runtime: 742813 }
    
  • Look for a line like this to see when the prepare phase starts:
    Performing .signers state update, burn_height: 116, for_cycle: 6, coinbase_height: 14, signers_contract: ST000000000000000000002AMW42H.signers
    
  1. The signers should vote for an aggregate public key during the prepare phase
  • Look for something like:
    Contract-call successfully processed, txid: 2230b282127ef098c135b6211a4e2b9d2fdc80aa0581a43e5069de850a6ec371, origin: ST18MDW2PDTBSCR1ACXYRJP2JX70FWNM6YY2VX4SS, origin_nonce: 1, contract_name: ST000000000000000000002AMW42H.signers-voting, function_name: vote-for-aggregate-public-key, function_args: [u1, 0x024e012a4d3de00757bc46b7465b3e70b18f590357bec4b81697e96f5261643de2, u1, u6], return_value: (ok true), cost: ExecutionCost { write_length: 449, write_count: 5, read_length: 16148, read_count: 21, runtime: 78441 }
    
  • You should see one vote for each signer, and they should be voting for the same key
  1. Blocks should continue to be mined, one Stacks block per Bitcoin block up to the epoch 3.0 activation height
  • Look for the activation of 3.0:
    Epoch-3.0 boundary reached, stopping Epoch-2.x run loop
    ...
    Reached Epoch-3.0 boundary, starting nakamoto node
    
  1. Currently, the Nakamoto node takes 2 Bitcoin blocks to start producing Stacks blocks (this should be fixed)
  • Look for something like:
    Miner node: submitting leader_key_register op - 035379aa40c02890d253cfa577964116eb5295570ae9f7287cbae5f2585f5b2c7c, waiting for its inclusion in the next Bitcoin block
    
  1. Nakamoto node should now start mining blocks
  • Look for something like:
    Miner: Succeeded assembling Stacks block #29: 3a6b8426239fca1a1ad8b2015705f407546fbd71e825a2f1708366240c279b08, with 3 txs
    
  • Followed by something like:
    Proposed block to stackerdb: StackerDBChunkAckData { accepted: true, reason: None, metadata: Some(SlotMetadata { slot_id: 0, slot_version: 1, data_hash: 113524c2b7c5a3aa1686ebd3521137894b2e55a688f5c4aad79e82de6f6dfe73, signature: 0125e255f0ea6d629fedfdd3c5c8d0b1ce25dd0d1a71cc9bc0baec367afd750c3c786ef1806671c6f66bc31b3060eb4f66c02ec68f4d1394e56128c81515ec8d85 }) }
    
  • And then something like:
    Miner: received a signature accross the proposed block's signer signature hash (a76a9189d02ccad0a4caa4c7e4d4e1a4479ddb834c615b7770855d65592ec90b): ThresholdSignature(Signature { R: Point { x: secp256k1_fe { n: [4208419166360750, 3706120344343498, 2474500277905408, 3686832806691084, 203651813915202] }, y: secp256k1_fe { n: [3616908292274700, 583172320044076, 763229068939564, 1543800824577186, 239601253556166] }, z: secp256k1_fe { n: [1, 0, 0, 0, 0] } }, z: Scalar { scalar: secp256k1_scalar { d: [16102550635865938475, 14723069077065669543, 1047208629732631009, 6786898848164997974] } } })
    
  1. When a new burn block arrives, you should see:
    Miner node: submitting leader_block_commit (txid: 6fde12d542ffb45fd3bc1805dd80da605f2359cdb0ebcffda4332e9a999a7ce2, rbf: false, total spent: 37600, size: 352, fee_rate: 50)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment