Skip to content

Conversation

@gauravahuja
Copy link
Contributor

@gauravahuja gauravahuja commented Nov 25, 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 Validium L1 contract support (clients/builders), refactors rollup builders into an object, extends Web3J helper, and updates interfaces/methods.

  • Contracts/Clients:
    • Validium Support:
      • Add jvm-libs:linea:linea-contracts:l1-validium module (Web3J codegen for ValidiumV1).
      • Implement Web3JLineaValidiumSmartContractClientReadOnly and Web3JLineaValidiumSmartContractClient with acceptShnarfData* and finalizeBlocks* flows.
      • Introduce Web3JLineaValidiumFunctionBuilders for acceptShnarfData and finalizeBlocks.
    • Rollup Refactor:
      • Replace Web3JFunctionBuildersV6.kt with Web3JLineaRollupFunctionBuilders and update usages in Web3JLineaRollupSmartContractClient.
  • Core Interfaces:
    • Add LineaValidiumContractVersion and LineaValidiumSmartContractClientReadOnly.
    • Rename methods: acceptShnarfs* -> acceptShnarfData* in LineaValidiumSmartContractClient.
  • Helper Enhancements (Web3JContractAsyncHelper):
    • Add sendShnarfDataTransactionAndGetTxHash and executeEthCall(function, gasPriceCaps, ...) overload.
  • Build/Settings:
    • Wire new module into settings.gradle and add dependency in linea-contract-clients.

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

@gauravahuja gauravahuja changed the title Validium submitter Implement Valadium contracts for use in coordinator Nov 25, 2025
@gauravahuja gauravahuja requested a review from jonesho November 25, 2025 13:07
@@ -0,0 +1,165 @@
package net.consensys.linea.contract.l1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed from coordinator/clients/smart-contract-client/src/main/kotlin/net/consensys/linea/contract/l1/Web3JFunctionBuildersV6.kt

Copy link
Contributor

Choose a reason for hiding this comment

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

Next time plase use a git mv to make a better diff :)

}

override fun finalizedL2BlockTimestamp(blockParameter: BlockParameter): SafeFuture<ULong> {
TODO("Validium contract does not have currentTimestamp function")
Copy link
Contributor Author

Choose a reason for hiding this comment

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


override fun finalizedL2BlockTimestamp(blockParameter: BlockParameter): SafeFuture<ULong> {
TODO("Validium contract does not have currentTimestamp function")
}
Copy link

Choose a reason for hiding this comment

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

Bug: Validium client throws runtime error for interface method

The finalizedL2BlockTimestamp method uses TODO() which throws NotImplementedError at runtime. Since LineaValidiumSmartContractClientReadOnly extends LineaSmartContractClientReadOnly, callers expect this method to work. Any code that interacts with the Validium client through the common interface and calls this method will crash unexpectedly. If the Validium contract truly doesn't support this operation, a more appropriate exception type like UnsupportedOperationException with a descriptive message would provide better error handling.

Fix in Cursor Fix in Web

@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 25.12077% with 155 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.31%. Comparing base (c49aa2c) to head (2763531).

Files with missing lines Patch % Lines
...ntract/l1/Web3JLineaValidiumSmartContractClient.kt 0.00% 56 Missing ⚠️
.../contract/l1/Web3JLineaValidiumFunctionBuilders.kt 0.00% 43 Missing ⚠️
...1/Web3JLineaValidiumSmartContractClientReadOnly.kt 0.00% 27 Missing ⚠️
.../kotlin/linea/contract/Web3JContractAsyncHelper.kt 0.00% 25 Missing ⚠️
...ea/contract/l1/Web3JLineaRollupFunctionBuilders.kt 96.07% 0 Missing and 2 partials ⚠️
...contract/l1/Web3JLineaRollupSmartContractClient.kt 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1782      +/-   ##
============================================
- Coverage     63.98%   63.31%   -0.67%     
- Complexity     1524     1528       +4     
============================================
  Files           404      407       +3     
  Lines         14545    14691     +146     
  Branches       1562     1565       +3     
============================================
- Hits           9306     9301       -5     
- Misses         4620     4771     +151     
  Partials        619      619              
Flag Coverage Δ *Carryforward flag
hardhat 96.28% <ø> (-0.02%) ⬇️ Carriedforward from 503682e
kotlin 60.77% <25.12%> (-0.69%) ⬇️

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

Files with missing lines Coverage Δ
...ts/smartcontract/LineaRollupSmartContractClient.kt 100.00% <ø> (ø)
...tlin/linea/contract/l1/LineaSmartContractClient.kt 50.00% <ø> (ø)
...ea/contract/l1/Web3JLineaRollupFunctionBuilders.kt 96.07% <96.07%> (ø)
...contract/l1/Web3JLineaRollupSmartContractClient.kt 70.00% <60.00%> (ø)
.../kotlin/linea/contract/Web3JContractAsyncHelper.kt 39.92% <0.00%> (-4.38%) ⬇️
...1/Web3JLineaValidiumSmartContractClientReadOnly.kt 0.00% <0.00%> (ø)
.../contract/l1/Web3JLineaValidiumFunctionBuilders.kt 0.00% <0.00%> (ø)
...ntract/l1/Web3JLineaValidiumSmartContractClient.kt 0.00% <0.00%> (ø)

... and 15 files with indirect coverage changes

🚀 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.

}

interface LineaRollupSmartContractClientReadOnly : ContractVersionProvider<LineaContractVersion> {
enum class LineaValidiumContractVersion : Comparable<LineaValidiumContractVersion> {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this PR rebased on MAIN? these changes should already be on main branch, no?

Copy link
Contributor Author

@gauravahuja gauravahuja Nov 25, 2025

Choose a reason for hiding this comment

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

This PR needs the Validium ABI which is in the main alt-da branch, so this change is on top of chore/design-alt-da-interfaces

fluentcrafter
fluentcrafter previously approved these changes Nov 25, 2025
Base automatically changed from chore/design-alt-da-interfaces to main November 27, 2025 16:15
@thedarkjester thedarkjester dismissed fluentcrafter’s stale review November 27, 2025 16:15

The base branch was changed.

@thedarkjester thedarkjester requested a review from a team as a code owner November 27, 2025 16:15
)
}
.thenApply { it.transactionHash }
}
Copy link

Choose a reason for hiding this comment

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

Bug: Missing synchronization on transaction sending method

The new sendShnarfDataTransactionAndGetTxHash method is missing the @Synchronized annotation that all other transaction-sending methods in this class have (sendTransaction, sendTransactionAsync, sendTransactionAfterEthCallAsync, sendBlobCarryingTransaction). This creates a potential race condition when multiple threads call acceptShnarfData concurrently, as the underlying createAndSendRawTransaction (which handles nonce management and signing) could be accessed without proper synchronization.

Fix in Cursor Fix in Web

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.

5 participants