Skip to content

Commit

Permalink
add necessary charts changes and smoke test, change stop height to be…
Browse files Browse the repository at this point in the history
… inclusive
  • Loading branch information
ethanoroshiba authored and SuperFluffy committed Feb 4, 2025
1 parent a45206c commit d12ed9a
Show file tree
Hide file tree
Showing 20 changed files with 612 additions and 161 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,37 @@ jobs:
run: |
TAG=sha-$(git rev-parse --short HEAD)
just run-smoke-test $TAG
smoke-test-evm-rollup-restart:
needs: [run_checker, composer, conductor, sequencer, sequencer-relayer, evm-bridge-withdrawer, cli]
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'astriaorg/astria') && (github.event_name == 'merge_group' || needs.run_checker.outputs.run_docker == 'true')
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Install kind
uses: helm/kind-action@v1
with:
install_only: true
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Smoke Test Environment
timeout-minutes: 10
run: |
TAG=sha-$(git rev-parse --short HEAD)
just deploy cluster
kubectl create secret generic regcred --from-file=.dockerconfigjson=$HOME/.docker/config.json --type=kubernetes.io/dockerconfigjson
echo -e "\n\nDeploying with astria images tagged $TAG"
just --set defaultValues "dev/values/rollup/evm-restart-test.yaml" deploy smoke-test $TAG
- name: Run Smoke test
timeout-minutes: 3
run: |
TAG=sha-$(git rev-parse --short HEAD)
just run-smoke-test $TAG
smoke-cli:
needs: [run_checker, composer, conductor, sequencer, sequencer-relayer, evm-bridge-withdrawer, cli]
Expand Down Expand Up @@ -300,3 +331,4 @@ jobs:
uses: ./.github/workflows/reusable-success.yml
with:
success: ${{ !contains(needs.*.result, 'failure') }}

5 changes: 3 additions & 2 deletions charts/deploy.just
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ clean-persisted-data:
deploy-local-metrics:
kubectl apply -f kubernetes/metrics-server-local.yml

defaultValues := "dev/values/rollup/dev.yaml"
defaultTag := ""
deploy-smoke-test tag=defaultTag:
deploy-smoke-test tag=defaultTag values=defaultValues:
@echo "Deploying ingress controller..." && just deploy ingress-controller > /dev/null
@just wait-for-ingress-controller > /dev/null
@echo "Deploying local celestia instance..." && just deploy celestia-local > /dev/null
Expand All @@ -184,7 +185,7 @@ deploy-smoke-test tag=defaultTag:
{{ if tag != '' { replace('--set images.sequencer.devTag=# --set sequencer-relayer.images.sequencerRelayer.devTag=#', '#', tag) } else { '' } }} \
--create-namespace > /dev/null
@just wait-for-sequencer > /dev/null
@echo "Starting EVM rollup..." && helm install -n astria-dev-cluster astria-chain-chart ./charts/evm-stack -f dev/values/rollup/dev.yaml \
@echo "Starting EVM rollup..." && helm install -n astria-dev-cluster astria-chain-chart ./charts/evm-stack -f {{ values }} \
{{ if tag != '' { replace('--set evm-rollup.images.conductor.devTag=# --set composer.images.composer.devTag=# --set evm-bridge-withdrawer.images.evmBridgeWithdrawer.devTag=#', '#', tag) } else { '' } }} \
--set blockscout-stack.enabled=false \
--set postgresql.enabled=false \
Expand Down
2 changes: 1 addition & 1 deletion charts/evm-rollup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version: 1.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
appVersion: "1.0.2"

