ethpandaops / ethereum-package

A Kurtosis package that deploys a private, portable, and modular Ethereum devnet
MIT License
256 stars 147 forks source link

Add easy way to sync public testnet or devnets. #378

Closed barnabasbusa closed 10 months ago

barnabasbusa commented 11 months ago

It would be great if we could try to sync up public testnets/devnets using a single one liner configuration.

In this case, we won't need to run genesis, but rather pull the genesis related metrics into an artifact (if its a devnet).

Ideally I should be able to sync "holesky" with:

participants:
  - el_client_type: geth
    cl_client_type: teku
network_params:
  network: "holesky"

In case of a public testnet, no need to pull any data, as its built into the clients. Planning to rework it such

def default_network_params():
    # this is temporary till we get params working
    return {
        "preregistered_validator_keys_mnemonic": "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete",
        "num_validator_keys_per_node": 64,
        "network_id": "3151908",
        "deposit_contract_address": "0x4242424242424242424242424242424242424242",
        "seconds_per_slot": 12,
        "genesis_delay": 120,
        "max_churn": 8,
        "ejection_balance": 16000000000,
        "capella_fork_epoch": 0,
        "deneb_fork_epoch": 500,
        "electra_fork_epoch": None,
        "network": "kurtosis", 
    }

if network_params.network != kurtosis && network == public testnet name

def default_network_params():
    # this is temporary till we get params working
    return {
        "preregistered_validator_keys_mnemonic": <ignored>
        "num_validator_keys_per_node": <ignored>,
        "network_id": <ignored>,
        "deposit_contract_address": <ignored>,
        "seconds_per_slot": <ignored>,
        "genesis_delay": <ignored>,,
        "max_churn": <ignored>,,
        "ejection_balance": <ignored>,,
        "capella_fork_epoch": <ignored>,,
        "deneb_fork_epoch": <ignored>,,
        "electra_fork_epoch": <ignored>,
        "network": "sepolia", 
    }

if network_params.network != kurtosis && network != public testnet name

def default_network_params():
    # this is temporary till we get params working
    return {
        "preregistered_validator_keys_mnemonic": <ignored>
        "num_validator_keys_per_node": <ignored>,
        "network_id": <ignored>,
        "deposit_contract_address": <ignored>,
        "seconds_per_slot": <ignored>,
        "genesis_delay": <ignored>,,
        "max_churn": <ignored>,,
        "ejection_balance": <ignored>,,
        "capella_fork_epoch": <ignored>,,
        "deneb_fork_epoch": <ignored>,,
        "electra_fork_epoch": <ignored>,
        "network": "dencun-devnet-12", 
    }

pull network config from github.com/ethpandaops/<network_params.network | get the first word + append devnets>/network-configs/<network_params.network>/ zip that up into an artifact and use those values.

Probably want to split these two up into their own PRs, and test them well.

Public testnet syncing might require persistence. https://github.com/kurtosis-tech/ethereum-package/issues/371

parithosh commented 11 months ago

i think you mean fetch configs from eth-clients and not from the ethpandaops org :D

barnabasbusa commented 11 months ago

eth-clients have no devnet config

parithosh commented 11 months ago

eth-clients is the canonical source for every public testnet config :D e,g: holesky should be fetched from here: https://github.com/eth-clients/holesky

barnabasbusa commented 11 months ago

testnet config doesn't need to be fetched at all, as it's part of each client. (as I described above )