-
Notifications
You must be signed in to change notification settings - Fork 781
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
check the da cache and the attester cache in responding to RPC requests #5138
check the da cache and the attester cache in responding to RPC requests #5138
Conversation
@@ -45,7 +46,7 @@ pub struct ProcessingComponents<E: EthSpec> { | |||
/// Blobs required for a block can only be known if we have seen the block. So `Some` here | |||
/// means we've seen it, a `None` means we haven't. The `kzg_commitments` value helps us figure | |||
/// out whether incoming blobs actually match the block. | |||
pub block_commitments: Option<KzgCommitments<E>>, | |||
pub block: Option<Arc<SignedBeaconBlock<E>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is now retaining full blocks, might be good to add a metric to track processing_cache
size in case it ever leaks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a few more metrics related metrics as well 0cf408f
@@ -1141,10 +1141,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> { | |||
>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably rename this function get_blocks_checking_caches
or something along these lines.. perhaps we should come up with a unified way of referring to these two caches.. idk if we'd just call them "early caches" or something..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok feedback so far has been addressed |
@@ -19,7 +19,7 @@ use types::{ | |||
}; | |||
|
|||
#[derive(PartialEq)] | |||
pub enum CheckEarlyAttesterCache { | |||
pub enum CheckCaches { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why not use bool
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually try to use enums over bools when we need to pass something into a function. If you end up with two bools as params it can be ambiguous
…ts (#5138) Squashed commit of the following: commit a6144f6 Author: realbigsean <seananderson33@GMAIL.com> Date: Thu Feb 15 15:48:07 2024 -0500 Revert "make rustup update run on the runners" This reverts commit d097e9b. commit d097e9b Author: realbigsean <seananderson33@GMAIL.com> Date: Thu Feb 15 15:16:08 2024 -0500 make rustup update run on the runners commit 1be438e Merge: 597e05f 256d904 Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:55:45 2024 -0500 Merge branch 'unstable' of https://github.com/sigp/lighthouse into check-da-cache-in-rpc-response commit 597e05f Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:54:44 2024 -0500 rename early attester cache method commit 0cf408f Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:53:47 2024 -0500 add da cache metrics commit 2f6cf41 Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 18:31:32 2024 -0500 update comment commit 0512420 Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 18:25:15 2024 -0500 use the processing cache instead commit 66b911f Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 15:52:42 2024 -0500 check the da cache and the attester cache in responding to RPC requests
…ts (#5138) Squashed commit of the following: commit a6144f6 Author: realbigsean <seananderson33@GMAIL.com> Date: Thu Feb 15 15:48:07 2024 -0500 Revert "make rustup update run on the runners" This reverts commit d097e9b. commit d097e9b Author: realbigsean <seananderson33@GMAIL.com> Date: Thu Feb 15 15:16:08 2024 -0500 make rustup update run on the runners commit 1be438e Merge: 597e05f 256d904 Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:55:45 2024 -0500 Merge branch 'unstable' of https://github.com/sigp/lighthouse into check-da-cache-in-rpc-response commit 597e05f Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:54:44 2024 -0500 rename early attester cache method commit 0cf408f Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:53:47 2024 -0500 add da cache metrics commit 2f6cf41 Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 18:31:32 2024 -0500 update comment commit 0512420 Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 18:25:15 2024 -0500 use the processing cache instead commit 66b911f Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 15:52:42 2024 -0500 check the da cache and the attester cache in responding to RPC requests
…ts (#5138) Squashed commit of the following: commit a6144f6 Author: realbigsean <seananderson33@GMAIL.com> Date: Thu Feb 15 15:48:07 2024 -0500 Revert "make rustup update run on the runners" This reverts commit d097e9b. commit d097e9b Author: realbigsean <seananderson33@GMAIL.com> Date: Thu Feb 15 15:16:08 2024 -0500 make rustup update run on the runners commit 1be438e Merge: 597e05f 256d904 Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:55:45 2024 -0500 Merge branch 'unstable' of https://github.com/sigp/lighthouse into check-da-cache-in-rpc-response commit 597e05f Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:54:44 2024 -0500 rename early attester cache method commit 0cf408f Author: realbigsean <seananderson33@GMAIL.com> Date: Wed Feb 14 21:53:47 2024 -0500 add da cache metrics commit 2f6cf41 Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 18:31:32 2024 -0500 update comment commit 0512420 Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 18:25:15 2024 -0500 use the processing cache instead commit 66b911f Author: realbigsean <seananderson33@GMAIL.com> Date: Mon Jan 29 15:52:42 2024 -0500 check the da cache and the attester cache in responding to RPC requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
So we're now serving blocks as soon as it passes gossip validation and cached in da cache, which I think is spec compliant 👍
@Mergifyio queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at f214729 |
Issue Addressed
Resolves #5093
Proposed Changes
This does not currently check if a block exists in the DA cache's overflow to disk, I'm sort of thinking that's overkill. But can add it in.I decided to use theprocessing_cache
because this includes payloads we haven't verified. This is technically correct according to the spec