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

add option to collect light client data #3474

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

etan-status
Copy link
Contributor

Light clients require full nodes to serve additional data so that they
can stay in sync with the network. This patch adds a new launch option
--import-light-client-data to configure what data to make available.
For now, data is only kept in memory; it is not persisted at this time.
Note that data is only locally collected, a separate patch is needed to
actually make it availble over the network. --serve-light-client-data
will be used for serving data, but is not functional yet outside tests.

@github-actions
Copy link

github-actions bot commented Mar 9, 2022

Unit Test Results

     12 files  ±  0     833 suites  +4   53m 42s ⏱️ + 25m 53s
1 677 tests +  3  1 629 ✔️ +  3    48 💤 ±0  0 ±0 
9 787 runs  +12  9 675 ✔️ +12  112 💤 ±0  0 ±0 

Results for commit 54769c4. ± Comparison against base commit 21b71bd.

♻️ This comment has been updated with latest results.

@etan-status
Copy link
Contributor Author

etan-status commented Mar 11, 2022

Should add another test case for checkpoint sync, and also allow collecting data when data of last 4 finalized checkpoints and non-finalized blocks are not all known.

Copy link
Member

@arnetheduck arnetheduck left a comment

Choose a reason for hiding this comment

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

In general, we can merge this and start running on a couple of unstable nodes just to see how it behaves - some tuning and optimization work will likely be needed here to avoid unnecessary work and degrade gracefully when blocks and states are missing etc, but in general looks good for a first cut.

@etan-status etan-status force-pushed the dev/etan/lc-datacollection branch from 307467f to 935c446 Compare March 11, 2022 13:26
@etan-status
Copy link
Contributor Author

  • Add test for initialization from checkpoint sync.
  • Do not rewind non-finalized blocks in only-new import mode. May lead to suboptimal (but still correct) data for current period, but speeds up startup time.

Comment on lines +92 to +94
importTailSlot*: Slot
## The earliest slot for which light client data is collected.
## Only relevant for `ImportLightClientData.OnlyNew`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added importTailSlot for OnlyNew import mode. Data is only collected from this slot onward.

store.finalized_header == latestUpdate.get.finalized_header
store.optimistic_header == latestUpdate.get.attested_header

test "Init from checkpoint":
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 is the new checkpointing test. Simply checks whether there are any errors when initializing from a checkpoint.

Copy link
Member

Choose a reason for hiding this comment

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

this test ends up with bogus data (zero hashes) in some of its internal structures - I've disabled it in 1249b8c because the errors surface with the new, more strict, error handling - this, and checkpoint sync in general, needs revisiting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@etan-status
Copy link
Contributor Author

In general, we can merge this and start running on a couple of unstable nodes just to see how it behaves

One remaining question would be what import mode to use.

  • OnlyNew has no startup time increase but only includes data from startup onwards.
  • Full is deterministic and includes the max weak subjectivity period, but has very slow startup time.
  • OnDemand has ~10 seconds increased startup time, and has lag spikes when data is being requested, but otherwise behaves like Full.

@arnetheduck
Copy link
Member

Let's go with OnlyNew for now - a bit of chaos in the tests will stress the system as well

@etan-status etan-status force-pushed the dev/etan/lc-datacollection branch from 935c446 to d7ac3e9 Compare March 11, 2022 13:38
Light clients require full nodes to serve additional data so that they
can stay in sync with the network. This patch adds a new launch option
`--import-light-client-data` to configure what data to make available.
For now, data is only kept in memory; it is not persisted at this time.
Note that data is only locally collected, a separate patch is needed to
actually make it availble over the network. `--serve-light-client-data`
will be used for serving data, but is not functional yet outside tests.
@etan-status etan-status force-pushed the dev/etan/lc-datacollection branch from d7ac3e9 to 54769c4 Compare March 11, 2022 17:00
@etan-status
Copy link
Contributor Author

  • Rebase to unstable, handling getForkedBlock(BlockRef) that got removed assuming blocks for existing BlockRef always succeed in loading.

@etan-status etan-status merged commit ae408c2 into unstable Mar 11, 2022
@etan-status etan-status deleted the dev/etan/lc-datacollection branch March 11, 2022 20:28
@etan-status
Copy link
Contributor Author

Let's go with OnlyNew for now - a bit of chaos in the tests will stress the system as well

#3487

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.

2 participants