From 9a01beb6ad0d2672473c880931ef1bdf98cb6d4d Mon Sep 17 00:00:00 2001 From: ido Date: Tue, 3 Dec 2024 14:51:12 +0200 Subject: [PATCH 01/26] generalized oracle template and connect sidecar --- .../files/cometbft/config/config.toml | 2 +- .../files/cometbft/config/genesis.json | 64 +++++++++++++++-- charts/sequencer/files/scripts/markets.json | 38 ++++++++++ charts/sequencer/templates/_helpers.tpl | 3 + charts/sequencer/templates/configmaps.yaml | 7 +- charts/sequencer/templates/statefulsets.yaml | 20 ++++++ charts/sequencer/values.yaml | 70 ++++++++++++++++--- 7 files changed, 187 insertions(+), 17 deletions(-) create mode 100644 charts/sequencer/files/scripts/markets.json diff --git a/charts/sequencer/files/cometbft/config/config.toml b/charts/sequencer/files/cometbft/config/config.toml index b6d8ae68e1..39722993b9 100644 --- a/charts/sequencer/files/cometbft/config/config.toml +++ b/charts/sequencer/files/cometbft/config/config.toml @@ -111,7 +111,7 @@ grpc_laddr = "" # 0 - unlimited. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} # 1024 - 40 - 10 - 50 = 924 = ~900 -grpc_max_open_connections = {{ .Values.cometbft.config.grpc.maxOpenConnections }} +grpc_max_open_connections = {{ .Values.cometbft.config.grpc.maxOpenConnections }} # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool unsafe = false diff --git a/charts/sequencer/files/cometbft/config/genesis.json b/charts/sequencer/files/cometbft/config/genesis.json index f76d4f3f2d..e1f3effcb5 100644 --- a/charts/sequencer/files/cometbft/config/genesis.json +++ b/charts/sequencer/files/cometbft/config/genesis.json @@ -108,7 +108,7 @@ {{- if $index }},{{- end }} { "address": {{ include "sequencer.address" $value.address }}, - "balance": {{ include "sequencer.toUint128Proto" ( toString $value.balance | replace "\"" "" ) }} + "balance": {{ include "sequencer.toUint128Proto" ( toString $value.balance | replace "\"" "" ) }} } {{- end }} ], @@ -125,20 +125,70 @@ "connect": { "marketMap": { "marketMap": { - "markets": {} + "markets": { + {{- range $index, $market := .Values.sequencer.oracle.markets }} + {{- if $index }},{{- end }} + "{{ $market.name }}": { + "providerConfigs": [ + {{- range $providerIndex, $provider := $market.providerConfigs }} + {{- if $providerIndex }},{{- end }} + { + "name": "{{ $provider.name }}", + "normalizeByPair": { + "Base": "{{ $provider.normalizeByPair.Base }}", + "Quote": "{{ $provider.normalizeByPair.Quote }}" + }, + "offChainTicker": "{{ $provider.offChainTicker }}" + } + {{- end }} + ], + "ticker": { + "currencyPair": { + "Base": "{{ $market.ticker.currencyPair.Base }}", + "Quote": "{{ $market.ticker.currencyPair.Quote }}" + }, + "decimals": "{{ $market.ticker.decimals }}", + "enabled": {{ $market.ticker.enabled }}, + "minProviderCount": "{{ $market.ticker.minProviderCount }}" + } + } + {{- end }} + } }, "params": { - "marketAuthorities": [], - "admin": "{{ .Values.genesis.marketAdminAddress }}" + "admin": "{{ .Values.genesis.oracle.marketAdminAddress }}", + "marketAuthorities": [ + {{- range $index, $authority := .Values.genesis.oracle.marketAuthorities }} + {{- if $index }},{{- end }} + "{{ $authority }}" + {{- end }} + ] } }, "oracle": { - "currencyPairGenesis": [], - "nextId": "0" + "currencyPairGenesis": [ + {{- range $index, $genesis := .Values.sequencer.oracle.currencyPairGenesis }} + {{- if $index }},{{- end }} + { + "currencyPair": { + "Base": "{{ $genesis.currencyPair.Base }}", + "Quote": "{{ $genesis.currencyPair.Quote }}" + }, + "currencyPairPrice": { + "blockTimestamp": "{{ $genesis.currencyPairPrice.blockTimestamp }}", + "price": "{{ $genesis.currencyPairPrice.price }}" + } + {{- if $genesis.id }}, + "id": "{{ $genesis.id }}" + {{- end }} + } + {{- end }} + ], + "nextId": "{{ .Values.sequencer.oracle.nextId }}" } } - {{- end}} }, + {{- end}} "chain_id": "{{ .Values.genesis.chainId }}", "consensus_params": { "block": { diff --git a/charts/sequencer/files/scripts/markets.json b/charts/sequencer/files/scripts/markets.json new file mode 100644 index 0000000000..34990e4f36 --- /dev/null +++ b/charts/sequencer/files/scripts/markets.json @@ -0,0 +1,38 @@ +{ + "markets": { + "BTC/USD": { + "ticker": { + "currency_pair": { + "Base": "BTC", + "Quote": "USD" + }, + "decimals": 5, + "min_provider_count": 1, + "enabled": true + }, + "provider_configs": [ + { + "name": "coingecko_api", + "off_chain_ticker": "bitcoin/usd" + } + ] + }, + "ETH/USD": { + "ticker": { + "currency_pair": { + "Base": "ETH", + "Quote": "USD" + }, + "decimals": 6, + "min_provider_count": 1, + "enabled": true + }, + "provider_configs": [ + { + "name": "coingecko_api", + "off_chain_ticker": "ethereum/usd" + } + ] + } + } +} diff --git a/charts/sequencer/templates/_helpers.tpl b/charts/sequencer/templates/_helpers.tpl index 2dc1da25ab..fc2e7dd23e 100644 --- a/charts/sequencer/templates/_helpers.tpl +++ b/charts/sequencer/templates/_helpers.tpl @@ -11,6 +11,9 @@ Namepsace to deploy elements into. {{- define "cometBFT.image" -}} {{ .Values.images.cometBFT.repo }}:{{ if .Values.global.dev }}{{ .Values.images.cometBFT.devTag }}{{ else }}{{ .Values.images.cometBFT.tag }}{{ end }} {{- end }} +{{- define "connect.image" -}} +{{ .Values.images.connect.repo }}:{{ if .Values.global.dev }}{{ .Values.images.connect.devTag }}{{ else }}{{ .Values.images.connect.tag }}{{ end }} +{{- end }} {{/* Return if ingress is stable. diff --git a/charts/sequencer/templates/configmaps.yaml b/charts/sequencer/templates/configmaps.yaml index f666257a1d..61d208e7a2 100644 --- a/charts/sequencer/templates/configmaps.yaml +++ b/charts/sequencer/templates/configmaps.yaml @@ -30,6 +30,11 @@ metadata: data: init-cometbft.sh: | {{- tpl (.Files.Get "files/scripts/init-cometbft.sh") $ | nindent 4 }} + {{- if not .Values.global.dev }} + {{- else }} + markets.json: | + {{- tpl (.Files.Get "files/scripts/markets.json") $ | nindent 4 }} + {{- end }} --- apiVersion: v1 kind: ConfigMap @@ -77,6 +82,6 @@ data: ASTRIA_SEQUENCER_ORACLE_CLIENT_TIMEOUT_MILLISECONDS: "{{ .Values.sequencer.oracle.clientTimeout }}" {{- if not .Values.global.dev }} {{- else }} - ASTRIA_SEQUENCER_NO_ORACLE: "true" + ASTRIA_SEQUENCER_NO_ORACLE: "{{ not .Values.sequencer.oracle.enabled }}" {{- end }} --- diff --git a/charts/sequencer/templates/statefulsets.yaml b/charts/sequencer/templates/statefulsets.yaml index 362a410f61..7880671f43 100644 --- a/charts/sequencer/templates/statefulsets.yaml +++ b/charts/sequencer/templates/statefulsets.yaml @@ -94,6 +94,26 @@ spec: limits: cpu: {{ .Values.resources.cometbft.limits.cpu }} memory: {{ .Values.resources.cometbft.limits.memory }} + {{- if not .Values.global.dev }} + {{- else }} + - name: connect + image: "{{ include "connect.image" . }}" + imagePullPolicy: {{ .Values.images.connect.pullPolicy }} + volumeMounts: + - mountPath: /scripts + name: cometbft-init-scripts-volume + command: [ "connect"] + args: + - "--market-config-path" + - "/scripts/markets.json" + - "--port" + - "8081" + - "--log-std-out-level" + - "debug" + ports: + - containerPort: {{ .Values.ports.oracleGrpc }} + name: oracle-grpc + {{- end }} volumes: - name: cometbft-config-volume configMap: diff --git a/charts/sequencer/values.yaml b/charts/sequencer/values.yaml index 8d01e06b7d..b856dd588f 100644 --- a/charts/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -24,17 +24,26 @@ images: repo: ghcr.io/astriaorg/sequencer pullPolicy: IfNotPresent tag: 1.0.0 - devTag: latest + devTag: sha-77d8a02 + connect: + repo: ghcr.io/skip-mev/connect-sidecar + pullPolicy: IfNotPresent + tag: v2 + devTag: v2 moniker: "" genesis: chainId: "" - genesisTime: "" # '2023-09-22T17:22:35.092832Z' + genesisTime: "" # '2023-09-22T17:22:35.092832Z' addressPrefixes: base: "astria" ibcCompat: "astriacompat" authoritySudoAddress: "" - marketAdminAddress: "" + oracle: + marketAdminAddress: "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm" + marketAuthorities: + - "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm" + - "astria1xnlvg0rle2u6auane79t4p27g8hxnj36ja960z" allowedFeeAssets: [] # - nria ibc: @@ -44,7 +53,7 @@ genesis: sudoAddress: "" relayerAddresses: [] # Note large balances must be strings support templating with the u128 size account balances - genesisAccounts: [] + genesisAccounts: [] # - address: 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 # balance: "333333333333333333" @@ -110,7 +119,52 @@ sequencer: parked: maxTxCount: 200 oracle: + enabled: true clientTimeout: 1000 + markets: + - name: "BTC/USD" + providerConfigs: + - name: "coingecko_api" + normalizeByPair: + Base: "USDT" + Quote: "USD" + offChainTicker: "bitcoin/usd" + ticker: + currencyPair: + Base: "BTC" + Quote: "USD" + decimals: "5" + enabled: true + minProviderCount: "1" + - name: "ETH/USD" + providerConfigs: + - name: "coingecko_api" + normalizeByPair: + Base: "USDT" + Quote: "USD" + offChainTicker: "ethereum/usd" + ticker: + currencyPair: + Base: "ETH" + Quote: "USD" + decimals: "6" + enabled: true + minProviderCount: "1" + currencyPairGenesis: + - currencyPair: + Base: "BTC" + Quote: "USD" + currencyPairPrice: + blockTimestamp: "2024-07-04T19:46:35+00:00" + price: "5834065777" + - currencyPair: + Base: "ETH" + Quote: "USD" + currencyPairPrice: + blockTimestamp: "2024-07-04T19:46:35+00:00" + price: "3138872234" + id: "1" + nextId: "2" metrics: enabled: false otel: @@ -206,23 +260,23 @@ cometbft: devContent: priv_key: type: tendermint/PrivKeyEd25519 - value: "" # can override with a value for local testing + value: "" # can override with a value for local testing secret: resourceName: "projects/$PROJECT_ID/secrets/privValidatorKey/versions/latest" privValidatorKey: filename: privValidatorKey.json devContent: # Ed25519 address of validator - address: "" # can override with a value for local testing + address: "" # can override with a value for local testing # public key for the validator address pub_key: type: tendermint/PubKeyEd25519 - value: "" # can override with a value for local testing + value: "" # can override with a value for local testing # private key for the validator address # This is a secret key, should use a secret manager for production deployments priv_key: type: tendermint/PrivKeyEd25519 - value: "" # can override with a value for local testing + value: "" # can override with a value for local testing secret: resourceName: "projects/$PROJECT_ID/secrets/privValidatorKey/versions/latest" From 379186bf26ba3e76c399ad1d7614a66a494657a9 Mon Sep 17 00:00:00 2001 From: ido Date: Wed, 4 Dec 2024 21:19:06 +0200 Subject: [PATCH 02/26] log vote extension price update --- .../src/app/vote_extension.rs | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/crates/astria-sequencer/src/app/vote_extension.rs b/crates/astria-sequencer/src/app/vote_extension.rs index 1e5d4b2a8f..d763a6be41 100644 --- a/crates/astria-sequencer/src/app/vote_extension.rs +++ b/crates/astria-sequencer/src/app/vote_extension.rs @@ -14,8 +14,8 @@ use astria_core::{ generated::connect::{ abci::v2::OracleVoteExtension as RawOracleVoteExtension, service::v2::{ - oracle_client::OracleClient, QueryPricesRequest, + oracle_client::OracleClient, }, }, protocol::connect::v1::{ @@ -24,17 +24,17 @@ use astria_core::{ }, }; use astria_eyre::eyre::{ - bail, - ensure, - eyre, OptionExt as _, Result, WrapErr as _, + bail, + ensure, + eyre, }; use futures::{ - stream::FuturesUnordered, StreamExt as _, TryStreamExt, + stream::FuturesUnordered, }; use indexmap::IndexMap; use itertools::Itertools as _; @@ -602,6 +602,10 @@ pub(super) async fn apply_prices_from_vote_extensions( }, block_height: height, }; + debug!( + "applied price from vote extension currency_pair=\"{}\" price={}", + currency_pair, price.price + ); state .put_price_for_currency_pair(price.currency_pair().clone(), quote_price) @@ -620,6 +624,7 @@ mod test { }; use astria_core::{ + Timestamp, connect::{ market_map::v2::{ Market, @@ -635,7 +640,6 @@ mod test { }, crypto::SigningKey, protocol::transaction::v1::action::ValidatorUpdate, - Timestamp, }; use cnidarium::{ Snapshot, @@ -863,19 +867,16 @@ mod test { state .put_currency_pair_state(pair.clone(), pair_state) .unwrap(); - market_map.markets.insert( - pair.to_string(), - Market { - ticker: Ticker { - currency_pair: pair, - decimals: 6, - min_provider_count: 0, - enabled: true, - metadata_json: String::new(), - }, - provider_configs: Vec::new(), + market_map.markets.insert(pair.to_string(), Market { + ticker: Ticker { + currency_pair: pair, + decimals: 6, + min_provider_count: 0, + enabled: true, + metadata_json: String::new(), }, - ); + provider_configs: Vec::new(), + }); } state.put_num_currency_pairs(3).unwrap(); state.put_market_map(market_map).unwrap(); From f6692a8ab9065350a0b7bde14c13a31b204ffef5 Mon Sep 17 00:00:00 2001 From: ido Date: Thu, 5 Dec 2024 00:43:23 +0200 Subject: [PATCH 03/26] working chart --- charts/sequencer/templates/statefulsets.yaml | 2 - charts/sequencer/values.yaml | 77 ++++++++------------ 2 files changed, 29 insertions(+), 50 deletions(-) diff --git a/charts/sequencer/templates/statefulsets.yaml b/charts/sequencer/templates/statefulsets.yaml index 7880671f43..fb86a7e342 100644 --- a/charts/sequencer/templates/statefulsets.yaml +++ b/charts/sequencer/templates/statefulsets.yaml @@ -108,8 +108,6 @@ spec: - "/scripts/markets.json" - "--port" - "8081" - - "--log-std-out-level" - - "debug" ports: - containerPort: {{ .Values.ports.oracleGrpc }} name: oracle-grpc diff --git a/charts/sequencer/values.yaml b/charts/sequencer/values.yaml index b856dd588f..fd2a768592 100644 --- a/charts/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -24,7 +24,7 @@ images: repo: ghcr.io/astriaorg/sequencer pullPolicy: IfNotPresent tag: 1.0.0 - devTag: sha-77d8a02 + devTag: local connect: repo: ghcr.io/skip-mev/connect-sidecar pullPolicy: IfNotPresent @@ -44,7 +44,8 @@ genesis: marketAuthorities: - "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm" - "astria1xnlvg0rle2u6auane79t4p27g8hxnj36ja960z" - allowedFeeAssets: [] + allowedFeeAssets: + [] # - nria ibc: enabled: true @@ -53,7 +54,8 @@ genesis: sudoAddress: "" relayerAddresses: [] # Note large balances must be strings support templating with the u128 size account balances - genesisAccounts: [] + genesisAccounts: + [] # - address: 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 # balance: "333333333333333333" @@ -108,7 +110,8 @@ genesis: base: "0" multiplier: "0" - validators: [] + validators: + [] # - name: core # power: '1' # address: 091E47761C58C474534F4D414AF104A6CAF90C22 @@ -121,35 +124,7 @@ sequencer: oracle: enabled: true clientTimeout: 1000 - markets: - - name: "BTC/USD" - providerConfigs: - - name: "coingecko_api" - normalizeByPair: - Base: "USDT" - Quote: "USD" - offChainTicker: "bitcoin/usd" - ticker: - currencyPair: - Base: "BTC" - Quote: "USD" - decimals: "5" - enabled: true - minProviderCount: "1" - - name: "ETH/USD" - providerConfigs: - - name: "coingecko_api" - normalizeByPair: - Base: "USDT" - Quote: "USD" - offChainTicker: "ethereum/usd" - ticker: - currencyPair: - Base: "ETH" - Quote: "USD" - decimals: "6" - enabled: true - minProviderCount: "1" + markets: [] currencyPairGenesis: - currencyPair: Base: "BTC" @@ -329,7 +304,7 @@ ports: cometbftMetrics: 26660 sequencerABCI: 26658 # note: the oracle sidecar also uses 8080 by default but can be changed with --port - sequencerGrpc: 8080 + sequencerGrpc: 9090 relayerRpc: 2450 sequencerMetrics: 9000 oracleGrpc: 8081 @@ -356,14 +331,14 @@ alerting: release: kube-prometheus-stack namespace: monitoring rules: - - alert: Chain_Node_Down - expr: up{container="cometbft"} == 0 # Insert your query Expression - for: 1m # Rough number but should be enough to init warn - labels: - severity: critical - annotations: - summary: Chain Node is Down (instance {{ $labels.instance }}) - description: "chain node '{{ $labels.namespace }}' has disappeared from Prometheus target discovery.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + - alert: Chain_Node_Down + expr: up{container="cometbft"} == 0 # Insert your query Expression + for: 1m # Rough number but should be enough to init warn + labels: + severity: critical + annotations: + summary: Chain Node is Down (instance {{ $labels.instance }}) + description: "chain node '{{ $labels.namespace }}' has disappeared from Prometheus target discovery.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" storage: enabled: false @@ -383,7 +358,8 @@ ingress: # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress # ingressClassName: nginx # Values can be templdated - annotations: {} + annotations: + {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" labels: {} @@ -392,11 +368,13 @@ ingress: pathType: Prefix hosts: {} # - chart-example.local - service: {} + service: + {} # name: sequencer-service # port: # name: cometbft-rpc - defaultBackend: {} + defaultBackend: + {} # service: # name: sequencer-service # port: @@ -427,7 +405,8 @@ ingress: # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress # ingressClassName: nginx # Values can be templdated - annotations: {} + annotations: + {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" labels: {} @@ -436,11 +415,13 @@ ingress: pathType: Prefix hosts: {} # - chart-example.local - service: {} + service: + {} # name: sequencer-service # port: # name: cometbft-rpc - defaultBackend: {} + defaultBackend: + {} # service: # name: sequencer-service # port: From 68a93e68aad2c8a64f1540847865b3624805c248 Mon Sep 17 00:00:00 2001 From: ido Date: Thu, 5 Dec 2024 19:06:59 +0200 Subject: [PATCH 04/26] cleanup --- .../files/cometbft/config/genesis.json | 8 +-- charts/sequencer/templates/configmaps.yaml | 4 +- charts/sequencer/templates/service.yaml | 5 ++ .../sequencer/templates/servicemonitor.yaml | 10 ++++ charts/sequencer/templates/statefulsets.yaml | 7 ++- charts/sequencer/values.yaml | 47 ++++++----------- dev/values/validators/all-without-native.yml | 50 +++++++++++++++++++ dev/values/validators/all.yml | 50 +++++++++++++++++++ 8 files changed, 135 insertions(+), 46 deletions(-) diff --git a/charts/sequencer/files/cometbft/config/genesis.json b/charts/sequencer/files/cometbft/config/genesis.json index e1f3effcb5..b1f0a3d859 100644 --- a/charts/sequencer/files/cometbft/config/genesis.json +++ b/charts/sequencer/files/cometbft/config/genesis.json @@ -208,15 +208,9 @@ "version": { "app": "0" }, - {{- if not .Values.global.dev }} - "abci": { - "vote_extensions_enable_height": "0" - } - {{- else }} "abci": { - "vote_extensions_enable_height": "1" + "vote_extensions_enable_height": "{{ .Values.genesis.consensusParams.voteExtensionsEnableHeight }}" } - {{- end}} }, "genesis_time": "{{ .Values.genesis.genesisTime }}", "initial_height": "0", diff --git a/charts/sequencer/templates/configmaps.yaml b/charts/sequencer/templates/configmaps.yaml index 61d208e7a2..e2b3a1f312 100644 --- a/charts/sequencer/templates/configmaps.yaml +++ b/charts/sequencer/templates/configmaps.yaml @@ -78,10 +78,10 @@ data: OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.sequencer.otel.otlpHeaders }}" OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.sequencer.otel.traceHeaders }}" OTEL_SERVICE_NAME: "{{ tpl .Values.sequencer.otel.serviceName . }}" - ASTRIA_SEQUENCER_ORACLE_GRPC_ADDR: "http://127.0.0.1:{{ .Values.ports.oracleGrpc }}" - ASTRIA_SEQUENCER_ORACLE_CLIENT_TIMEOUT_MILLISECONDS: "{{ .Values.sequencer.oracle.clientTimeout }}" {{- if not .Values.global.dev }} {{- else }} ASTRIA_SEQUENCER_NO_ORACLE: "{{ not .Values.sequencer.oracle.enabled }}" + ASTRIA_SEQUENCER_ORACLE_GRPC_ADDR: "http://127.0.0.1:{{ .Values.ports.oracleGrpc }}" + ASTRIA_SEQUENCER_ORACLE_CLIENT_TIMEOUT_MILLISECONDS: "{{ .Values.sequencer.oracle.clientTimeout }}" {{- end }} --- diff --git a/charts/sequencer/templates/service.yaml b/charts/sequencer/templates/service.yaml index 9ae814b253..33c3fe3514 100644 --- a/charts/sequencer/templates/service.yaml +++ b/charts/sequencer/templates/service.yaml @@ -66,5 +66,10 @@ spec: - name: seq-metric port: {{ .Values.ports.sequencerMetrics }} targetPort: seq-metric + {{- if .Values.sequencer.oracle.metrics.enabled }} + - name: oracle-metric + port: {{ .Values.ports.oracleMetrics }} + targetPort: oracle-metric + {{- end }} {{- end }} {{- end }} diff --git a/charts/sequencer/templates/servicemonitor.yaml b/charts/sequencer/templates/servicemonitor.yaml index 5eb681a645..886ca30ffc 100644 --- a/charts/sequencer/templates/servicemonitor.yaml +++ b/charts/sequencer/templates/servicemonitor.yaml @@ -34,6 +34,16 @@ spec: {{- with .Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} + {{- if .Values.sequencer.oracle.metrics.enabled }} + - port: oracle-metric + path: / + {{- with .Values.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + {{- end }} {{- end }} --- {{- end }} diff --git a/charts/sequencer/templates/statefulsets.yaml b/charts/sequencer/templates/statefulsets.yaml index fb86a7e342..56561154ca 100644 --- a/charts/sequencer/templates/statefulsets.yaml +++ b/charts/sequencer/templates/statefulsets.yaml @@ -94,8 +94,6 @@ spec: limits: cpu: {{ .Values.resources.cometbft.limits.cpu }} memory: {{ .Values.resources.cometbft.limits.memory }} - {{- if not .Values.global.dev }} - {{- else }} - name: connect image: "{{ include "connect.image" . }}" imagePullPolicy: {{ .Values.images.connect.pullPolicy }} @@ -107,11 +105,12 @@ spec: - "--market-config-path" - "/scripts/markets.json" - "--port" - - "8081" + - "{{ .Values.ports.oracleGrpc }}" ports: - containerPort: {{ .Values.ports.oracleGrpc }} name: oracle-grpc - {{- end }} + - containerPort: {{ .Values.ports.oracleMetrics }} + name: oracle-metric volumes: - name: cometbft-config-volume configMap: diff --git a/charts/sequencer/values.yaml b/charts/sequencer/values.yaml index fd2a768592..c921fefbf5 100644 --- a/charts/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -24,7 +24,7 @@ images: repo: ghcr.io/astriaorg/sequencer pullPolicy: IfNotPresent tag: 1.0.0 - devTag: local + devTag: sha-0efc808 connect: repo: ghcr.io/skip-mev/connect-sidecar pullPolicy: IfNotPresent @@ -44,8 +44,7 @@ genesis: marketAuthorities: - "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm" - "astria1xnlvg0rle2u6auane79t4p27g8hxnj36ja960z" - allowedFeeAssets: - [] + allowedFeeAssets: [] # - nria ibc: enabled: true @@ -54,8 +53,7 @@ genesis: sudoAddress: "" relayerAddresses: [] # Note large balances must be strings support templating with the u128 size account balances - genesisAccounts: - [] + genesisAccounts: [] # - address: 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 # balance: "333333333333333333" @@ -65,6 +63,7 @@ genesis: maxAgeDuration: "1209600000000000" maxAgeNumBlocks: "4000000" maxBytes: "1048576" + voteExtensionsEnableHeight: "1" fees: feeChange: @@ -125,21 +124,8 @@ sequencer: enabled: true clientTimeout: 1000 markets: [] - currencyPairGenesis: - - currencyPair: - Base: "BTC" - Quote: "USD" - currencyPairPrice: - blockTimestamp: "2024-07-04T19:46:35+00:00" - price: "5834065777" - - currencyPair: - Base: "ETH" - Quote: "USD" - currencyPairPrice: - blockTimestamp: "2024-07-04T19:46:35+00:00" - price: "3138872234" - id: "1" - nextId: "2" + currencyPairGenesis: [] + metrics: enabled: false otel: @@ -304,10 +290,11 @@ ports: cometbftMetrics: 26660 sequencerABCI: 26658 # note: the oracle sidecar also uses 8080 by default but can be changed with --port - sequencerGrpc: 9090 + sequencerGrpc: 8080 relayerRpc: 2450 sequencerMetrics: 9000 oracleGrpc: 8081 + oracleMetrics: 8002 # ServiceMonitor configuration serviceMonitor: @@ -358,8 +345,7 @@ ingress: # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress # ingressClassName: nginx # Values can be templdated - annotations: - {} + annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" labels: {} @@ -368,13 +354,11 @@ ingress: pathType: Prefix hosts: {} # - chart-example.local - service: - {} + service: {} # name: sequencer-service # port: # name: cometbft-rpc - defaultBackend: - {} + defaultBackend: {} # service: # name: sequencer-service # port: @@ -405,8 +389,7 @@ ingress: # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress # ingressClassName: nginx # Values can be templdated - annotations: - {} + annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" labels: {} @@ -415,13 +398,11 @@ ingress: pathType: Prefix hosts: {} # - chart-example.local - service: - {} + service: {} # name: sequencer-service # port: # name: cometbft-rpc - defaultBackend: - {} + defaultBackend: {} # service: # name: sequencer-service # port: diff --git a/dev/values/validators/all-without-native.yml b/dev/values/validators/all-without-native.yml index c1e1f7683d..66eeba1a55 100644 --- a/dev/values/validators/all-without-native.yml +++ b/dev/values/validators/all-without-native.yml @@ -20,6 +20,56 @@ genesis: # account balances genesisAccounts: [] +sequencer: + oracle: + enabled: true + metrics: + enabled: true + markets: + - name: "BTC/USD" + providerConfigs: + - name: "coingecko_api" + normalizeByPair: + Base: "USDT" + Quote: "USD" + offChainTicker: "bitcoin/usd" + ticker: + currencyPair: + Base: "BTC" + Quote: "USD" + decimals: "5" + enabled: true + minProviderCount: "1" + - name: "ETH/USD" + providerConfigs: + - name: "coingecko_api" + normalizeByPair: + Base: "USDT" + Quote: "USD" + offChainTicker: "ethereum/usd" + ticker: + currencyPair: + Base: "ETH" + Quote: "USD" + decimals: "6" + enabled: true + minProviderCount: "1" + currencyPairGenesis: + - currencyPair: + Base: "BTC" + Quote: "USD" + currencyPairPrice: + blockTimestamp: "2024-07-04T19:46:35+00:00" + price: "5834065777" + - currencyPair: + Base: "ETH" + Quote: "USD" + currencyPairPrice: + blockTimestamp: "2024-07-04T19:46:35+00:00" + price: "3138872234" + id: "1" + nextId: "2" + resources: cometbft: requests: diff --git a/dev/values/validators/all.yml b/dev/values/validators/all.yml index d62c054191..3cbc52b526 100644 --- a/dev/values/validators/all.yml +++ b/dev/values/validators/all.yml @@ -38,6 +38,56 @@ genesis: - address: astria1d7zjjljc0dsmxa545xkpwxym86g8uvvwhtezcr balance: "69000000" +sequencer: + oracle: + enabled: true + metrics: + enabled: true + markets: + - name: "BTC/USD" + providerConfigs: + - name: "coingecko_api" + normalizeByPair: + Base: "USDT" + Quote: "USD" + offChainTicker: "bitcoin/usd" + ticker: + currencyPair: + Base: "BTC" + Quote: "USD" + decimals: "5" + enabled: true + minProviderCount: "1" + - name: "ETH/USD" + providerConfigs: + - name: "coingecko_api" + normalizeByPair: + Base: "USDT" + Quote: "USD" + offChainTicker: "ethereum/usd" + ticker: + currencyPair: + Base: "ETH" + Quote: "USD" + decimals: "6" + enabled: true + minProviderCount: "1" + currencyPairGenesis: + - currencyPair: + Base: "BTC" + Quote: "USD" + currencyPairPrice: + blockTimestamp: "2024-07-04T19:46:35+00:00" + price: "5834065777" + - currencyPair: + Base: "ETH" + Quote: "USD" + currencyPairPrice: + blockTimestamp: "2024-07-04T19:46:35+00:00" + price: "3138872234" + id: "1" + nextId: "2" + resources: cometbft: requests: From fad027d0b9f741870ea9c162df7cb86a6e553262 Mon Sep 17 00:00:00 2001 From: ido Date: Thu, 5 Dec 2024 19:58:52 +0200 Subject: [PATCH 05/26] fmt --- .../src/app/vote_extension.rs | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/crates/astria-sequencer/src/app/vote_extension.rs b/crates/astria-sequencer/src/app/vote_extension.rs index d763a6be41..12ca11af30 100644 --- a/crates/astria-sequencer/src/app/vote_extension.rs +++ b/crates/astria-sequencer/src/app/vote_extension.rs @@ -14,8 +14,8 @@ use astria_core::{ generated::connect::{ abci::v2::OracleVoteExtension as RawOracleVoteExtension, service::v2::{ - QueryPricesRequest, oracle_client::OracleClient, + QueryPricesRequest, }, }, protocol::connect::v1::{ @@ -24,17 +24,17 @@ use astria_core::{ }, }; use astria_eyre::eyre::{ - OptionExt as _, - Result, - WrapErr as _, bail, ensure, eyre, + OptionExt as _, + Result, + WrapErr as _, }; use futures::{ + stream::FuturesUnordered, StreamExt as _, TryStreamExt, - stream::FuturesUnordered, }; use indexmap::IndexMap; use itertools::Itertools as _; @@ -604,7 +604,8 @@ pub(super) async fn apply_prices_from_vote_extensions( }; debug!( "applied price from vote extension currency_pair=\"{}\" price={}", - currency_pair, price.price + price.currency_pair(), + price.price() ); state @@ -624,7 +625,6 @@ mod test { }; use astria_core::{ - Timestamp, connect::{ market_map::v2::{ Market, @@ -640,6 +640,7 @@ mod test { }, crypto::SigningKey, protocol::transaction::v1::action::ValidatorUpdate, + Timestamp, }; use cnidarium::{ Snapshot, @@ -867,16 +868,19 @@ mod test { state .put_currency_pair_state(pair.clone(), pair_state) .unwrap(); - market_map.markets.insert(pair.to_string(), Market { - ticker: Ticker { - currency_pair: pair, - decimals: 6, - min_provider_count: 0, - enabled: true, - metadata_json: String::new(), + market_map.markets.insert( + pair.to_string(), + Market { + ticker: Ticker { + currency_pair: pair, + decimals: 6, + min_provider_count: 0, + enabled: true, + metadata_json: String::new(), + }, + provider_configs: Vec::new(), }, - provider_configs: Vec::new(), - }); + ); } state.put_num_currency_pairs(3).unwrap(); state.put_market_map(market_map).unwrap(); From 59f18adac02a49b84445ba402f4f3d4b5310ee4d Mon Sep 17 00:00:00 2001 From: ido Date: Thu, 5 Dec 2024 22:52:19 +0200 Subject: [PATCH 06/26] use sequencer grpc endpoint --- charts/sequencer/files/cometbft/config/genesis.json | 2 ++ charts/sequencer/templates/statefulsets.yaml | 4 ++-- charts/sequencer/values.yaml | 2 +- dev/values/validators/all.yml | 6 ------ 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/charts/sequencer/files/cometbft/config/genesis.json b/charts/sequencer/files/cometbft/config/genesis.json index b1f0a3d859..3c2484e90d 100644 --- a/charts/sequencer/files/cometbft/config/genesis.json +++ b/charts/sequencer/files/cometbft/config/genesis.json @@ -134,10 +134,12 @@ {{- if $providerIndex }},{{- end }} { "name": "{{ $provider.name }}", + {{- if $provider.normalizeByPair }} "normalizeByPair": { "Base": "{{ $provider.normalizeByPair.Base }}", "Quote": "{{ $provider.normalizeByPair.Quote }}" }, + {{- end }} "offChainTicker": "{{ $provider.offChainTicker }}" } {{- end }} diff --git a/charts/sequencer/templates/statefulsets.yaml b/charts/sequencer/templates/statefulsets.yaml index 56561154ca..5fe1539c3d 100644 --- a/charts/sequencer/templates/statefulsets.yaml +++ b/charts/sequencer/templates/statefulsets.yaml @@ -102,8 +102,8 @@ spec: name: cometbft-init-scripts-volume command: [ "connect"] args: - - "--market-config-path" - - "/scripts/markets.json" + - "--market-map-endpoint" + - "127.0.0.1:{{ .Values.ports.sequencerGrpc }}" - "--port" - "{{ .Values.ports.oracleGrpc }}" ports: diff --git a/charts/sequencer/values.yaml b/charts/sequencer/values.yaml index c921fefbf5..40d69134b3 100644 --- a/charts/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -24,7 +24,7 @@ images: repo: ghcr.io/astriaorg/sequencer pullPolicy: IfNotPresent tag: 1.0.0 - devTag: sha-0efc808 + devTag: sha-80be7eb connect: repo: ghcr.io/skip-mev/connect-sidecar pullPolicy: IfNotPresent diff --git a/dev/values/validators/all.yml b/dev/values/validators/all.yml index 3cbc52b526..b34216ce3f 100644 --- a/dev/values/validators/all.yml +++ b/dev/values/validators/all.yml @@ -47,9 +47,6 @@ sequencer: - name: "BTC/USD" providerConfigs: - name: "coingecko_api" - normalizeByPair: - Base: "USDT" - Quote: "USD" offChainTicker: "bitcoin/usd" ticker: currencyPair: @@ -61,9 +58,6 @@ sequencer: - name: "ETH/USD" providerConfigs: - name: "coingecko_api" - normalizeByPair: - Base: "USDT" - Quote: "USD" offChainTicker: "ethereum/usd" ticker: currencyPair: From bbdf4a54b9e51671b0528e804f193d5b57302664 Mon Sep 17 00:00:00 2001 From: noot <36753753+noot@users.noreply.github.com> Date: Tue, 10 Dec 2024 02:22:11 +0900 Subject: [PATCH 07/26] fix(sequencer): bump penumbra dep to commit with ibc height fix (#1856) ## Summary bump penumbra dep to commit with ibc height fix as it was merged upstream: https://github.com/penumbra-zone/penumbra/commit/ac7abacc9bb09503d6fd6a396bc0b6850079084e ## Background see #1691 ## Changes - bump penumbra dep to commit with ibc height fix ## Testing it has been tested on the current live networks already --- Cargo.lock | 57 +++++++++++++++--------------- Cargo.toml | 7 ++-- crates/astria-sequencer/Cargo.toml | 2 +- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index def7009d8b..dc5c5bd69c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1873,8 +1873,8 @@ dependencies = [ [[package]] name = "cnidarium" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "async-trait", @@ -1902,8 +1902,8 @@ dependencies = [ [[package]] name = "cnidarium-component" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "async-trait", @@ -2447,8 +2447,8 @@ dependencies = [ [[package]] name = "decaf377-fmd" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "ark-ff 0.4.2", "ark-serialize 0.4.2", @@ -2461,8 +2461,8 @@ dependencies = [ [[package]] name = "decaf377-ka" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "ark-ff 0.4.2", "decaf377", @@ -3248,8 +3248,9 @@ dependencies = [ [[package]] name = "f4jumble" -version = "0.0.0" -source = "git+https://github.com/zcash/librustzcash?rev=2425a0869098e3b0588ccd73c42716bcf418612c#2425a0869098e3b0588ccd73c42716bcf418612c" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a83e8d7fd0c526af4aad893b7c9fe41e2699ed8a776a6c74aecdeafe05afc75" dependencies = [ "blake2b_simd 1.0.2", ] @@ -5750,8 +5751,8 @@ dependencies = [ [[package]] name = "penumbra-asset" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "ark-ff 0.4.2", @@ -5789,8 +5790,8 @@ dependencies = [ [[package]] name = "penumbra-ibc" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "ark-ff 0.4.2", @@ -5826,8 +5827,8 @@ dependencies = [ [[package]] name = "penumbra-keys" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "aes", "anyhow", @@ -5870,8 +5871,8 @@ dependencies = [ [[package]] name = "penumbra-num" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "ark-ff 0.4.2", @@ -5906,8 +5907,8 @@ dependencies = [ [[package]] name = "penumbra-proto" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "async-trait", @@ -5935,8 +5936,8 @@ dependencies = [ [[package]] name = "penumbra-sct" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "ark-ff 0.4.2", @@ -5971,8 +5972,8 @@ dependencies = [ [[package]] name = "penumbra-tct" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "ark-ed-on-bls12-377", "ark-ff 0.4.2", @@ -6000,8 +6001,8 @@ dependencies = [ [[package]] name = "penumbra-tower-trace" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "futures", "hex", @@ -6022,8 +6023,8 @@ dependencies = [ [[package]] name = "penumbra-txhash" -version = "0.80.7" -source = "git+https://github.com/penumbra-zone/penumbra.git?tag=v0.80.7#35f9f2f64a652b6055a39ff227e504636436cb7e" +version = "0.80.9" +source = "git+https://github.com/penumbra-zone/penumbra.git?rev=ac7abacc9bb09503d6fd6a396bc0b6850079084e#ac7abacc9bb09503d6fd6a396bc0b6850079084e" dependencies = [ "anyhow", "blake2b_simd 1.0.2", diff --git a/Cargo.toml b/Cargo.toml index bded5e96a9..33ab556fb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,9 +81,10 @@ itoa = "1.0.10" jsonrpsee = { version = "0.20" } pbjson-types = "0.6" # Note that when updating the penumbra versions, vendored types in `proto/sequencerapis/astria_vendored` may need to be updated as well. -penumbra-ibc = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7", default-features = false } -penumbra-proto = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7" } -penumbra-tower-trace = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7" } +# can update to a tagged version when https://github.com/penumbra-zone/penumbra/commit/ac7abacc9bb09503d6fd6a396bc0b6850079084e is released +penumbra-ibc = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "ac7abacc9bb09503d6fd6a396bc0b6850079084e", default-features = false } +penumbra-proto = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "ac7abacc9bb09503d6fd6a396bc0b6850079084e" } +penumbra-tower-trace = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "ac7abacc9bb09503d6fd6a396bc0b6850079084e" } pin-project-lite = "0.2.13" prost = "0.12" rand = "0.8.5" diff --git a/crates/astria-sequencer/Cargo.toml b/crates/astria-sequencer/Cargo.toml index a2b8ee67b7..56014df011 100644 --- a/crates/astria-sequencer/Cargo.toml +++ b/crates/astria-sequencer/Cargo.toml @@ -33,7 +33,7 @@ telemetry = { package = "astria-telemetry", path = "../astria-telemetry", featur ] } borsh = { version = "1.5.1", features = ["bytes", "derive"] } -cnidarium = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7", features = [ +cnidarium = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "ac7abacc9bb09503d6fd6a396bc0b6850079084e", features = [ "metrics", ] } ibc-proto = { version = "0.41.0", features = ["server"] } From 6e91760cd67832db997c1534b5dc0394d7d0d113 Mon Sep 17 00:00:00 2001 From: Fraser Hutchison <190532+Fraser999@users.noreply.github.com> Date: Tue, 10 Dec 2024 10:48:31 +0000 Subject: [PATCH 08/26] chore: update `url` dependency (#1869) ## Summary Updated the version of `url`. ## Background Running `cargo audit` yields a warning of a vulnerability in `idna` (see [RUSTSEC-2024-0421](https://rustsec.org/advisories/RUSTSEC-2024-0421)). The suggested fix is to upgrade `idna` to >= v1.0.0. `idna` is only a dependency in our tree of `url`, and we cannot upgrade `idna` to >= v1.0.0 without upgrading `url`. However, upgrading `url` from v2.5.2 to v2.5.4 causes the `idna` dependency to upgrade to v1.0.3, hence fixing the issue. ## Changes - Ran `cargo update -p url` to increase the version of `idna` to v1.0.3. ## Testing Ran normal test suite. ## Changelogs Changelogs updated. --- Cargo.lock | 274 +++++++++++++++++-- crates/astria-bridge-contracts/CHANGELOG.md | 6 + crates/astria-bridge-withdrawer/CHANGELOG.md | 4 + crates/astria-cli/CHANGELOG.md | 13 +- crates/astria-composer/CHANGELOG.md | 4 + crates/astria-conductor/CHANGELOG.md | 4 + crates/astria-core/CHANGELOG.md | 30 +- crates/astria-sequencer-relayer/CHANGELOG.md | 4 + crates/astria-sequencer/CHANGELOG.md | 1 + 9 files changed, 297 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc5c5bd69c..130b3bff21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4400,6 +4400,124 @@ dependencies = [ "sha3", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -4408,12 +4526,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -5009,6 +5138,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "litrs" version = "0.4.1" @@ -7631,6 +7766,17 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -7931,6 +8077,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -8532,27 +8688,12 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.13" @@ -8613,9 +8754,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -8635,6 +8776,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -9151,6 +9304,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -9185,6 +9350,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -9206,6 +9395,27 @@ dependencies = [ "syn 2.0.75", ] +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -9226,6 +9436,28 @@ dependencies = [ "syn 2.0.75", ] +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2 1.0.86", + "quote", + "syn 2.0.75", +] + [[package]] name = "zstd-sys" version = "2.0.13+zstd.1.5.6" diff --git a/crates/astria-bridge-contracts/CHANGELOG.md b/crates/astria-bridge-contracts/CHANGELOG.md index 5e821bef75..d064918d0c 100644 --- a/crates/astria-bridge-contracts/CHANGELOG.md +++ b/crates/astria-bridge-contracts/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + +### Fixed + - Read the provided contract's `decimals` function, falling back to a hardcoded value of 18 if the call fails. [#1762](https://github.com/astriaorg/astria/pull/1762) diff --git a/crates/astria-bridge-withdrawer/CHANGELOG.md b/crates/astria-bridge-withdrawer/CHANGELOG.md index e298881919..59090f4cd0 100644 --- a/crates/astria-bridge-withdrawer/CHANGELOG.md +++ b/crates/astria-bridge-withdrawer/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + ## [1.0.1] - 2024-11-01 ### Fixed diff --git a/crates/astria-cli/CHANGELOG.md b/crates/astria-cli/CHANGELOG.md index 8bb8637b8f..7cadb8c69a 100644 --- a/crates/astria-cli/CHANGELOG.md +++ b/crates/astria-cli/CHANGELOG.md @@ -13,16 +13,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `fee-assets` subcommand to `sequencer` CLI [#1816](https://github.com/astriaorg/astria/pull/1816). -### Fixed - -- Fixed ICS20 withdrawal source when using channel with more than one - port/channel combo. [#1768](https://github.com/astriaorg/astria/pull/1768) - ### Changed -- Removed default values from `--sequencer.chain-id` and `--sequencer-url` arguments +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). +- Remove default values from `--sequencer.chain-id` and `--sequencer-url` arguments [#1792](https://github.com/astriaorg/astria/pull/1792) +### Fixed + +- Fix ICS20 withdrawal source when using channel with more than one + port/channel combo. [#1768](https://github.com/astriaorg/astria/pull/1768) + ## [0.5.1] - 2024-10-23 ### Added diff --git a/crates/astria-composer/CHANGELOG.md b/crates/astria-composer/CHANGELOG.md index e430c3d066..52a945378c 100644 --- a/crates/astria-composer/CHANGELOG.md +++ b/crates/astria-composer/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + ## [1.0.0] - 2024-10-25 ### Changed diff --git a/crates/astria-conductor/CHANGELOG.md b/crates/astria-conductor/CHANGELOG.md index eb75e304d5..b9de90e6d4 100644 --- a/crates/astria-conductor/CHANGELOG.md +++ b/crates/astria-conductor/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + ## [1.0.0] - 2024-10-25 ### Changed diff --git a/crates/astria-core/CHANGELOG.md b/crates/astria-core/CHANGELOG.md index 0477f1767c..b24c5b2855 100644 --- a/crates/astria-core/CHANGELOG.md +++ b/crates/astria-core/CHANGELOG.md @@ -12,28 +12,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release. -- Added method `TracePrefixed::leading_channel` to read the left-most channel of - a trace prefixed ICS20 asset [#1768](https://github.com/astriaorg/astria/pull/1768) -- Added `impl Protobuf for Address` [#1802](https://github.com/astriaorg/astria/pull/1802) +- Add method `TracePrefixed::leading_channel` to read the left-most channel of + a trace prefixed ICS20 asset [#1768](https://github.com/astriaorg/astria/pull/1768). +- Add `impl Protobuf for Address` [#1802](https://github.com/astriaorg/astria/pull/1802). ### Changed -- Moved `astria_core::crypto` to `astria-core-crypto` and reexported +- Move `astria_core::crypto` to `astria-core-crypto` and reexport `astria_core_crypto as crypto` (this change is transparent) - [#1800](https://github.com/astriaorg/astria/pull/1800/) -- Moved definitions of address domain type to `astria-core-address` and - reexported items using the same aliases [#1802](https://github.com/astriaorg/astria/pull/1802) - -### Changed - + [#1800](https://github.com/astriaorg/astria/pull/1800/). +- Move definitions of address domain type to `astria-core-address` and + reexport items using the same aliases [#1802](https://github.com/astriaorg/astria/pull/1802). - Move all Astria APIs generated from the Protobuf spec from `astria_core::generated` to `astria_core::generated::astria` - [#1825](https://github.com/astriaorg/astria/pull/1825) + [#1825](https://github.com/astriaorg/astria/pull/1825). +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). ### Removed -- Removed method `TracePrefixed::last_channel` [#1768](https://github.com/astriaorg/astria/pull/1768) -- Removed method `SigningKey::try_address` [#1800](https://github.com/astriaorg/astria/pull/1800/) -- Removed inherent methods `Address::try_from_raw` and `Address::to_raw` - [#1802](https://github.com/astriaorg/astria/pull/1802) -- Removed `AddressBuilder::with_iter` from public interface [#1802](https://github.com/astriaorg/astria/pull/1802) +- Remove method `TracePrefixed::last_channel` [#1768](https://github.com/astriaorg/astria/pull/1768). +- Remove method `SigningKey::try_address` [#1800](https://github.com/astriaorg/astria/pull/1800/). +- Remove inherent methods `Address::try_from_raw` and `Address::to_raw` + [#1802](https://github.com/astriaorg/astria/pull/1802). +- Remove `AddressBuilder::with_iter` from public interface [#1802](https://github.com/astriaorg/astria/pull/1802). diff --git a/crates/astria-sequencer-relayer/CHANGELOG.md b/crates/astria-sequencer-relayer/CHANGELOG.md index 63d39156ac..b2afb363c8 100644 --- a/crates/astria-sequencer-relayer/CHANGELOG.md +++ b/crates/astria-sequencer-relayer/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). + ## [1.0.0] - 2024-10-25 ### Changed diff --git a/crates/astria-sequencer/CHANGELOG.md b/crates/astria-sequencer/CHANGELOG.md index 3fffea9a55..c80e93586f 100644 --- a/crates/astria-sequencer/CHANGELOG.md +++ b/crates/astria-sequencer/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Index all event attributes [#1786](https://github.com/astriaorg/astria/pull/1786). - Consolidate action handling to single module [#1759](https://github.com/astriaorg/astria/pull/1759). - Ensure all deposit assets are trace prefixed [#1807](https://github.com/astriaorg/astria/pull/1807). +- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). ## [1.0.0] - 2024-10-25 From 86e00798e002c4571998d4ff2e987c866926f7a1 Mon Sep 17 00:00:00 2001 From: Jordan Oroshiba Date: Tue, 10 Dec 2024 11:48:24 -0800 Subject: [PATCH 09/26] chore(ci): action to autoclose stale issues and prs (#1862) ## Summary Adds a regularly scheduled action to mark PRs and issues as stale, and then autoclose with a message if no action taken. ## Background Sometimes issues & pull requests stay around without action or cleanup. By tagging stale items and checking them we can make sure the list of PRs and issues we have is actually actionable. Closing does not impact ability to find and use in future, but makes sure that pertinent issues are easy to find. --- .github/workflows/scheduled.yml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 45549618ed..dc5d58b067 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -1,5 +1,6 @@ name: Scheduled on: + workflow_dispatch: schedule: - cron: '0 0 * * *' @@ -14,3 +15,38 @@ jobs: - uses: rustsec/audit-check@v2.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v9 + with: + # Utilize a separate token for the stale worker to avoid rate limiting + repo-token: ${{ secrets.STALE_WORKER_TOKEN }} + # This is half the number of operations allowed per hour for the + # GitHub API. + operations-per-run: 2500 + days-before-stale: 45 + days-before-close: 7 + # start with the oldest issues first, as they are most likely to be stale. + ascending: true + stale-issue-label: 'stale' + stale-pr-label: 'stale' + # Allow tagging issues in such a way that they are exempt from the stale check + exempt-issue-labels: 'ignore-stale' + exempt-pr-labels: 'ignore-stale' + # Labels to easily find issues closed because they are stale. + close-issue-label: 'closed-stale' + close-pr-label: 'closed-stale' + stale-issue-message: | + This issue is stale because it has been open 45 days with no activity. Remove stale label or this issue + be closed in 7 days. + close-issue-message: 'This issue was closed because it was stale' + stale-pr-message: | + This PR is stale because it has been open 45 days with no activity. Remove stale label or this PR will be + closed in 7 days. + close-pr-message: 'This PR was closed because it has been stale.' + # Exempt anything added to a milestone from being considered stale + exempt-all-milestones: true From 311d3585df7e85ab21973d5320484ead054b8a33 Mon Sep 17 00:00:00 2001 From: Scott Hurd Date: Wed, 11 Dec 2024 13:14:31 -0800 Subject: [PATCH 10/26] Enable SVC annotations on faucet and graph-node (#1872) ## Summary Add ability to annotate services for internal or external use differentiation ## Changes - Changes to helper.tpl and service templates to enable annotation --------- Co-authored-by: WafflesVonMaple --- charts/evm-faucet/Chart.yaml | 2 +- charts/evm-faucet/templates/_helper.tpl | 12 +++++++++++ charts/evm-faucet/templates/service.yaml | 4 ++++ charts/evm-faucet/values.yaml | 3 +++ charts/evm-stack/Chart.lock | 6 +++--- charts/evm-stack/Chart.yaml | 4 ++-- charts/graph-node/Chart.yaml | 2 +- charts/graph-node/templates/_helpers.tpl | 21 +++++++++++++++++++ charts/graph-node/templates/services.yaml | 8 +++++++ charts/graph-node/values.yaml | 4 ++++ charts/sequencer-faucet/Chart.yaml | 4 ++-- .../sequencer-faucet/templates/_helpers.tpl | 14 ++++++++++++- .../sequencer-faucet/templates/service.yaml | 4 ++++ charts/sequencer-faucet/values.yaml | 3 +++ 14 files changed, 81 insertions(+), 10 deletions(-) diff --git a/charts/evm-faucet/Chart.yaml b/charts/evm-faucet/Chart.yaml index 88ca092515..dff2ef7506 100644 --- a/charts/evm-faucet/Chart.yaml +++ b/charts/evm-faucet/Chart.yaml @@ -16,7 +16,7 @@ type: application # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.2 +version: 0.1.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/evm-faucet/templates/_helper.tpl b/charts/evm-faucet/templates/_helper.tpl index 6ac61d91da..639b02d707 100644 --- a/charts/evm-faucet/templates/_helper.tpl +++ b/charts/evm-faucet/templates/_helper.tpl @@ -38,3 +38,15 @@ Return the appropriate apiVersion for ingress. {{- print "extensions/v1beta1" }} {{- end }} {{- end }} + +{{/* +Service annotations +*/}} +{{- define "evmFaucet.serviceAnnotations" }} +{{- if .Values.additionalAnnotations }} +{{ toYaml .Values.additionalAnnotations }} +{{- end }} +{{- if .Values.service.annotations }} +{{ toYaml .Values.service.annotations }} +{{- end }} +{{- end }} diff --git a/charts/evm-faucet/templates/service.yaml b/charts/evm-faucet/templates/service.yaml index c994fd66de..bdc1a0c6c4 100644 --- a/charts/evm-faucet/templates/service.yaml +++ b/charts/evm-faucet/templates/service.yaml @@ -3,6 +3,10 @@ apiVersion: v1 metadata: name: {{tpl .Values.config.rollupName . }}-evm-faucet-service namespace: {{ include "evmFaucet.namespace" . }} + {{- if or .Values.additionalAnnotations .Values.service.annotations }} + annotations: + {{- include "evmFaucet.serviceAnnotations" . | indent 4 }} + {{- end }} spec: selector: app: {{tpl .Values.config.rollupName . }}-evm-faucet diff --git a/charts/evm-faucet/values.yaml b/charts/evm-faucet/values.yaml index 6ec6c892c2..b79100f424 100644 --- a/charts/evm-faucet/values.yaml +++ b/charts/evm-faucet/values.yaml @@ -58,3 +58,6 @@ secretProvider: ports: faucet: 8080 + +service: + annotations: {} diff --git a/charts/evm-stack/Chart.lock b/charts/evm-stack/Chart.lock index 142c15567e..a1fab2d482 100644 --- a/charts/evm-stack/Chart.lock +++ b/charts/evm-stack/Chart.lock @@ -10,7 +10,7 @@ dependencies: version: 1.0.0 - name: evm-faucet repository: file://../evm-faucet - version: 0.1.2 + version: 0.1.3 - name: evm-bridge-withdrawer repository: file://../evm-bridge-withdrawer version: 1.0.1 @@ -20,5 +20,5 @@ dependencies: - name: blockscout-stack repository: https://blockscout.github.io/helm-charts version: 1.6.8 -digest: sha256:618d0978ce1fa169bffa360010e8afeb06f21ffb7574e8a298d1d561bbcee05b -generated: "2024-11-11T13:27:42.868678+02:00" +digest: sha256:037f984f43d4eb0616c27f8a36a359680d4d745f4687a4ca54f7d77fb5119d99 +generated: "2024-12-11T11:48:47.334728-08:00" diff --git a/charts/evm-stack/Chart.yaml b/charts/evm-stack/Chart.yaml index 990a8c4c53..e0df534b99 100644 --- a/charts/evm-stack/Chart.yaml +++ b/charts/evm-stack/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.3 +version: 1.0.4 dependencies: - name: celestia-node @@ -30,7 +30,7 @@ dependencies: repository: "file://../composer" condition: composer.enabled - name: evm-faucet - version: 0.1.2 + version: 0.1.3 repository: "file://../evm-faucet" condition: evm-faucet.enabled - name: evm-bridge-withdrawer diff --git a/charts/graph-node/Chart.yaml b/charts/graph-node/Chart.yaml index 5a866a2b8b..0a58aad89c 100644 --- a/charts/graph-node/Chart.yaml +++ b/charts/graph-node/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: graph-node description: A Helm chart for Graph Node deployment -version: 0.2.0 +version: 0.2.1 appVersion: "0.0.1" maintainers: diff --git a/charts/graph-node/templates/_helpers.tpl b/charts/graph-node/templates/_helpers.tpl index c6aba56008..d0830293a7 100644 --- a/charts/graph-node/templates/_helpers.tpl +++ b/charts/graph-node/templates/_helpers.tpl @@ -12,3 +12,24 @@ Namepsace to deploy elements into. {{- define "graphnode.namespace" -}} {{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}} {{- end }} + +{{/* +Service annotations +*/}} +{{- define "graphNode.serviceAnnotations" }} +{{- if .Values.graphNode.additionalAnnotations }} +{{ toYaml .Values.graphNode.additionalAnnotations }} +{{- end }} +{{- if .Values.graphNode.service.annotations }} +{{ toYaml .Values.graphNode.service.annotations }} +{{- end }} +{{- end }} + +{{- define "ipfs.serviceAnnotations" }} +{{- if .Values.ipfs.additionalAnnotations }} +{{ toYaml .Values.ipfs.additionalAnnotations }} +{{- end }} +{{- if .Values.ipfs.service.annotations }} +{{ toYaml .Values.ipfs.service.annotations }} +{{- end }} +{{- end }} diff --git a/charts/graph-node/templates/services.yaml b/charts/graph-node/templates/services.yaml index 54613bd4ae..46dec74ce7 100644 --- a/charts/graph-node/templates/services.yaml +++ b/charts/graph-node/templates/services.yaml @@ -3,6 +3,10 @@ kind: Service metadata: name: graph-node namespace: {{ include "graphnode.namespace" . }} + {{- if or .Values.graphNode.additionalAnnotations .Values.graphNode.service.annotations }} + annotations: + {{- include "graphNode.serviceAnnotations" . | indent 4 }} + {{- end }} spec: selector: app: graph-node @@ -28,6 +32,10 @@ kind: Service metadata: name: ipfs namespace: {{ include "graphnode.namespace" . }} + {{- if or .Values.ipfs.additionalAnnotations .Values.ipfs.service.annotations }} + annotations: + {{- include "ipfs.serviceAnnotations" . | indent 4 }} + {{- end }} spec: selector: app: ipfs diff --git a/charts/graph-node/values.yaml b/charts/graph-node/values.yaml index 1fcb3146ea..d9572bcfdc 100644 --- a/charts/graph-node/values.yaml +++ b/charts/graph-node/values.yaml @@ -14,6 +14,8 @@ graphNode: replicas: 1 metrics: enabled: false + service: + annotations: {} ports: http: 8000 jsonRpc: 8001 @@ -41,6 +43,8 @@ ipfs: enabled: false local: true size: 5Gi + service: + annotations: {} ports: api: 5001 diff --git a/charts/sequencer-faucet/Chart.yaml b/charts/sequencer-faucet/Chart.yaml index 7aaa81d9fe..1e985b6b5e 100644 --- a/charts/sequencer-faucet/Chart.yaml +++ b/charts/sequencer-faucet/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.9.0 +version: 0.9.1 # This is the version number of the application being deployed. This version number should be # 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: "0.9.0" +appVersion: "0.9.1" maintainers: - name: wafflesvonmaple diff --git a/charts/sequencer-faucet/templates/_helpers.tpl b/charts/sequencer-faucet/templates/_helpers.tpl index df67bd2833..a09b945424 100644 --- a/charts/sequencer-faucet/templates/_helpers.tpl +++ b/charts/sequencer-faucet/templates/_helpers.tpl @@ -29,4 +29,16 @@ Return the appropriate apiVersion for ingress. {{- else }} {{- print "extensions/v1beta1" }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} + +{{/* +Service annotations +*/}} +{{- define "sequencer.serviceAnnotations" }} +{{- if .Values.additionalAnnotations }} +{{ toYaml .Values.additionalAnnotations }} +{{- end }} +{{- if .Values.service.annotations }} +{{ toYaml .Values.service.annotations }} +{{- end }} +{{- end }} diff --git a/charts/sequencer-faucet/templates/service.yaml b/charts/sequencer-faucet/templates/service.yaml index 56afcaa0c4..7dcc7e6d2c 100644 --- a/charts/sequencer-faucet/templates/service.yaml +++ b/charts/sequencer-faucet/templates/service.yaml @@ -3,6 +3,10 @@ apiVersion: v1 metadata: name: sequencer-faucet-service namespace: {{ .Values.global.namespace }} + {{- if or .Values.additionalAnnotations .Values.service.annotations }} + annotations: + {{- include "sequencer.serviceAnnotations" . | indent 4 }} + {{- end }} spec: selector: app: astria-dev-cluster diff --git a/charts/sequencer-faucet/values.yaml b/charts/sequencer-faucet/values.yaml index 0de9bdaaa7..ed31a06c44 100644 --- a/charts/sequencer-faucet/values.yaml +++ b/charts/sequencer-faucet/values.yaml @@ -55,6 +55,9 @@ secretProvider: ports: faucet: 8080 +service: + annotations: {} + ingress: enabled: true # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName From c1fd3e46c7b8051a33cfd2f0efc078186b9367f2 Mon Sep 17 00:00:00 2001 From: quasystaty Date: Thu, 12 Dec 2024 19:26:28 +0200 Subject: [PATCH 11/26] fix(charts): configurable components block times variables (#1827) ## Summary Configurable block time environment variables for conductor and sequencer-relayer components ## Background Currently, `ASTRIA_CONDUCTOR_CELESTIA_BLOCK_TIME_MS` and `ASTRIA_SEQUENCER_RELAYER_BLOCK_TIME` environment variables are hard coded in the charts, the variables determines polling frequency and thus should be easily configurable. ## Changes - configurable blocktime variables for conductor and sequencer relayer components. ## Testing locally templating the chart with new default values. ## Changelogs No updates required --- charts/celestia-local/Chart.yaml | 2 +- charts/celestia-local/files/scripts/init-celestia-appd.sh | 5 ++++- charts/celestia-local/values.yaml | 2 +- charts/evm-rollup/Chart.yaml | 2 +- charts/evm-rollup/templates/configmap.yaml | 2 +- charts/evm-rollup/values.yaml | 2 ++ charts/evm-stack/Chart.lock | 6 +++--- charts/evm-stack/Chart.yaml | 5 ++--- charts/sequencer-relayer/Chart.yaml | 2 +- charts/sequencer-relayer/templates/configmaps.yaml | 2 +- charts/sequencer-relayer/values.yaml | 1 + charts/sequencer/Chart.lock | 6 +++--- charts/sequencer/Chart.yaml | 4 ++-- 13 files changed, 23 insertions(+), 18 deletions(-) diff --git a/charts/celestia-local/Chart.yaml b/charts/celestia-local/Chart.yaml index 797cb6d7da..43318780ce 100644 --- a/charts/celestia-local/Chart.yaml +++ b/charts/celestia-local/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.7.0 +version: 0.7.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/celestia-local/files/scripts/init-celestia-appd.sh b/charts/celestia-local/files/scripts/init-celestia-appd.sh index 80ac2bd74a..10b4945a93 100755 --- a/charts/celestia-local/files/scripts/init-celestia-appd.sh +++ b/charts/celestia-local/files/scripts/init-celestia-appd.sh @@ -62,6 +62,9 @@ sed -i'.bak' 's#"null"#"kv"#g' "${home_dir}"/config/config.toml sed -i'.bak' 's#discard_abci_responses = true#discard_abci_responses = false#g' "${home_dir}"/config/config.toml # Override the VotingPeriod from 1 week to 1 minute sed -i'.bak' 's#"604800s"#"60s"#g' "${home_dir}"/config/genesis.json +# Set the CommitTimeout to 5 second +sed -i'.bak' 's#timeout_commit = "11s"#timeout_commit = "5s"#g' "${home_dir}"/config/config.toml + if $fast; then - sed -i'.bak' 's#timeout_commit = "11s"#timeout_commit = "1s"#g' "${home_dir}"/config/config.toml + sed -i'.bak' 's#timeout_commit = "5s"#timeout_commit = "1s"#g' "${home_dir}"/config/config.toml fi diff --git a/charts/celestia-local/values.yaml b/charts/celestia-local/values.yaml index 48766020bc..68ef2a3dd3 100644 --- a/charts/celestia-local/values.yaml +++ b/charts/celestia-local/values.yaml @@ -16,7 +16,7 @@ storage: path: "/data/celestia-data" celestiaAppImage: "ghcr.io/celestiaorg/celestia-app:v2.3.1" -celestiaNodeImage: "ghcr.io/celestiaorg/celestia-node:v0.18.3-mocha" +celestiaNodeImage: "ghcr.io/celestiaorg/celestia-node:v0.20.4" podSecurityContext: runAsUser: 10001 diff --git a/charts/evm-rollup/Chart.yaml b/charts/evm-rollup/Chart.yaml index c55081c828..482a162569 100644 --- a/charts/evm-rollup/Chart.yaml +++ b/charts/evm-rollup/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/evm-rollup/templates/configmap.yaml b/charts/evm-rollup/templates/configmap.yaml index 5a5d52ae57..bf733912bf 100644 --- a/charts/evm-rollup/templates/configmap.yaml +++ b/charts/evm-rollup/templates/configmap.yaml @@ -8,7 +8,7 @@ data: 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: "12000" + 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 . }}" diff --git a/charts/evm-rollup/values.yaml b/charts/evm-rollup/values.yaml index 1f2472c022..5437e0c07d 100644 --- a/charts/evm-rollup/values.yaml +++ b/charts/evm-rollup/values.yaml @@ -172,6 +172,8 @@ config: # The expected fastest block time possible from sequencer, determines polling # rate. sequencerBlockTimeMs: 2000 + # The expected fastest block time possible from DA, determines polling rate. + celestiaBlockTimeMs: 6000 # URL path for the sequencer sequencerRpc: "" # gRPC path for the sequencer diff --git a/charts/evm-stack/Chart.lock b/charts/evm-stack/Chart.lock index a1fab2d482..b2152edebc 100644 --- a/charts/evm-stack/Chart.lock +++ b/charts/evm-stack/Chart.lock @@ -4,7 +4,7 @@ dependencies: version: 0.4.0 - name: evm-rollup repository: file://../evm-rollup - version: 1.0.0 + version: 1.0.1 - name: composer repository: file://../composer version: 1.0.0 @@ -20,5 +20,5 @@ dependencies: - name: blockscout-stack repository: https://blockscout.github.io/helm-charts version: 1.6.8 -digest: sha256:037f984f43d4eb0616c27f8a36a359680d4d745f4687a4ca54f7d77fb5119d99 -generated: "2024-12-11T11:48:47.334728-08:00" +digest: sha256:d89234a3481aa511fb32e38b9d5799efb5848f490e67dc67e837e4eb6af670d1 +generated: "2024-12-12T18:24:37.475398+02:00" diff --git a/charts/evm-stack/Chart.yaml b/charts/evm-stack/Chart.yaml index e0df534b99..e11034ce73 100644 --- a/charts/evm-stack/Chart.yaml +++ b/charts/evm-stack/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.4 +version: 1.0.5 dependencies: - name: celestia-node @@ -23,7 +23,7 @@ dependencies: repository: "file://../celestia-node" condition: celestia-node.enabled - name: evm-rollup - version: 1.0.0 + version: 1.0.1 repository: "file://../evm-rollup" - name: composer version: 1.0.0 @@ -46,7 +46,6 @@ dependencies: version: "1.6.8" condition: blockscout-stack.enabled - # This is the version number of the application being deployed. This version number should be # 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. diff --git a/charts/sequencer-relayer/Chart.yaml b/charts/sequencer-relayer/Chart.yaml index dab7178563..77ff6e351c 100644 --- a/charts/sequencer-relayer/Chart.yaml +++ b/charts/sequencer-relayer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sequencer-relayer/templates/configmaps.yaml b/charts/sequencer-relayer/templates/configmaps.yaml index c59838009e..97738d36e6 100644 --- a/charts/sequencer-relayer/templates/configmaps.yaml +++ b/charts/sequencer-relayer/templates/configmaps.yaml @@ -6,7 +6,7 @@ metadata: data: ASTRIA_SEQUENCER_RELAYER_LOG: "astria_sequencer_relayer=debug" ASTRIA_SEQUENCER_RELAYER_SUBMISSION_STATE_PATH: "{{ include "sequencer-relayer.storage.submissionStatePath" . }}" - ASTRIA_SEQUENCER_RELAYER_BLOCK_TIME: "1000" + ASTRIA_SEQUENCER_RELAYER_BLOCK_TIME: "{{ .Values.config.relayer.blockTimeMs }}" ASTRIA_SEQUENCER_RELAYER_COMETBFT_ENDPOINT: "{{ .Values.config.relayer.cometbftRpc }}" ASTRIA_SEQUENCER_RELAYER_SEQUENCER_GRPC_ENDPOINT: "{{ .Values.config.relayer.sequencerGrpc }}" ASTRIA_SEQUENCER_RELAYER_CELESTIA_APP_GRPC_ENDPOINT: "{{ .Values.config.relayer.celestiaAppGrpc }}" diff --git a/charts/sequencer-relayer/values.yaml b/charts/sequencer-relayer/values.yaml index ba46a53ca2..16b9494776 100644 --- a/charts/sequencer-relayer/values.yaml +++ b/charts/sequencer-relayer/values.yaml @@ -25,6 +25,7 @@ config: cometbftRpc: "" sequencerGrpc: "" onlyIncludeRollups: "" + blockTimeMs: "1000" metrics: enabled: false diff --git a/charts/sequencer/Chart.lock b/charts/sequencer/Chart.lock index 8261e7086a..7523dc332c 100644 --- a/charts/sequencer/Chart.lock +++ b/charts/sequencer/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: sequencer-relayer repository: file://../sequencer-relayer - version: 1.0.0 -digest: sha256:6f65d48d295fde2acca7ea368fa319add42cd33eff18ddb9768eef09ea97bf57 -generated: "2024-10-27T10:01:12.181193-07:00" + version: 1.0.1 +digest: sha256:3b3ce65ff473606fcc86027653cadd212ba45ac8b39d5806d713b48f695ad235 +generated: "2024-11-20T11:24:11.85775+02:00" diff --git a/charts/sequencer/Chart.yaml b/charts/sequencer/Chart.yaml index cd718ae1dc..832ce7df76 100644 --- a/charts/sequencer/Chart.yaml +++ b/charts/sequencer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # 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. @@ -24,7 +24,7 @@ appVersion: "1.0.0" dependencies: - name: sequencer-relayer - version: "1.0.0" + version: "1.0.1" repository: "file://../sequencer-relayer" condition: sequencer-relayer.enabled From 1f2b9677f158c0028b0faed83bf484d05079cda7 Mon Sep 17 00:00:00 2001 From: quasystaty Date: Thu, 12 Dec 2024 20:20:45 +0200 Subject: [PATCH 12/26] fix(charts, evm-faucet): configurable interval, secretProvider template fix (#1873) ## Summary Current `evm-faucet` chart deployment does not support configuring request rate limit interval. ## Background Configurable request limit for production deployments ## Changes - fix secretProvider template - configurable request interval limit ## Testing Locally against a cluster ## Changelogs No updates required. --- charts/evm-faucet/Chart.yaml | 2 +- charts/evm-faucet/templates/configmap.yaml | 1 + charts/evm-faucet/templates/deployment.yaml | 3 ++- charts/evm-faucet/values.yaml | 1 + charts/evm-stack/Chart.lock | 6 +++--- charts/evm-stack/Chart.yaml | 4 ++-- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/charts/evm-faucet/Chart.yaml b/charts/evm-faucet/Chart.yaml index dff2ef7506..5a02dc5855 100644 --- a/charts/evm-faucet/Chart.yaml +++ b/charts/evm-faucet/Chart.yaml @@ -16,7 +16,7 @@ type: application # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.3 +version: 0.1.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/evm-faucet/templates/configmap.yaml b/charts/evm-faucet/templates/configmap.yaml index abfa3034cc..a534c5b166 100644 --- a/charts/evm-faucet/templates/configmap.yaml +++ b/charts/evm-faucet/templates/configmap.yaml @@ -8,6 +8,7 @@ data: ETH_FAUCET_PORT: "{{ .Values.ports.faucet }}" ETH_FAUCET_EVM_PROVIDER_URL: "{{ tpl .Values.config.providerUrl . }}" ETH_FAUCET_AMOUNT: "{{ .Values.config.amount }}" + ETH_FAUCET_INTERVAL: "{{ .Values.config.intervalMinutes }}" {{- if not .Values.secretProvider.enabled }} ETH_FAUCET_EVM_PRIVATE_KEY: "{{ .Values.config.privateKey.devContent }}" {{- end }} diff --git a/charts/evm-faucet/templates/deployment.yaml b/charts/evm-faucet/templates/deployment.yaml index 6f6c753175..f71d689e3b 100644 --- a/charts/evm-faucet/templates/deployment.yaml +++ b/charts/evm-faucet/templates/deployment.yaml @@ -24,6 +24,7 @@ spec: - -wallet.provider=$(ETH_FAUCET_EVM_PROVIDER_URL) - -wallet.privkey=$(ETH_FAUCET_EVM_PRIVATE_KEY) - -faucet.amount=$(ETH_FAUCET_AMOUNT) + - -faucet.minutes=$(ETH_FAUCET_INTERVAL) - -proxycount=$(ETH_FAUCET_PROXYCOUNT) image: {{ .Values.images.faucet.repo }}:{{ .Values.images.faucet.tag }} imagePullPolicy: {{ .Values.images.faucet.pullPolicy }} @@ -58,6 +59,6 @@ spec: driver: secrets-store.csi.k8s.io readOnly: true volumeAttributes: - secretProviderClass: evm-faucet-private-key + secretProviderClass: faucet-private-key {{- end }} --- diff --git a/charts/evm-faucet/values.yaml b/charts/evm-faucet/values.yaml index b79100f424..c7362c07cf 100644 --- a/charts/evm-faucet/values.yaml +++ b/charts/evm-faucet/values.yaml @@ -27,6 +27,7 @@ config: key: token # The amount of token to give per request amount: 1 + intervalMinutes: 100 providerUrl: http://{{ .Values.config.rollupName }}-evm-service.{{ include "evmFaucet.namespace" . }}.svc.cluster.local:8545 ingress: diff --git a/charts/evm-stack/Chart.lock b/charts/evm-stack/Chart.lock index b2152edebc..7de99729cf 100644 --- a/charts/evm-stack/Chart.lock +++ b/charts/evm-stack/Chart.lock @@ -10,7 +10,7 @@ dependencies: version: 1.0.0 - name: evm-faucet repository: file://../evm-faucet - version: 0.1.3 + version: 0.1.4 - name: evm-bridge-withdrawer repository: file://../evm-bridge-withdrawer version: 1.0.1 @@ -20,5 +20,5 @@ dependencies: - name: blockscout-stack repository: https://blockscout.github.io/helm-charts version: 1.6.8 -digest: sha256:d89234a3481aa511fb32e38b9d5799efb5848f490e67dc67e837e4eb6af670d1 -generated: "2024-12-12T18:24:37.475398+02:00" +digest: sha256:4715e557b6ceb0fa85c9efe86f5b26d665783f0be9162728efe808fa3a35d727 +generated: "2024-12-12T19:52:24.992658+02:00" diff --git a/charts/evm-stack/Chart.yaml b/charts/evm-stack/Chart.yaml index e11034ce73..dea0641cf7 100644 --- a/charts/evm-stack/Chart.yaml +++ b/charts/evm-stack/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.5 +version: 1.0.6 dependencies: - name: celestia-node @@ -30,7 +30,7 @@ dependencies: repository: "file://../composer" condition: composer.enabled - name: evm-faucet - version: 0.1.3 + version: 0.1.4 repository: "file://../evm-faucet" condition: evm-faucet.enabled - name: evm-bridge-withdrawer From bc2569a52e5aef9fe9098d99df1d604cb529f127 Mon Sep 17 00:00:00 2001 From: Ethan Oroshiba Date: Mon, 16 Dec 2024 12:19:26 -0600 Subject: [PATCH 13/26] chore(ci): update rust lint workflows and `just` recipes (#1871) ## Summary Moved rust lints to just recipes, added all to lint rust recipe. ## Background Discrepancies between the just recipe and GH workflow made it so that the lint command might succeed but then fail when a PR is opened. This is meant to make it easier to match the GH workflow locally and test to ensure this status check will pass. ## Changes - Moved all rust lints to just recipes. - Changed `_lint-rust` to call all of the above recipes. ## Testing Manually tested ## Changelogs No updates required --- .github/workflows/lint.yml | 4 +++- .github/workflows/test.yml | 19 ++++++++----------- justfile | 35 +++++++++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4388d2e707..b80c8417d8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -68,12 +68,14 @@ jobs: if: needs.run_checker.outputs.run_lint_rust == 'true' steps: - uses: actions/checkout@v4 + - name: Install just + uses: taiki-e/install-action@just - uses: dtolnay/rust-toolchain@master with: toolchain: nightly-2024-09-15 components: rustfmt - name: run rustfmt - run: cargo +nightly-2024-09-15 fmt --all -- --check + run: just lint rust-fmt toml: runs-on: ubuntu-22.04 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ebe04560b..833358ab33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -217,6 +217,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' + - name: Install just + uses: taiki-e/install-action@just - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.RUSTUP_TOOLCHAIN }} @@ -230,15 +232,10 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: run pedantic clippy on workspace crates run: | - cargo clippy --all-targets --all-features \ - -- --warn clippy::pedantic --warn clippy::arithmetic-side-effects \ - --warn clippy::allow_attributes --warn clippy::allow_attributes_without_reason \ - --deny warnings + just lint rust-clippy - name: run pedantic clippy on tools/protobuf-compiler run: | - cargo clippy --manifest-path tools/protobuf-compiler/Cargo.toml \ - --all-targets --all-features \ - -- --warn clippy::pedantic --deny warnings + just lint rust-clippy-tools custom-lints: runs-on: buildjet-8vcpu-ubuntu-2204 @@ -248,6 +245,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' + - name: Install just + uses: taiki-e/install-action@just - uses: dtolnay/rust-toolchain@master with: # This has to match `rust-toolchain` in the rust-toolchain file of the dylint lints @@ -266,9 +265,7 @@ jobs: run: | : # list all lint packages here to have clippy explicitly test them : # uses the same nightly installed above to work around the entry in rust-toolchain.toml - cargo +nightly-2024-09-05 clippy --all-targets --all-features \ - -p tracing_debug_field \ - -- --warn clippy::pedantic --deny warnings + just lint rust-clippy-custom - name: run dylint clippy on workspace crates env: # set the dylint driver path to the target/ directory so that it's hopefully cached by rust-cache @@ -276,7 +273,7 @@ jobs: DYLINT_RUSTFLAGS: "-D warnings" run: | mkdir -p "$DYLINT_DRIVER_PATH" - cargo dylint --all --workspace + just lint rust-dylint test: if: ${{ always() && !cancelled() }} diff --git a/justfile b/justfile index e6ac8d0884..6c35eafd9a 100644 --- a/justfile +++ b/justfile @@ -73,6 +73,8 @@ fmt lang=default_lang: @just _fmt-{{lang}} # Can lint 'rust', 'toml', 'proto', 'md' or 'all'. Defaults to all. +# Can also run the following sub-lints for rust: 'rust-fmt', 'rust-clippy', +# 'rust-clippy-custom', 'rust-clippy-tools', 'rust-dylint' lint lang=default_lang: @just _lint-{{lang}} @@ -93,9 +95,38 @@ _fmt-rust: [no-exit-message] _lint-rust: + just _lint-rust-fmt + just _lint-rust-clippy + just _lint-rust-clippy-custom + just _lint-rust-clippy-tools + just _lint-rust-dylint + +[no-exit-message] +_lint-rust-fmt: cargo +nightly-2024-09-15 fmt --all -- --check - cargo clippy -- --warn clippy::pedantic - cargo dylint --all + +[no-exit-message] +_lint-rust-clippy: + cargo clippy --all-targets --all-features \ + -- --warn clippy::pedantic --warn clippy::arithmetic-side-effects \ + --warn clippy::allow_attributes --warn clippy::allow_attributes_without_reason \ + --deny warnings + +[no-exit-message] +_lint-rust-clippy-custom: + cargo +nightly-2024-09-05 clippy --all-targets --all-features \ + -p tracing_debug_field \ + -- --warn clippy::pedantic --deny warnings + +[no-exit-message] +_lint-rust-clippy-tools: + cargo clippy --manifest-path tools/protobuf-compiler/Cargo.toml \ + --all-targets --all-features \ + -- --warn clippy::pedantic --deny warnings + +[no-exit-message] +_lint-rust-dylint: + cargo dylint --all --workspace [no-exit-message] _fmt-toml: From 9c43213c72bb2b9e527cec6dd57fa63ae2ad988f Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 16 Dec 2024 14:22:52 -0500 Subject: [PATCH 14/26] bump chart versions --- charts/celestia-local/Chart.yaml | 2 +- charts/celestia-node/Chart.yaml | 2 +- charts/evm-stack/Chart.yaml | 2 +- charts/hermes/Chart.yaml | 2 +- charts/sequencer/Chart.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/celestia-local/Chart.yaml b/charts/celestia-local/Chart.yaml index 797cb6d7da..43318780ce 100644 --- a/charts/celestia-local/Chart.yaml +++ b/charts/celestia-local/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.7.0 +version: 0.7.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/celestia-node/Chart.yaml b/charts/celestia-node/Chart.yaml index 296fcdca6b..331a1cf7a7 100644 --- a/charts/celestia-node/Chart.yaml +++ b/charts/celestia-node/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.4.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/evm-stack/Chart.yaml b/charts/evm-stack/Chart.yaml index 990a8c4c53..faee9e9d5f 100644 --- a/charts/evm-stack/Chart.yaml +++ b/charts/evm-stack/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.3 +version: 1.0.4 dependencies: - name: celestia-node diff --git a/charts/hermes/Chart.yaml b/charts/hermes/Chart.yaml index d7fe9a429e..7ba9b0dcec 100644 --- a/charts/hermes/Chart.yaml +++ b/charts/hermes/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.2 +version: 0.5.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sequencer/Chart.yaml b/charts/sequencer/Chart.yaml index 54b04be575..12eee2e6a1 100644 --- a/charts/sequencer/Chart.yaml +++ b/charts/sequencer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.1 +version: 1.0.2 # This is the version number of the application being deployed. This version number should be # 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. From 81aa0db6ab49d288372ed59341158b15ea4702ec Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 16 Dec 2024 14:30:13 -0500 Subject: [PATCH 15/26] fix charts --- charts/evm-stack/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/evm-stack/Chart.yaml b/charts/evm-stack/Chart.yaml index faee9e9d5f..6c272609eb 100644 --- a/charts/evm-stack/Chart.yaml +++ b/charts/evm-stack/Chart.yaml @@ -19,7 +19,7 @@ version: 1.0.4 dependencies: - name: celestia-node - version: 0.4.0 + version: 0.4.1 repository: "file://../celestia-node" condition: celestia-node.enabled - name: evm-rollup From fc32a25b96094751fd56459c3ad90ae1b9a9d89c Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 16 Dec 2024 14:47:04 -0500 Subject: [PATCH 16/26] update Chart.lock --- charts/evm-stack/Chart.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/evm-stack/Chart.lock b/charts/evm-stack/Chart.lock index 142c15567e..fb63e91c67 100644 --- a/charts/evm-stack/Chart.lock +++ b/charts/evm-stack/Chart.lock @@ -1,7 +1,7 @@ dependencies: - name: celestia-node repository: file://../celestia-node - version: 0.4.0 + version: 0.4.1 - name: evm-rollup repository: file://../evm-rollup version: 1.0.0 @@ -20,5 +20,5 @@ dependencies: - name: blockscout-stack repository: https://blockscout.github.io/helm-charts version: 1.6.8 -digest: sha256:618d0978ce1fa169bffa360010e8afeb06f21ffb7574e8a298d1d561bbcee05b -generated: "2024-11-11T13:27:42.868678+02:00" +digest: sha256:b4cd0856466de796f8221d489bd3fefab81e6536e46de5396045d3180b2df424 +generated: "2024-12-16T14:46:48.0965614-05:00" From 592cdc394fa12a3b1db932e2fd533e704072167d Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 16 Dec 2024 14:50:27 -0500 Subject: [PATCH 17/26] bump chart versions --- charts/celestia-local/Chart.yaml | 2 +- charts/evm-stack/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/celestia-local/Chart.yaml b/charts/celestia-local/Chart.yaml index 43318780ce..a7c37a846d 100644 --- a/charts/celestia-local/Chart.yaml +++ b/charts/celestia-local/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.7.1 +version: 0.7.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/evm-stack/Chart.yaml b/charts/evm-stack/Chart.yaml index 6c272609eb..dbdf748138 100644 --- a/charts/evm-stack/Chart.yaml +++ b/charts/evm-stack/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.4 +version: 1.0.5 dependencies: - name: celestia-node From ff6124125255e0b2c332c19d1cba3f0503e25cc7 Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 16 Dec 2024 14:53:40 -0500 Subject: [PATCH 18/26] bump chart versions --- charts/evm-stack/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/evm-stack/Chart.yaml b/charts/evm-stack/Chart.yaml index dbdf748138..b661eba03e 100644 --- a/charts/evm-stack/Chart.yaml +++ b/charts/evm-stack/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.5 +version: 1.1.0 dependencies: - name: celestia-node From 916b5d5e52ddc693faa507d2efa3409363b7e74c Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 16 Dec 2024 15:03:02 -0500 Subject: [PATCH 19/26] maybe fix yaml lint --- charts/sequencer/values.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/charts/sequencer/values.yaml b/charts/sequencer/values.yaml index 40d69134b3..c8712a0902 100644 --- a/charts/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -34,7 +34,8 @@ images: moniker: "" genesis: chainId: "" - genesisTime: "" # '2023-09-22T17:22:35.092832Z' + # '2023-09-22T17:22:35.092832Z' + genesisTime: "" addressPrefixes: base: "astria" ibcCompat: "astriacompat" @@ -221,23 +222,23 @@ cometbft: devContent: priv_key: type: tendermint/PrivKeyEd25519 - value: "" # can override with a value for local testing + value: "" # can override with a value for local testing secret: resourceName: "projects/$PROJECT_ID/secrets/privValidatorKey/versions/latest" privValidatorKey: filename: privValidatorKey.json devContent: # Ed25519 address of validator - address: "" # can override with a value for local testing + address: "" # can override with a value for local testing # public key for the validator address pub_key: type: tendermint/PubKeyEd25519 - value: "" # can override with a value for local testing + value: "" # can override with a value for local testing # private key for the validator address # This is a secret key, should use a secret manager for production deployments priv_key: type: tendermint/PrivKeyEd25519 - value: "" # can override with a value for local testing + value: "" # can override with a value for local testing secret: resourceName: "projects/$PROJECT_ID/secrets/privValidatorKey/versions/latest" @@ -319,8 +320,8 @@ alerting: namespace: monitoring rules: - alert: Chain_Node_Down - expr: up{container="cometbft"} == 0 # Insert your query Expression - for: 1m # Rough number but should be enough to init warn + expr: up{container="cometbft"} == 0 # Insert your query Expression + for: 1m # Rough number but should be enough to init warn labels: severity: critical annotations: From 638c89503c93a1de05370438ad62ccf357639e8a Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 16 Dec 2024 15:05:27 -0500 Subject: [PATCH 20/26] maybe fix yaml lint --- charts/sequencer/values.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/sequencer/values.yaml b/charts/sequencer/values.yaml index c8712a0902..d54ec479ab 100644 --- a/charts/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -34,8 +34,7 @@ images: moniker: "" genesis: chainId: "" - # '2023-09-22T17:22:35.092832Z' - genesisTime: "" + genesisTime: "" # '2023-09-22T17:22:35.092832Z' addressPrefixes: base: "astria" ibcCompat: "astriacompat" From 85d356c0575223e66000ba422a7a54661bf1a4db Mon Sep 17 00:00:00 2001 From: Ethan Oroshiba Date: Mon, 16 Dec 2024 14:09:48 -0600 Subject: [PATCH 21/26] chore(sequencer-relayer): change blob submitter to use boxed blocks (#1863) ## Summary Changed block channel to use boxed sequencer blocks. ## Background Running clippy with Rust 1.83.0 in #1857 triggered a lint for large error variant in the send methods for `BlobSubmitterHandle`. Large enum variants (including in Results) should be avoided because they are only as small as their largest variant: https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err. Creating the channel with a boxed block tackles this problem at its source. ## Changes - Boxed `SequencerBlock` in `BlobSubmitterHandle`, which tackles the problem of potentially large send errors at its source. ## Testing Passing all tests ## Changelogs No updates required. ## Breaking Changes Overridden code freeze since this is a very small, non breaking change that shouldn't have any bearing since our previous audit. ## Related Issues closes #1860 --- crates/astria-sequencer-relayer/src/relayer/mod.rs | 11 ++++++----- .../src/relayer/write/mod.rs | 14 +++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/crates/astria-sequencer-relayer/src/relayer/mod.rs b/crates/astria-sequencer-relayer/src/relayer/mod.rs index e4e58e0cb7..6f7afb299c 100644 --- a/crates/astria-sequencer-relayer/src/relayer/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/mod.rs @@ -83,6 +83,9 @@ use crate::{ IncludeRollup, }; +type ForwardFut<'a> = + Fuse>>>>; + pub(crate) struct Relayer { /// A token to notify relayer that it should shut down. #[expect( @@ -172,7 +175,7 @@ impl Relayer { // future to forward a sequencer block to the celestia-submission-task. // gets set in the select-loop if the task is at capacity. let mut forward_once_free: Fuse< - BoxFuture>>, + BoxFuture>>>, > = Fuse::terminated(); self.state.set_ready(); @@ -282,9 +285,7 @@ impl Relayer { block: SequencerBlock, block_stream: &mut read::BlockStream, submitter: write::BlobSubmitterHandle, - forward: &mut Fuse< - BoxFuture>>, - >, + forward: &mut ForwardFut, ) -> eyre::Result<()> { assert!( forward.is_terminated(), @@ -292,7 +293,7 @@ impl Relayer { congested and this future is in-flight", ); - if let Err(error) = submitter.try_send(block) { + if let Err(error) = submitter.try_send(Box::new(block)) { debug!( // Just print the error directly: TrySendError has no cause chain. %error, diff --git a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs index bed9880a20..aebb0debd4 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs @@ -86,7 +86,7 @@ struct StartedSubmissionAndFee { #[derive(Clone)] pub(super) struct BlobSubmitterHandle { - tx: mpsc::Sender, + tx: mpsc::Sender>, } impl BlobSubmitterHandle { @@ -95,8 +95,8 @@ impl BlobSubmitterHandle { /// This is a thin wrapper around [`mpsc::Sender::try_send`]. pub(super) fn try_send( &self, - block: SequencerBlock, - ) -> Result<(), TrySendError> { + block: Box, + ) -> Result<(), TrySendError>> { self.tx.try_send(block) } @@ -105,8 +105,8 @@ impl BlobSubmitterHandle { /// This is a thin wrapper around [`mpsc::Sender::send`]. pub(super) async fn send( &self, - block: SequencerBlock, - ) -> Result<(), SendError> { + block: Box, + ) -> Result<(), SendError>> { self.tx.send(block).await } } @@ -116,7 +116,7 @@ pub(super) struct BlobSubmitter { client_builder: CelestiaClientBuilder, /// The channel over which sequencer blocks are received. - blocks: mpsc::Receiver, + blocks: mpsc::Receiver>, /// The accumulator of all data that will be submitted to Celestia on the next submission. next_submission: NextSubmission, @@ -253,7 +253,7 @@ impl BlobSubmitter { sequencer_height = %block.height(), "skipping sequencer block as already included in previous submission" )); - } else if let Err(error) = self.add_sequencer_block_to_next_submission(block) { + } else if let Err(error) = self.add_sequencer_block_to_next_submission(*block) { break Err(error).wrap_err( "critically failed adding Sequencer block to next submission" ); From 0332384c763a05ab65a08e0b469ebe8e9cd7c2b6 Mon Sep 17 00:00:00 2001 From: Ethan Oroshiba Date: Mon, 16 Dec 2024 14:10:00 -0600 Subject: [PATCH 22/26] fix(sequencer)!: fix fungible token packet data import (#1880) ## Summary Restored original `FungibleTokenPacketData` import. ## Background #1759 imported a slightly differing version of `FungibleTokenPacketData`, whose `serde` implementation did not exclude empty fields, breaking consensus. ## Changes - Restored original `FungibleTokenPacketData` import. ## Testing @joroshiba has successfully fully synced with this change. ## Changelogs No updates required ## Breaking Changelist - Technically a breaking change, but unbreaking a previous mistake. --- .../src/action_handler/impls/ics20_withdrawal.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs b/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs index 35d1523ece..34fecb3cf1 100644 --- a/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs +++ b/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs @@ -26,7 +26,6 @@ use cnidarium::{ StateRead, StateWrite, }; -use ibc_proto::ibc::apps::transfer::v2::FungibleTokenPacketData; use ibc_types::core::channel::{ ChannelId, PortId, @@ -37,6 +36,7 @@ use penumbra_ibc::component::packet::{ SendPacketWrite as _, Unchecked, }; +use penumbra_proto::core::component::ibc::v1::FungibleTokenPacketData; use crate::{ accounts::{ From 96ee2ed467ab8dd582e4cc8f4ffcd0de4880cfab Mon Sep 17 00:00:00 2001 From: Ethan Oroshiba Date: Thu, 19 Dec 2024 09:00:28 -0600 Subject: [PATCH 23/26] chore(sequencer): add instrumentation (#1761) ## Summary Added instrumentation to most async functions which did not have it. ## Background Adding instrumentation to all async calls will aid in tracing since spans will be emitted even if no events happen under them. ## Changes - Added instrumentation to most async functions which did not have it. - Added `err` argument to the `instrument` macro where applicable. - Added fields to the `instrument` macro where applicable. ## Testing Passing all tests. ## Changelogs No updates required ## Related Issues closes #1321 --- .../src/accounts/component.rs | 2 +- crates/astria-sequencer/src/accounts/query.rs | 12 +++++- .../src/accounts/state_ext.rs | 17 ++++---- .../src/action_handler/impls/bridge_lock.rs | 5 +++ .../impls/bridge_sudo_change.rs | 5 +++ .../src/action_handler/impls/bridge_unlock.rs | 6 +++ .../action_handler/impls/fee_asset_change.rs | 5 +++ .../src/action_handler/impls/fee_change.rs | 5 +++ .../impls/ibc_relayer_change.rs | 5 +++ .../action_handler/impls/ibc_sudo_change.rs | 5 +++ .../action_handler/impls/ics20_withdrawal.rs | 6 +++ .../impls/init_bridge_account.rs | 5 +++ .../impls/rollup_data_submission.rs | 5 +++ .../impls/sudo_address_change.rs | 5 +++ .../src/action_handler/impls/transaction.rs | 7 +++- .../src/action_handler/impls/transfer.rs | 5 +++ .../action_handler/impls/validator_update.rs | 5 +++ .../astria-sequencer/src/address/state_ext.rs | 16 ++++++-- crates/astria-sequencer/src/app/mod.rs | 26 ++++++------ crates/astria-sequencer/src/app/state_ext.rs | 15 ++++--- crates/astria-sequencer/src/assets/query.rs | 2 + .../astria-sequencer/src/assets/state_ext.rs | 11 +++-- .../src/authority/component.rs | 11 +++-- .../src/authority/state_ext.rs | 11 +++-- crates/astria-sequencer/src/bridge/query.rs | 6 ++- .../astria-sequencer/src/bridge/state_ext.rs | 24 +++++++---- crates/astria-sequencer/src/fees/component.rs | 2 +- crates/astria-sequencer/src/fees/mod.rs | 2 +- crates/astria-sequencer/src/fees/query.rs | 5 ++- crates/astria-sequencer/src/fees/state_ext.rs | 14 ++++--- crates/astria-sequencer/src/grpc/state_ext.rs | 21 ++++++---- crates/astria-sequencer/src/ibc/component.rs | 11 +++-- .../src/ibc/host_interface.rs | 5 +++ .../src/ibc/ics20_transfer.rs | 31 ++++++++++---- crates/astria-sequencer/src/ibc/state_ext.rs | 11 ++--- .../src/mempool/mempool_state.rs | 7 +++- crates/astria-sequencer/src/mempool/mod.rs | 11 +++-- .../src/mempool/transactions_container.rs | 8 +++- crates/astria-sequencer/src/sequencer.rs | 41 +++++++++++-------- .../astria-sequencer/src/service/consensus.rs | 10 +++-- .../src/service/mempool/mod.rs | 4 ++ .../src/transaction/checks.rs | 11 +++-- 42 files changed, 299 insertions(+), 122 deletions(-) diff --git a/crates/astria-sequencer/src/accounts/component.rs b/crates/astria-sequencer/src/accounts/component.rs index c9d515ec45..b8869d4a7c 100644 --- a/crates/astria-sequencer/src/accounts/component.rs +++ b/crates/astria-sequencer/src/accounts/component.rs @@ -25,7 +25,7 @@ pub(crate) struct AccountsComponent; impl Component for AccountsComponent { type AppState = GenesisAppState; - #[instrument(name = "AccountsComponent::init_chain", skip_all)] + #[instrument(name = "AccountsComponent::init_chain", skip_all, err)] async fn init_chain(mut state: S, app_state: &Self::AppState) -> Result<()> where S: accounts::StateWriteExt + assets::StateReadExt, diff --git a/crates/astria-sequencer/src/accounts/query.rs b/crates/astria-sequencer/src/accounts/query.rs index 00c23a4095..af7d320228 100644 --- a/crates/astria-sequencer/src/accounts/query.rs +++ b/crates/astria-sequencer/src/accounts/query.rs @@ -28,7 +28,10 @@ use tendermint::{ }, block::Height, }; -use tracing::instrument; +use tracing::{ + instrument, + Level, +}; use crate::{ accounts::StateReadExt as _, @@ -36,6 +39,7 @@ use crate::{ assets::StateReadExt as _, }; +#[instrument(skip_all, fields(%asset), err(level = Level::DEBUG))] async fn ibc_to_trace( state: S, asset: &asset::IbcPrefixed, @@ -47,7 +51,7 @@ async fn ibc_to_trace( .ok_or_eyre("asset not found when user has balance of it; this is a bug") } -#[instrument(skip_all, fields(%address))] +#[instrument(skip_all, fields(%address), err(level = Level::DEBUG))] async fn get_trace_prefixed_account_balances( state: &S, address: &Address, @@ -70,6 +74,7 @@ async fn get_trace_prefixed_account_balances( /// Returns a list of [`AssetBalance`]s for the provided address. `AssetBalance`s are sorted /// alphabetically by [`asset::Denom`]. +#[instrument(skip_all)] pub(crate) async fn balance_request( storage: Storage, request: request::Query, @@ -112,6 +117,7 @@ pub(crate) async fn balance_request( } } +#[instrument(skip_all)] pub(crate) async fn nonce_request( storage: Storage, request: request::Query, @@ -150,6 +156,7 @@ pub(crate) async fn nonce_request( } } +#[instrument(skip_all, fields(%height), err(level = Level::DEBUG))] async fn get_snapshot_and_height(storage: &Storage, height: Height) -> Result<(Snapshot, Height)> { let snapshot = match height.value() { 0 => storage.latest_snapshot(), @@ -173,6 +180,7 @@ async fn get_snapshot_and_height(storage: &Storage, height: Height) -> Result<(S Ok((snapshot, height)) } +#[instrument(skip_all)] async fn preprocess_request( storage: &Storage, request: &request::Query, diff --git a/crates/astria-sequencer/src/accounts/state_ext.rs b/crates/astria-sequencer/src/accounts/state_ext.rs index ff466469db..2cae372809 100644 --- a/crates/astria-sequencer/src/accounts/state_ext.rs +++ b/crates/astria-sequencer/src/accounts/state_ext.rs @@ -25,7 +25,10 @@ use cnidarium::{ }; use futures::Stream; use pin_project_lite::pin_project; -use tracing::instrument; +use tracing::{ + instrument, + Level, +}; use super::storage::{ self, @@ -141,7 +144,7 @@ pub(crate) trait StateReadExt: StateRead + crate::assets::StateReadExt { } } - #[instrument(skip_all, fields(address = %address.display_address(), %asset), err)] + #[instrument(skip_all, fields(address = %address.display_address(), %asset), err(level = Level::WARN))] async fn get_account_balance<'a, TAddress, TAsset>( &self, address: &TAddress, @@ -165,7 +168,7 @@ pub(crate) trait StateReadExt: StateRead + crate::assets::StateReadExt { .wrap_err("invalid balance bytes") } - #[instrument(skip_all)] + #[instrument(skip_all, err)] async fn get_account_nonce(&self, address: &T) -> Result { let bytes = self .get_raw(&keys::nonce(address)) @@ -186,7 +189,7 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip_all, fields(address = %address.display_address(), %asset, balance), err)] + #[instrument(skip_all, fields(address = %address.display_address(), %asset, balance), err(level = Level::WARN))] fn put_account_balance<'a, TAddress, TAsset>( &mut self, address: &TAddress, @@ -205,7 +208,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip_all)] + #[instrument(skip_all, fields(address = %address.display_address(), nonce), err(level = Level::WARN))] fn put_account_nonce(&mut self, address: &T, nonce: u32) -> Result<()> { let bytes = StoredValue::from(storage::Nonce::from(nonce)) .serialize() @@ -214,7 +217,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip_all, fields(address = %address.display_address(), %asset, amount), err)] + #[instrument(skip_all, fields(address = %address.display_address(), %asset, amount), err(level = Level::WARN))] async fn increase_balance<'a, TAddress, TAsset>( &mut self, address: &TAddress, @@ -241,7 +244,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip_all, fields(address = %address.display_address(), %asset, amount))] + #[instrument(skip_all, fields(address = %address.display_address(), %asset, amount), err(level = Level::DEBUG))] async fn decrease_balance<'a, TAddress, TAsset>( &mut self, address: &TAddress, diff --git a/crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs b/crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs index 3be717fc61..38c61520c6 100644 --- a/crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs +++ b/crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs @@ -13,6 +13,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::{ @@ -36,6 +40,7 @@ impl ActionHandler for BridgeLock { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/bridge_sudo_change.rs b/crates/astria-sequencer/src/action_handler/impls/bridge_sudo_change.rs index a69775cf5f..97f7dbaa57 100644 --- a/crates/astria-sequencer/src/action_handler/impls/bridge_sudo_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/bridge_sudo_change.rs @@ -7,6 +7,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -24,6 +28,7 @@ impl ActionHandler for BridgeSudoChange { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs b/crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs index d2362a5742..3789fa5bde 100644 --- a/crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs +++ b/crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs @@ -10,6 +10,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::{ @@ -28,6 +32,7 @@ use crate::{ #[async_trait] impl ActionHandler for BridgeUnlock { // TODO(https://github.com/astriaorg/astria/issues/1430): move checks to the `BridgeUnlock` parsing. + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_stateless(&self) -> Result<()> { ensure!(self.amount > 0, "amount must be greater than zero",); ensure!(self.memo.len() <= 64, "memo must not be more than 64 bytes"); @@ -46,6 +51,7 @@ impl ActionHandler for BridgeUnlock { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/fee_asset_change.rs b/crates/astria-sequencer/src/action_handler/impls/fee_asset_change.rs index c92161e751..fabbe3247c 100644 --- a/crates/astria-sequencer/src/action_handler/impls/fee_asset_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/fee_asset_change.rs @@ -8,6 +8,10 @@ use async_trait::async_trait; use cnidarium::StateWrite; use futures::StreamExt as _; use tokio::pin; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -25,6 +29,7 @@ impl ActionHandler for FeeAssetChange { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> eyre::Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/fee_change.rs b/crates/astria-sequencer/src/action_handler/impls/fee_change.rs index f066ded9ea..3b399ddc40 100644 --- a/crates/astria-sequencer/src/action_handler/impls/fee_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/fee_change.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -22,6 +26,7 @@ impl ActionHandler for FeeChange { /// check that the signer of the transaction is the current sudo address, /// as only that address can change the fee + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> eyre::Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/ibc_relayer_change.rs b/crates/astria-sequencer/src/action_handler/impls/ibc_relayer_change.rs index e5de94afbe..9ddce3ea30 100644 --- a/crates/astria-sequencer/src/action_handler/impls/ibc_relayer_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/ibc_relayer_change.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -23,6 +27,7 @@ impl ActionHandler for IbcRelayerChange { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/ibc_sudo_change.rs b/crates/astria-sequencer/src/action_handler/impls/ibc_sudo_change.rs index f82af648fc..487f71b4e6 100644 --- a/crates/astria-sequencer/src/action_handler/impls/ibc_sudo_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/ibc_sudo_change.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -21,6 +25,7 @@ impl ActionHandler for IbcSudoChange { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs b/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs index 34fecb3cf1..cf29705315 100644 --- a/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs +++ b/crates/astria-sequencer/src/action_handler/impls/ics20_withdrawal.rs @@ -37,6 +37,10 @@ use penumbra_ibc::component::packet::{ Unchecked, }; use penumbra_proto::core::component::ibc::v1::FungibleTokenPacketData; +use tracing::{ + instrument, + Level, +}; use crate::{ accounts::{ @@ -60,6 +64,7 @@ use crate::{ #[async_trait] impl ActionHandler for action::Ics20Withdrawal { // TODO(https://github.com/astriaorg/astria/issues/1430): move checks to the `Ics20Withdrawal` parsing. + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_stateless(&self) -> Result<()> { ensure!(self.timeout_time() != 0, "timeout time must be non-zero",); ensure!(self.amount() > 0, "amount must be greater than zero",); @@ -95,6 +100,7 @@ impl ActionHandler for action::Ics20Withdrawal { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/init_bridge_account.rs b/crates/astria-sequencer/src/action_handler/impls/init_bridge_account.rs index 85e05de042..fdea8cab4f 100644 --- a/crates/astria-sequencer/src/action_handler/impls/init_bridge_account.rs +++ b/crates/astria-sequencer/src/action_handler/impls/init_bridge_account.rs @@ -9,6 +9,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -26,6 +30,7 @@ impl ActionHandler for InitBridgeAccount { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/rollup_data_submission.rs b/crates/astria-sequencer/src/action_handler/impls/rollup_data_submission.rs index 3881e221bf..23be358129 100644 --- a/crates/astria-sequencer/src/action_handler/impls/rollup_data_submission.rs +++ b/crates/astria-sequencer/src/action_handler/impls/rollup_data_submission.rs @@ -5,11 +5,16 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::action_handler::ActionHandler; #[async_trait] impl ActionHandler for RollupDataSubmission { + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_stateless(&self) -> Result<()> { // TODO: do we want to place a maximum on the size of the data? // https://github.com/astriaorg/astria/issues/222 diff --git a/crates/astria-sequencer/src/action_handler/impls/sudo_address_change.rs b/crates/astria-sequencer/src/action_handler/impls/sudo_address_change.rs index 7c7cb2e5e2..eb3f4f771a 100644 --- a/crates/astria-sequencer/src/action_handler/impls/sudo_address_change.rs +++ b/crates/astria-sequencer/src/action_handler/impls/sudo_address_change.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -25,6 +29,7 @@ impl ActionHandler for SudoAddressChange { /// check that the signer of the transaction is the current sudo address, /// as only that address can change the sudo address + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/transaction.rs b/crates/astria-sequencer/src/action_handler/impls/transaction.rs index a5b66bf4fd..8605906ad4 100644 --- a/crates/astria-sequencer/src/action_handler/impls/transaction.rs +++ b/crates/astria-sequencer/src/action_handler/impls/transaction.rs @@ -18,6 +18,10 @@ use astria_eyre::{ }, }; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ accounts::{ @@ -74,6 +78,7 @@ impl std::error::Error for InvalidNonce {} #[async_trait::async_trait] impl ActionHandler for Transaction { + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_stateless(&self) -> Result<()> { ensure!(!self.actions().is_empty(), "must have at least one action"); @@ -149,7 +154,7 @@ impl ActionHandler for Transaction { // FIXME (https://github.com/astriaorg/astria/issues/1584): because most lines come from delegating (and error wrapping) to the // individual actions. This could be tidied up by implementing `ActionHandler for Action` // and letting it delegate. - #[expect(clippy::too_many_lines, reason = "should be refactored")] + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { // Add the current signed transaction into the ephemeral state in case // downstream actions require access to it. diff --git a/crates/astria-sequencer/src/action_handler/impls/transfer.rs b/crates/astria-sequencer/src/action_handler/impls/transfer.rs index 27d955bca3..75735e8df4 100644 --- a/crates/astria-sequencer/src/action_handler/impls/transfer.rs +++ b/crates/astria-sequencer/src/action_handler/impls/transfer.rs @@ -6,6 +6,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::{ @@ -23,6 +27,7 @@ impl ActionHandler for Transfer { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/action_handler/impls/validator_update.rs b/crates/astria-sequencer/src/action_handler/impls/validator_update.rs index 4bd0d72c3c..5ad1ceab06 100644 --- a/crates/astria-sequencer/src/action_handler/impls/validator_update.rs +++ b/crates/astria-sequencer/src/action_handler/impls/validator_update.rs @@ -7,6 +7,10 @@ use astria_eyre::eyre::{ }; use async_trait::async_trait; use cnidarium::StateWrite; +use tracing::{ + instrument, + Level, +}; use crate::{ action_handler::ActionHandler, @@ -23,6 +27,7 @@ impl ActionHandler for ValidatorUpdate { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn check_and_execute(&self, mut state: S) -> Result<()> { let from = state .get_transaction_context() diff --git a/crates/astria-sequencer/src/address/state_ext.rs b/crates/astria-sequencer/src/address/state_ext.rs index 0f5cd5bf30..b217e80a56 100644 --- a/crates/astria-sequencer/src/address/state_ext.rs +++ b/crates/astria-sequencer/src/address/state_ext.rs @@ -16,16 +16,23 @@ use cnidarium::{ StateRead, StateWrite, }; -use tracing::instrument; +use tracing::{ + instrument, + Level, +}; use super::storage::{ self, keys, }; -use crate::storage::StoredValue; +use crate::{ + accounts::AddressBytes as _, + storage::StoredValue, +}; #[async_trait] pub(crate) trait StateReadExt: StateRead { + #[instrument(skip_all, fields(address = %address.display_address()), err(level = Level::DEBUG))] async fn ensure_base_prefix(&self, address: &Address) -> Result<()> { let prefix = self .get_base_prefix() @@ -39,6 +46,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(()) } + #[instrument(skip_all, err(level = Level::DEBUG))] async fn try_base_prefixed(&self, slice: &[u8]) -> Result
{ let prefix = self .get_base_prefix() @@ -51,7 +59,7 @@ pub(crate) trait StateReadExt: StateRead { .wrap_err("failed to construct address from byte slice and state-provided base prefix") } - #[instrument(skip_all, err)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_base_prefix(&self) -> Result { let Some(bytes) = self .get_raw(keys::BASE_PREFIX) @@ -66,7 +74,7 @@ pub(crate) trait StateReadExt: StateRead { .context("invalid base prefix bytes") } - #[instrument(skip_all, err)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_ibc_compat_prefix(&self) -> Result { let Some(bytes) = self .get_raw(keys::IBC_COMPAT_PREFIX) diff --git a/crates/astria-sequencer/src/app/mod.rs b/crates/astria-sequencer/src/app/mod.rs index 78386c6f9f..794f5720c2 100644 --- a/crates/astria-sequencer/src/app/mod.rs +++ b/crates/astria-sequencer/src/app/mod.rs @@ -79,6 +79,7 @@ use tracing::{ debug, info, instrument, + Level, }; pub(crate) use self::state_ext::{ @@ -235,6 +236,7 @@ pub(crate) struct App { } impl App { + #[instrument(name = "App::new", skip_all, err)] pub(crate) async fn new( snapshot: Snapshot, mempool: Mempool, @@ -268,7 +270,7 @@ impl App { }) } - #[instrument(name = "App:init_chain", skip_all)] + #[instrument(name = "App:init_chain", skip_all, err)] pub(crate) async fn init_chain( &mut self, storage: Storage, @@ -355,7 +357,7 @@ impl App { /// It puts this special "commitment" as the first transaction in a block. /// When other validators receive the block, they know the first transaction is /// supposed to be the commitment, and verifies that is it correct. - #[instrument(name = "App::prepare_proposal", skip_all)] + #[instrument(name = "App::prepare_proposal", skip_all, err(level = Level::WARN))] pub(crate) async fn prepare_proposal( &mut self, prepare_proposal: abci::request::PrepareProposal, @@ -405,7 +407,7 @@ impl App { /// Generates a commitment to the `sequence::Actions` in the block's transactions /// and ensures it matches the commitment created by the proposer, which /// should be the first transaction in the block. - #[instrument(name = "App::process_proposal", skip_all)] + #[instrument(name = "App::process_proposal", skip_all, err(level = Level::WARN))] pub(crate) async fn process_proposal( &mut self, process_proposal: abci::request::ProcessProposal, @@ -565,7 +567,7 @@ impl App { /// /// As a result, all transactions in a sequencer block are guaranteed to execute /// successfully. - #[instrument(name = "App::execute_transactions_prepare_proposal", skip_all)] + #[instrument(name = "App::execute_transactions_prepare_proposal", skip_all, err(level = Level::DEBUG))] async fn execute_transactions_prepare_proposal( &mut self, block_size_constraints: &mut BlockSizeConstraints, @@ -745,7 +747,7 @@ impl App { /// /// As a result, all transactions in a sequencer block are guaranteed to execute /// successfully. - #[instrument(name = "App::execute_transactions_process_proposal", skip_all)] + #[instrument(name = "App::execute_transactions_process_proposal", skip_all, err(level = Level::DEBUG))] async fn execute_transactions_process_proposal( &mut self, txs: Vec, @@ -823,7 +825,7 @@ impl App { /// /// this *must* be called anytime before a block's txs are executed, whether it's /// during the proposal phase, or finalize_block phase. - #[instrument(name = "App::pre_execute_transactions", skip_all, err)] + #[instrument(name = "App::pre_execute_transactions", skip_all, err(level = Level::WARN))] async fn pre_execute_transactions(&mut self, block_data: BlockData) -> Result<()> { let chain_id = self .state @@ -878,7 +880,7 @@ impl App { /// `SequencerBlock`. /// /// this must be called after a block's transactions are executed. - #[instrument(name = "App::post_execute_transactions", skip_all)] + #[instrument(name = "App::post_execute_transactions", skip_all, err(level = Level::WARN))] async fn post_execute_transactions( &mut self, block_hash: Hash, @@ -962,7 +964,7 @@ impl App { /// /// This is called by cometbft after the block has already been /// committed by the network's consensus. - #[instrument(name = "App::finalize_block", skip_all)] + #[instrument(name = "App::finalize_block", skip_all, err)] pub(crate) async fn finalize_block( &mut self, finalize_block: abci::request::FinalizeBlock, @@ -1076,7 +1078,7 @@ impl App { Ok(finalize_block) } - #[instrument(skip_all, err)] + #[instrument(skip_all, err(level = Level::WARN))] async fn prepare_commit(&mut self, storage: Storage) -> Result { // extract the state we've built up to so we can prepare it as a `StagedWriteBatch`. let dummy_state = StateDelta::new(storage.latest_snapshot()); @@ -1113,7 +1115,7 @@ impl App { Ok(app_hash) } - #[instrument(name = "App::begin_block", skip_all)] + #[instrument(name = "App::begin_block", skip_all, err(level = Level::WARN))] async fn begin_block( &mut self, begin_block: &abci::request::BeginBlock, @@ -1149,7 +1151,7 @@ impl App { } /// Executes a signed transaction. - #[instrument(name = "App::execute_transaction", skip_all)] + #[instrument(name = "App::execute_transaction", skip_all, err(level = Level::DEBUG))] async fn execute_transaction(&mut self, signed_tx: Arc) -> Result> { signed_tx .check_stateless() @@ -1186,7 +1188,7 @@ impl App { Ok(events) } - #[instrument(name = "App::end_block", skip_all)] + #[instrument(name = "App::end_block", skip_all, err(level = Level::WARN))] async fn end_block( &mut self, height: u64, diff --git a/crates/astria-sequencer/src/app/state_ext.rs b/crates/astria-sequencer/src/app/state_ext.rs index b9a2e3b78e..d1dfb5e07a 100644 --- a/crates/astria-sequencer/src/app/state_ext.rs +++ b/crates/astria-sequencer/src/app/state_ext.rs @@ -12,7 +12,10 @@ use cnidarium::{ StateWrite, }; use tendermint::Time; -use tracing::instrument; +use tracing::{ + instrument, + Level, +}; use super::storage::{ self, @@ -22,7 +25,7 @@ use crate::storage::StoredValue; #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip_all)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_chain_id(&self) -> Result { let Some(bytes) = self .get_raw(keys::CHAIN_ID) @@ -37,7 +40,7 @@ pub(crate) trait StateReadExt: StateRead { .wrap_err("invalid chain id bytes") } - #[instrument(skip_all)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_revision_number(&self) -> Result { let Some(bytes) = self .get_raw(keys::REVISION_NUMBER) @@ -52,7 +55,7 @@ pub(crate) trait StateReadExt: StateRead { .wrap_err("invalid revision number bytes") } - #[instrument(skip_all)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_block_height(&self) -> Result { let Some(bytes) = self .get_raw(keys::BLOCK_HEIGHT) @@ -67,7 +70,7 @@ pub(crate) trait StateReadExt: StateRead { .context("invalid block height bytes") } - #[instrument(skip_all)] + #[instrument(skip_all, err(level = Level::WARN))] async fn get_block_timestamp(&self) -> Result