Skip to content

[revive] eth-rpc refactoring#8148

Merged
pgherveou merged 25 commits intomasterfrom
pg/update-caching
Apr 22, 2025
Merged

[revive] eth-rpc refactoring#8148
pgherveou merged 25 commits intomasterfrom
pg/update-caching

Conversation

@pgherveou
Copy link
Copy Markdown
Contributor

@pgherveou pgherveou commented Apr 3, 2025

Refactor eth-rpc

  • Get rid of the in memory-cache, we can just store receipts logs into sqlite, and use in-memory db for non archive node.
  • Track both best and finalized blocks so that we can properly index transaction receipts in case of a relay chain re-org.
  • Keep reference to the latest finalized block so that we can use that for queries that use the finalized block tag
  • use --index-last-n-blocks cli parameter to re-index the last n block when the server start
  • Fix issue related to gas estimate calculation for EIP1559 transaction types

tested changes with paritytech/evm-test-suite#87

fix paritytech/contract-issues#35 paritytech/contract-issues#33

@pgherveou pgherveou requested a review from Copilot April 4, 2025 18:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 9 out of 12 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • substrate/frame/revive/rpc/.sqlx/query-6345c84da6afad02d0fdf4e1657c53e64320c118d39db73f573510235baf4ba0.json: Language not supported
  • substrate/frame/revive/rpc/.sqlx/query-d7377b5a09f075668d259d02e3fc7a12048a70a33b96381118d6c24210afce34.json: Language not supported
  • substrate/frame/revive/rpc/.sqlx/query-e3d7860041663651866032e8fb054cff3e1707381845f47f693177dbce110448.json: Language not supported
Comments suppressed due to low confidence (2)

substrate/frame/revive/rpc/src/client.rs:525

  • The conversion for the storage key has been changed from big endian to little endian. Please verify that using little endian encoding aligns with the storage layout expectations to avoid potential mismatches.
.get_storage(contract_address, key.to_little_endian());

substrate/frame/revive/rpc/src/tests.rs:129

  • [nitpick] The error message string in the assert_eq! macro mixes placeholder syntax with literal variable names. Consider using a properly formatted message with all variables explicitly passed to ensure they are correctly interpolated.
assert_eq!(Some(value), balance.checked_sub(initial_balance), "Ethan {:?} {balance:?} should have increased by {value:?} from {initial_balance}.", ethan.address());

@pgherveou pgherveou enabled auto-merge April 7, 2025 09:11
@pgherveou
Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience runtime_dev --bump patch

@pgherveou pgherveou added T7-smart_contracts This PR/Issue is related to smart contracts. R0-no-crate-publish-required The change does not require any crates to be re-published. labels Apr 8, 2025
@pgherveou pgherveou requested a review from athei April 16, 2025 15:28
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/14496043458
Failed job name: test-linux-stable-no-try-runtime

@pgherveou pgherveou added this pull request to the merge queue Apr 22, 2025
auto-merge was automatically disabled April 22, 2025 09:50

Pull Request is not mergeable

Merged via the queue into master with commit adb4130 Apr 22, 2025
233 of 244 checks passed
@pgherveou pgherveou deleted the pg/update-caching branch April 22, 2025 11:03
ordian added a commit that referenced this pull request Apr 28, 2025
* master: (120 commits)
  [CI] Improve GH build status checking (#8331)
  [CI/CD] Use original PR name in prdoc check for the backport PR's to the stable branches (#8329)
  Add new host APIs set_storage_or_clear and get_storage_or_zero (#7857)
  push to dockerhub (#8322)
  Snowbridge - V1 - Adds 2 hop transfer to Rococo (#7956)
  [AHM] Prepare `election-provider-multi-block` for full lazy data deletion (#8304)
  Check umbrella version (#8250)
  [AHM] Fully bound staking async (#8303)
  migrate parachain-templates tests to `gha` (#8226)
  staking-async: add missing new_session_genesis (#8310)
  New NFT traits: granular and abstract interface (#5620)
  Extract create_pool_with_native_on macro to common crate (#8289)
  XCMP: use batching when enqueuing inbound messages (#8021)
  Snowbridge - Tests refactor (#8014)
  Allow configuration of worst case buy execution weight (#7944)
  Fix faulty pre-upgrade migration check in pallet-session (#8294)
  [pallet-revive] add get_storage_var_key for variable-sized keys (#8274)
  add poke_deposit extrinsic to pallet-recovery (#7882)
  `txpool`: use tracing for structured logging (#8001)
  [revive] eth-rpc refactoring (#8148)
  ...
castillax pushed a commit that referenced this pull request May 12, 2025
Refactor eth-rpc
- Get rid of the in memory-cache, we can just store receipts logs into
sqlite, and use in-memory db for non archive node.
- Track both best and finalized blocks so that we can properly index
transaction receipts in case of a relay chain re-org.
- Keep reference to the latest finalized block so that we can use that
for queries that use the `finalized` block tag
- use `--index-last-n-blocks` cli parameter to re-index the last n block
when the server start
- Fix issue related to gas estimate calculation for EIP1559 transaction
types

tested changes with paritytech/evm-test-suite#87

fix paritytech/contract-issues#35
paritytech/contract-issues#33

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published. T7-smart_contracts This PR/Issue is related to smart contracts.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[RPC] eth_getTransactionReceipt unable to query data

4 participants