-
Notifications
You must be signed in to change notification settings - Fork 774
test: simplify process_blocks test-loop setup + enable spice #15630
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,10 @@ impl<'a> TestLoopNode<'a> { | |
| self.client().chain.head().unwrap() | ||
| } | ||
|
|
||
| pub fn final_head(&self) -> Arc<Tip> { | ||
| self.client().chain.final_head().unwrap() | ||
| } | ||
|
|
||
| pub fn last_executed(&self) -> Arc<Tip> { | ||
| if ProtocolFeature::Spice.enabled(PROTOCOL_VERSION) { | ||
| self.client().chain.chain_store().spice_execution_head().unwrap() | ||
|
|
@@ -423,6 +427,13 @@ impl<'a> NodeRunner<'a> { | |
| self.run_until(|node| node.head().height >= height, timeout); | ||
| } | ||
|
|
||
| pub fn run_until_final_head_height(&mut self, height: BlockHeight) { | ||
| let initial_height = self.final_head().height; | ||
| let height_diff = height.saturating_sub(initial_height) as usize; | ||
| let timeout = self.calculate_block_distance_timeout(height_diff); | ||
| self.run_until(|node| node.final_head().height >= height, timeout); | ||
| } | ||
|
Comment on lines
+430
to
+435
|
||
|
|
||
| pub fn run_until_executed_height(&mut self, height: BlockHeight) { | ||
| let initial_height = self.last_executed().height; | ||
| let height_diff = height.saturating_sub(initial_height) as usize; | ||
|
|
@@ -596,6 +607,10 @@ impl<'a> NodeRunner<'a> { | |
| self.client().chain.head().unwrap() | ||
| } | ||
|
|
||
| fn final_head(&self) -> Arc<Tip> { | ||
| self.client().chain.final_head().unwrap() | ||
| } | ||
|
|
||
| fn last_executed(&self) -> Arc<Tip> { | ||
| if ProtocolFeature::Spice.enabled(PROTOCOL_VERSION) { | ||
| self.client().chain.chain_store().spice_execution_head().unwrap() | ||
|
|
||
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 refactor changes the shard layout version used by the test: the previous setup used
ShardLayout::multi_shard(4, 3), whileTestLoopBuilder::num_shards(4)currently hard-codesShardLayout::multi_shard(.., 1). If the test is meant to exercise shard-layout version 3 behavior (or keep semantics identical while simplifying setup), consider using.shard_layout(ShardLayout::multi_shard(4, 3))here (or extendingnum_shardsto accept a version).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 don't think version matters for this test.