Skip to content

feat(coordinator): added BlobSubmitterV2 interface and implementation - #3673

Merged
jonesho merged 33 commits into
mainfrom
coordinator/feat-blob-submitter-v2-for-risc-v
Oct 16, 2026
Merged

jonesho merged 33 commits into
mainfrom
coordinator/feat-blob-submitter-v2-for-risc-v

Conversation

@jonesho

@jonesho jonesho commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

…or BlobSubmitterV2 implementation and simplified BlobSubmittedEvent

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • If this change is deployed to any environment (including Devnet), E2E test coverage exists or is included in this
    PR.
  • I have informed the team of any breaking changes if there are any.

Note

High Risk
Changes L1 submission/finalization encoding and domain events that drive coordinator progress tracking; mistakes could break blob posting, finalization, or metrics on production rollup/validium paths.

Overview
This PR aligns the coordinator and contract bindings with a data rolling hash (and DA offset) model on Lineth Rollup V9 and Validium V3, replacing the previous shnarf/blob-hash submission and finalization shapes.

L1 contract surface: LinethRollupV9-rc.abi is regenerated so submitBlobs takes parentDataRollingHash and storedDataRollingHash, finalizeBlocks uses FinalizationDataV5 with parentDataRollingHash, endDataRollingHash, and startOffset/endOffset, and init/events reference dataRollingHashProvider instead of shnarfProvider. Local deploy scripts use dataRollingHashProvider; a new deployValidiumV3Stub target deploys a no-op Validium V3 stub for dev.

Coordinator: Web3j builders and clients encode the new rollup and validium calls (acceptDataRollingHash, finalizeBlocksV9 on validium). submitBlobsV9 gains an onlyEthCall path for preflight-only blob submission. BlobSubmitterV2 submits BlobRecordV2 chunks (rollup EIP-4844 and validium V2 implementations). BlobSubmittedEvent and FinalizationSubmittedEvent are slimmed to end-block number/timestamp plus submission time (no tx hash, shnarf, or nested proof in the event). Trackers and AggregationSubmitter follow those fields.

Reviewed by Cursor Bugbot for commit 78d5744. Bugbot is set up for automated code reviews on this repo. Configure here.

@jonesho jonesho self-assigned this Jul 30, 2026
@jonesho
jonesho force-pushed the coordinator/feat-blob-submitter-v2-for-risc-v branch from 2819ca2 to f0d25e8 Compare July 31, 2026 06:23
@jonesho
jonesho marked this pull request as ready for review July 31, 2026 09:50
Base automatically changed from coordinator-r5-blobdao-interface to main July 31, 2026 13:57
@jonesho
jonesho force-pushed the coordinator/feat-blob-submitter-v2-for-risc-v branch from 7ffc48c to 4eb7c81 Compare August 3, 2026 07:26

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@jonesho jonesho changed the title feat(coordinator): added BlobSubmitterAsEIP4844MultipleBlobsPerTxV2 f… feat(coordinator): added BlobSubmitterV2 f… Aug 3, 2026
@jonesho jonesho changed the title feat(coordinator): added BlobSubmitterV2 f… feat(coordinator): added BlobSubmitterV2 interface and implementation Aug 3, 2026
@jonesho
jonesho marked this pull request as draft August 3, 2026 07:33
@jonesho
jonesho force-pushed the coordinator/feat-blob-submitter-v2-for-risc-v branch from bde12ce to 1f361c5 Compare August 5, 2026 08:42
@jonesho
jonesho marked this pull request as ready for review August 5, 2026 10:04
@jonesho
jonesho force-pushed the coordinator/feat-blob-submitter-v2-for-risc-v branch from 39831fa to 0850d3c Compare August 9, 2026 19:12
@jonesho
jonesho requested a review from gauravahuja August 10, 2026 06:23
@fluentcrafter

Copy link
Copy Markdown
Contributor

Hi @jonesho what's this PR about? What's his motivation or issue/problem that is trying to solve?

@jonesho
jonesho marked this pull request as draft September 10, 2026 19:16
@jonesho

