Commit Graph

24 Commits

Author SHA1 Message Date
Friðrik Ásmundsson
813d133c24
Merge pull request #11462 from filecoin-project/update-estimate-gas
api: Add block param to eth_estimateGas
2023-11-29 15:45:14 +00:00
Fridrik Asmundsson
dd667d28be Update one test to pass optional block param to EthEstimateGas 2023-11-29 15:17:05 +00:00
Steven Allen
a34cc5e4e9
fix: eth: handle unresolvable addresses (#11433)
Correctly handle "unresolvable" to/from addresses in top-level messages in the Ethereum API. Specifically:

1. Fail if we can't resolve the from address. As far as I can tell, this should be impossible (the message statically couldn't have been included in the block if the sender didn't exist).
2. If we can't resolve the "to" address to an ID, use "max uint64" as the ID (`0xff0000000000000000000000ffffffffffffffff`). This will only happen if the transaction was reverted. It'll be a little confusing, but the alternative is to (a) use an empty address (will look like a contract creation, which is definitely wrong) or (b) use a random/hashed address which will likely be more confusing as it won't be "obviously weird".
2023-11-29 16:12:18 +04:00
Fridrik Asmundsson
a3417e7488 Make block param to EthEstimateGas optional 2023-11-29 10:26:22 +00:00
Fridrik Asmundsson
717d2a0eeb Add block param to EthEstimateGas 2023-11-28 14:57:05 +00:00
Steven Allen
d5fd4cdcc0
feat: eth: encode eth tx input as solidity ABI (#11402)
When translating "native" messages to Ethereum transactions, correctly handle parameters:

1. If the message looks like a valid "create external", treat it as a contract creation.
2. If it looks like a valid EVM invocation, decode it as such.
3. Otherwise, ABI-encode the parameters to make them look like a "handle_filecoin_method" call. This
    will help chain explorers recognize these messages.

Part of #11355
2023-11-17 20:46:49 +01:00
Steven Allen
420f33017e
fix: api: compute the effective gas cost with the correct base-fee (#11357)
fixes #11252
2023-10-27 07:37:16 -07:00
Aayush
62032e7c2a feat: deflake: TestGetBlockByNumber 2023-08-09 19:25:32 -04:00
Fridrik Asmundsson
dda2d7e023 Refactor EthBlockNumberOrHash and remove the number field 2023-06-22 17:18:50 +00:00
Fridrik Asmundsson
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
Raúl Kripalani
3d21d71231 simplify test. 2023-03-09 19:05:31 +00:00
Raúl Kripalani
d38bdcebfd fix lint. 2023-03-09 14:59:56 +00:00
Raúl Kripalani
fd3ddc860e fmt. 2023-03-09 12:15:35 +00:00
Raúl Kripalani
b6dc0d2002 add a test to verify block parameter soundness. 2023-03-08 21:15:07 +00:00
Łukasz Magiera
6851b6a523 Merge remote-tracking branch 'origin/release/v1.20.0' into fix/eth-orpc-validate 2023-02-06 10:41:52 +01:00
Maciej Witowski
90fced7cb2 Test: assert all fields returned from EthGetTransactionByHash have expected values
Related to  https://github.com/filecoin-project/lotus/pull/10151#discussion_r1092358973
2023-02-01 17:38:09 +01:00
Ian Davis
d29a244064 Merge remote-tracking branch 'origin/release/v1.20.0' into iand/eth-openrpc-validate 2023-02-01 16:19:17 +00:00
Aayush
99b879d014 Add test for EthGetTransactionByHash 2023-01-31 12:55:46 -05:00
Ian Davis
2a73e1c2e1 Add test for eth_getStorageAt 2023-01-24 13:12:31 +00:00
Łukasz Magiera
60dbd59aa0 itests: Default enable Eth rpc 2023-01-19 19:21:00 +01:00
Łukasz Magiera
66f5ee4ae9 config: Fevm.EnableEthPRC 2023-01-19 18:31:17 +01:00
Geoff Stuart
3b283681a9 Fix test 2023-01-16 07:41:19 -05:00
Geoff Stuart
f8121c8f1c Add gc for eth tx database 2023-01-16 07:04:20 -05:00
raulk
cdf3812e40
NV18: Filecoin EVM runtime + Actor Events + EthAccount + EAM + f4 addressing (#9998)
Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Raul Kripalani <raulk@users.noreply.github.com>
Co-authored-by: Kevin Li <ychiaoli18@users.noreply.github.com>
Co-authored-by: vyzo <vyzo@hackzen.org>
Co-authored-by: Ian Davis <nospam@iandavis.com>
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
Co-authored-by: Jiaying Wang <42981373+jennijuju@users.noreply.github.com>
Co-authored-by: Jennifer Wang <jiayingw703@gmail.com>
Co-authored-by: Geoff Stuart <geoff.vball@gmail.com>
Co-authored-by: Shrenuj Bansal <shrenuj.bansal@protocol.ai>
Co-authored-by: Shrenuj Bansal <108157875+shrenujbansal@users.noreply.github.com>
Co-authored-by: Geoff Stuart <geoffrey.stuart@protocol.ai>
Co-authored-by: Aayush Rajasekaran <aayushrajasekaran@Aayushs-MacBook-Pro.local>
Co-authored-by: ZenGround0 <5515260+ZenGround0@users.noreply.github.com>
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
2023-01-13 19:11:13 +00:00