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

Fix bugs discoverd by e2e tests #2407

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Fix bugs discoverd by e2e tests #2407

wants to merge 8 commits into from

Conversation

AnkushinDaniil
Copy link
Contributor

@AnkushinDaniil AnkushinDaniil commented Jan 29, 2025

Tip

This PR implements simple PRC version control. Basically it introduces a new rpcVersion field responsible for RPC version. It affects the MarshalJSON method. The only exception is BlockHeader, because if we implement this method for this structure, all structures BlockWith* containing BlockHeader will use this method and we will see only BlockHeader. In these cases we simply make the L2Gas field nil if necessary. In addition, in #2401 the rpcVersion field is used in some calculations in the fee estimation.

Below are the key changes grouped by theme:

Removal of L2 Gas Fields:

  • Removed L2Gas field from the DataAvailability struct in core/transaction.go.
  • Removed L2Gas field handling in adaptExecutionResources functions in adapters/core2p2p/receipt.go and adapters/p2p2core/receipt.go. [1] [2]

RPC Method Versioning:

  • Added versioning constants V0_7 and V0_8 in rpc/handlers.go.
  • Introduced version-specific RPC methods in rpc/block.go and rpc/handlers.go, such as BlockWithTxHashesV0_7, BlockWithTxsV0_7, and BlockWithReceiptsV0_7. [1] [2] [3]

Fee Estimation Adjustments:

  • Removed FeeEstimateV0_7 struct and integrated versioning into the FeeEstimate struct in rpc/estimate_fee.go. [1] [2]
  • Updated the EstimateFeeV0_7 and EstimateMessageFeeV0_7 methods to use the new versioning approach. [1] [2]

Test Updates:

  • Modified tests in rpc/block_test.go and rpc/estimate_fee_pkg_test.go to accommodate the changes in fee estimation and RPC method versioning. [1] [2] [3]

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 72.02797% with 40 lines in your changes missing coverage. Please review.

Project coverage is 74.22%. Comparing base (1caf86f) to head (94cf299).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
rpc/block.go 12.50% 21 Missing ⚠️
rpc/simulation.go 50.00% 11 Missing and 1 partial ⚠️
rpc/estimate_fee.go 86.66% 4 Missing ⚠️
rpc/transaction.go 92.85% 2 Missing ⚠️
rpc/handlers.go 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2407      +/-   ##
==========================================
- Coverage   74.41%   74.22%   -0.19%     
==========================================
  Files         113      113              
  Lines       13016    13088      +72     
==========================================
+ Hits         9686     9715      +29     
- Misses       2592     2632      +40     
- Partials      738      741       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnkushinDaniil AnkushinDaniil marked this pull request as ready for review January 29, 2025 08:50
@AnkushinDaniil AnkushinDaniil enabled auto-merge (squash) January 29, 2025 08:50
@rianhughes rianhughes self-requested a review January 31, 2025 13:43
@rodrigo-pino rodrigo-pino changed the title Fix e2e Fix bugs discoverd by e2e tests Feb 3, 2025
@rodrigo-pino rodrigo-pino added RPC JSON RPC API blocked Depends on another to be solved first labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Depends on another to be solved first RPC JSON RPC API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants