Try โ€‚โ€‰HackMD

Quick Merge Demo: Prysm x Catalyst interop

Last Updated: Mar 30, 2021

Background

This provides instructions on running beacon chain and eth1 chain using Prysm's interop mode. Beacon chain node (Prysm) inserts application payload into the eth1 chain node (Catalyst). Beacon chain validator produces application payload by requesting from eth1 node and signs over it. In this interop mode, participation is 100% and the chain should finalize at the start of epoch 4.

Setup

Commands to start

1.) Check out catalyst branch and start the Catalyst eth1 instance

./run-catalyst.sh

Notes: If you plan to send transaction later, edit run-catalyst.sh's "alloc\": \{\} with the address and eth amount.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

2.) Check out quick-merge-demo branch and generate the beacon chain genesis state

bazel run //tools/genesis-state-gen โ€“ โ€“num-validators=64 โ€“output-ssz=/tmp/genesis.ssz โ€“mainnet-config

Note: There's no limit to the number of validators you can use. But make sure it's consistent with the validator command below

3.) In the same quick-merge-demo branch, start the beacon node in interop mode

bazel run //beacon-chain โ€“ โ€“datadir /tmp/mergechaindata โ€“clear-db โ€“interop-genesis-state /tmp/genesis.ssz โ€“interop-eth1data-votes โ€“min-sync-peers=0 โ€“http-web3provider=http://localhost:8545 โ€“deposit-contract 0x8A04d14125D0FDCDc742F4A05C051De07232EDa4 โ€“pyrmont โ€“bootstrap-node=

4.) In the same quick-merge-demo branch, start the validator client in interop mode

bazel run //validator โ€“ โ€“beacon-rpc-provider localhost:4000 โ€“interop-num-validators=64 โ€“interop-start-index=0 โ€“clear-db

What you should see

Catalyst

Receives from beacon node and imports new application payload to the eth1 chain

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Beacon node

Produces new application payload using Catalyst and package payload into beacon block
Inserts beacon block application payload to Catalyst

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Validator client

Receives from beacon node and signs beacon block which contains application payload

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Next steps

  • Further alignment with the merge spec
  • Brainstorm how we can leverage this experience for a more public testnet so the community can test drive it. Please do reach out to us if you have any cool ideas
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More โ†’

How to send transaction

Metamask

  1. Connect to Localhost 8545 and change the chain ID to the one specified in genesis.json (i.e. 220720). Balance with your address should be reflected

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More โ†’

  2. Now send a transaction

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More โ†’

  3. To verify, you should see transaction picked up by the eth1 node

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More โ†’

Beacon node

Beacon node requests eth1 application data and produces it for validator. It then inserts it back to the eth1 node. (See numTransactions=1)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Validator

Validator signs over the block with eth1 application payload

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Back in Metamask, you should see original transaction has been confirmed

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Reference

Spec
Research: executable beacon chain
Research: eth1+eth2 client relationship research
Original quick merge proposal
[DRAFT] Eth1-Eth2 communication protocol