Skip to content

Commit

Permalink
chore: remove pragma devnet
Browse files Browse the repository at this point in the history
  • Loading branch information
EvolveArt committed Jan 22, 2025
1 parent a0d3690 commit 3f9a582
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 252 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ It then processes the data and computes the following metrics:
- `long_tail_asset_total_sources{network, pair, type}`: Current number of sources available for a given pair.
- `publisher_balance{network, publisher}`: Balance of a publisher. (in ETH)

Metrics specifics to our Pragma App Chains:

- `dispatch_event_latest_block`: The latest block that triggered a Dispatch event from Hyperlane,
- `dispatch_event_feed_latest_block_update`: The latest block that triggered a Dispatch event from Hyperlane for a specific Feed ID,
- `dispatch_event_nb_feeds_updated`: The number of feeds updated per Dispatch event at a given block.

Metrics specifics to Starknet (mainnet/sepolia):

- `vrf_balance{network}`: Balance of the VRF contract. (in ETH)
Expand Down
8 changes: 0 additions & 8 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ pub enum NetworkName {
Mainnet,
#[strum(ascii_case_insensitive)]
Testnet,
#[strum(ascii_case_insensitive, serialize = "pragma-devnet")]
PragmaDevnet,
}

#[derive(Debug, EnumString, IntoStaticStr, PartialEq, Eq, Hash, Clone, Display)]
Expand Down Expand Up @@ -164,18 +162,12 @@ impl Config {
match self.network.name {
NetworkName::Mainnet => format!("mainnet_{}", table_name),
NetworkName::Testnet => table_name.to_string(),
NetworkName::PragmaDevnet => format!("pragma_devnet_{}", table_name),
}
}

pub fn all_publishers(&self) -> &HashMap<String, Felt> {
&self.publishers
}

/// Check if the configuration is set for a Pragma Chain
pub fn is_pragma_chain(&self) -> bool {
matches!(self.network.name, NetworkName::PragmaDevnet)
}
}

#[derive(Debug, Clone)]
Expand Down
21 changes: 0 additions & 21 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,27 +265,6 @@ lazy_static! {
&["network"]
)
.unwrap();
pub static ref DISPATCH_EVENT_LATEST_BLOCK: GaugeVec = register_gauge_vec!(
opts!(
"dispatch_event_latest_block",
"The latest block that triggered a Dispatch event from Hyperlane"
),
&["network"]
).unwrap();
pub static ref DISPATCH_EVENT_FEED_LATEST_BLOCK_UPDATE: GaugeVec = register_gauge_vec!(
opts!(
"dispatch_event_feed_latest_block_update",
"The latest block that triggered a Dispatch event from Hyperlane for a specific Feed ID"
),
&["network", "feed_id"]
).unwrap();
pub static ref DISPATCH_EVENT_NB_FEEDS_UPDATED: GaugeVec = register_gauge_vec!(
opts!(
"dispatch_event_nb_feeds_updated",
"The number of feeds updated per Dispatch event at a given block"
),
&["network", "block"]
).unwrap();
// LST conversion rate metrics
pub static ref LST_CONVERSION_RATE: GaugeVec = register_gauge_vec!(
opts!(
Expand Down
14 changes: 0 additions & 14 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,3 @@ pub struct OORequest {
pub updated_at: NaiveDateTime,
pub updated_at_tx: String,
}

#[derive(Queryable, Debug, QueryableByName, Selectable)]
#[diesel(table_name = crate::schema::pragma_devnet_dispatch_event)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct FeedDispatch {
pub network: String,
pub block_hash: String,
pub block_number: i64,
pub block_timestamp: NaiveDateTime,
pub transaction_hash: String,
pub hyperlane_message_nonce: BigDecimal,
pub feeds_updated: Option<Vec<String>>,
pub _cursor: i64,
}
54 changes: 0 additions & 54 deletions src/processing/dispatch.rs

This file was deleted.

23 changes: 0 additions & 23 deletions src/processing/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::monitoring::{

use crate::schema::future_entry::dsl as testnet_dsl;
use crate::schema::mainnet_future_entry::dsl as mainnet_dsl;
use crate::schema::pragma_devnet_future_entry::dsl as pragma_devnet_dsl;

use bigdecimal::ToPrimitive;
use diesel::ExpressionMethods;
Expand Down Expand Up @@ -54,13 +53,6 @@ pub async fn process_data_by_pair(
.first(&mut conn)
.await?
}
NetworkName::PragmaDevnet => {
pragma_devnet_dsl::pragma_devnet_future_entry
.filter(pragma_devnet_dsl::pair_id.eq(pair.clone()))
.order(pragma_devnet_dsl::block_timestamp.desc())
.first(&mut conn)
.await?
}
};

tracing::info!("Processing data for pair: {}", pair);
Expand Down Expand Up @@ -145,14 +137,6 @@ pub async fn process_data_by_pair_and_source(
.first(&mut conn)
.await?
}
NetworkName::PragmaDevnet => {
pragma_devnet_dsl::pragma_devnet_future_entry
.filter(pragma_devnet_dsl::pair_id.eq(pair))
.filter(pragma_devnet_dsl::source.eq(src))
.order(pragma_devnet_dsl::block_timestamp.desc())
.first(&mut conn)
.await?
}
};

