Skip to content

Commit

Permalink
terra: migrate to cosmwasm 1.1.0 (wormhole-foundation#3138)
Browse files Browse the repository at this point in the history
* terra/contracts: migrate to cosmwasm 1.1.0

use `classic-bindings` crate instead of terra-cosmwasm.
This is the updated version that calls the correct query post chain upgrade

* terra/Dockerfile: update workspace optimizer

* terra: label is now required on instantiate

* terra: accept either 32 or 20 byte addresses

* terra: update devnet terra classic

* node/cosmwasm: always CW >1

* tilt: re-introduce terra classic tests

* terra: make get_address support both 20 and 32 byte addresses

* terra: fix tests to account for burn tax

Since the tests are now ran against the new LocalTerra which has burn
tax, the transaction results are different from before

* terra/token-bridge: check first 12 bytes to determine native denoms

* terra/token-bridge: simplify conditional

---------

Co-authored-by: Evan Gray <[email protected]>
  • Loading branch information
2 people authored and djb15 committed Dec 14, 2023
1 parent 1258cad commit eccb454
Show file tree
Hide file tree
Showing 49 changed files with 3,134 additions and 1,291 deletions.
30 changes: 1 addition & 29 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def build_node_yaml():
"--terraLCD",
"http://terra-terrad:1317",
"--terraContract",
"terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5",
"terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au",
]

if terra2:
Expand Down Expand Up @@ -633,20 +633,6 @@ if terra_classic:
trigger_mode = trigger_mode,
)

k8s_resource(
"terra-postgres",
labels = ["terra"],
trigger_mode = trigger_mode,
)

k8s_resource(
"terra-fcd",
resource_deps = ["terra-terrad", "terra-postgres"],
port_forwards = [port_forward(3060, name = "Terra FCD [:3060]", host = webHost)],
labels = ["terra"],
trigger_mode = trigger_mode,
)

if terra2 or wormchain:
docker_build(
ref = "cosmwasm_artifacts",
Expand Down Expand Up @@ -680,20 +666,6 @@ if terra2:
trigger_mode = trigger_mode,
)

k8s_resource(
"terra2-postgres",
labels = ["terra2"],
trigger_mode = trigger_mode,
)

k8s_resource(
"terra2-fcd",
resource_deps = ["terra2-terrad", "terra2-postgres"],
port_forwards = [port_forward(3061, container_port = 3060, name = "Terra 2 FCD [:3061]", host = webHost)],
labels = ["terra2"],
trigger_mode = trigger_mode,
)

if algorand:
k8s_yaml_with_ns("devnet/algorand-devnet.yaml")

