Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(charts): snapshot startup for sequencer #1876

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions charts/sequencer/files/scripts/init-cometbft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,39 @@ set -o errexit -o nounset

# Only need to configure cometbft data if not already initialized
if [ ! -d "/cometbft/data" ]; then
# Load the snapshot on load if enabled
{{- if .Values.snapshotLoad.enabled }}
echo "Downdloading snapshot..."
rclone config create r2 s3 \
provider={{ .Values.snapshotLoad.config.provider }} \
access_key_id={{ .Values.snapshotLoad.config.accessKeyId }} \
secret_access_key={{ .Values.snapshotLoad.config.secretAccessKey }} \
region={{ .Values.snapshotLoad.config.region }} \
endpoint={{ .Values.snapshotLoad.config.endpoint }} \
acl={{ .Values.snapshotLoad.config.acl }}
rclone copy -P r2:astria-mainnet-snapshots/ /snapshot/

echo "Extracting snapshot..."
mkdir /cometbft/data
mkdir /sequencer/penumbra.db
tar -C /cometbft/data/ --strip-components=2 -xzf /snapshot/cometbft_*.tar.gz cometbft/data
tar -C /sequencer/penumbra.db/ --strip-components=2 -xzf /snapshot/sequencer_*.tar.gz sequencer/penumbra.db
rm /snapshot/cometbft_*.tar.gz /snapshot/sequencer_*.tar.gz
{{- else }}
# Otherwise initialize with basic values
echo "Intializing cometbft with empty data directory..."
cp -LR /data/ /cometbft/data
{{- end }}
else
echo "CometBFT data directory already initialized"
fi

