Skip to content

Commit 5825bfa

Browse files
committed
chore: bump reth to 2.2.0 and migrate its db
1 parent a4e7179 commit 5825bfa

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

spartan/terraform/deploy-ethereum-nodes/main.tf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,40 @@ locals {
8686
}
8787
extraArgs = [
8888
"--chain=${var.chain}",
89+
"--storage.v2=true",
8990
]
9091

9192
persistence = {
9293
enabled = true
9394
size = var.reth_storage
9495
storageClassName = "premium-rwo"
9596
}
97+
98+
initContainers = [
99+
{
100+
name = "migrate-storage-v2"
101+
image = var.reth_image
102+
imagePullPolicy = "Always"
103+
command = [
104+
"sh",
105+
"-ac",
106+
<<-EOT
107+
if [ ! -f /data/db/db/metadata.json ]; then
108+
echo "No existing Reth database found, skipping storage v2 migration."
109+
exit 0
110+
fi
111+
112+
reth db --datadir=/data --chain=${var.chain} migrate-v2
113+
EOT
114+
]
115+
volumeMounts = [
116+
{
117+
name = "storage"
118+
mountPath = "/data"
119+
}
120+
]
121+
}
122+
]
96123
})
97124
]
98125
}

spartan/terraform/deploy-ethereum-nodes/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ variable "lighthouse_p2p_port" {
4848
variable "reth_image" {
4949
description = "Reth Docker image"
5050
type = string
51-
default = "ghcr.io/paradigmxyz/reth:v2.0.0"
51+
default = "ghcr.io/paradigmxyz/reth:v2.2.0"
5252
}
5353

5454
variable "reth_chart_version" {

0 commit comments

Comments
 (0)