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

das: DASing of past headers #473

Merged
merged 28 commits into from
Mar 28, 2022
Merged

Conversation

renaynay
Copy link
Member

@renaynay renaynay commented Feb 23, 2022

This PR implements DASing of past headers in a single routine.

Eventually, this will be parallelised.

TODO

  • figure out what to do in the instance that DASer runs and samples new headers [100:150] and DASer is stopped, so sample routine stores latest checkpoint to disk as last DASed height (150) but catchUp routine has only sampled from [1:40] so there is a gap missing from (40: 100)?
  • fix constructor
  • cleanup
  • lint
  • doc.go
  • open issue for parallelisation of DASer
  • open issue for DASState

Resolves #181.

@renaynay renaynay added the area:shares Shares and samples label Feb 23, 2022
@renaynay renaynay force-pushed the dasing-of-past-headers branch from a034dbe to 8a540d9 Compare February 23, 2022 12:29
@Bidon15 Bidon15 mentioned this pull request Feb 23, 2022
2 tasks
@renaynay renaynay force-pushed the dasing-of-past-headers branch 2 times, most recently from 7621a53 to 76e4016 Compare February 24, 2022 17:28
@renaynay renaynay marked this pull request as ready for review February 24, 2022 19:49
@renaynay renaynay force-pushed the dasing-of-past-headers branch from 548ce3e to 2b6edea Compare February 24, 2022 20:07
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Left some nits. Overall looks very good.

das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser_test.go Outdated Show resolved Hide resolved
das/daser_test.go Outdated Show resolved Hide resolved
das/doc.go Show resolved Hide resolved
das/checkpoint_store.go Outdated Show resolved Hide resolved
das/checkpoint_store.go Outdated Show resolved Hide resolved
das/checkpoint_store.go Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
@renaynay renaynay force-pushed the dasing-of-past-headers branch from 4eeac67 to ee95275 Compare March 1, 2022 13:41
@renaynay
Copy link
Member Author

renaynay commented Mar 7, 2022

I think I will address the first TODO in a separate issue:

figure out what to do in the instance that DASer runs and samples new headers [100:150] and DASer is stopped, so sample routine stores latest checkpoint to disk as last DASed height (150) but catchUp routine has only sampled from [1:40] so there is a gap missing from (40: 100)?

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

Generally looks good, but there are two issues:

  • Stopping logic will panic if there were two or more catchups
  • A few changes still needed to be done before share: Cache Availability #180 becomes helpful

das/doc.go Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

Ok, so the last two issues are fixed. Here is another review with suggestions, thoughts, and one bug catch.

Also, I think I found a drawback in a solution for the last TODO. Think of a common case:

  • A Node is started and needs/starts a catch-up
  • It finishes catching up while the sample routine is and was going for thousands of heights
  • The node is stopped along with the DASser and the very old checkpoint is saved
  • On startup, DASer will load this old checkpoint and will start dasing from it

You may think that #180 will fix this and this is true to some extent, but #180 is about the new ShareAvailable implementation which stores the fact of availability on disk and to check it we need to do an IO per height, so on long height ranges, this can be an IO waste issue. I think we can justify this issue in the case of a gap described originally, but for the common case I mentioned above this is not acceptable IMO. Also, the logs will be misleading and false stating, as it would say catching up over already sampled headers.

The issue can be fixed by checking: if there were no catchUp routines terminated(meaning we fully caught up on everything), then store the checkpoint not from the catchUpScheduler, but the one in sample like it was before.

das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
@adlerjohn
Copy link
Member

CI won't run with merge conflicts IIRC, so could you fix the conflict as you push?

@renaynay renaynay force-pushed the dasing-of-past-headers branch from 4889821 to 329c004 Compare March 21, 2022 14:10
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
@Wondertan
Copy link
Member

@renaynay, did you get a chance to run DASer manually?

@renaynay renaynay force-pushed the dasing-of-past-headers branch from d474f09 to 21045cb Compare March 21, 2022 18:20
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
@renaynay renaynay force-pushed the dasing-of-past-headers branch from 8dd3c00 to c01a057 Compare March 26, 2022 12:41
Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

No more serious issues I am aware of, only nits left. Almost there.

das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Outdated Show resolved Hide resolved
das/daser.go Show resolved Hide resolved
Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

What is with the 2 TODOs mentioned in the opening comment?

das/checkpoint_store.go Show resolved Hide resolved
das/checkpoint_store.go Outdated Show resolved Hide resolved
das/daser.go Show resolved Hide resolved
@renaynay
Copy link
Member Author

@liamsi the 2 TODOs mentioned initially in the comment of this PR are related to an issue that can only be resolved once #427 is implemented.

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

I find the naming confusing but the docs clarify it. So LGTM

@renaynay renaynay merged commit c5ee765 into celestiaorg:main Mar 28, 2022
@renaynay renaynay deleted the dasing-of-past-headers branch March 28, 2022 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:shares Shares and samples kind:feat Attached to feature PRs
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

das: DASer checkpoints and DASing of past headers
4 participants