jonesho commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi @jonesho what's this PR about? What's his motivation or issue/problem that is trying to solve?

@fluentcrafter this was the PR to address the new blob submitter for RISC-V proving system, however the implementation is obsolete given that it was created before the "flexible blobbing proposal", will mark this as draft now, and resume once we have the L1 contract changes from the contract team, will ping them again.

…ream

Stub for building the [4-byte-len BE][lz4(truncated_conflation)] segment
per conflation. LZ4 implementation deferred; stub unblocks the coordinator.

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
…omain types

StreamPosition captures the last sealed chunk's end block, DRH, and byte
offset — used for cold-start recovery via BlobsRepositoryV2. The DRH fold
function is stubbed pending keccak256 implementation.

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
…RISC-V rollup

Repurpose the blobs table for rollup proof records (no DB migration):
- BlobRecordV2: parentShnarf→parentDataRollingHash, endShnarf→dataRollingHash,
  totalBatchesCount→totalConflationsCount; add proofHash and endOffset fields
- BlobData: blobHash→chunkHash, compressedData→blobBytes, batchesCount→conflationsCount
- BlobsInfo JSON: matching key renames + new endOffset field
- BlobsPostgresDaoV2: write proofHash to blob_hash column; read it back in parseRecord
- BlobsPostgresDaoG TODO: blob_hash repurposed, remove from drop list

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
…ndler

RollupProofPoller polls up to proofPollsPerTick (default 20) in-flight rollup
proof requests per tick, modelled on ExecutionProofGeneratingCoordinator.action().
RollupProofHandler is a fun interface delivered with the poller; context carries
all fields needed to assemble BlobRecordV2 when the proof response arrives.
RollupProofPersistenceHandler implements RollupProofHandler and writes to BlobsRepositoryV2.

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
…C-V rollup proofs

Combined chunk assembly and proof submission coordinator. Ingests conflated batches,
builds the continuous DA byte stream, seals BLOB_BYTES_LENGTH chunks, queries
BatchesRepository to gate submission on all N conflations being proven, then submits
a RollupProofRequestV1 and hands the proof index to RollupProofPoller.

BlockEncoder and chunkHasher are injected to keep web3j and RLP off coordinator/core's
classpath. The l2Executions hash field carries TODO pending the follow-on PR that
adds proof_index_hash to the batches table.

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
…ngCoordinator

- Add findBatchesByBlockRange to BatchesDao/Repository/PostgresBatchesRepository/
  RetryingBatchesPostgresDao to retrieve proofIndexHash per conflation at
  proof-submission time; add integration tests for the new query
- Resolve TODO in buildRequest: fetch proofIndexHash from batches table and
  populate BlockIntervalProofIndex.hash for each l2Executions entry
- Convert DataRollingHashCalculator and ConflationSegmentBuilder from objects to
  fun interfaces, wired as constructor parameters in RollupProofGeneratingCoordinator
- Remove self-recursive trySubmitRollupProof call; the polling loop handles
  subsequent windows without the latency optimisation
- Revert totalConflationsCount/conflationsCount field renames back to
  totalBatchesCount/batchesCount

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
Cover the key behaviours of the coordinator:
- out-of-order conflation rejection
- no submission when fewer than N conflations accumulated
- no submission when not all conflations are proven (null or partial)
- proof request content when all N conflations are proven
- correct context passed to RollupProofPoller after submission
- window state reset after successful submission

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
gauravahuja and others added 11 commits October 12, 2026 14:31
Link issue #3658 to track dropping blob_hash and expected_shnarf columns
and renaming blob_compression_proof to blobs_info after riscv migration.
Remove inline schema comments now tracked in the issue.

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
…or BlobSubmitterV2 implementation and simplified BlobSubmittedEvent

Signed-off-by: jonesho <jones.ho@consensys.net>
Signed-off-by: jonesho <jones.ho@consensys.net>
Signed-off-by: jonesho <jones.ho@consensys.net>
Signed-off-by: jonesho <jones.ho@consensys.net>
Signed-off-by: jonesho <jones.ho@consensys.net>
…b submitter V2

