37 Commits

Author SHA1 Message Date
8feaa02de0 Revert "feat: fix GetBlock for null rounds by returning nil (#12529)"
This reverts commit c6745545041939b97962e376ee2593609bb3d5b5.
2024-10-28 15:17:44 +11:00
ab3446726f feat(eth): implement eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex (#12618) 2024-10-25 02:00:14 +00:00
c674554504 feat: fix GetBlock for null rounds by returning nil (#12529)
* update pb version

* docs: update changelog

* fix: remove redundant code in sectors.go

* feat: Update EthGetBlockByNumber to return pointer to EthBlock

* fix TestGetBlockByNumber

* fix: Remove unnecessary assertions tests

* Update eth_api_test.go

* feat: Refactor EthGetBlockByNumber test in fevm_test.go

---------

Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
2024-10-03 11:52:16 +00:00
f33d4a28af fix(eth): complete eth_getBlockReceipts implementation
Co-authored-by: Rod Vagg <rod@vagg.org>
2024-09-26 10:10:33 +04:00
2a75ba8879 feat(eth): implement eth_getBlockReceipts 2024-09-26 10:10:33 +04:00
42e6e41efe feat(eth): add EthSendRawTransactionUntrusted, use via gateway eth_sendRawTransaction (#12431)
* test(mpool): more complete testing of MpoolPush* methods
* feat(eth): add EthSendRawTransactionUntrusted, use via gateway eth_sendRawTransaction
* fix(eth): move EthSendRawTransactionUntrusted off main EthModuleAPI
  - Move it to EthAPI so the GatewayAPI doesn't have to implement it.
2024-09-07 08:14:12 +00:00
a7b1db5f04 fix: address issues raised from code review 2024-08-09 11:03:28 +10:00
c4b699a051 feat!: make max-filters configurable, count combined subs+filters
* CLI takes --eth-max-filters-per-conn
* gateway.NewNode() now takes the API plus an optional list of Options
2024-08-09 11:03:28 +10:00
1fd00bcf22 feat: gateway: auto-cleanup of installed filters when ws connection ends 2024-08-09 11:03:28 +10:00
f8981cbe16 fix!: gateway: limit stateful calls to websockets
Ref: https://github.com/filecoin-project/go-jsonrpc/pull/118
Ref: https://github.com/filecoin-project/lotus/issues/11589
Ref: https://github.com/filecoin-project/lotus/issues/11153
2024-08-09 11:03:28 +10:00
ba07505963 feat: ETH API: Add V1 API to convert Filecoin Address to ETH address (#12324)
- ``

Co-authored-by: Rod Vagg <rod@vagg.org>

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
2024-08-01 08:25:23 +04:00
9063b3b34b feat: eth: add trace_filter API (#12123) 2024-07-25 13:03:25 +10:00
1bc8a8b32c chore: remove (deprecated) deps on build/ proxy-constants
This is a large diff, yet should have exactly zero functional changes

Ideally as a result of this some parts of the depchain will become lighter,
with downstream reaping the same benefits as the team that initiated this split.

P.S. work was done while forming better intuition of current dependency graph
2024-07-22 17:36:12 +04:00
6408709018 feat: eth: support "safe" and "finalized" for eth_getBlockByNumber (#12110)
* add support for eth_getBlockByNumber to accept the term safe which we are using as 30 blocks

* fix lint catch of unnecessary cast

* add finalized to get block by number

* Update chain/types/ethtypes/eth_types.go

Co-authored-by: Rod Vagg <rod@vagg.org>

* add test for eth get block by number to accept latest and safe and finalized as arguments

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
2024-06-21 11:38:21 +10:00
8f94aad42e feat: Add trace transaction API (#12075)
* changelog for trace_transaction

* adding boilerplate for trace_transaction to /api/

* add eth trace transaction proxy and mock api

* trace tx boilerplate

* trace transaction implementation - under construction

* fix types for eth trace transaction

* trace_transaction implemented

* golint and handle transaction not found

* gofmt

* ran make docsgen

* pointer bugfix  and make docsgen

* tx.BlockNumber is nil when the transaction is still in the mpool/pending and there is no trace for pending transactions

* check eth trace transaction happy case and two error cases - tx not found and tx pending in itests

* simplify error msg check for gh action fail

---------

Co-authored-by: Michael Seiler <michaelseiler@Michaels-Laptop.local>
2024-06-07 14:14:34 -04:00
26d3fd2ecc chore: lint: fix lint errors with new linting config
Ref: https://github.com/filecoin-project/lotus/issues/11967
2024-05-13 14:52:09 +10:00
6b353e56f3 add ETH addrs API to Gateway (#11979) 2024-05-08 15:35:00 +02:00
a3417e7488 Make block param to EthEstimateGas optional 2023-11-29 10:26:22 +00:00
717d2a0eeb Add block param to EthEstimateGas 2023-11-28 14:57:05 +00:00
8d8891a431 Moved tracing types to ethtypes to address circular dependencies 2023-08-28 17:48:22 +00:00
4068e0710d Do not return interface{} from trace api methods 2023-08-28 17:48:22 +00:00
1b0f54a61b Add new tracing API 2023-08-28 17:48:22 +00:00
a626b3e62c fix: gateway: return an error when an Eth filter is not found
Previously, we'd just return nothing.
2023-08-09 12:14:45 -07:00
dda2d7e023 Refactor EthBlockNumberOrHash and remove the number field 2023-06-22 17:18:50 +00:00
f358160cd5 Add EIP-1898 support needed for The Graph compatibility
Fixes: #10814

This PR updates the following RPC methods according to EIP-1898
specs.

The following RPC methods are affected:

- eth_getBalance
- eth_getStorageAt
- eth_getTransactionCount
- eth_getCode
- eth_call

Note that eth_getBlockByNumber was not included in this list in
the spec although it seems it should be affected also?

Currently these methods all accept a blkParam string which can be
one of "latest", "earliest", "pending", or a block number (decimal
or hex). The spec enables caller to additionally specify a json
hash which can include the following fields:

- blockNumber EthUint64: A block number (decimal or hex) which is
  similar to the original use of the blkParam string
- blockHash EthHash: The block hash
- requireCanonical bool) If true we should make sure the block is
  in the canonical chain

Since the blkParam needs to support both being a number/string and
a json hash then this to properly work we need to introduce a new
struct with pointer fields to check if they exist. This is done
in the EthBlockParamByNumberOrHash struct which first tries to
unmarshal as a json hash (according to eip-1898) and then fallback
to unmarshal as string/number.
2023-06-20 09:38:00 +00:00
2bc205ed62 feat: Add eth_syncing RPC method
This commit adds eth_syncing RPC method which returns an object
with data about the sync status or false.
2023-05-10 16:08:18 -04:00
17274e72da feat: expose limited apis on the gateway 2023-03-15 16:12:18 -07:00
fee480193e feat: apply gateway lookback limit to eth API lookback
This change:

1. Introduces new "limited" API endpoints for EthGetTransactionByHash
   and EthGetTransactionReceipt that accept lookback-limits.
2. Implements the gateway version of these API endpoints by calling the
   limited variants with the default message search lookback limit.

fixes #10412
2023-03-15 16:11:11 -07:00
3556a4b07b fix: gateway: correctly apply the fee history lookback max
This fix ensures that the full fee-history range falls into the
allowable lookback rang.
2023-03-13 16:45:26 -07:00
8b5bc45fcf fix: eth API: correct gateway restrictions, drop unimplemented methods 2023-03-07 12:53:04 -05:00
3c580403c1 implement itest and handle optional params 2023-02-10 13:33:59 -05:00
a6a2f0dbae gateway: Support all EthModule methods 2023-02-02 13:37:31 +01:00
ad14d71978 eth rpc: Params are optional in eth_subscribe 2023-01-31 11:08:51 +01:00
965b1cf03c itests: Fix TestEthSubscribeLogs 2023-01-31 10:28:12 +01:00
1286d76988 gateway: eth_subscribe support 2023-01-31 10:28:12 +01:00
22231dc34f gateway: Limits and proxy for eth_ methods 2023-01-13 20:04:42 +01:00
708618d11c feat: gateway: eth_ api support 2023-01-13 20:04:41 +01:00