-
Notifications
You must be signed in to change notification settings - Fork 873
#6853 Adding store tests for data column pruning #7228
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
base: unstable
Are you sure you want to change the base?
Conversation
@@ -3205,6 +3210,9 @@ async fn deneb_prune_blobs_no_finalization() { | |||
Some(deneb_fork_slot) | |||
); | |||
check_blob_existence(&harness, Slot::new(0), harness.head_slot(), true); |
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.
You might have already noticed, this test runs multiple times on CI for all forks.
The code that reads FORK_NAME
from env var is here:
lighthouse/beacon_node/beacon_chain/src/test_utils.rs
Lines 193 to 206 in 6f31d44
/// Return a `ChainSpec` suitable for test usage. | |
/// | |
/// If the `fork_from_env` feature is enabled, read the fork to use from the FORK_NAME environment | |
/// variable. Otherwise use the default spec. | |
pub fn test_spec<E: EthSpec>() -> ChainSpec { | |
let mut spec = if cfg!(feature = "fork_from_env") { | |
let fork_name = std::env::var(FORK_NAME_ENV_VAR).unwrap_or_else(|e| { | |
panic!( | |
"{} env var must be defined when using fork_from_env: {:?}", | |
FORK_NAME_ENV_VAR, e | |
) | |
}); | |
let fork = ForkName::from_str(fork_name.as_str()).unwrap(); | |
fork.make_genesis_spec(E::default_spec()) |
So this assertion would fail when FORK_NAME=fulu
, because we don't store any blobs from since the Fulu fork. I think it might be cleaner to start a separate test that verifies data column pruning instead of having to add conditions on every assertion.
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.
Sorry, I thought we still keep the blobs in Fulu. Changes have been made respectively. Is there a reason that we no longer keep blobs? Is it to save the storage?
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.
Yes, that's one of the reasons - but also it's no longer useful to the CL from Fulu.
- The network form of blobs on the beacon chain is
DataColumnSidecar
, we'll stop usingBlobSidecar
on p2p from Fulu slots. - Another reason is fullnodes will no longer have blobs, but just samples (DataColumns)
@@ -3337,6 +3348,9 @@ async fn deneb_prune_blobs_margin_test(margin: u64) { | |||
Some(deneb_fork_slot) | |||
); | |||
check_blob_existence(&harness, Slot::new(1), harness.head_slot(), true); | |||
if check_data_columns { | |||
check_data_column_existence(&harness, Slot::new(1), harness.head_slot(), true); | |||
} |
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.
Same as above, when FORK_NAME=fulu
, check_blob_existence
would fail already before hitting this line.
Thanks for the PR @SunnysidedJ ! Please see my comments above and let me know if it's unclear or if you have any questions! |
Major changes:
|
|
||
// Finalize to epoch 5. | ||
// Finalize to epoch 5 (Deneb). | ||
harness |
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.
Returns a stack overflow here. Seems like using the spec with customization is not working properly. I think we need a separate issue for this. Any thoughts?
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.
(The test fails at the unstable branch as well)
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.
Yeah this has been a known issue for a while, so these tests are always run with --release
. This is because the c-kzg
library forces us to initialise a blob-sized array. I think either moving to rust-eth-kzg
or perhaps updating to the latest c-kzg
library would resolve this (I haven't checked)
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.
I see. I will try running them either on Windows or Linux machine for the completion of this task for now
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.
This should work on macOS if you run with --release
or you can run the debug test with this env var: RUST_MIN_STACK=4194304
(setting a higher minimum stack size)
@@ -3282,6 +3290,56 @@ async fn deneb_prune_blobs_fork_boundary() { | |||
assert_eq!(store.get_blob_info().oldest_blob_slot, Some(pruned_slot)); | |||
check_blob_existence(&harness, Slot::new(0), pruned_slot - 1, false); | |||
check_blob_existence(&harness, pruned_slot, harness.head_slot(), true); | |||
|
|||
// Finalize to epoch 11 (Fulu) |
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 logic to test that blobs get removed once we reach Fulu fork, but couldn't test it due to the stack overflow issue above
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.
ah yeah, could you run it with --release
, unfortunately we haven't been able to tackle that issue yet.
let num_blocks = E::slots_per_epoch() * 7; | ||
|
||
// Finalize to epoch 5. | ||
harness |
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.
The same issue as above
When I enable Fulu and try blob pruning, the blobs aren't pruned correctly. It'd be appreciated if you could have a look on the commit that reproduces the problem: SunnysidedJ@6217cf9 |
Some required checks have failed. Could you please take a look @SunnysidedJ? 🙏 |
Hi @SunnysidedJ, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time. |
…l-prune-store-tests
I'm going to take a look at the fulu blob pruning test issues |
The test is now passing. The reason it was failing was two fold:
I've added an intermediary step to fork to electra and run some checks there. Not sure if theres any additional checks we want to make in this test. |
Some required checks have failed. Could you please take a look @SunnysidedJ? 🙏 |
ah still need to fix one other test, working on that now |
a634758 we werent updating data column info after pruning. |
All required checks have passed and there are no merge conflicts. This pull request may now be ready for another review. |
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.
Sorry, I have been busy with other things and couldn't take much attention to this PR. Thank you for taking a deeper look and unblocking some of the issues I faced with the test cases. Please let me know if you have worked further since last commit and if this needs to be done with priority so that I can clearly understand the status. I will continue working on this whenever I'm available!
harness | ||
.extend_chain( | ||
blocks_to_fulu as usize, | ||
blocks_to_electra as usize, |
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.
Shouldn't this be 13 (7 + 6 epochs in total)?
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.
yes the chain was extended to epoch 13, but the finalized epoch is at 11, I've added some comments here:
06431e4 to make things a bit clearer
// Fulu fork epoch | ||
let oldest_slot = fulu_fork_epoch.start_slot(E::slots_per_epoch()); | ||
// Blobs should not exist | ||
check_blob_existence(&harness, oldest_slot, harness.head_slot(), false); |
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.
Need to also check that blobs don't exist from Slot 0
check_blob_existence(&harness, pruned_slot, electra_first_slot - 1, true); | ||
// Check that blobs exist from electra to the current head | ||
check_blob_existence(&harness, electra_first_slot, harness.head_slot(), true); | ||
// Finalize to epoch 15 (Fulu) |
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.
to 17?
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.
weve extended the chain to 17 but finalized epoch 15 (added some comments for clarity)
// Blobs should not exist | ||
check_blob_existence(&harness, oldest_slot, harness.head_slot(), false); | ||
// Data columns should exist | ||
check_data_column_existence(&harness, oldest_slot, harness.head_slot(), true); |
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.
Need to also check that columns don't exist from Slot 0
let oldest_slot = data_availability_boundary.start_slot(E::slots_per_epoch()); | ||
assert_eq!(store.get_blob_info().oldest_blob_slot, Some(oldest_slot)); | ||
// Blobs should exist | ||
check_blob_existence(&harness, oldest_slot, harness.head_slot(), true); |
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.
Need to also check that blobs don't exist from Slot 0
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.
Pulled the changes and I'm looking into why Slot 40 exists when I call check_blob_existence(&harness, Slot::new(0), oldest_slot - 1, false)
All required checks have passed and there are no merge conflicts. This pull request may now be ready for another review. |
Issue Addressed
#6853 Update store tests to cover data column pruning
Proposed Changes
Created a helper function
check_data_column_existence
which is a copy ofcheck_blob_existence
but checking data columns instead.The helper function is then used to check whether data columns are also pruned when blobs are pruned if PeerDAS is enabled.
Additional Info
.