maintainers:
- name: wafflesvonmaple
Expand Down
106 changes: 91 additions & 15 deletions charts/evm-rollup/files/genesis/geth-genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
{{- if .Values.genesis.cancunTime }}
"cancunTime": {{ toString .Values.genesis.cancunTime | replace "\"" "" }},
{{- end }}
{{- if .Values.genesis.cancunTime }}
{{- if .Values.genesis.pragueTime }}
"pragueTime": {{ toString .Values.genesis.pragueTime | replace "\"" "" }},
{{- end }}
{{- if .Values.genesis.cancunTime }}
{{- if .Values.genesis.verkleTime }}
"verkleTime": {{ toString .Values.genesis.verkleTime | replace "\"" "" }},
{{- end }}
"terminalTotalDifficulty": 0,
Expand All @@ -27,22 +27,98 @@
{{- range $key, $value := .Values.genesis.extra }}
"{{ $key }}": {{ toPrettyJson $value | indent 8 | trim }},
{{- end }}
{{- if .Values.genesis.extraDataOverride }}
"astriaExtraDataOverride": "{{ .Values.genesis.extraDataOverride }}",
{{- end }}
"astriaOverrideGenesisExtraData": {{ .Values.genesis.overrideGenesisExtraData }},
"astriaSequencerInitialHeight": {{ toString .Values.genesis.sequencerInitialHeight | replace "\"" "" }},
"astriaRollupName": "{{ tpl .Values.genesis.rollupName . }}",
"astriaCelestiaInitialHeight": {{ toString .Values.genesis.celestiaInitialHeight | replace "\"" "" }},
"astriaCelestiaHeightVariance": {{ toString .Values.genesis.celestiaHeightVariance | replace "\"" "" }},
"astriaBridgeAddresses": {{ toPrettyJson .Values.genesis.bridgeAddresses | indent 8 | trim }},
"astriaFeeCollectors": {{ toPrettyJson .Values.genesis.feeCollectors | indent 8 | trim }},
"astriaEIP1559Params": {{ toPrettyJson .Values.genesis.eip1559Params | indent 8 | trim }},
"astriaSequencerAddressPrefix": "{{ .Values.genesis.sequencerAddressPrefix }}"
{{- if not .Values.global.dev }}
{{- else }}
{{- end }}
"astriaForks": {
{{- $forks := .Values.genesis.forks }}
{{- $index := 0 }}
{{- $lastIndex := sub (len $forks) 1 }}
{{- range $key, $value := .Values.genesis.forks }}
"{{ $key }}": {
{{- $fields := list }}
{{- with $value }}

{{- if .height }}
{{- $fields = append $fields (printf "\"height\": %s" (toString .height | replace "\"" "")) }}
{{- end }}

{{- if .halt }}
{{- $fields = append $fields (printf "\"halt\": %s" (toString .halt | replace "\"" "")) }}
{{- end }}

{{- if .snapshotChecksum }}
{{- $fields = append $fields (printf "\"snapshotChecksum\": %s" (toString .snapshotChecksum)) }}
{{- end }}

{{- if .extraDataOverride }}
{{- $fields = append $fields (printf "\"extraDataOverride\": %s" (toString .extraDataOverride)) }}
{{- end }}

{{- if .feeCollector }}
{{- $fields = append $fields (printf "\"feeCollector\": \"%s\"" (toString .feeCollector)) }}
{{- end }}

{{- if .eip1559Params }}
{{- $fields = append $fields (printf "\"eip1559Params\": %s" (toPrettyJson .eip1559Params | indent 8 | trim)) }}
{{- end }}

{{- if .sequencer }}
{{- $sequencerFields := list }}

{{- if .sequencer.chainId }}
{{- $sequencerFields = append $sequencerFields (printf "\"chainId\": \"%s\"" (tpl .sequencer.chainId .)) }}
{{- end }}

{{- if .sequencer.addressPrefix }}
{{- $sequencerFields = append $sequencerFields (printf "\"addressPrefix\": \"%s\"" .sequencer.addressPrefix) }}
{{- end }}

{{- if .sequencer.startHeight }}
{{- $sequencerFields = append $sequencerFields (printf "\"startHeight\": %s" (toString .sequencer.startHeight | replace "\"" "")) }}
{{- end }}

{{- if .sequencer.stopHeight }}
{{- $sequencerFields = append $sequencerFields (printf "\"stopHeight\": %s" (toString .sequencer.stopHeight | replace "\"" "")) }}
{{- end }}

{{- $fields = append $fields (printf "\"sequencer\": {\n%s\n}" (join ",\n" $sequencerFields | indent 4)) }}
{{- end }}

{{- if .celestia }}
{{- $celestiaFields := list }}

{{- if .celestia.chainId }}
{{- $celestiaFields = append $celestiaFields (printf "\"chainId\": \"%s\"" (tpl .celestia.chainId .)) }}
{{- end }}

{{- if .celestia.startHeight }}
{{- $celestiaFields = append $celestiaFields (printf "\"startHeight\": %s" (toString .celestia.startHeight | replace "\"" "")) }}
{{- end }}

{{- if .celestia.heightVariance }}
{{- $celestiaFields = append $celestiaFields (printf "\"heightVariance\": %s" (toString .celestia.heightVariance | replace "\"" "")) }}
{{- end }}

{{- if $celestiaFields | len }}
{{- $fields = append $fields (printf "\"celestia\": {\n%s\n}" (join ",\n" $celestiaFields | indent 4)) }}
{{- end }}
{{- end }}

{{- if .bridgeAddresses }}
{{- $fields = append $fields (printf "\"bridgeAddresses\": %s" (toPrettyJson .bridgeAddresses | indent 4 | trim)) }}
{{- end }}

{{- join ",\n" $fields | indent 16 }}
}
{{- if ne $index $lastIndex }},{{ end }}
{{- $index := add $index 1 }}
{{- end }}
{{- end }}
}
},
{{- if not .Values.global.dev }}
{{- else }}
{{- end }}
"difficulty": "0",
"gasLimit": "{{ toString .Values.genesis.gasLimit | replace "\"" "" }}",
"alloc": {
Expand Down
4 changes: 1 addition & 3 deletions charts/evm-rollup/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ metadata:
data:
ASTRIA_CONDUCTOR_LOG: "astria_conductor={{ .Values.config.logLevel }}"
ASTRIA_CONDUCTOR_CELESTIA_NODE_HTTP_URL: "{{ .Values.config.celestia.rpc }}"
ASTRIA_CONDUCTOR_EXPECTED_CELESTIA_CHAIN_ID: "{{ tpl .Values.config.conductor.celestiaChainId . }}"
ASTRIA_CONDUCTOR_CELESTIA_BEARER_TOKEN: "{{ .Values.config.celestia.token }}"
ASTRIA_CONDUCTOR_CELESTIA_BLOCK_TIME_MS: "{{ .Values.config.conductor.celestiaBlockTimeMs }}"
ASTRIA_CONDUCTOR_EXECUTION_RPC_URL: "http://127.0.0.1:{{ .Values.ports.executionGRPC }}"
ASTRIA_CONDUCTOR_EXECUTION_COMMIT_LEVEL: "{{ .Values.config.conductor.executionCommitLevel }}"
ASTRIA_CONDUCTOR_SEQUENCER_GRPC_URL: "{{ tpl .Values.config.conductor.sequencerGrpc . }}"
ASTRIA_CONDUCTOR_SEQUENCER_COMETBFT_URL: "{{ tpl .Values.config.conductor.sequencerRpc . }}"
ASTRIA_CONDUCTOR_EXPECTED_SEQUENCER_CHAIN_ID: "{{ tpl .Values.config.conductor.sequencerChainId . }}"
ASTRIA_CONDUCTOR_SEQUENCER_BLOCK_TIME_MS: "{{ .Values.config.conductor.sequencerBlockTimeMs }}"
ASTRIA_CONDUCTOR_NO_METRICS: "{{ not .Values.metrics.enabled }}"
ASTRIA_CONDUCTOR_METRICS_HTTP_LISTENER_ADDR: "0.0.0.0:{{ .Values.ports.conductorMetrics }}"
Expand Down Expand Up @@ -85,4 +83,4 @@ data:
{{- end }}
---
{{- end }}
{{- end }}
{{- end }}
97 changes: 52 additions & 45 deletions charts/evm-rollup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,68 +11,79 @@ images:
repo: ghcr.io/astriaorg/astria-geth
pullPolicy: IfNotPresent
tag: 1.0.0
devTag: latest
devTag: pr-59
overrideTag: ""
conductor:
repo: ghcr.io/astriaorg/conductor
pullPolicy: IfNotPresent
tag: 1.0.0
tag: 1.0.1
devTag: latest
snapshot:
repo: rclone/rclone
pullPolicy: IfNotPresent
tag: 1.69.0

genesis:
## These values are used to configure the genesis block of the rollup chain
## no defaults as they are unique to each chain

# The name of the rollup chain, used to generate the Rollup ID
rollupName: ""
# Block height to start syncing rollup from, lowest possible is 2
sequencerInitialHeight: ""
# The first Celestia height to utilize when looking for rollup data
celestiaInitialHeight: ""
# The variance in Celestia height to allow before halting the chain
celestiaHeightVariance: ""
# Will fill the extra data in each block, can be left empty
# can also fill with something unique for your chain.
extraDataOverride: ""

# The "forks" for upgrading the chain. Contains necessary information for starting
# and, if desired, restarting the chain at a given height. The necessary fields
# for the genesis fork are provided, and additional forks can be added as needed.
forks:
launch:
# The block height to start the chain at, 0 for genesis
height: "0"
# Whether to halt the rollup chain at the given height. False for genesis
halt: "false"
# Checksum of the snapshot to use upon restart
snapshotChecksum: ""
# Will fill the extra data in each block, can be left empty
# can also fill with something unique for your chain.
extraDataOverride: ""
# Configure the fee collector for the evm tx fees, activated at block heights.
# If not configured, all tx fees will be burned.
feeCollector: ""
# 1: "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30"
# Configure EIP-1559 params, activated at block heights.
eip1559Params: {}
# 1:
# minBaseFee: 0
# elasticityMultiplier: 2
# baseFeeChangeDenominator: 8
sequencer:
# The chain id of the sequencer chain
chainId: ""
# The hrp for bech32m addresses, unlikely to be changed
addressPrefix: "astria"
# Block height to start syncing rollup from, lowest possible is 2
startHeight: ""
# Block height (on sequencer) to stop syncing rollup at, continuing to next configuration fork.
# A height of 0 indicates no stop height.
stopHeight: ""
celestia:
# The chain id of the celestia chain
chainId: ""
# The first Celestia height to utilize when looking for rollup data
startHeight: ""
# The variance in Celestia height to allow before halting the chain
heightVariance: ""
# Configure the sequencer bridge addresses and allowed assets if using
# the astria canonical bridge. Recommend removing alloc values if so.
bridgeAddresses: []
# - address: "684ae50c49a434199199c9c698115391152d7b3f"
# startHeight: 1
# assetDenom: "nria"
# senderAddress: "0x0000000000000000000000000000000000000000"
# assetPrecision: 9

## These are general configuration values with some recommended defaults

# Configure the gas Limit
gasLimit: "50000000"
# If set to true the genesis block will contain extra data
overrideGenesisExtraData: true
# The hrp for bech32m addresses, unlikely to be changed
sequencerAddressPrefix: "astria"

## These values are used to configure astria native bridging
## Many of the fields have commented out example fields

# Configure the sequencer bridge addresses and allowed assets if using
# the astria canonical bridge. Recommend removing alloc values if so.
bridgeAddresses: []
# - address: "684ae50c49a434199199c9c698115391152d7b3f"
# startHeight: 1
# assetDenom: "nria"
# senderAddress: "0x0000000000000000000000000000000000000000"
# assetPrecision: 9


## Fee configuration

# Configure the fee collector for the evm tx fees, activated at block heights.
# If not configured, all tx fees will be burned.
feeCollectors: {}
# 1: "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30"
# Configure EIP-1559 params, activated at block heights
eip1559Params: {}
# 1:
# minBaseFee: 0
# elasticityMultiplier: 2
# baseFeeChangeDenominator: 8

## Standard Eth Genesis config values
# An EVM chain number id, different from the astria rollup name
Expand Down Expand Up @@ -191,8 +202,6 @@ config:
# - "FirmOnly" -> blocks are only pulled from DA
# - "SoftAndFirm" -> blocks are pulled from both the sequencer and DA
executionCommitLevel: 'SoftAndFirm'
# The chain id of the Astria sequencer chain conductor communicates with
sequencerChainId: ""
# The expected fastest block time possible from sequencer, determines polling
# rate.
sequencerBlockTimeMs: 2000
Expand All @@ -204,8 +213,6 @@ config:
sequencerGrpc: ""
# The maximum number of requests to make to the sequencer per second
sequencerRequestsPerSecond: 500
# The chain id of the celestia network the conductor communicates with
celestiaChainId: ""

celestia:
# if config.rollup.executionLevel is NOT 'SoftOnly' AND celestia-node is not enabled
Expand Down
3 changes: 0 additions & 3 deletions charts/evm-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ global:
rollupName: ""
evmChainId: ""
sequencerChainId: ""
celestiaChainId: ""
otel:
endpoint: ""
tracesEndpoint: ""
Expand All @@ -29,8 +28,6 @@ evm-rollup:
chainId: "{{ .Values.global.evmChainId }}"
config:
conductor:
sequencerChainId: "{{ .Values.global.sequencerChainId }}"
celestiaChainId: "{{ .Values.global.celestiaChainId }}"
sequencerRpc: "{{ .Values.global.sequencerRpc }}"
sequencerGrpc: "{{ .Values.global.sequencerGrpc }}"
otel:
Expand Down
6 changes: 3 additions & 3 deletions crates/astria-conductor/src/celestia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,13 @@ impl RunningReader {
}
}

/// The stop height is reached if a) the next height to be forwarded would be equal
/// or greater than the stop height, and b) there is no block currently in flight.
/// The stop height is reached if a) the next height to be forwarded would be greater
/// than the stop height, and b) there is no block currently in flight.
fn has_reached_stop_height(&self) -> bool {
self.rollup_state
.sequencer_stop_block_height()
.map_or(false, |stop_height| {
self.block_cache.next_height_to_pop() >= stop_height.get()
self.block_cache.next_height_to_pop() > stop_height.get()
})
&& self.enqueued_block.is_terminated()
}
Expand Down
Loading

0 comments on commit d12ed9a

Please sign in to comment.