From 47e2c16b3e9bd4b8119425decd001a4438c02142 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 8 Aug 2023 11:48:35 -0700 Subject: [PATCH] Parameterize eth chain (#161) * Sepolia support * Update the geth version * Parameterize storage * Open p2p ports for geth * Don't init genesis when joining an eth network * Parameterize enablement of a validator * Don't expose p2p ports * Remove debugging statement * Removed `network` value --- .../chains/virtual/eth/statefulset.yaml | 42 ++- charts/devnet/values.yaml | 269 ++++++++++++++++++ 2 files changed, 287 insertions(+), 24 deletions(-) diff --git a/charts/devnet/templates/chains/virtual/eth/statefulset.yaml b/charts/devnet/templates/chains/virtual/eth/statefulset.yaml index 7b448157..9407f17f 100644 --- a/charts/devnet/templates/chains/virtual/eth/statefulset.yaml +++ b/charts/devnet/templates/chains/virtual/eth/statefulset.yaml @@ -6,7 +6,6 @@ {{ $defaultChain := get $defaultFile.defaultChains $chain.subtype | default dict }} {{ $chain = merge $chain $defaultChain }} - apiVersion: apps/v1 kind: StatefulSet metadata: @@ -31,7 +30,7 @@ spec: rm -rf /ethereum/{execution,consensus}; \ mkdir -p /ethereum/consensus/{beacon,validator} /ethereum/execution \ && cd /ethereum/consensus; \ - stat genesis.ssz || wget -S https://github.com/eth-clients/eth2-networks/raw/master/shared/prater/genesis.ssz"] + stat genesis.ssz || wget -S {{ $chain.genesisStateUrl }};" ] volumeMounts: - name: ethereum mountPath: /ethereum @@ -41,6 +40,7 @@ spec: volumeMounts: - name: ethereum mountPath: /ethereum + {{- if not $chain.joinNetwork }} - name: prysm-beacon-init image: {{ $chain.prysmCtl.image }} command: {{ $chain.prysmCtl.command }} @@ -54,23 +54,24 @@ spec: - name: config mountPath: /etc/config readOnly: true - - name: geth-account-init + - name: geth-genesis-init image: {{ $chain.geth.image }} - command: ['sh', '-c', "if [ -e /ethereum/.init ]; then exit 0; fi; geth --datadir=/ethereum/execution account import --password /dev/null /etc/secrets/secret.json"] + command: ['sh', '-c', "if [ -e /ethereum/.init ]; then exit 0; fi; geth init --datadir=/ethereum/execution /etc/config/genesis.json"] volumeMounts: - name: ethereum mountPath: /ethereum - - name: secrets - mountPath: /etc/secrets + - name: config + mountPath: /etc/config readOnly: true - - name: geth-genesis-init + {{- end }} + - name: geth-account-init image: {{ $chain.geth.image }} - command: ['sh', '-c', "if [ -e /ethereum/.init ]; then exit 0; fi; geth init --datadir=/ethereum/execution /etc/config/genesis.json"] + command: ['sh', '-c', "if [ -e /ethereum/.init ]; then exit 0; fi; geth --datadir=/ethereum/execution account import --password /dev/null /etc/secrets/secret.json"] volumeMounts: - name: ethereum mountPath: /ethereum - - name: config - mountPath: /etc/config + - name: secrets + mountPath: /etc/secrets readOnly: true - name: init-done image: alpine/openssl @@ -97,10 +98,7 @@ spec: - name: secrets mountPath: /etc/secrets readOnly: true - resources: - requests: - cpu: 100m - memory: 1Gi + resources: {{- include "getResourceObject" $chain.geth.resources | trim | nindent 12 }} - name: beacon-chain image: {{ $chain.beaconChain.image }} command: {{ $chain.beaconChain.command }} @@ -125,10 +123,8 @@ spec: - name: secrets mountPath: /etc/secrets readOnly: true - resources: - requests: - cpu: 100m - memory: 1Gi + resources: {{- include "getResourceObject" $chain.beaconChain.resources | trim | nindent 12 }} + {{- if $chain.validator.enabled }} - name: validator image: {{ $chain.validator.image }} command: {{ $chain.validator.command }} @@ -143,10 +139,8 @@ spec: - name: config mountPath: /etc/config readOnly: true - resources: - requests: - cpu: 100m - memory: 1Gi + resources: {{- include "getResourceObject" $chain.beaconChain.resources | trim | nindent 12 }} + {{- end }} {{- include "imagePullSecrets" $chain | indent 6 }} volumes: - name: secrets @@ -160,10 +154,10 @@ spec: name: ethereum spec: accessModes: [ "ReadWriteOnce" ] - storageClassName: hostpath + storageClassName: {{ $chain.storageClassName }} resources: requests: - storage: 10Gi + storage: {{ $chain.storage }} {{- end }} {{- end }} diff --git a/charts/devnet/values.yaml b/charts/devnet/values.yaml index 0d6dccec..b6a611dd 100644 --- a/charts/devnet/values.yaml +++ b/charts/devnet/values.yaml @@ -49,6 +49,275 @@ timeouts: timeout_precommit_delta: 400ms timeout_commit: 800ms +# API for interacting with the charts for devnet +# TODO: need a way to create state reaching jobs, those will run user bash scripts +# after the chain has been initialized, get the chain to a state and then complete +defaultChains: + osmosis: + image: ghcr.io/cosmology-tech/starship/osmosis:v15.1.2-wasmvm1.1.2 + home: /root/.osmosisd + binary: osmosisd + prefix: osmo + denom: uosmo + coins: 100000000000000uosmo,100000000000000uion + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/osmosis-labs/osmosis + juno: + image: ghcr.io/cosmology-tech/starship/juno:v15.0.0 + home: /root/.juno + binary: junod + prefix: juno + denom: ujuno + coins: 100000000000000ujuno + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/CosmosContracts/juno + wasmd: + image: anmol1696/wasmd:latest + home: /root/.wasmd + binary: wasmd + prefix: wasm + denom: stake + coins: 100000000000000ucosm,100000000000000stake + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/CosmWasm/wasmd + cosmos: + image: ghcr.io/cosmology-tech/starship/gaia:v9.1.1 + home: /root/.gaia + binary: gaiad + prefix: cosmos + denom: uatom + coins: 100000000000000stake,100000000000000uatom + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/cosmos/gaia + simapp: + image: ghcr.io/cosmology-tech/starship/simapp:v0.47.3 + home: /root/.simapp + binary: simd + prefix: cosmos + denom: stake + coins: 100000000000000stake + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/cosmos/cosmos-sdk/tree/main/simapp + persistencecore: + image: anmol1696/persistencecore:latest + home: /root/.persistenceCore + binary: persistenceCore + prefix: persistence + denom: uxprt + coins: 100000000000000uxprt + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/persistenceOne/persistenceCore + stride: + image: ghcr.io/cosmology-tech/starship/stride:v9.2.1 + home: /root/.stride + binary: strided + prefix: stride + denom: ustrd + coins: 100000000000000ustrd + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/Stride-Labs/stride + injective: + image: ghcr.io/cosmology-tech/starship/injective:v1.11-1685225746 + home: /root/.injectived + binary: injectived + prefix: inj + denom: inj + coins: 100000000000000inj + hdPath: m/44'/60'/0'/0/0 + coinType: 60 + repo: https://github.com/InjectiveLabs/injective-chain-releases + ics: + image: ghcr.io/cosmology-tech/starship/ics:v0.1.0 + home: /root/.ics + binary: interchain-security-pd + prefix: cosmos + denom: uatom + coins: 100000000000000stake,100000000000000uatom + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/cosmos/interchain-security + cronos: + image: ghcr.io/cosmology-tech/starship/cronos:v1.0.4 + home: /root/.cronos + binary: cronosd + prefix: crc + denom: basecro + coins: 100000000000000basecro + hdPath: m/44'/60'/0'/0/0 + coinType: 60 + repo: https://github.com/crypto-org-chain/cronos + cryptoorgchain: + image: ghcr.io/cosmology-tech/starship/cryptoorgchain:v4.1.2 + home: /root/.cryptoorgchain + binary: chain-maind + prefix: cro + denom: basecro + coins: 100000000000000basecro + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/crypto-org-chain/chain-main + evmos: + image: ghcr.io/cosmology-tech/starship/evmos:v12.1.5 + home: /root/.evmosd + binary: evmosd + prefix: evmos + denom: aevmos + coins: 100000000000000aevmos + hdPath: m/44'/60'/0'/0/0 + coinType: 60 + repo: https://github.com/evmos/evmos + regen: + image: ghcr.io/cosmology-tech/starship/regen:v5.0.0 + home: /root/.regen + binary: regen + prefix: regen + denom: uregen + coins: 100000000000000uregen + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/regen-network/regen-ledger + quasar: + image: ghcr.io/cosmology-tech/starship/quasar:v0.1.1 + home: /root/.quasarnode + binary: quasarnoded + prefix: quasar + denom: uqsr + coins: 100000000000000uqsr + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/quasar-finance/quasar-preview + quicksilver: + image: ghcr.io/cosmology-tech/starship/quicksilver:v0.6.6 + home: /root/.quicksilverd + binary: quicksilverd + prefix: quick + denom: uqck + coins: 100000000000000uqck + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/ingenuity-build/quicksilver + sei: + image: ghcr.io/cosmology-tech/starship/sei:2.0.46beta + home: /root/.seid + binary: seid + prefix: sei + denom: usei + coins: 100000000000000usei + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/sei-protocol/sei-chain + sommelier: + image: ghcr.io/cosmology-tech/starship/sommelier:v6.0.0 + home: /root/.sommelier + binary: sommelier + prefix: somm + denom: usomm + coins: 100000000000000usomm + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/PeggyJV/sommelier + stargaze: + image: ghcr.io/cosmology-tech/starship/stargaze:v10.0.1 + home: /root/.starsd + binary: starsd + prefix: stars + denom: ustars + coins: 100000000000000ustars + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/public-awesome/stargaze + umee: + image: ghcr.io/cosmology-tech/starship/umee:v3.1.0 + home: /root/.umee + binary: umeed + prefix: umee + denom: uumee + coins: 100000000000000uumee + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/umee-network/umee + eth: + storageClassName: hostpath + genesisStateUrl: https://github.com/eth-clients/merge-testnets/blob/main/sepolia/genesis.ssz + joinNetwork: false + prysmCtl: + image: gcr.io/prysmaticlabs/prysm/cmd/prysmctl + command: ["/app/cmd/prysmctl/prysmctl"] + args: + - testnet + - generate-genesis + - --num-validators=36 + - --output-ssz=/ethereum/consensus/genesis.ssz + - --chain-config-file=/etc/config/config.yml + geth: + image: ethereum/client-go:v1.12.0 + args: + - --nodiscover + - --http + - --http.api=eth,net,web3,debug + - --http.addr=0.0.0.0 + - --http.vhosts=* + - --authrpc.addr=0.0.0.0 + - --authrpc.jwtsecret=/etc/secrets/jwt.hex + - --datadir=/ethereum/execution + - --allow-insecure-unlock + - --unlock=0x123463a4B065722E99115D6c222f267d9cABb524 + - --password=/dev/null + - --syncmode=full + - --mine + - --miner.etherbase=0x123463a4b065722e99115d6c222f267d9cabb524 + - --networkid=32382 + beaconChain: + image: gcr.io/prysmaticlabs/prysm/beacon-chain:v4.0.7 + command: ["/app/cmd/beacon-chain/beacon-chain"] + args: + - --datadir=/ethereum/consensus/beacon + - --min-sync-peers=0 + - --genesis-state=/ethereum/consensus/genesis.ssz + - --bootstrap-node= + - --chain-config-file=/etc/config/config.yml + - --config-file=/etc/config/config.yml + - --chain-id=32382 + - --rpc-host=0.0.0.0 + - --contract-deployment-block=0 + - --grpc-gateway-host=0.0.0.0 + - --execution-endpoint=http://localhost:8551 + - --accept-terms-of-use + - --jwt-secret=/etc/secrets/jwt.hex + - --contract-deployment-block=0 + - --suggested-fee-recipient=0x123463a4B065722E99115D6c222f267d9cABb524 + validator: + enabled: false + image: gcr.io/prysmaticlabs/prysm/validator:v4.0.7 + command: ["/app/cmd/validator/validator"] + args: + - --accept-terms-of-use + - --beacon-rpc-provider=localhost:4000 + - --datadir=/ethereum/consensus/validator + - --interop-num-validators=36 + - --interop-start-index=0 + - --force-clear-db + - --chain-config-file=/etc/config/config.yml + - --config-file=/etc/config/config.yml + - --suggested-fee-recipient=0x0C46c2cAFE097b4f7e1BB868B89e5697eE65f934 + contracts: [] + + +defaultRelayers: + ts-relayer: + image: ghcr.io/cosmology-tech/starship/ts-relayer:0.9.0 + hermes: + image: ghcr.io/cosmology-tech/starship/hermes:1.5.1 + go-relayer: + image: ghcr.io/polymerdao/relayer-ibcx:starship-integration + chains: [] # Examples running chains # - name: osmosis-1