Skip to content
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

Zingo sync reorg logic #1348

Merged
merged 21 commits into from
Nov 22, 2024
Merged

Conversation

Oscar-Pepper
Copy link
Contributor

atop #1343

@zancas
Copy link
Member

zancas commented Nov 19, 2024

I clicked update branch.

@Oscar-Pepper Oscar-Pepper marked this pull request as ready for review November 21, 2024 07:26
@zancas
Copy link
Member

zancas commented Nov 21, 2024

I noticed that CI was failing, and that this branch was out of date, so I clicked "Update Branch".

@Oscar-Pepper
Copy link
Contributor Author

I noticed that CI was failing, and that this branch was out of date, so I clicked "Update Branch".

Oh I forgot to run clippy! Ok fixing now

@@ -31,7 +31,7 @@ async fn sync_mainnet_test() {
let mut lightclient = LightClient::create_from_wallet_base_async(
WalletBase::from_string(HOSPITAL_MUSEUM_SEED.to_string()),
&config,
2_611_700,
2_715_150,
Copy link
Member

@zancas zancas Nov 22, 2024

Choose a reason for hiding this comment

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

If this is, for example a NU height, or protocol epoch, I think it would be best to import the most general relevant constant and use it explicitly.

If it's an HMS-specific birthday, then maybe we should associate it with that seed in some ergonomic way, so that e.g. other tests can get the seed-associated bday?

If it's not, for example if it's a birthday that's idiosyncratic to this test, then let's throw some kind of comment on it, specifying that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test will be removed eventually it is ignored and I only use it sometimes when a larger chain is needed. This birthday is just a block height near to the server tip at time of writing.

@@ -77,8 +77,8 @@ async fn sync_test() {
.await
.unwrap();

Copy link
Member

Choose a reason for hiding this comment

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

I thought we wanted to cut dbgs out? I guess I am ok with commented out dbgs in test code. Is that our practice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sync development its good to have these dbgs ready to go when needed. I don't think we should normally allow debug but that's why I created a separate sync.rs test suite

@@ -35,6 +35,15 @@ impl SyncState {
spend_locations: Vec::new(),
}
}

Copy link
Member

Choose a reason for hiding this comment

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

From local checks this fn could currently be pub(crate).. should we promote it to fully pub "on demand"?

Do we already have a consumer using it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought this could be useful API but Im happy with making it pub(crate), i will make this change on the following PR. I think it's a good policy to keep things private unless there is a known use case for sure

Copy link
Member

@zancas zancas left a comment

Choose a reason for hiding this comment

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

There are a number of private methods introduced in this PR, for example the "truncate" family.

What is our strategy for adding focused single-fn unit tests?

What about test-coverage information for the zingo-sync crate?

@zancas zancas merged commit b7360d1 into zingolabs:dev Nov 22, 2024
17 checks passed
@Oscar-Pepper
Copy link
Contributor Author

There are a number of private methods introduced in this PR, for example the "truncate" family.

What is our strategy for adding focused single-fn unit tests?

What about test-coverage information for the zingo-sync crate?

before zingo sync is released all error handling and a large % test coverage will be added.

as unit tests have to change when a fn changes I want to write a PoC first to be more time efficient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants