Skip to content

Conversation

@gauravahuja
Copy link
Contributor

@gauravahuja gauravahuja commented Nov 26, 2025

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.
  • I have informed the team of any breaking changes if there are any.

Note

Adds a Validium L1 data submission path selectable via config, introduces a Validium smart contract client, and generalizes blob submission to work with either Rollup or Validium; also migrates usages to LineaRollupContractVersion.

  • Config:
    • Add dataSubmission (ROLLUP | VALIDIUM) to L1SubmissionConfig and TOML (L1SubmissionConfigToml), with decoder TomlDataSubmissionDecoder and parsing tests updated.
  • Coordinator/App:
    • Select contract client based on l1-submission.data-submission and add createLineaValidiumContractClient.
    • Generalize BlobSubmissionCoordinator to LineaSmartContractClient; add ValidiumBlobSubmitter; update L1ShnarfBasedAlreadySubmittedBlobsFilter to accept LineaSmartContractClientReadOnly.
  • Smart Contract Clients:
    • Implement Web3JLineaValidiumSmartContractClient and LineaValidiumEnhancedWrapper.
    • Switch APIs to LineaRollupContractVersion and update builders (Web3JLineaRollupFunctionBuilders).
  • Tests/Integration:
    • Update tests to use LineaRollupContractVersion; wire changes in submission/finalization and state recovery tests; minor assertion tweak in config parsing test.

Written by Cursor Bugbot for commit 3fe801a. This will update automatically on new commits. Configure here.


