Skip to content

Commit

Permalink
feat: support volatile exchange rate (#192)
Browse files Browse the repository at this point in the history
* feat: gas oracle support volatile exchange rate

* update contracts

* clean up
  • Loading branch information
yiweichi authored Oct 17, 2024
1 parent ec25b7f commit 7e764d2
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion charts/contracts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: contracts helm charts
name: contracts
version: 0.0.13
version: 0.0.14
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down
4 changes: 2 additions & 2 deletions charts/contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# contracts

![Version: 0.0.13](https://img.shields.io/badge/Version-0.0.13-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.14](https://img.shields.io/badge/Version-0.0.14-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

contracts helm charts

Expand All @@ -25,7 +25,7 @@ Kubernetes: `>=1.22.0-0`
| envFrom[0].configMapRef.name | string | `"contracts-deployment-env"` | |
| global.isStandalone | bool | `false` | |
| image.repository | string | `"scrolltech/scroll-stack-contracts"` | |
| image.tag | string | `"deploy-v0.0.25"` | |
| image.tag | string | `"deploy-aa80925c5c4cacd62a35380a5ec081a6865621eb"` | |
| scrollConfig | string | `"{}\n"` | |
| scrollConfigContracts | string | `"{}\n"` | |

Expand Down
2 changes: 1 addition & 1 deletion charts/contracts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ global:

image:
repository: scrolltech/scroll-stack-contracts
tag: deploy-v0.0.25
tag: deploy-aa80925c5c4cacd62a35380a5ec081a6865621eb

envFrom:
- configMapRef:
Expand Down
2 changes: 1 addition & 1 deletion charts/gas-oracle/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: gas-oracle helm charts
name: gas-oracle
version: 0.0.9
version: 0.0.10
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down
4 changes: 2 additions & 2 deletions charts/gas-oracle/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gas-oracle

![Version: 0.0.9](https://img.shields.io/badge/Version-0.0.9-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.10](https://img.shields.io/badge/Version-0.0.10-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

gas-oracle helm charts

Expand Down Expand Up @@ -39,7 +39,7 @@ Kubernetes: `>=1.22.0-0`
| global.nameOverride | string | `"gas-oracle"` | |
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"scrolltech/gas-oracle"` | |
| image.tag | string | `"v4.4.60"` | |
| image.tag | string | `"v4.4.66"` | |
| initContainers.1-check-postgres-connection.args[0] | string | `"postgresql"` | |
| initContainers.1-check-postgres-connection.args[1] | string | `"$(SCROLL_ROLLUP_DB_CONFIG_DSN)"` | |
| initContainers.1-check-postgres-connection.args[2] | string | `"--timeout"` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/gas-oracle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ global:
image:
repository: scrolltech/gas-oracle
pullPolicy: Always
tag: v4.4.60
tag: v4.4.66

command:
[
Expand Down
2 changes: 1 addition & 1 deletion charts/rollup-node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: rollup-node helm charts
name: rollup-node
version: 0.0.11
version: 0.0.12
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down
4 changes: 2 additions & 2 deletions charts/rollup-node/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# rollup-node

![Version: 0.0.11](https://img.shields.io/badge/Version-0.0.11-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.12](https://img.shields.io/badge/Version-0.0.12-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

rollup-node helm charts

Expand Down Expand Up @@ -38,7 +38,7 @@ Kubernetes: `>=1.22.0-0`
| global.nameOverride | string | `"rollup-node"` | |
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"scrolltech/rollup-relayer"` | |
| image.tag | string | `"v4.4.60"` | |
| image.tag | string | `"v4.4.66"` | |
| initContainers.1-check-postgres-connection.args[0] | string | `"postgresql"` | |
| initContainers.1-check-postgres-connection.args[1] | string | `"$(SCROLL_ROLLUP_DB_CONFIG_DSN)"` | |
| initContainers.1-check-postgres-connection.args[2] | string | `"--timeout"` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/rollup-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ controller:
image:
repository: scrolltech/rollup-relayer
pullPolicy: Always
tag: v4.4.60
tag: v4.4.66

env:
- name: METRICS_PORT
Expand Down
8 changes: 4 additions & 4 deletions charts/scroll-sdk/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: scroll helm charts to deploy scroll sdk
name: scroll-sdk
version: 0.0.48
version: 0.0.49
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down Expand Up @@ -42,7 +42,7 @@ dependencies:
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: chain-monitor.enabled
- name: contracts
version: 0.0.13
version: 0.0.14
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: contracts.enabled
- name: coordinator-api
Expand All @@ -58,7 +58,7 @@ dependencies:
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: frontends.enabled
- name: gas-oracle
version: 0.0.9
version: 0.0.10
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: gas-oracle.enabled
- name: l1-explorer
Expand Down Expand Up @@ -98,7 +98,7 @@ dependencies:
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: rollup-explorer-backend.enabled
- name: rollup-node
version: 0.0.11
version: 0.0.12
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: rollup-node.enabled
- name: rpc-gateway
Expand Down
8 changes: 4 additions & 4 deletions charts/scroll-sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# scroll-sdk

![Version: 0.0.48](https://img.shields.io/badge/Version-0.0.48-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.49](https://img.shields.io/badge/Version-0.0.49-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

scroll helm charts to deploy scroll sdk

Expand Down Expand Up @@ -30,18 +30,18 @@ Kubernetes: `>=1.22.0-0`
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | bridge-history-api | 0.0.7 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | bridge-history-fetcher | 0.0.11 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | chain-monitor | 0.0.9 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | contracts | 0.0.13 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | contracts | 0.0.14 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | coordinator-api | 0.0.9 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | coordinator-cron | 0.0.7 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | frontends | 0.0.9 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | gas-oracle | 0.0.9 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | gas-oracle | 0.0.10 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l1-devnet | 0.0.3 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l1-explorer | 0.0.2 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-bootnode | 0.0.14 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-rpc | 0.0.13 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-sequencer | 0.0.12 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rollup-explorer-backend | 0.0.4 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rollup-node | 0.0.11 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rollup-node | 0.0.12 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rpc-gateway | 0.0.2 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | scroll-common | 0.0.4 |
| oci://registry-1.docker.io/bitnamicharts | postgresql | 15.5.0 |
Expand Down
4 changes: 4 additions & 0 deletions charts/scroll-sdk/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ ROLLUP_EXPLORER_DB_CONNECTION_STRING = "postgres://postgres:qwerty12345@postgres
ALTERNATIVE_GAS_TOKEN_ENABLED = false
# EXAMPLE_GAS_TOKEN_DECIMAL = 6
# L1_GAS_TOKEN = "0x68a041e7c20Afa4784b5d9C63246c89545Ac0E66"
GAS_ORACLE_INCORPORATE_TOKEN_EXCHANGE_RATE_ENANBLED = false
EXCHANGE_RATE_UPDATE_MODE = "Fixed"
FIXED_EXCHANGE_RATE = "0.01"
TOKEN_SYMBOL_PAIR = "UNIETH"

[sequencer]

Expand Down
4 changes: 2 additions & 2 deletions devnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ L1_RPC_HOST := l1-devnet.scrollsdk

bootstrap:
echo "Pulling helm chart..."
helm pull oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-sdk --version 0.0.48
helm pull oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-sdk --version 0.0.49
echo "Extracting helm chart..."
tar -xvf *.tgz
$(MAKE) config

config:
echo "Creating configuration files..."
cd scroll-sdk && time docker run --rm -it -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-v0.0.26
cd scroll-sdk && time docker run --rm -it -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-aa80925c5c4cacd62a35380a5ec081a6865621eb
echo "Creating env files..."
./create-env-files.sh scroll-sdk
./prepare-config-files.sh
Expand Down
4 changes: 2 additions & 2 deletions devnet/create-env-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ get_service_configmap_variables() {
echo "COORDINATOR_DB_CONNECTION_STRING:SCROLL_COORDINATOR_DB_DSN"
;;
gas-oracle)
echo "L1_RPC_ENDPOINT:SCROLL_L1_RPC GAS_ORACLE_DB_CONNECTION_STRING:SCROLL_ROLLUP_DB_CONFIG_DSN L2_GAS_ORACLE_SENDER_PRIVATE_KEY:SCROLL_ROLLUP_L1_CONFIG_RELAYER_CONFIG_GAS_ORACLE_SENDER_PRIVATE_KEY L1_GAS_ORACLE_SENDER_PRIVATE_KEY:SCROLL_ROLLUP_L2_CONFIG_RELAYER_CONFIG_GAS_ORACLE_SENDER_PRIVATE_KEY"
echo "L1_RPC_ENDPOINT:SCROLL_L1_RPC GAS_ORACLE_DB_CONNECTION_STRING:SCROLL_ROLLUP_DB_CONFIG_DSN L2_GAS_ORACLE_SENDER_PRIVATE_KEY:SCROLL_ROLLUP_L1_CONFIG_RELAYER_CONFIG_GAS_ORACLE_SENDER_SIGNER_CONFIG_PRIVATE_KEY_SIGNER_CONFIG_PRIVATE_KEY L1_GAS_ORACLE_SENDER_PRIVATE_KEY:SCROLL_ROLLUP_L2_CONFIG_RELAYER_CONFIG_GAS_ORACLE_SENDER_SIGNER_CONFIG_PRIVATE_KEY_SIGNER_CONFIG_PRIVATE_KEY"
;;
l1-devnet)
echo "CHAIN_ID_L1:CHAIN_ID"
Expand All @@ -67,7 +67,7 @@ get_service_configmap_variables() {
echo "CHAIN_ID_L2:CHAIN_ID L1_RPC_ENDPOINT:L2GETH_L1_ENDPOINT L2GETH_SIGNER_ADDRESS:L2GETH_SIGNER_ADDRESS L1_CONTRACT_DEPLOYMENT_BLOCK:L2GETH_L1_CONTRACT_DEPLOYMENT_BLOCK L2GETH_KEYSTORE:L2GETH_KEYSTORE L2GETH_PASSWORD:L2GETH_PASSWORD L2GETH_NODEKEY:L2GETH_NODEKEY L2_GETH_STATIC_PEERS:L2GETH_PEER_LIST L2GETH_CCC_NUMWORKERS:L2GETH_CCC_NUMWORKERS"
;;
rollup-node)
echo "L1_RPC_ENDPOINT:L1_RPC_ENDPOINT L2_RPC_ENDPOINT:L2_RPC_ENDPOINT ROLLUP_NODE_DB_CONNECTION_STRING:SCROLL_ROLLUP_DB_CONFIG_DSN L1_SCROLL_CHAIN_PROXY_ADDR:L1_SCROLL_CHAIN_PROXY_ADDR L1_COMMIT_SENDER_PRIVATE_KEY:SCROLL_ROLLUP_L2_CONFIG_RELAYER_CONFIG_COMMIT_SENDER_PRIVATE_KEY L1_FINALIZE_SENDER_PRIVATE_KEY:SCROLL_ROLLUP_L2_CONFIG_RELAYER_CONFIG_FINALIZE_SENDER_PRIVATE_KEY"
echo "L1_RPC_ENDPOINT:L1_RPC_ENDPOINT L2_RPC_ENDPOINT:L2_RPC_ENDPOINT ROLLUP_NODE_DB_CONNECTION_STRING:SCROLL_ROLLUP_DB_CONFIG_DSN L1_SCROLL_CHAIN_PROXY_ADDR:L1_SCROLL_CHAIN_PROXY_ADDR L1_COMMIT_SENDER_PRIVATE_KEY:SCROLL_ROLLUP_L2_CONFIG_RELAYER_CONFIG_COMMIT_SENDER_SIGNER_CONFIG_PRIVATE_KEY_SIGNER_CONFIG_PRIVATE_KEY L1_FINALIZE_SENDER_PRIVATE_KEY:SCROLL_ROLLUP_L2_CONFIG_RELAYER_CONFIG_FINALIZE_SENDER_SIGNER_CONFIG_PRIVATE_KEY_SIGNER_CONFIG_PRIVATE_KEY"
;;
*)
echo "Service $service_name not found."
Expand Down
4 changes: 4 additions & 0 deletions examples/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ ROLLUP_EXPLORER_DB_CONNECTION_STRING = ""
ALTERNATIVE_GAS_TOKEN_ENABLED = false
# EXAMPLE_GAS_TOKEN_DECIMAL = 6
# L1_GAS_TOKEN = "0x68a041e7c20Afa4784b5d9C63246c89545Ac0E66"
GAS_ORACLE_INCORPORATE_TOKEN_EXCHANGE_RATE_ENANBLED = false
EXCHANGE_RATE_UPDATE_MODE = "Fixed"
FIXED_EXCHANGE_RATE = "0.01"
TOKEN_SYMBOL_PAIR = "UNIETH"

[sequencer]

Expand Down

0 comments on commit 7e764d2

Please sign in to comment.