Expand Down
2 changes: 1 addition & 1 deletion devnet/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ spec:
# - --terraLCD
# - http://terra-terrad:1317
# - --terraContract
# - terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5
# - terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au
# - --terra2WS
# - ws://terra2-terrad:26657/websocket
# - --terra2LCD
Expand Down
146 changes: 0 additions & 146 deletions devnet/terra-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,6 @@ spec:
selector:
app: terra-terrad
---
apiVersion: v1
kind: Service
metadata:
labels:
app: terra-postgres
name: terra-postgres
spec:
ports:
- name: postgres
port: 5432
protocol: TCP
selector:
app: terra-postgres
---
apiVersion: v1
kind: Service
metadata:
labels:
app: terra-fcd
name: terra-fcd
spec:
ports:
- name: fcd
port: 3060
protocol: TCP
selector:
app: terra-fcd
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -88,121 +60,3 @@ spec:
periodSeconds: 5
restartPolicy: Always
serviceName: terra-terrad
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: terra-postgres
name: terra-postgres
spec:
replicas: 1
selector:
matchLabels:
app: terra-postgres
template:
metadata:
labels:
app: terra-postgres
spec:
containers:
- image: postgres:12
name: fcd-postgres
ports:
- containerPort: 5432
resources: {}
env:
- name: POSTGRES_USER
value: dev
- name: POSTGRES_PASSWORD
value: dev
- name: POSTGRES_DB
value: fcd
restartPolicy: Always
serviceName: terra-postgres
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: terra-fcd
name: terra-fcd
spec:
replicas: 1
selector:
matchLabels:
app: terra-fcd
template:
metadata:
labels:
app: terra-fcd
spec:
containers:
- image: terramoney/fcd:bombay
name: fcd-collector
command:
- sh
- -c
- "sed -i \"s/level: \\'info\\'/level: \\'warn\\'/g\" src/lib/logger.ts && ./entrypoint.sh collector"
resources: {}
env:
- name: CHAIN_ID
value: localterra
- name: LCD_URI
value: http://terra-terrad:1317
- name: BYPASS_URI
value: http://terra-terrad:1317
- name: RPC_URI
value: http://terra-terrad:26657
- name: TYPEORM_CONNECTION
value: postgres
- name: TYPEORM_HOST
value: terra-postgres
- name: TYPEORM_USERNAME
value: dev
- name: TYPEORM_PASSWORD
value: dev
- name: TYPEORM_DATABASE
value: fcd
- name: TYPEORM_SYNCHRONIZE
value: "true"
- name: TYPEORM_LOGGING
value: "false"
- name: TYPEORM_ENTITIES
value: "src/orm/*Entity.ts"
- image: terramoney/fcd:bombay
name: fcd-api
command:
- sh
- -c
- "sed -i \"s/level: \\'info\\'/level: \\'warn\\'/g\" src/lib/logger.ts && ./entrypoint.sh start"
resources: {}
ports:
- containerPort: 3060
env:
- name: CHAIN_ID
value: localterra
- name: LCD_URI
value: http://terra-terrad:1317
- name: BYPASS_URI
value: http://terra-terrad:1317
- name: RPC_URI
value: http://terra-terrad:26657
- name: TYPEORM_CONNECTION
value: postgres
- name: TYPEORM_HOST
value: terra-postgres
- name: TYPEORM_USERNAME
value: dev
- name: TYPEORM_PASSWORD
value: dev
- name: TYPEORM_DATABASE
value: fcd
- name: TYPEORM_SYNCHRONIZE
value: "false"
- name: TYPEORM_LOGGING
value: "false"
- name: TYPEORM_ENTITIES
value: "src/orm/*Entity.ts"
restartPolicy: Always
serviceName: terra-fcd
146 changes: 0 additions & 146 deletions devnet/terra2-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,6 @@ spec:
selector:
app: terra2-terrad
---
apiVersion: v1
kind: Service
metadata:
labels:
app: terra2-postgres
name: terra2-postgres
spec:
ports:
- name: postgres
port: 5432
protocol: TCP
selector:
app: terra2-postgres
---
apiVersion: v1
kind: Service
metadata:
labels:
app: terra2-fcd
name: terra2-fcd
spec:
ports:
- name: fcd
port: 3060
protocol: TCP
selector:
app: terra2-fcd
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -88,121 +60,3 @@ spec:
periodSeconds: 5
restartPolicy: Always
serviceName: terra2-terrad
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: terra2-postgres
name: terra2-postgres
spec:
replicas: 1
selector:
matchLabels:
app: terra2-postgres
template:
metadata:
labels:
app: terra2-postgres
spec:
containers:
- image: postgres:12
name: fcd-postgres
ports:
- containerPort: 5432
resources: {}
env:
- name: POSTGRES_USER
value: dev
- name: POSTGRES_PASSWORD
value: dev
- name: POSTGRES_DB
value: fcd
restartPolicy: Always
serviceName: terra2-fcd
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: terra2-fcd
name: terra2-fcd
spec:
replicas: 1
selector:
matchLabels:
app: terra2-fcd
template:
metadata:
labels:
app: terra2-fcd
spec:
containers:
- image: terramoney/fcd:2.0.5
name: fcd-collector
command:
- sh
- -c
- "sed -i \"s/level: \\'info\\'/level: \\'warn\\'/g\" src/lib/logger.ts && ./entrypoint.sh collector"
resources: {}
env:
- name: CHAIN_ID
value: localterra
- name: LCD_URI
value: http://terra2-terrad:1317
- name: BYPASS_URI
value: http://terra2-terrad:1317
- name: RPC_URI
value: http://terra2-terrad:26657
- name: TYPEORM_CONNECTION
value: postgres
- name: TYPEORM_HOST
value: terra2-postgres
- name: TYPEORM_USERNAME
value: dev
- name: TYPEORM_PASSWORD
value: dev
- name: TYPEORM_DATABASE
value: fcd
- name: TYPEORM_SYNCHRONIZE
value: "true"
- name: TYPEORM_LOGGING
value: "false"
- name: TYPEORM_ENTITIES
value: "src/orm/*Entity.ts"
- image: terramoney/fcd:2.0.5
name: fcd-api
command:
- sh
- -c
- "sed -i \"s/level: \\'info\\'/level: \\'warn\\'/g\" src/lib/logger.ts && ./entrypoint.sh start"
resources: {}
ports:
- containerPort: 3060
env:
- name: CHAIN_ID
value: localterra
- name: LCD_URI
value: http://terra2-terrad:1317
- name: BYPASS_URI
value: http://terra2-terrad:1317
- name: RPC_URI
value: http://terra2-terrad:26657
- name: TYPEORM_CONNECTION
value: postgres
- name: TYPEORM_HOST
value: terra2-postgres
- name: TYPEORM_USERNAME
value: dev
- name: TYPEORM_PASSWORD
value: dev
- name: TYPEORM_DATABASE
value: fcd
- name: TYPEORM_SYNCHRONIZE
value: "false"
- name: TYPEORM_LOGGING
value: "false"
- name: TYPEORM_ENTITIES
value: "src/orm/*Entity.ts"
restartPolicy: Always
serviceName: terra2-fcd
6 changes: 3 additions & 3 deletions docs/devnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
| NFT Bridge | SOL | NFTWqJR8YnRVqPDvTJrYuLrQDitTG5AScqbeghi4zSA | |
| Migration Contract | SOL | Ex9bCdVMSfx7EzB3pgSi2R4UHwJAXvTw18rBQm5YQ8gK | |
| Test Wallet | Terra | terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v | Mnemonic: `notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius` |
| Test CW20 | Terra | terra13nkgqrfymug724h8pprpexqj9h629sa3ncw7sh | Tokens minted to Test Wallet |
| Bridge Core | Terra | terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5 | |
| Token Bridge | Terra | terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4 | |
| Test CW20 | Terra | terra1zwv6feuzhy6a9wekh96cd57lsarmqlwxdypdsplw6zhfncqw6ftqynf7kp | Tokens minted to Test Wallet |
| Bridge Core | Terra | terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au | |
| Token Bridge | Terra | terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6 | |
| Test Wallet | Terra2 | terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v | Mnemonic: `notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius` |
| Test CW20 | Terra2 | terra1zwv6feuzhy6a9wekh96cd57lsarmqlwxdypdsplw6zhfncqw6ftqynf7kp | Tokens minted to Test Wallet |
| Bridge Core | Terra2 | terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au | |
Expand Down
Loading

0 comments on commit eccb454

Please sign in to comment.