Signed-off-by: jonesho <jones.ho@consensys.net>
Signed-off-by: jonesho <jones.ho@consensys.net>
This reverts commit 3fe9a92.

Signed-off-by: jonesho <jones.ho@consensys.net>
…nto coordinator/feat-blob-submitter-v2-for-risc-v
Signed-off-by: jonesho <jones.ho@consensys.net>
@jonesho
jonesho force-pushed the coordinator/feat-blob-submitter-v2-for-risc-v branch from 4997dc4 to e3d027f Compare October 14, 2026 08:45
@jonesho
jonesho changed the base branch from main to feat/riscv-rollup-coordinator October 14, 2026 08:46
@jonesho
jonesho changed the base branch from feat/riscv-rollup-coordinator to main October 14, 2026 08:47
@jonesho
jonesho marked this pull request as ready for review October 14, 2026 09:02

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e3d027f. Configure here.

Signed-off-by: jonesho <jones.ho@consensys.net>
Signed-off-by: jonesho <jones.ho@consensys.net>
Signed-off-by: jonesho <jones.ho@consensys.net>
// transactionHash = transactionHash.toByteArray(), // or decodeHex()?
// )
// blobSubmittedEventConsumer.accept(blobSubmittedEvent)
// }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@gauravahuja same here, I don't have a concrete idea on the event structure to be dispatched as well as the consumer, I will leave this for you when integrating the submitter with conflationAppV2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I you look at how the blobSubmittedEvent is used in pre riscv you will notice that is is mostly used for metric tracking. It also does not use all the fields from the BlobSubmittedEvent. So the data class BlobSubmittedEvent can be simplified and used here too.

The other thing is that Conflation App is not releated to blob or aggregation submission. The L1RelayingApp owns them. We will need to either reuse the existing BlobSubmission and AggregationFinalization coordinators or create new ones.

@jonesho jonesho Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@gauravahuja I revised and simplified the BlobSubmittedEvent to keep only the in-use fields.

For risc-v, one caveat is that BlobSubmittedEvent will be fired only when all the blobs in a BlobRecordV2 were submitted that might be done by multiple blob-carrying transactions (my understanding is that a BlobRecordV2 is 1 to 1 to a rollup proof, and the number of blobs involved in a rollup proof can be more than 6 (i.e. max # of blobs per transaction on L1)), and hence we might need multiple blob transactions for a BlobRecordV2.

Also note that, in risc-v, we no longer have concrete block range information per blob, all we have and need during blob submission is the resultant parentDataRollingHash and storedDataRollingHash of the submitting blobs, and that's why I skipped emitting BlobSubmittedEvent per blob transaction. Let me if that makes sense to you :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That makes sense, but then we need to decide how do we handle the case of more than 6 blobs per rollup and how do we filter out already submitted blobs. This will be important for BlobSubmissionCoordinatorV2

// submissionTimestamp = clock.now(),
// transactionHash = transactionHash.toByteArray(),
// )
// aggregationSubmittedEventConsumer.accept(aggregationSubmittedEvent)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@gauravahuja same here, I don't have a concrete idea on the event structure to be dispatched as well as the consumer, I will leave this for you when integrating the submitter with conflationAppV2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similar comment as for the BlobSubmissionEvent. We only use a few fields from FinalizationSubmittedEvent and others can be removed. This way you can reuse the same dataclass here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@gauravahuja Similarily, I revise and simplify the AggregationSubmittedEvent to keep only the in-use fields.

Signed-off-by: jonesho <jones.ho@consensys.net>
@jonesho
jonesho requested review from gauravahuja and removed request for gauravahuja October 15, 2026 08:41

@gauravahuja gauravahuja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PR looks good to me but there are still open questions about the BlobSubmisisonCoordinator and AggregationFinalizationCoordinator. These two will be integrateing the BlobSubmitter and AggregationSubmitter.

@jonesho
jonesho merged commit 5d0b687 into main Oct 16, 2026
117 of 122 checks passed
@jonesho
jonesho deleted the coordinator/feat-blob-submitter-v2-for-risc-v branch October 16, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants