Skip to content

Conversation

cctdaniel
Copy link
Contributor

@cctdaniel cctdaniel commented Feb 4, 2024

TODO: support market_hours when the on-chain component is done

Copy link

vercel bot commented Feb 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Visit Preview Feb 28, 2024 7:15am
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Feb 28, 2024 7:15am

@cctdaniel cctdaniel marked this pull request as draft February 4, 2024 13:13
Comment on lines +139 to +153
filters: Some(vec![RpcFilterType::Memcmp(Memcmp::new(
0, // offset
MemcmpEncodedBytes::Bytes(b"PAS1".to_vec()), // bytes
))]),
Copy link
Contributor Author

@cctdaniel cctdaniel Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getting

warning: use of deprecated field `solana_client::rpc_filter::Memcmp::offset`: Field will be made private in future. Please use a constructor method instead.
   --> src/network/pythnet.rs:140:13
    |
140 |             offset:   0,
    |             ^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated field `solana_client::rpc_filter::Memcmp::bytes`: Field will be made private in future. Please use a constructor method instead.
   --> src/network/pythnet.rs:141:13
    |
141 |             bytes:    MemcmpEncodedBytes::Bytes(b"PAS1".to_vec()),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated field `solana_client::rpc_filter::Memcmp::encoding`: Field has no server-side effect. Specify encoding with `MemcmpEncodedBytes` variant instead. Field will be made private in future. Please use a constructor method instead.
   --> src/network/pythnet.rs:142:13
    |
142 |             encoding: None,
    |             ^^^^^^^^^^^^^^

possibly due to upgrading solana packages hence the change here to fix the warnings

the new Memcmp::new method does not require an encoding parameter, so we can omit it

impl Memcmp {
    pub fn new(offset: usize, encoded_bytes: MemcmpEncodedBytes) -> Self {
        Self {
            offset,
            bytes: encoded_bytes,
            encoding: None,
        }
    }
}

@cctdaniel cctdaniel marked this pull request as ready for review February 6, 2024 06:59
@@ -52,7 +53,7 @@ impl From<PriceIdInput> for PriceIdentifier {

type Base64String = String;

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by refactors

@@ -284,7 +294,7 @@ pub async fn spawn(opts: RunOptions, state: Arc<State>) -> Result<()> {
})
};

let task_guadian_watcher = {
let task_guardian_watcher = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo fix

@cctdaniel cctdaniel force-pushed the hermes-v2-price-feeds-metadata branch from a5db5b7 to 9a451c4 Compare February 16, 2024 03:18
@cctdaniel cctdaniel force-pushed the hermes-v2-price-feeds-metadata branch from dc38d38 to a828c26 Compare February 17, 2024 12:38
Comment on lines +386 to +392
// Split product keys into chunks of 150 to avoid too many open files error (error trying to connect: tcp open error: Too many open files (os error 24))
for product_keys_chunk in mapping_acct
.products
.iter()
.filter(|&prod_pkey| *prod_pkey != Pubkey::default())
.collect::<Vec<_>>()
.chunks(150)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried with 200 but still intermittently getting os error 24 so went with 150 to be safe

@cctdaniel cctdaniel merged commit 9fd9e17 into main Feb 28, 2024
@cctdaniel cctdaniel deleted the hermes-v2-price-feeds-metadata branch February 28, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants