-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[indexer-alt] pruning tests for pipelines that depend on CpSequenceNumbers
for tx intervals
#20744
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
e8252bf
to
040df88
Compare
(temp_db, temp_dir) | ||
} | ||
|
||
async fn setup_test_env( |
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 should extend the current Indexer::new_for_testing() into a simple test indexer builder.
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.
admittedly, I was a little lazy and skipped this ... but can circle back
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 seems to be doing something that's specific to sui-indexer-alt
(because it uses an IndexerConfig
) whereas new_for_testing
is part of the framework. Could we split up start_indexer
so that it accepts an instance of Indexer
to populate that would help make best use of both things?
9fd872e
to
5ef7c04
Compare
72e140e
to
794ec20
Compare
da186e3
to
491e105
Compare
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.
Some high level comments/themes:
- The
derive(Default)
s should be unnecessary on all the pipelines. - Can we standardise the name on
cp_sequence_numbers
instead ofcp_mapping
? (This may no longer be relevant after applying the comment aboutderive(Default)
). - In hindsight (and for next time) it would have been nice to put this out a pipeline at a time (break up the PR) -- that way we could identify common patterns like the above more quickly and avoid lots of fix ups.
- It would be really great if we could find a way to augment
TestCheckpointDataBuilder
so that we could use it for the epoch pipeline tests as well.
crates/sui-indexer-alt-framework/src/handlers/cp_sequence_numbers.rs
Outdated
Show resolved
Hide resolved
crates/sui-indexer-alt/src/lib.rs
Outdated
@@ -44,6 +44,7 @@ pub async fn start_indexer( | |||
// TODO: There is probably a better way to handle this. | |||
// For instance, we could also pass in dummy genesis data in the benchmark mode. | |||
with_genesis: bool, | |||
cancel: Option<CancellationToken>, |
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 really, really dislike the pattern of making the CancellationToken
optional and creating a new one if one is not supplied because it makes it difficult to track where a given token originates from -- this was a source of pain for us multiple times in the previous indexer implementation, where we would forget to replace a None
with a Some(...)
and we had cancellation token "split-brain".
If the indexer needs to share space with another service, pass the responsibility of creating the cancellation token unequivocally up to the parent.
cancel: Option<CancellationToken>, | |
cancel: CancellationToken, |
(temp_db, temp_dir) | ||
} | ||
|
||
async fn setup_test_env( |
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 seems to be doing something that's specific to sui-indexer-alt
(because it uses an IndexerConfig
) whereas new_for_testing
is part of the framework. Could we split up start_indexer
so that it accepts an instance of Indexer
to populate that would help make best use of both things?
491e105
to
44f663f
Compare
CpSequenceNumbers
for tx intervals
44f663f
to
814dec7
Compare
814dec7
to
2a558e4
Compare
Looks like this would require an advance epoch transaction, which has the system state as an output object, added to the checkpoint. I've got most of this down, except the system state part ... worst case scenario, I think we can spin up simulacrum, take the VerifiedCheckpoint and convert it into CheckpointData to feed to the pipeline? But I think I can work something out. Will do so in a follow-up PR |
it's a bit easier for |
Description
pruning tests for pipelines that depend on
CpSequenceNumbers
for tx intervalsTest plan
All tests!
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.