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

New 'Ethereum JSONRPC' client implementation #160

Merged
merged 12 commits into from
Mar 20, 2024

Conversation

goran-ethernal
Copy link
Collaborator

@goran-ethernal goran-ethernal commented Mar 20, 2024

Description

This PR implements a new Ethereum JSONRPC client in the jsonrpc package in blade.

Goals behind this PR

  1. We need a client that can use the types from blade like types.Transaction, types.Receipt, types.Header, types.TxAccessList, etc.
  2. To have our own implementation we can modify and expand as needs arise.
  3. So it can be used with blade txn signers.

What was done in PR

  1. Implemented new json rpc client EthClient in jsonrpc package.
  2. Add e2e test for each of its functions.
  3. Added JSON unmarshalling for our types like Transaction, Block, Header, Receipt, Log, AccessList, and each inner transaction type, since we have functions that returned json marshalled types (eth_getBlockByNumber, eth_getTransactionByHash, eth_getTransactionReceipt, etc.).
  4. Added our own CallMsg implementation for eth_call endpoint.
  5. Reorganized code a bit.
  6. Removed unused functions that lint and static analysis reported.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

@goran-ethernal goran-ethernal added the feature New feature label Mar 20, 2024
@goran-ethernal goran-ethernal requested a review from a team March 20, 2024 09:35
@goran-ethernal goran-ethernal self-assigned this Mar 20, 2024
@goran-ethernal goran-ethernal force-pushed the jsonrpc-client-implementation branch from 1be5f01 to d4a643a Compare March 20, 2024 09:36
@goran-ethernal goran-ethernal force-pushed the jsonrpc-client-implementation branch from d9145b5 to 8f97085 Compare March 20, 2024 10:16
tests/tests Outdated Show resolved Hide resolved
jsonrpc/codec.go Outdated Show resolved Hide resolved
jsonrpc/codec.go Outdated Show resolved Hide resolved
jsonrpc/codec.go Outdated Show resolved Hide resolved
jsonrpc/codec.go Show resolved Hide resolved
types/base_tx.go Show resolved Hide resolved
@goran-ethernal goran-ethernal merged commit e6f539c into develop Mar 20, 2024
9 of 10 checks passed
@goran-ethernal goran-ethernal deleted the jsonrpc-client-implementation branch March 20, 2024 14:44
@goran-ethernal goran-ethernal mentioned this pull request Mar 25, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants