Geth
https://github.com/MariusVanDerWijden/go-ethereum/tree/merge-kiln-jwt
815a414312db9a922c5a34ac034fb7aa8861f2e7
Prysm
auth-kiln branch
https://github.com/prysmaticlabs/prysm/commit/77de59bf62838796a0f9cb31dd1f5f1ef11c3ed2
Building geth:
make geth
Building Prysm
go build -o /tmp/beacon ./cmd/beacon-chain
go build -o /tmp/validator ./cmd/validator
go build -o /tmp/gen ./tools/genesis-state-gen
genesis.json
{
"config": {
"chainId": 1,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"berlinBlock": 0,
"londonBlock": 0,
"clique": {
"period": 5,
"epoch": 30000
},
"terminalTotalDifficulty": 10
},
"nonce": "0x42",
"timestamp": "0x0",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1C9C380",
"difficulty": "0x0",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
"balance": "0x6d6172697573766477000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFeePerGas": "0x7"
}
Save it to /tmp/genesis.json
sk.json
45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8
Save it to /tmp/sk.json
save the auth JWT key
0x98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4
Write it as /tmp/jwt
To start Geth:
./build/bin/geth --http --ws -http.api "engine" --datadir "~/ethereum/taunus" init /tmp/genesis.json
./build/bin/geth --http --ws -http.api "engine" --datadir "~/ethereum/taunus" account import /tmp/sk.json
./build/bin/geth --http --ws -http.api "engine,eth,net" --datadir "~/ethereum/taunus" --allow-insecure-unlock --unlock "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" --password "" --nodiscover console --override.terminaltotaldifficulty 9 --jwt-secret=0x98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4
merge.yml
CONFIG_NAME: "local"
ALTAIR_FORK_EPOCH: 1
BELLATRIX_FORK_EPOCH: 2
DEPOSIT_CHAIN_ID: 1
SECONDS_PER_SLOT: 6
SLOTS_PER_EPOCH: 6
TERMINAL_TOTAL_DIFFICULTY: 9
Save it to /tmp/merge.yml
To start Prysm:
Generate a genesis state
/tmp/gen --num-validators=256 --output-ssz=/tmp/genesis.ssz --mainnet-config
Start beacon node
Notes:
http-web3provider
and execution-provider
flags should point to gethchain-config-file
flag should point to merge.yml
/tmp/beacon --datadir /tmp/chaindata --force-clear-db --interop-genesis-state /tmp/genesis.ssz --interop-eth1data-votes --min-sync-peers=0 --http-web3provider=http://localhost:8545 --deposit-contract 0x8A04d14125D0FDCDc742F4A05C051De07232EDa4 --bootstrap-node= --chain-config-file=/tmp/merge.yml --execution-provider=http://localhost:8551 --jwt-secret=/tmp/jwt
Start validator node
/tmp/validator --beacon-rpc-provider localhost:4000 --interop-num-validators=256 --interop-start-index=0 --force-clear-db --chain-config-file=/tmp/merge.yml
Once you see the following log on the beacon node (~after 12 slots):
[2022-02-15 09:53:39] INFO rpc/validator: Received payload hash=0x0000000000000000000000000000000000000000000000000000000000000000 number=0 parentHash=0x0000000000000000000000000000000000000000000000000000000000000000 txCount=0
Enter miner.start()
in geth console
Once ttd
is reached, we should see the following logs on the beacon node:
[2022-02-15 15:54:39] INFO rpc/validator: Retrieved terminal block hash hash=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b3678294aaea number=[5] parentTd=[8] td=[10] ttd=+9
[2022-02-15 15:54:39] INFO rpc/validator: Successfully called forkchoiceUpdated with attribute hash:=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b3678294aaea status:=VALID
[2022-02-15 15:54:39] INFO rpc/validator: Received payload ID hash=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b3678294aaea id=0xc0052e2a68 slot=17
[2022-02-15 15:54:39] INFO rpc/validator: Received payload hash=0xad6cd74803d6b5996f06ae57849aefbedfcb4acdbecfbd940a4cb60f1ef9ceca number=6 parentHash=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b3678294aaea txCount=0
[2022-02-15 15:54:39] INFO blockchain: Successfully called newPayload hash:=0xad6cd74803d6b5996f06ae57849aefbedfcb4acdbecfbd940a4cb60f1ef9ceca parentHash=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b36
A fundamental property of blockchains is the notion of "finality," which roughly means that after a certain period of time, transactions that have been included in the canonical chain are extremely difficult or almost impossible to revert. Eth2 has an "explicit" mechanism of chain finality enshrined within the protocol, which is different from the "probabilistic" finality found in proof-of-work chains such as Ethereum or Bitcoin today. In proof of work, consensus is fundamentally a global race that a lucky miner wins by being the first to produce a valid block: a result of finding a mathematical solution to a computationally difficult problem. As such, block times are probabilistic. The more blocks are added to the chain, the harder it is to revert, as each represents a cumulative sum of electrical and computational power required to create it. Given there are real, physical guarantees that would prevent an attacker from being able to revert the Bitcoin and Ethereum blockchains today, we can consider transactions past a certain amount of time included on-chain as "finalized." The objective of Stateless Ethereum RPC is to enable the client to operate without the need to store the entire state tree. Ethereum proof of stake, however, does not function on the concept of probabilistic finality. Instead, it enshrines finality into the protocol by saying "If > 2/3s of validators have voted correctly on the chain head for a long period of time, we can consider everything before a specific checkpoint as finalized". Finality is explicit, and nodes that follow the protocol will not be able to revert the finalized checkpoint as it is fundamentally impossible regardless of consensus weight. How Finality Works in ETH2 ETH2 is a synchronous protocol that operates on a "checkpoint" mechanism for bookkeeping. Essentially, a set of validators is assigned to either produce blocks or vote on blocks in a window of 32 potential slots. Each slot is a period of 12 seconds. Those 32 slots constitute an epoch. In an epoch, there are 32 assigned block proposers and everyone else is known as an attester, assigned to vote on proposed blocks once per epoch. There is only one block proposer assigned per slot, but many "attesters" can be assigned per slot For example, Alice is selected as a block proposer for slot 4 in the epoch and Bob, James, Charlie, and Susan are assigned as attesters at slot 4, meaning they should be voting on Alice's produced block as canonical.
Jul 4, 2024Contextual logging:
Dec 6, 2023This guide will set up
Nov 17, 2023Today in BOLD, challenges can have subchallenges, and we have a total of 3 levels. We do this because at each challenge, validators have to commit to N state roots of a block’s history, which can be very expensive to compute. For example, computing 2048 machine hashes for the execution of a block and collecting them takes around 5 minutes on a modern MacBook Pro.
Aug 16, 2023or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up