companion object {
fun valueOfIgnoreCase(name: String): DataSubmission {
return DataSubmission.entries.firstOrNull { it.name.equals(name, ignoreCase = true) }
Copy link

Choose a reason for hiding this comment

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

Bug: Unused property in DataSubmission enum

The DataSubmission enum defines a mame property but valueOfIgnoreCase uses it.name instead of it.mame for comparison. This is inconsistent with the SignerType enum pattern which uses it.mame. The defined property serves no purpose and creates dead code, breaking the established pattern in the codebase.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

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

please address this. Also, I don't thing we need the name property...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I was just following what was done for a similar TOML config enum SignerType

// eth_estimateGas would fail because we submit multiple blob tx
// and 2nd would fail with revert reason
useEthEstimateGas = false,
val transactionManager = createTransactionManager(
Copy link

Choose a reason for hiding this comment

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

Bug: Null pointer exception for Validium blob gas cap

The code force-unwraps maxFeePerBlobGasCap!! when creating gas providers for both ROLLUP and VALIDIUM modes. Since maxFeePerBlobGasCap is nullable and Validium doesn't use EIP-4844 blobs, this will throw a NullPointerException when running in Validium mode if the configuration doesn't provide this optional value. The gas provider creation should handle Validium differently or require the value only for ROLLUP mode.

Additional Locations (1)

Fix in Cursor Fix in Web

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 18.37838% with 151 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.37%. Comparing base (503682e) to head (3fe801a).

Files with missing lines Patch % Lines
...zkevm/ethereum/submission/ValidiumBlobSubmitter.kt 0.00% 64 Missing ⚠️
.../consensys/zkevm/coordinator/app/L1DependentApp.kt 0.00% 21 Missing ⚠️
...ntract/l1/Web3JLineaValidiumSmartContractClient.kt 0.00% 20 Missing ⚠️
.../linea/contract/l1/LineaValidiumEnhancedWrapper.kt 0.00% 11 Missing ⚠️
...m/ethereum/submission/BlobSubmissionCoordinator.kt 52.63% 8 Missing and 1 partial ⚠️
...ys/zkevm/coordinator/app/BlockchainClientHelper.kt 0.00% 7 Missing ⚠️
...ordinator/config/v2/toml/L1SubmissionConfigToml.kt 60.00% 2 Missing and 2 partials ⚠️
...ea/coordinator/config/v2/toml/decoders/Decoders.kt 55.55% 2 Missing and 2 partials ⚠️
...submission/ContractUpgradeSubmissionLatchFilter.kt 0.00% 3 Missing ⚠️
.../l1/Web3JLineaRollupSmartContractClientReadOnly.kt 70.00% 1 Missing and 2 partials ⚠️
... and 3 more
Additional details and impacted files
@@                   Coverage Diff                    @@
##             validium_submitter    #1788      +/-   ##
========================================================
- Coverage                 63.87%   63.37%   -0.51%     
  Complexity                 1527     1527              
========================================================
  Files                       407      409       +2     
  Lines                     14557    14703     +146     
  Branches                   1554     1563       +9     
========================================================
+ Hits                       9299     9318      +19     
- Misses                     4649     4771     +122     
- Partials                    609      614       +5     
Flag Coverage Δ *Carryforward flag
hardhat 96.28% <ø> (ø) Carriedforward from 503682e
kotlin 60.84% <18.37%> (-0.52%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
.../linea/coordinator/config/v2/L1SubmissionConfig.kt 96.82% <100.00%> (+0.15%) ⬆️
...a/coordinator/config/v2/toml/ConfigLoaderHelper.kt 50.64% <100.00%> (+0.64%) ⬆️
...ission/L1ShnarfBasedAlreadySubmittedBlobsFilter.kt 90.00% <100.00%> (ø)
...tlin/linea/contract/l1/LineaSmartContractClient.kt 50.00% <ø> (ø)
...n/net/consensys/zkevm/ethereum/ContractsManager.kt 61.53% <0.00%> (ø)
...ea/contract/l1/Web3JLineaRollupFunctionBuilders.kt 96.07% <0.00%> (ø)
...zkevm/ethereum/MakefileContractDeploymentHelper.kt 40.27% <0.00%> (ø)
...submission/ContractUpgradeSubmissionLatchFilter.kt 0.00% <0.00%> (ø)
.../l1/Web3JLineaRollupSmartContractClientReadOnly.kt 65.15% <70.00%> (+1.65%) ⬆️
...ordinator/config/v2/toml/L1SubmissionConfigToml.kt 92.12% <60.00%> (-2.75%) ⬇️
... and 7 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@fluentcrafter fluentcrafter left a comment

Choose a reason for hiding this comment

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

I haven't finished the review. Leaving some comments in the meantime

}
}

class TomlDataSubmissionDecoder : Decoder<L1SubmissionConfigToml.DataSubmission> {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need a specific decoder. Toml library shall handle that out for the box, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again, i did not experiment with enum and toml library, I just followed a similar pattern we have for SignerType. You can notice the TomlSignerTypeDecoder just above this class.


companion object {
fun valueOfIgnoreCase(name: String): DataSubmission {
return DataSubmission.entries.firstOrNull { it.name.equals(name, ignoreCase = true) }
Copy link
Contributor

Choose a reason for hiding this comment

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

please address this. Also, I don't thing we need the name property...

val dataSubmission: DataSubmission = DataSubmission.ROLLUP,
) {

enum class DataSubmission(val mame: String) {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, name is an enum class attribute, I can either override name or have a different variable name. I just followed a similar enum that we use for TOML config SignerType

web3jClient: Web3j,
smartContractErrors: SmartContractErrors,
useEthEstimateGas: Boolean,
): LineaValidiumSmartContractClient {
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks duplicated. Have you considered

fun createLineaContractClient(
  dataAvailabiltyType:  DataSubmission
  contractAddress: String,
  transactionManager: AsyncFriendlyTransactionManager,
  contractGasProvider: ContractGasProvider,
  web3jClient: Web3j,
  smartContractErrors: SmartContractErrors,
  useEthEstimateGas: Boolean,
):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is better.

val aggregation: AggregationSubmissionConfig,
val dataSubmission: DataSubmission,
) : FeatureToggle {
enum class DataSubmission {
Copy link
Contributor

Choose a reason for hiding this comment

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

DataSubmission is not appropriate IMO

suggestions:

  • DataAvailability
  • DataStorageMode
  • L2DaType

@julien-marchand any inputs on this?

This will have impact on logic/proving once filly implemented

val toml = """
[l1-submission]
disabled = true
data-submission = "validium"
Copy link
Contributor

Choose a reason for hiding this comment

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

In our meeting with @julien-marchand we agreed on this config layout

[l1-submission.blob]
data-availability = "ROLLUP, PRIVIDIUM, VALIDIUM"

What's the motivation/rationale to:

  1. put it on upper level, l1-submission
  2. change the name to data-submission?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. I did not put under l1-submission.blob because validium also involves shnarf submission. So overall it is how data (shnarf and blobs) are available not just blobs.
  2. I forgot what name we had decided on, I will update it to data-availability.

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.

4 participants