Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core, sequencer): rename connect oracle to price feed #1923

Open
wants to merge 5 commits into
base: fraser/1874-sequencer-upgrades
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -102,9 +102,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 @@ -113,12 +113,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 @@ -35,7 +35,7 @@ images:
pullPolicy: IfNotPresent
tag: 1.0.0
devTag: pr-1866
connect:
priceFeed:
repo: ghcr.io/skip-mev/connect-sidecar
pullPolicy: IfNotPresent
tag: v2
Expand All @@ -49,7 +49,7 @@ genesis:
base: "astria"
ibcCompat: "astriacompat"
authoritySudoAddress: ""
oracle:
priceFeed:
marketAdminAddress: "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm"
marketAuthorities:
- "astria1rsxyjrcm255ds9euthjx6yc3vrjt9sxrm9cfgm"
Expand Down Expand Up @@ -130,7 +130,7 @@ sequencer:
mempool:
parked:
maxTxCount: 200
oracle:
priceFeed:
enabled: true
clientTimeout: 1000
markets: []
Expand Down Expand Up @@ -299,12 +299,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::{
self,
SequencerBlockHeader,
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,12 +6,12 @@ use astria_core::{
CommitmentState,
},
primitive::v1::RollupId,
protocol::connect::v1::ExtendedCommitInfoWithCurrencyPairMapping,
protocol::price_feed::v1::ExtendedCommitInfoWithCurrencyPairMapping,
sequencerblock::v1::block::{
self,
FilteredSequencerBlock,
FilteredSequencerBlockParts,
OracleData,
PriceFeedData,
RollupData,
},
};
Expand Down Expand Up @@ -709,7 +709,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 @@ -734,7 +734,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 @@ -744,23 +744,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

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

Loading
Loading