* 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>
* 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>
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.
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