let network_env = &config.network_str();
Expand Down Expand Up @@ -205,13 +189,6 @@ pub async fn process_data_by_publisher(
.first(&mut conn)
.await?
}
NetworkName::PragmaDevnet => {
pragma_devnet_dsl::pragma_devnet_future_entry
.filter(pragma_devnet_dsl::publisher.eq(publisher.clone()))
.order(pragma_devnet_dsl::block_timestamp.desc())
.first(&mut conn)
.await?
}
};

tracing::info!("Processing data for publisher: {}", publisher);
Expand Down
1 change: 0 additions & 1 deletion src/processing/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pub mod api;
pub mod common;
pub mod dispatch;
pub mod future;
pub mod spot;
pub mod vrf;
31 changes: 0 additions & 31 deletions src/processing/spot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::monitoring::{
};

use crate::schema::mainnet_spot_entry::dsl as mainnet_dsl;
use crate::schema::pragma_devnet_spot_entry::dsl as pragma_devnet_dsl;
use crate::schema::spot_entry::dsl as testnet_dsl;

use bigdecimal::ToPrimitive;
Expand Down Expand Up @@ -56,13 +55,6 @@ pub async fn process_data_by_pair(
.first(&mut conn)
.await?
}
NetworkName::PragmaDevnet => {
pragma_devnet_dsl::pragma_devnet_spot_entry
.filter(pragma_devnet_dsl::pair_id.eq(pair.clone()))
.order(pragma_devnet_dsl::block_timestamp.desc())
.first(&mut conn)
.await?
}
};

