Skip to content

EthApi Interface - new eth methods - #1584

Merged
fluentcrafter merged 9 commits into
mainfrom
eth-api-pt-2
Nov 19, 2025
Merged

fluentcrafter merged 9 commits into
mainfrom
eth-api-pt-2

Conversation

@fluentcrafter

@fluentcrafter fluentcrafter commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor

This PR implements issue(s) #1577

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

Refactors EthApi into modular interfaces with many new eth_* methods, implements them in Web3j clients (with retries), adds domain models/mappers, and updates coordinator and log searcher to new APIs.

  • API Surface (major refactor):
    • Split EthApiClient into modular interfaces: EthApiChainIdClient, EthApiFeeClient, EthApiSimulationClient, EthApiBlockClient, EthLogsClient, EthApiAccountClient, EthApiTransactionClient, EthApiExecutionClientInfo.
    • Add methods: ethChainId, ethBlockNumber, block getters (ethFind/GetBlockByNumber{FullTxs,TxHashes}), account (ethGetBalance, ethGetTransactionCount), fees (ethGasPrice, ethMaxPriorityFeePerGas, ethFeeHistory), txs (ethGetTransactionByHash, ethGetTransactionReceipt, ethSendRawTransaction), node info (ethProtocolVersion, ethCoinbase, ethMining), simulation (ethCall, ethEstimateGas).
  • Domain Models & Mappers:
    • New TransactionForEthCall and TransactionReceipt models; add mappers (TransactionForEthCallMapper, TransactionReceiptMapper).
  • Client Implementations:
    • Web3jEthApiClient implements new methods; Web3jEthApiClientWithRetries wraps them with tailored retry predicates (incl. execution-reverted stop).
    • EthLogsClient adds FilterOptions + ethGetLogs helper.
    • FakeEthApiClient updated to new interface/methods.
  • Call Sites Updated:
    • Replace getChainId() with ethChainId() and getBlockByNumberWithoutTransactionsData() with ethGetBlockByNumberTxHashes() in coordinator components and log searcher.
  • Tests:
    • Update tests to use new method names (ethGetBlockByNumber{FullTxs,TxHashes}) and behaviors.

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

cursor[bot]

This comment was marked as outdated.

@codecov-commenter

codecov-commenter commented Oct 17, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.49828% with 275 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.48%. Comparing base (7d62ea2) to head (edcdd26).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...src/main/kotlin/linea/domain/TransactionReceipt.kt 0.00% 87 Missing ⚠️
.../main/kotlin/linea/domain/TransactionForEthCall.kt 0.00% 53 Missing ⚠️
...ain/kotlin/linea/web3j/ethapi/Web3jEthApiClient.kt 10.25% 35 Missing ⚠️
...main/kotlin/linea/ethapi/EthApiSimulationClient.kt 0.00% 28 Missing ⚠️
...linea/web3j/ethapi/Web3jEthApiClientWithRetries.kt 19.35% 25 Missing ⚠️
...in/linea/web3j/mappers/TransactionReceiptMapper.kt 0.00% 19 Missing ⚠️
...linea/web3j/mappers/TransactionForEthCallMapper.kt 0.00% 14 Missing ⚠️
...aces/src/main/kotlin/linea/ethapi/EthLogsClient.kt 0.00% 10 Missing ⚠️
.../src/main/kotlin/linea/ethapi/EthApiBlockClient.kt 50.00% 0 Missing and 2 partials ⚠️
.../consensys/zkevm/coordinator/app/L1DependentApp.kt 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1584      +/-   ##
============================================
- Coverage     65.67%   64.48%   -1.19%     
  Complexity     1522     1522              
============================================
  Files           389      396       +7     
  Lines         14117    14381     +264     
  Branches       1454     1545      +91     
============================================
+ Hits           9271     9274       +3     
- Misses         4236     4497     +261     
  Partials        610      610              
Flag Coverage Δ *Carryforward flag
hardhat 96.20% <ø> (ø) Carriedforward from 0624c92
kotlin 62.04% <5.49%> (-1.23%) ⬇️

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

Files with missing lines Coverage Δ
...on/proofcreation/ZkProofCreationCoordinatorImpl.kt 97.67% <100.00%> (ø)
...rc/main/kotlin/linea/ethapi/EthLogsSearcherImpl.kt 91.60% <100.00%> (ø)
...faces/src/main/kotlin/linea/ethapi/EthApiClient.kt 100.00% <100.00%> (+50.00%) ⬆️
.../consensys/zkevm/coordinator/app/L1DependentApp.kt 0.00% <0.00%> (ø)
...dination/aggregation/AggregationL2StateProvider.kt 0.00% <0.00%> (ø)
.../src/main/kotlin/linea/ethapi/EthApiBlockClient.kt 50.00% <50.00%> (ø)
...aces/src/main/kotlin/linea/ethapi/EthLogsClient.kt 0.00% <0.00%> (ø)
...linea/web3j/mappers/TransactionForEthCallMapper.kt 0.00% <0.00%> (ø)
...in/linea/web3j/mappers/TransactionReceiptMapper.kt 0.00% <0.00%> (ø)
...linea/web3j/ethapi/Web3jEthApiClientWithRetries.kt 46.42% <19.35%> (-34.22%) ⬇️
... and 4 more

... and 1 file 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.

Comment thread jvm-libs/linea/clients/interfaces/src/main/kotlin/linea/ethapi/EthApiClient.kt Outdated
@fluentcrafter
fluentcrafter changed the base branch from main to eth-api-pt-1 October 17, 2025 18:43
Comment thread jvm-libs/linea/clients/interfaces/src/main/kotlin/linea/ethapi/EthApiClient.kt Outdated
Base automatically changed from eth-api-pt-1 to main October 20, 2025 12: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.

Just the one comment, otherwise LGTM

@fluentcrafter
fluentcrafter merged commit 3dc5340 into main Nov 19, 2025
50 of 51 checks passed
@fluentcrafter
fluentcrafter deleted the eth-api-pt-2 branch November 19, 2025 11:45
jonesho pushed a commit that referenced this pull request Nov 24, 2025
#1584)

* skip ref test that are deployment transaction to an already existing account (code or nonce)

Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>

* missing the g1v1

* one more

---------

Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Co-authored-by: FlorianHuc <florian.huc@gmail.com>
jonesho pushed a commit that referenced this pull request Dec 8, 2025
#1584)

* skip ref test that are deployment transaction to an already existing account (code or nonce)

Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>

* missing the g1v1

* one more

---------

Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Co-authored-by: FlorianHuc <florian.huc@gmail.com>
Filter94 pushed a commit that referenced this pull request Jun 24, 2026
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