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

feat: shielded sync improvements #1441

Merged
merged 3 commits into from
Dec 27, 2024
Merged

Conversation

mateuszjasiuk
Copy link
Collaborator

@mateuszjasiuk mateuszjasiuk commented Dec 23, 2024

Resolves #1420 and #1439

  • increase number of concurrent fetches
  • add ability to invalidate shielded context
invalidate.shielded.sync.mp4
  • store shielded context by chain id

image

@mateuszjasiuk mateuszjasiuk changed the title feat: 100 concurrent fetches feat: shielded sync improvements Dec 23, 2024
@mateuszjasiuk mateuszjasiuk force-pushed the feat/shielded-sync-improvements branch 2 times, most recently from a718ba8 to 9b164bd Compare December 24, 2024 12:10
@mateuszjasiuk mateuszjasiuk requested review from euharrison, pedrorezende and jurevans and removed request for euharrison December 24, 2024 12:17
@mateuszjasiuk mateuszjasiuk marked this pull request as ready for review December 24, 2024 12:19
@mateuszjasiuk mateuszjasiuk force-pushed the feat/shielded-sync-improvements branch 2 times, most recently from 65abd93 to 6138a70 Compare December 24, 2024 13:47
@@ -75,13 +77,14 @@ export function shieldedSync(

export const fetchShieldedBalance = async (
viewingKey: DatedViewingKey,
addresses: string[]
addresses: string[],
chainId: string
): Promise<Balance> => {
// TODO mock shielded balance
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you delete from here as well?

@@ -73,13 +83,6 @@ export const ShieldedBalanceChart = (): JSX.Element => {

useEffect(() => {
shieledSync();

const timeoutId = setTimeout(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The original idea here is to avoid flashing a "100%" in case it syncs quickly (less than 3s)

Copy link
Collaborator Author

@mateuszjasiuk mateuszjasiuk Dec 27, 2024

Choose a reason for hiding this comment

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

Yeah! I changed it because I had some problems getting right behavior when navigating from settings. RIght now instead of timeout it does this:

        // If total is more than one batch of 100, show progress
        if (total > 100) {
          setShowSyncProgress(true);
        }

so we show progress immediately but only if there is more than 100 blocks to fetch and parse :)

This can probably be improved more, because it takes longer to fetch without masp indexer, but it should be fine for now

@mateuszjasiuk mateuszjasiuk force-pushed the feat/shielded-sync-improvements branch from 798eaaa to fe3723d Compare December 27, 2024 09:13
Base automatically changed from feat/vks-birthdays to main December 27, 2024 10:42
@mateuszjasiuk mateuszjasiuk force-pushed the feat/shielded-sync-improvements branch from fe3723d to d086607 Compare December 27, 2024 12:33
@mateuszjasiuk mateuszjasiuk merged commit 7a5430a into main Dec 27, 2024
10 checks passed
@mateuszjasiuk mateuszjasiuk deleted the feat/shielded-sync-improvements branch December 27, 2024 12:57
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.

Namadillo: Speed up Shielded-sync by adapting block bundle size to height
2 participants