Conversation
| #define PC_PUBKEY_SIZE_64 (PC_PUBKEY_SIZE/sizeof(uint64_t)) | ||
| #define PC_MAP_TABLE_SIZE 640 | ||
| #define PC_MAX_PUBLISHERS 256 | ||
| #define PC_MAX_SYMBOLS 1024 |
There was a problem hiding this comment.
what we do if we exceed this numbers?
There was a problem hiding this comment.
That sounds like a Pythnet v2 problem anyway
There was a problem hiding this comment.
The program doesn't allow exceeding these numbers, we will probably face a lot of issues if we decide to increase these numbers. We are hoping to go to pythnet V2 before we need to increase these numbers. From the trasactions limit that we currently have, i don't think this will an issue.
But if you think there is a chance that we exceed these number before pythnet v2, we better address it now.
program/rust/src/accounts/score.rs
Outdated
| pub publisher_permissions: [[u64; PC_MAX_SYMBOLS_64 as usize]; PC_MAX_PUBLISHERS as usize], | ||
| pub scores: [f64; PC_MAX_PUBLISHERS as usize], | ||
| pub publishers: [Pubkey; PC_MAX_PUBLISHERS as usize], | ||
| pub symbols: [Pubkey; PC_MAX_SYMBOLS as usize], |
There was a problem hiding this comment.
We actually already have something similar to this (a list of all symbols) in the mapping account but the product accounts (and not the price accounts) are listed there
program/rust/src/accounts/score.rs
Outdated
| self.publisher_permissions[x][y / 64] |= 1 << (y % 64); | ||
| } else { | ||
| self.publisher_permissions[x][y / 64] &= !(1 << (y % 64)); | ||
| } |
There was a problem hiding this comment.
get_publisher_permission and set_publisher_permission could almost be in their own struct PermissionTable, that we can proptest
There was a problem hiding this comment.
I will try this at some point to see how much it will change the program size, my current guess is that it will increase it.
program/rust/src/accounts/score.rs
Outdated
| pub symbols: [Pubkey; PC_MAX_SYMBOLS as usize], | ||
| } | ||
|
|
||
| impl PublisherScoresAccount { |
There was a problem hiding this comment.
This struct is begging for a prop test like in this https://github.com/pyth-network/pyth-client/blob/main/program/rust/src/tests/test_twap.rs#L50
| @@ -93,139 +102,26 @@ pub fn add_publisher( | |||
| price_data.num_ += 1; | |||
|
|
|||
| // Sort the publishers in the list | |||
No description provided.