# Don't replace the config directory if it already exists
if [ ! -d "/cometbft/config" ]; then
echo "Creating Config Directory..."
cp -LR /config/ /cometbft/config
else
echo "Updating config directory..."
cp /config/* /cometbft/config/
fi

Expand Down
6 changes: 6 additions & 0 deletions charts/sequencer/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ spec:
- mountPath: /cometbft
name: sequencer-shared-storage-vol
subPath: {{ .Values.moniker }}/cometbft
- mountPath: /sequencer
name: sequencer-shared-storage-vol
subPath: {{ .Values.moniker }}/sequencer
- mountPath: /snapshot
name: sequencer-shared-storage-vol
subPath: {{ .Values.moniker }}/snapshot
containers:
- name: sequencer
image: {{ include "sequencer.image" . }}
Expand Down
104 changes: 57 additions & 47 deletions charts/sequencer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@ global:
useTTY: true
dev: false

snapshotLoad:
enabled: true
config:
provider: Cloudflare
accessKeyId: 0d8d8005e468dd86498bde6dfa02044f
secretAccessKey: e33ea43e00d9b655cb72d8a8107fa2957bd6b77e5718df0a26f259956532bba8
region: auto
endpoint: https://fb1caa337c8e4e3101363ca1240e03ca.r2.cloudflarestorage.com
acl: private

# sequencer core images
images:
init:
repo: ghcr.io/tomwright/dasel
repo: rclone/rclone
pullPolicy: IfNotPresent
tag: alpine
tag: 1.56.0
cometBFT:
repo: docker.io/cometbft/cometbft
pullPolicy: IfNotPresent
Expand All @@ -24,7 +34,7 @@ images:
repo: ghcr.io/astriaorg/sequencer
pullPolicy: IfNotPresent
tag: 1.0.0
devTag: latest
devTag: local

moniker: ""
genesis:
Expand Down Expand Up @@ -54,49 +64,49 @@ genesis:
maxAgeNumBlocks: "4000000"
maxBytes: "1048576"

fees:
feeChange:
base: "0"
multiplier: "0"
bridgeLock:
base: "0"
multiplier: "1"
bridgeSudoChange:
base: "24"
multiplier: "0"
bridgeUnlock:
base: "0"
multiplier: "0"
feeAssetChange:
base: "0"
multiplier: "0"
ibcRelay:
base: "0"
multiplier: "0"
ibcRelayerChange:
base: "0"
multiplier: "0"
ibcSudoChange:
base: "0"
multiplier: "0"
ics20Withdrawal:
base: "24"
multiplier: "0"
initBridgeAccount:
base: "48"
multiplier: "0"
rollupDataSubmission:
base: "32"
multiplier: "1"
sudoAddressChange:
base: "0"
multiplier: "0"
transfer:
base: "12"
multiplier: "0"
validatorUpdate:
base: "0"
multiplier: "0"
fees: {}
# feeChange:
# base: "0"
# multiplier: "0"
# bridgeLock:
# base: "0"
# multiplier: "1"
# bridgeSudoChange:
# base: "24"
# multiplier: "0"
# bridgeUnlock:
# base: "0"
# multiplier: "0"
# feeAssetChange:
# base: "0"
# multiplier: "0"
# ibcRelay:
# base: "0"
# multiplier: "0"
# ibcRelayerChange:
# base: "0"
# multiplier: "0"
# ibcSudoChange:
# base: "0"
# multiplier: "0"
# ics20Withdrawal:
# base: "24"
# multiplier: "0"
# initBridgeAccount:
# base: "48"
# multiplier: "0"
# rollupDataSubmission:
# base: "32"
# multiplier: "1"
# sudoAddressChange:
# base: "0"
# multiplier: "0"
# transfer:
# base: "12"
# multiplier: "0"
# validatorUpdate:
# base: "0"
# multiplier: "0"

validators: []
# - name: core
Expand Down Expand Up @@ -307,7 +317,7 @@ alerting:
description: "chain node '{{ $labels.namespace }}' has disappeared from Prometheus target discovery.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

storage:
enabled: false
enabled: true
local: true
entities:
sequencerSharedStorage:
Expand Down
145 changes: 138 additions & 7 deletions dev/values/validators/single.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,130 @@
global:
namespaceOverride: astria-dev-cluster

moniker: node0
images:
sequencer:
devTag: "1.0.0"
cometbft:
devTag: "v0.38.11"

moniker: jordan-test

genesis:
chainId: astria
genesisTime: "2024-10-25T21:20:00.000000Z"
# controlled by threshold signature
authoritySudoAddress: astria1f7d96l29kz22q2tcwrpg925dxt7z8jtsjgs9uh
nativeAssetBaseDenomination: false
allowedFeeAssets: []
ibc:
enabled: true
inboundEnabled: true
outboundEnabled: true
# controlled by threshold signature
sudoAddress: astria1v70qrgnua42f4x3kl40d60ae2zftftmqe4c7gy
# astria-mainnet-seq-ibc-relayer
relayerAddresses:
- astria1pz0txxwcenc98vx6alnprcef46kyrvrya8cs8p
genesisAccounts: []
fees:
feeChange:
base: "0"
multiplier: "0"
sudoAddressChange:
base: "0"
multiplier: "0"
feeAssetChange:
base: "0"
multiplier: "0"
validatorUpdate:
base: "0"
multiplier: "0"
ibcSudoChange:
base: "0"
multiplier: "0"
ibcRelayerChange:
base: "0"
multiplier: "0"
ibcRelay:
base: "0"
multiplier: "0"
initBridgeAccount:
base: "10000000"
multiplier: "0"
bridgeSudoChange:
base: "1000000"
multiplier: "0"
rollupDataSubmission: false
bridgeLock: false
transfer: false
bridgeUnlock: false
ics20Withdrawal: false
validators:
- name: core
power: '1'
address: 091E47761C58C474534F4D414AF104A6CAF90C22
pubKey: lV57+rGs2vac7mvkGHP1oBFGHPJM3a+WoAzeFDCJDNU=
# Astria astria0
- name: astria0
power: '100'
address: 63FD0CE49F485F167A8B94B9E80DBBD351FA9F98
pubKey: 8rPKInUBqFKv7Wie/O4G9P6wHWccMfifpeU/BlhFaHw=
# Astria astria1
- name: astria1
power: '100'
address: 4E72A7432B5C0FAEC21CF251535781723A8248A7
pubKey: IzGYindOUk15ZL6bh6j8+fjSRgjeoL93txgA9ETfFXI=
# Astria astria2
- name: astria2
power: '100'
address: 47BD55BC6E3CA4A8519C372744AEE40C9340B8B4
pubKey: S9VKKZgwdtiWWll3PT1yn+xgqZLci+MMtPmH2wuux+w=
# Astria node3
- name: astria3
power: '100'
address: 3A7E64DFA6E11958B5A0903EA4C3D5A8E662C503
pubKey: XntgAVoWJS7SE7hSw9OHyHBrP50+l8mZc/ctaQWIseQ=
# Nodes.Guru
- name: Nodes.Guru
power: '25'
address: 8F6D2388C4C068A0217F75E914C3FBA8E28079B7
pubKey: S4vhA0z7Gw5p3Yszwnlm+BdXELSOeRH4/jBL2r55zo8=
# Qubelabs
- name: Qubelabs
power: '25'
address: 3CB3760D29B485C711D27D5AC5CE6B4AF048263D
pubKey: KA/DKcILRpYVybz9ZHh784yZr9WvvCHRKzy+Av9KlUg=
# DSRV
- name: DSRV
power: '25'
address: 19685F5CFF69B64EF6C50E8BB4BA506DB1E1BB5C
pubKey: jqnJZ1Op4TPiNTHNVFyvXtdRuObhDhnl1cKyH/FO3kY=
# Nocturnal Labs
- name: Nocturnal Labs
power: '25'
address: 816B7C75D3C43D5F700D67975F020D938AF882F9
pubKey: IdsrfKarwcDa0ToNrDfRXPByuYdlwSDxvwJlJM0mc9A=
# P-OPS Team
- name: P-OPS Team
power: '25'
address: 4E8AD81B9361FBF6DBC853514F1B259A75B2D5C0
pubKey: hCbuIHcC8Ivufr1hR/cPUPetS0snT9fSzgMQgWKZx9c=
# Tessellated
- name: Tessellated
power: '25'
address: 666CBCE466D0DECDBBB3982AF747B74E0BD44030
pubKey: gyhVdvDyxSV2XH0jby1vnmQitPowjm/pn1CDVprre2c=
# P2P.ORG - P2P Validator
- name: P2P.ORG - P2P Validator
power: '25'
address: 4FBB2E3BF3B5DDD7FCD5C4A028336F680098A1FB
pubKey: GLN47O9Iea9yKR9m8FMpZ180KL52Ht1i3yO9xu760Ew=

cometbft:
config:
p2p:
# List of nodes to keep persistent connections to
persistentPeers:
- 472667f76caa59499d023836f34305fb1b879202@34.146.155.71:26656
- 7c63e5951433cd144dcd28ff822b696294e747ce@35.243.92.67:26656
- 845cd82094c83188af13f3a6a33cf825a2764ba2@34.84.168.120:26656
- 2c5f26275c1b2f09712792d19247f83095b2e21a@34.84.217.48:26656
secrets:
nodeKey:
filename: nodeKey.json
Expand All @@ -29,8 +144,24 @@ cometbft:
priv_key:
value: dGOTAweQV8Do9P2n+A8m5EnboDrlxgD3dg4vrYpdIRqVXnv6saza9pzua+QYc/WgEUYc8kzdr5agDN4UMIkM1Q==

resources:
cometbft:
requests:
cpu: 2000m
memory: 4Gi
limits:
cpu: 2000m
memory: 4Gi
sequencer:
requests:
cpu: 2000m
memory: 4Gi
limits:
cpu: 2000m
memory: 4Gi

sequencer-relayer:
enabled: true
enabled: false
config:
relayer:
sequencerChainId: sequencer-test-chain-0
Expand All @@ -45,7 +176,7 @@ sequencer-relayer:
enabled: false

storage:
enabled: false
enabled: true

ingress:
rpc:
Expand Down
Loading