f358160cd5
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. |
||
---|---|---|
.. | ||
client | ||
docgen | ||
docgen-openrpc | ||
mocks | ||
types | ||
v0api | ||
v1api | ||
api_common.go | ||
api_errors.go | ||
api_full.go | ||
api_gateway.go | ||
api_net.go | ||
api_storage.go | ||
api_test.go | ||
api_wallet.go | ||
api_worker.go | ||
cbor_gen.go | ||
checkstatuscode_string.go | ||
eth_aliases.go | ||
miner_subsystems.go | ||
permissioned.go | ||
proxy_gen.go | ||
proxy_util_test.go | ||
proxy_util.go | ||
README.md | ||
types.go | ||
utils.go | ||
version.go | ||
wrap.go |
Lotus API
This package contains all lotus API definitions. Interfaces defined here are exposed as JsonRPC 2.0 endpoints by lotus programs.
Versions
File | Alias File | Interface | Exposed by | Version | HTTP Endpoint | Status | Docs |
---|---|---|---|---|---|---|---|
api_common.go |
v0api/latest.go |
Common |
lotus; lotus-miner | v0 | /rpc/v0 |
Latest, Stable | Methods |
api_full.go |
v1api/latest.go |
FullNode |
lotus | v1 | /rpc/v1 |
Latest, Work in progress | Methods |
api_storage.go |
v0api/latest.go |
StorageMiner |
lotus-miner | v0 | /rpc/v0 |
Latest, Stable | Methods |
api_worker.go |
v0api/latest.go |
Worker |
lotus-worker | v0 | /rpc/v0 |
Latest, Stable | Methods |
v0api/full.go |
FullNode |
lotus | v0 | /rpc/v0 |
Stable | Methods |