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

Core/v2 #824

Merged
merged 5 commits into from
Oct 23, 2024
Merged

Core/v2 #824

merged 5 commits into from
Oct 23, 2024

Conversation

mooselumph
Copy link
Collaborator

Why are these changes needed?

v2 of core library

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(


operatorCounts := []uint{4}

numBlob := 1 // must be greater than 0
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

comment from @hopeyen: could we add more tests such as different number of blobs and blobs that would be considered invalid by the verifier?

NumChunks uint32
}

func (p BlobVersionParameters) MaxNumOperators() uint32 {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is theoretical max number of operators based on the config, which is different from the max number of operators imposed on contracts. Do we need this method or just use what's on the contracts?
It's problematic if a BlobVersionParameters is set in a way that allows max # operators smaller than what's configured onchain, so it looks like we already have to make sure the set of parameters allow the max # operators configured onchain when they're added

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good callout. Since all of this will be on chain, what about having some on-chain checks to ensure consistency when any of these parameters are updated?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good idea. Can you add a quick comment over BlobVersionParameters that this is supposed to go onchain?

cc @0x0aa0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

core/v2/assignment.go Outdated Show resolved Hide resolved
core/v2/assignment.go Outdated Show resolved Hide resolved
core/v2/types.go Outdated Show resolved Hide resolved
@@ -0,0 +1,123 @@
package corev2
Copy link
Contributor

Choose a reason for hiding this comment

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

should we just name the package v2?

core/v2/utils.go Outdated
@@ -0,0 +1,26 @@
package corev2
Copy link
Contributor

Choose a reason for hiding this comment

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

should we replace existing usages?

Copy link
Contributor

@dmanc dmanc left a comment

Choose a reason for hiding this comment

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

lgtm, left some comments

core/utils.go Outdated Show resolved Hide resolved
encoding/kzg/prover/prover_cpu.go Outdated Show resolved Hide resolved
lengthProofChan := make(chan LengthProofResult, 1)
commitmentChan := make(chan CommitmentResult, 1)
proofChan := make(chan ProofsResult, 1)
commitmentsChan := make(chan commitmentsResult, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just making sure, the changes here are just refactors to allow us to expose GetFrames and GetCommitments. None of the functionality changes in any major way?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's right!

@mooselumph mooselumph merged commit a1119bd into Layr-Labs:master Oct 23, 2024
7 checks passed
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