tracing::info!("Processing data for pair: {}", pair);
Expand Down Expand Up @@ -134,14 +126,6 @@ pub async fn process_data_by_pair_and_source(
.first(&mut conn)
.await?
}
NetworkName::PragmaDevnet => {
pragma_devnet_dsl::pragma_devnet_spot_entry
.filter(pragma_devnet_dsl::pair_id.eq(pair))
.filter(pragma_devnet_dsl::source.eq(src))
.order(pragma_devnet_dsl::block_timestamp.desc())
.first(&mut conn)
.await?
}
NetworkName::Mainnet => {
mainnet_dsl::mainnet_spot_entry
.filter(mainnet_dsl::pair_id.eq(pair))
Expand Down Expand Up @@ -195,13 +179,6 @@ pub async fn process_data_by_publisher(
.first(&mut conn)
.await?
}
NetworkName::PragmaDevnet => {
pragma_devnet_dsl::pragma_devnet_spot_entry
.filter(pragma_devnet_dsl::publisher.eq(publisher.clone()))
.order(pragma_devnet_dsl::block_timestamp.desc())
.first(&mut conn)
.await?
}
NetworkName::Mainnet => {
mainnet_dsl::mainnet_spot_entry
.filter(mainnet_dsl::publisher.eq(publisher.clone()))
Expand Down Expand Up @@ -279,14 +256,6 @@ pub async fn get_price_deviation_for_source_from_chain(
.first(&mut conn)
.await?
}
NetworkName::PragmaDevnet => {
pragma_devnet_dsl::pragma_devnet_spot_entry
.filter(pragma_devnet_dsl::pair_id.eq(pair))
.filter(pragma_devnet_dsl::source.eq(source))
.order(pragma_devnet_dsl::block_timestamp.desc())
.first(&mut conn)
.await?
}
NetworkName::Mainnet => {
mainnet_dsl::mainnet_spot_entry
.filter(mainnet_dsl::pair_id.eq(pair))
Expand Down
94 changes: 0 additions & 94 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,6 @@ diesel::table! {
}
}

diesel::table! {
pragma_devnet_future_entry (data_id) {
#[max_length = 255]
network -> Varchar,
#[max_length = 255]
pair_id -> Varchar,
#[max_length = 255]
data_id -> Varchar,
#[max_length = 255]
block_hash -> Varchar,
block_number -> Int8,
block_timestamp -> Timestamp,
#[max_length = 255]
transaction_hash -> Varchar,
price -> Numeric,
timestamp -> Timestamp,
#[max_length = 255]
publisher -> Varchar,
#[max_length = 255]
source -> Varchar,
volume -> Numeric,
expiration_timestamp -> Nullable<Timestamp>,
_cursor -> Int8,
}
}

diesel::table! {
mainnet_future_entry (data_id) {
#[max_length = 255]
Expand Down Expand Up @@ -127,31 +101,6 @@ diesel::table! {
}
}

diesel::table! {
pragma_devnet_spot_entry (data_id) {
#[max_length = 255]
network -> Varchar,
#[max_length = 255]
pair_id -> Varchar,
#[max_length = 255]
data_id -> Varchar,
#[max_length = 255]
block_hash -> Varchar,
block_number -> Int8,
block_timestamp -> Timestamp,
#[max_length = 255]
transaction_hash -> Varchar,
price -> Numeric,
timestamp -> Timestamp,
#[max_length = 255]
publisher -> Varchar,
#[max_length = 255]
source -> Varchar,
volume -> Numeric,
_cursor -> Int8,
}
}

diesel::table! {
mainnet_spot_checkpoints (pair_id) {
#[max_length = 255]
Expand Down Expand Up @@ -200,30 +149,6 @@ diesel::table! {
}
}

diesel::table! {
pragma_devnet_spot_checkpoints (data_id) {
#[max_length = 255]
network -> Varchar,
#[max_length = 255]
pair_id -> Varchar,
#[max_length = 255]
data_id -> Varchar,
#[max_length = 255]
block_hash -> Varchar,
block_number -> Int8,
block_timestamp -> Timestamp,
#[max_length = 255]
transaction_hash -> Varchar,
price -> Numeric,
#[max_length = 255]
sender_address -> Varchar,
aggregation_mode -> Numeric,
_cursor -> Int8,
timestamp -> Timestamp,
nb_sources_aggregated -> Numeric,
}
}

diesel::table! {
vrf_requests (data_id) {
#[max_length = 255]
Expand Down Expand Up @@ -283,31 +208,12 @@ diesel::table! {
}
}

diesel::table! {
pragma_devnet_dispatch_event (block_number) {
#[max_length = 255]
network -> Varchar,
#[max_length = 255]
block_hash -> Varchar,
block_number -> Int8,
block_timestamp -> Timestamp,
#[max_length = 255]
transaction_hash -> Varchar,
hyperlane_message_nonce -> Numeric,
feeds_updated -> Nullable<Array<Text>>,
_cursor -> Int8,
}
}

diesel::allow_tables_to_appear_in_same_query!(
mainnet_future_entry,
mainnet_spot_checkpoints,
mainnet_spot_entry,
future_entry,
spot_checkpoints,
spot_entry,
pragma_devnet_future_entry,
pragma_devnet_spot_entry,
pragma_devnet_spot_checkpoints,
vrf_requests,
);

0 comments on commit 3f9a582

Please sign in to comment.