Skip to content

Commit

Permalink
rename connect oracle to price feed
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser999 committed Jan 22, 2025
1 parent b47fa25 commit 38e5684
Show file tree
Hide file tree
Showing 127 changed files with 1,116 additions and 1,090 deletions.
12 changes: 6 additions & 6 deletions charts/sequencer/files/cometbft/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@
],
{{- if not .Values.global.dev }}
{{- else }}
"connect": {
"price_feed": {
"marketMap": {
"marketMap": {
"markets": {
{{- range $index, $market := .Values.sequencer.oracle.markets }}
{{- range $index, $market := .Values.sequencer.priceFeed.markets }}
{{- if $index }},{{- end }}
"{{ $market.name }}": {
"providerConfigs": [
Expand Down Expand Up @@ -158,9 +158,9 @@
}
},
"params": {
"admin": "{{ .Values.genesis.oracle.marketAdminAddress }}",
"admin": "{{ .Values.genesis.priceFeed.marketAdminAddress }}",
"marketAuthorities": [
{{- range $index, $authority := .Values.genesis.oracle.marketAuthorities }}
{{- range $index, $authority := .Values.genesis.priceFeed.marketAuthorities }}
{{- if $index }},{{- end }}
"{{ $authority }}"
{{- end }}
Expand All @@ -169,7 +169,7 @@
},
"oracle": {
"currencyPairGenesis": [
{{- range $index, $genesis := .Values.sequencer.oracle.currencyPairGenesis }}
{{- range $index, $genesis := .Values.sequencer.priceFeed.currencyPairGenesis }}
{{- if $index }},{{- end }}
{
"currencyPair": {
Expand All @@ -186,7 +186,7 @@
}
{{- end }}
],
"nextId": "{{ .Values.sequencer.oracle.nextId }}"
"nextId": "{{ .Values.sequencer.priceFeed.nextId }}"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions charts/sequencer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ 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 }}
{{- define "priceFeed.image" -}}
{{ .Values.images.priceFeed.repo }}:{{ if .Values.global.dev }}{{ .Values.images.priceFeed.devTag }}{{ else }}{{ .Values.images.priceFeed.tag }}{{ end }}
{{- end }}

{{/*
Expand Down
6 changes: 3 additions & 3 deletions charts/sequencer/templates/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ data:
{{- else }}
ASTRIA_SEQUENCER_UPGRADES_FILEPATH: "/sequencer-upgrades/upgrades.json"
ASTRIA_SEQUENCER_COMETBFT_RPC_ADDR: "http://127.0.0.1:{{ .Values.ports.cometbftRpc }}"
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 }}"
ASTRIA_SEQUENCER_NO_PRICE_FEED: "{{ not .Values.sequencer.priceFeed.enabled }}"
ASTRIA_SEQUENCER_PRICE_FEED_GRPC_ADDR: "http://127.0.0.1:{{ .Values.ports.priceFeedGrpc }}"
ASTRIA_SEQUENCER_PRICE_FEED_CLIENT_TIMEOUT_MILLISECONDS: "{{ .Values.sequencer.priceFeed.clientTimeout }}"
{{- end }}
---
10 changes: 5 additions & 5 deletions charts/sequencer/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
port: {{ .Values.ports.sequencerGrpc }}
targetPort: sequencer-grpc
---
{{- if .Values.serviceMonitor.enabled }}
{{- if .Values.serviceMonitor.enabled }}
kind: Service
apiVersion: v1
metadata:
Expand All @@ -66,10 +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
{{- if .Values.sequencer.priceFeed.metrics.enabled }}
- name: price-fd-metric
port: {{ .Values.ports.priceFeedMetrics }}
targetPort: price-fd-metric
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/sequencer/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ spec:
{{- with .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- if .Values.sequencer.oracle.metrics.enabled }}
- port: oracle-metric
{{- if .Values.sequencer.priceFeed.metrics.enabled }}
- port: price-fd-metric
path: /
{{- with .Values.serviceMonitor.interval }}
interval: {{ . }}
Expand Down
16 changes: 8 additions & 8 deletions charts/sequencer/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ spec:
limits:
cpu: {{ .Values.resources.cometbft.limits.cpu }}
memory: {{ .Values.resources.cometbft.limits.memory }}
- name: connect
image: "{{ include "connect.image" . }}"
imagePullPolicy: {{ .Values.images.connect.pullPolicy }}
- name: price-feed
image: "{{ include "priceFeed.image" . }}"
imagePullPolicy: {{ .Values.images.priceFeed.pullPolicy }}
volumeMounts:
- mountPath: /scripts
name: cometbft-init-scripts-volume
Expand All @@ -107,12 +107,12 @@ spec:
- "--market-map-endpoint"
- "127.0.0.1:{{ .Values.ports.sequencerGrpc }}"
- "--port"
- "{{ .Values.ports.oracleGrpc }}"
- "{{ .Values.ports.priceFeedGrpc }}"
ports:
- containerPort: {{ .Values.ports.oracleGrpc }}
name: oracle-grpc
- containerPort: {{ .Values.ports.oracleMetrics }}
name: oracle-metric
- containerPort: {{ .Values.ports.priceFeedGrpc }}
name: price-feed-grpc
- containerPort: {{ .Values.ports.priceFeedMetrics }}
name: price-fd-metric
volumes:
- name: cometbft-config-volume
configMap:
Expand Down
12 changes: 6 additions & 6 deletions charts/sequencer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ images:
pullPolicy: IfNotPresent
tag: 1.0.0
devTag: sha-80be7eb
connect:
priceFeed:
repo: ghcr.io/skip-mev/connect-sidecar
pullPolicy: IfNotPresent
tag: v2
Expand All @@ -39,7 +39,7 @@ genesis:
base: "astria"
ibcCompat: "astriacompat"
authoritySudoAddress: ""
oracle:
priceFeed:
marketAdminAddress: "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm"
marketAuthorities:
- "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm"
Expand Down Expand Up @@ -120,7 +120,7 @@ sequencer:
mempool:
parked:
maxTxCount: 200
oracle:
priceFeed:
enabled: true
clientTimeout: 1000
markets: []
Expand Down Expand Up @@ -289,12 +289,12 @@ ports:
cometbftRpc: 26657
cometbftMetrics: 26660
sequencerABCI: 26658
# note: the oracle sidecar also uses 8080 by default but can be changed with --port
# note: the price feed sidecar also uses 8080 by default but can be changed with --port
sequencerGrpc: 8080
relayerRpc: 2450
sequencerMetrics: 9000
oracleGrpc: 8081
oracleMetrics: 8002
priceFeedGrpc: 8081
priceFeedMetrics: 8002

# ServiceMonitor configuration
serviceMonitor:
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-conductor/src/celestia/block_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ mod tests {
}

fn make_test_extended_commit_info_bytes() -> Vec<u8> {
use astria_core::generated::protocol::connect::v1::ExtendedCommitInfoWithCurrencyPairMapping;
use astria_core::generated::protocol::price_feed::v1::ExtendedCommitInfoWithCurrencyPairMapping;

let extended_commit_info: tendermint_proto::abci::ExtendedCommitInfo =
tendermint::abci::types::ExtendedCommitInfo {
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-conductor/src/celestia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{

use astria_core::{
primitive::v1::RollupId,
protocol::connect::v1::ExtendedCommitInfoWithCurrencyPairMapping,
protocol::price_feed::v1::ExtendedCommitInfoWithCurrencyPairMapping,
sequencerblock::v1::block::SequencerBlockHeader,
};
use astria_eyre::eyre::{
Expand Down
25 changes: 14 additions & 11 deletions crates/astria-conductor/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use astria_core::{
CommitmentState,
},
primitive::v1::RollupId,
protocol::connect::v1::ExtendedCommitInfoWithCurrencyPairMapping,
protocol::price_feed::v1::ExtendedCommitInfoWithCurrencyPairMapping,
sequencerblock::v1::block::{
FilteredSequencerBlock,
FilteredSequencerBlockParts,
OracleData,
PriceFeedData,
RollupData,
},
};
Expand Down Expand Up @@ -710,7 +710,7 @@ impl ExecutableBlock {
} = block;
let timestamp = convert_tendermint_time_to_protobuf_timestamp(header.time());
let transactions =
insert_oracle_data_into_transactions_if_exists(transactions, extended_commit_info);
insert_price_feed_data_into_transactions_if_exists(transactions, extended_commit_info);
Self {
hash: block_hash,
height: header.height(),
Expand All @@ -735,7 +735,7 @@ impl ExecutableBlock {
.unwrap_or_default();

let transactions =
insert_oracle_data_into_transactions_if_exists(transactions, extended_commit_info);
insert_price_feed_data_into_transactions_if_exists(transactions, extended_commit_info);
Self {
hash: block_hash,
height,
Expand All @@ -745,23 +745,26 @@ impl ExecutableBlock {
}
}

fn insert_oracle_data_into_transactions_if_exists(
fn insert_price_feed_data_into_transactions_if_exists(
transactions: Vec<Bytes>,
extended_commit_info: Option<ExtendedCommitInfoWithCurrencyPairMapping>,
) -> Vec<Bytes> {
use prost::Message as _;

if let Some(extended_commit_info) = extended_commit_info {
let Ok(prices) = astria_core::connect::utils::calculate_prices_from_vote_extensions(
&extended_commit_info.extended_commit_info,
&extended_commit_info.id_to_currency_pair,
) else {
let Ok(prices) =
astria_core::oracles::price_feed::utils::calculate_prices_from_vote_extensions(
&extended_commit_info.extended_commit_info,
&extended_commit_info.id_to_currency_pair,
)
else {
debug!(
"failed to calculate prices from vote extensions; continuing without oracle data"
"failed to calculate prices from vote extensions; continuing without price feed \
data"
);
return transactions;
};
let rollup_data = RollupData::OracleData(Box::new(OracleData::new(prices)));
let rollup_data = RollupData::PriceFeedData(Box::new(PriceFeedData::new(prices)));
std::iter::once(rollup_data.into_raw().encode_to_vec().into())
.chain(transactions)
.collect()
Expand Down
4 changes: 2 additions & 2 deletions crates/astria-conductor/tests/blackbox/helpers/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ macro_rules! mount_executed_block {
::serde_json::json!({
"prevBlockHash": BASE64_STANDARD.encode($parent),
"transactions": [
{"oracleData": {}},
{"priceFeedData": {}},
{"sequencedData": BASE64_STANDARD.encode($crate::helpers::data())}
],
}),
Expand Down Expand Up @@ -414,7 +414,7 @@ macro_rules! mount_execute_block_tonic_code {
::serde_json::json!({
"prevBlockHash": BASE64_STANDARD.encode($parent),
"transactions": [
{"oracleData": {}},
{"priceFeedData": {}},
{"sequencedData": BASE64_STANDARD.encode($crate::helpers::data())}
],
}),
Expand Down
12 changes: 6 additions & 6 deletions crates/astria-core/src/generated/astria.protocol.genesis.v1.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 38e5684

Please sign in to comment.