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

Max contracts is currently limited by heap size #8

Closed
tomjohn1028 opened this issue Jan 27, 2021 · 3 comments
Closed

Max contracts is currently limited by heap size #8

tomjohn1028 opened this issue Jan 27, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request V1

Comments

@tomjohn1028
Copy link
Collaborator

const MAX_CONTRACTS: usize = 10;

We currently have a limit on the max contracts because of how we serialize and deserialize the entire OptionMarket with option_writer_registry included.

Based on the Solana Account data limits (~10MB as of this writing) and OptionMarket should really be able to hold > 30,000 OptionWriters in its registry. Allowing for that many open option contracts for a given market.

To get closer to this 30,000 limit for V1, we will need to avoid loading the entire registry into memory and some how shard / parse it more efficiently. Looping may prove to be an issue because of the Solana runtime compute limits.

@tomjohn1028 tomjohn1028 added enhancement New feature or request V1 labels Jan 27, 2021
@tomjohn1028
Copy link
Collaborator Author

@Taylor123 locally I had the tests pass at 1,000 and 10,000, but got a stack overflow at const MAX_CONTRACTS: usize = 30000;

Might have to do some more stress testing on the limitations.

@Taylor123 Taylor123 added the on hold Paused until all high priority issues are resolved label Feb 16, 2021
@tomjohn1028 tomjohn1028 removed the on hold Paused until all high priority issues are resolved label Mar 16, 2021
@tomjohn1028 tomjohn1028 self-assigned this Mar 16, 2021
@tomjohn1028
Copy link
Collaborator Author

  • add integration test for removing an option writer at the end of the registry (compute limitations is the worry)
  • try changing market.rs:142 to use a slice

@tomjohn1028
Copy link
Collaborator Author

This is obsolete after the refactor to remove OptionWriterRegistry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request V1
Projects
None yet
Development

No branches or pull requests

2 participants