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: add batch and chunk provers and verifiers #689

Merged
merged 41 commits into from
Aug 1, 2023

Conversation

silathdiir
Copy link
Contributor

@silathdiir silathdiir commented Jul 30, 2023

TODO

Purpose or design rationale of this PR

Add new batch and chunk provers and verifiers according to scroll-prover, and make unit-tests pass.

PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

Deployment tag versioning

Has tag in common/version.go been updated?

  • No, this PR doesn't involve a new deployment, git tag, docker image tag
  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change
  • Yes

@silathdiir silathdiir marked this pull request as draft July 30, 2023 14:02
@silathdiir silathdiir requested a review from lispc July 30, 2023 14:28
@0xmountaintop
Copy link
Member

add and update corresponding types (as ChunkHash) used in new provers and verifiers.

do you know how to do it? you may need to update

  • (b *BaseCollector) sendTask
  • (b *ChunkProofCollector) sendTask
  • (b *BatchProofCollector) sendTask

I'm think about changing the (b *BaseCollector) sendTask() parameter types

func (b *BaseCollector) sendTask(proveType message.ProofType, hash string, blockHashes []common.Hash, subProofs []*message.ChunkProof) ([]*coordinatorType.ProverStatus, error)
->
func (b *BaseCollector) sendTask(proveType message.ProofType, hash string, chunkTaskDetail *common.ChunkTaskDetail, batchTaskDetail *message.BatchTaskDetail) ([]*coordinatorType.ProverStatus, error)

add 2 new types (ChunkTaskDetail & BatchTaskDetail) to common/types/message/message.go and fill into them

to calculate ChunkHash you will probably need these info in database/migrate/migrations/00004_chunk.sql

    parent_chunk_hash                 VARCHAR         NOT NULL,
    state_root                        VARCHAR         NOT NULL,
    parent_chunk_state_root           VARCHAR         NOT NULL,
    withdraw_root                     VARCHAR         NOT NULL,

you can change

func (bp *BatchProofCollector) sendTask(ctx context.Context, taskID string) ([]*coordinatorType.ProverStatus, error) {
	// get chunk proofs from db
	chunkProofs, err := bp.chunkOrm.GetProofsByBatchHash(ctx, taskID)

and get them

@0xmountaintop 0xmountaintop marked this pull request as ready for review August 1, 2023 11:52
@0xmountaintop 0xmountaintop force-pushed the batch-chunk-provers-and-verifiers branch 3 times, most recently from 15f8b0b to 8ed7966 Compare August 1, 2023 12:46
more fix

more fix

more fix

more fix

more fix

more fix
@0xmountaintop 0xmountaintop force-pushed the batch-chunk-provers-and-verifiers branch from 8ed7966 to 409ff52 Compare August 1, 2023 12:54
@0xmountaintop 0xmountaintop changed the title [WIP] feat: add batch and chunk provers and verifiers feat: add batch and chunk provers and verifiers Aug 1, 2023
@0xmountaintop 0xmountaintop merged commit 62f7069 into develop Aug 1, 2023
17 checks passed
@0xmountaintop 0xmountaintop deleted the batch-chunk-provers-and-verifiers branch August 1, 2023 14:45
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