Skip to content

Conversation

@ali-behjati
Copy link
Collaborator

@ali-behjati ali-behjati commented May 13, 2024

  • Remove rent check because it costs 500CU (+10% of upd_price without aggregate) and it really is not needed.
  • Use abs() on checking confidence threshold because it's incredibly slow on negative prices (2000CU). We don't have negative prices but will guard us in the future.

- Remove rent check on hot code path because it costs 500CU and
  add/remove instructions take care of it.
- Use abs() on checking confidence threshold because it's incredibly
  slow on negative prices (2000CU). We don't have negative prices
  but will guard us in the future.
@ali-behjati ali-behjati requested review from Reisen, guibescos and jayantk and removed request for guibescos and jayantk May 13, 2024 15:25
jayantk
jayantk previously approved these changes May 13, 2024

check_valid_funding_account(funding_account)?;
check_valid_writable_account(program_id, price_account)?;
check_valid_writable_account_without_rent_check(program_id, price_account)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

mmmmm what about removing the rent check everywhere? I think the check is not useful anywhere

Copy link
Contributor

Choose a reason for hiding this comment

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

this is introducing more complexity

@ali-behjati ali-behjati force-pushed the optimize/optimize-checks branch from d8be0a7 to 2996b13 Compare May 13, 2024 18:36
@ali-behjati ali-behjati merged commit 9acf172 into main May 13, 2024
@ali-behjati ali-behjati deleted the optimize/optimize-checks branch May 13, 2024 18:50
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.

4 participants