Skip to content

[Merged by Bors] - Customisable shuffling cache size #4081

Closed
AgeManning wants to merge 16 commits intosigp:unstablefrom
AgeManning:rp-cache
Closed

[Merged by Bors] - Customisable shuffling cache size #4081
AgeManning wants to merge 16 commits intosigp:unstablefrom
AgeManning:rp-cache

Conversation

@AgeManning
Copy link
Copy Markdown
Member

This PR enables the user to adjust the shuffling cache size.

This is useful for some HTTP API requests which require re-computing old shufflings. This PR currently optimizes the
beacon/states/{state_id}/committees HTTP API by first checking the cache before re-building shuffling.

If the shuffling is set to a non-default value, then the HTTP API request will also fill the cache when as it constructs new shufflings.

If the CLI flag is not present or the value is set to the default of 16 the default behaviour is observed.

@AgeManning AgeManning added ready-for-review The code is ready for review v4.0.0 Mainnet Capella release expected late March 2023 labels Mar 14, 2023
Copy link
Copy Markdown
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Looks correct, I just had a few stylistic/testing nitpicks

It would be good to add two CLI regression tests in lighthouse/tests/beacon_node.rs, testing the default value and the value after applying the flag (should also use run_with_zero_port for these tests).

@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Mar 17, 2023
@AgeManning AgeManning added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Mar 20, 2023
@michaelsproul
Copy link
Copy Markdown
Member

@AgeManning I just pushed a commit to optimise the regular case (reading from the head state) to remove the .into_owned(): d7f6da6.

I also fixed the indentation of those format strings

@AgeManning
Copy link
Copy Markdown
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Mar 21, 2023
This PR enables the user to adjust the shuffling cache size.

This is useful for some HTTP API requests which require re-computing old shufflings. This PR currently optimizes the
beacon/states/{state_id}/committees HTTP API by first checking the cache before re-building shuffling.

If the shuffling is set to a non-default value, then the HTTP API request will also fill the cache when as it constructs new shufflings.

If the CLI flag is not present or the value is set to the default of 16 the default behaviour is observed.


Co-authored-by: Michael Sproul <michael@sigmaprime.io>
@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Mar 21, 2023
@michaelsproul
Copy link
Copy Markdown
Member

lets do a batch

bors r-

@bors
Copy link
Copy Markdown

bors bot commented Mar 21, 2023

Canceled.

@michaelsproul
Copy link
Copy Markdown
Member

bors r+

bors bot pushed a commit that referenced this pull request Mar 21, 2023
This PR enables the user to adjust the shuffling cache size.

This is useful for some HTTP API requests which require re-computing old shufflings. This PR currently optimizes the
beacon/states/{state_id}/committees HTTP API by first checking the cache before re-building shuffling.

If the shuffling is set to a non-default value, then the HTTP API request will also fill the cache when as it constructs new shufflings.

If the CLI flag is not present or the value is set to the default of 16 the default behaviour is observed.


Co-authored-by: Michael Sproul <michael@sigmaprime.io>
@bors bors bot changed the title Customisable shuffling cache size [Merged by Bors] - Customisable shuffling cache size Mar 21, 2023
@bors bors bot closed this Mar 21, 2023
Woodpile37 pushed a commit to Woodpile37/lighthouse that referenced this pull request Jan 6, 2024
This PR enables the user to adjust the shuffling cache size.

This is useful for some HTTP API requests which require re-computing old shufflings. This PR currently optimizes the
beacon/states/{state_id}/committees HTTP API by first checking the cache before re-building shuffling.

If the shuffling is set to a non-default value, then the HTTP API request will also fill the cache when as it constructs new shufflings.

If the CLI flag is not present or the value is set to the default of 16 the default behaviour is observed.


Co-authored-by: Michael Sproul <michael@sigmaprime.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge This PR is ready to merge. v4.0.0 Mainnet Capella release expected late March 2023

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants