Commit Graph

41 Commits

Author SHA1 Message Date
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
92844c8921 fix recursive test 2023-09-23 14:32:53 -04:00
Steven Allen
5743ed0151 test: fix fevm recursive call
We've now lost 2 recursive calls, but that really shouldn't make a
difference.
2023-07-13 22:26:25 -07: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
Aayush
5e6e011fe2 fix: FEVM_tests: update recursive limits 2023-04-23 14:21:26 -04:00
Aayush
19f1ad2762 Merge branch 'releases' into asr/merge-release-into-master 2023-03-01 14:18:35 -05:00
Łukasz Magiera
3841e5444f
Merge pull request #10308 from filecoin-project/asr/merge-release-into-master
chore: merge release/v1.20.0 into master
2023-02-20 14:05:15 +01:00
snissn
510f980348
tests: itests: blocktest properties (#10304)
* add itests for various fevm block properties and assert correct chain id

* add value checks to the block property solidity itests

* move get block function to kit
2023-02-17 14:32:54 -08:00
Steven Allen
73102e9432
test: eth: make sure we can deploy a new placeholder on transfer (#10281)
We have a test that triggers smart-contract logic on "transfers", but nothing that tries to create a new actor as a side-effect of a transfer.

fixes https://github.com/filecoin-project/ref-fvm/issues/1670
2023-02-17 13:29:53 -08:00
Steven Allen
30615a4ed6
feat: eth: return revert data on failed gas estimation (#10298)
Unfortunately, we need to execute the message twice to get this (unless
we want to change some APIs). But it's unlikely to be a performance
issue and will definitely help people debug failures.
2023-02-17 10:36:30 -08:00
Steven Allen
00b6d06041
feat: eth: parse revert data (#10295)
We don't really want to do this in the FVM because it's Ethereum
specific, but this makes sense to do in the Ethereum API.

See:

See https://docs.soliditylang.org/en/latest/control-structures.html#panic-via-assert-and-error-via-require
2023-02-17 01:18:03 +00:00
Steven Allen
5854d72784
fix: eth: correctly decode EthGetStorageAt output (#10284)
* fix: eth: correctly decode EthGetStorageAt output

We cbor-encode it. Also:

1. Actually use the passed block param.
2. Check if the target actor is an EVM actor to avoid nonsense outputs.

fixes https://github.com/filecoin-project/ref-fvm/issues/1621
2023-02-16 16:36:52 -08:00
snissn
9f2f9154d2
itest for block.difficulty (#10263) 2023-02-13 18:29:11 -08:00
Mike Seiler
3177f63a17 add test for transparent delegate proxy from openzeppelin 2023-02-13 13:57:18 +01:00
raulk
37e1ac5d93
eth: FIP-0055: implement final version of transitory delegated signature. (#10239) 2023-02-12 21:08:42 +00:00
Steven Allen
80fccba93f
fix: gas: update ffi & correct the message inclusion cost in nv18 (#10228)
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2023-02-10 12:48:20 +00:00
Łukasz Magiera
c98093be03 Merge remote-tracking branch 'origin/release/v1.20.0' into mikers/create2test2 2023-02-09 18:19:47 +01:00
Łukasz Magiera
d84479bb05
Merge pull request #10162 from filecoin-project/mikers/deployValueTest2
tests: itests: test creating a contract and sending value
2023-02-09 18:00:15 +01:00
Steven Allen
89499bfd40 fvm: chore: update FVM
This:

1. Updates the builtin actors bundle (for actors v10).
2. Updates the event entry type to include the codec.
3. Removes the cbor encoding and zero trimming from event data.

I've chose to:

1. _Not_ add codec handling to the event filtering system for now.
2. _Skip_ events with unexpected codecs.

We don't actually _allow_ these events in the FVM right now, and it
simplifies the implementation.

However, I _am_ recording the codecs in the database so we don't have to
migrate it later.
2023-02-07 18:15:40 -08:00
snissn
23eaee49d4
clean up test for recursive delegate call count. improved readability (#10195) 2023-02-06 13:32:39 -08:00
Mike Seiler
fc2a6a82cb Merge branch 'release/v1.20.0' into mikers/create2test2 2023-02-06 20:40:29 +00:00
Mike Seiler
2673ec3c82 use WithValue language for test 2023-02-06 20:35:35 +00:00
Mike Seiler
f671a3c81c merge 2023-02-06 20:24:23 +00:00
Steven Allen
e0931f8f90 itest: fix remaining fevm failures 2023-02-06 11:01:49 -08:00
Steven Allen
d16b2902d4 itest: fix: test comment 2023-02-06 09:52:38 -08:00
Steven Allen
6bf3a21158 itest: fix FEVM tests for upstream changes 2023-02-06 09:20:22 -08:00
Travis Person
03b419e3d4 feat: compute a better gas limit for recursive external contract calls 2023-02-03 20:40:18 +00:00
raulk
b46258d0bf
feat: evm: align events implementation with FIP-0049 and FIP-0054. (#10152)
- Event keys are now t1, t2, t3, t4 for topics; and d for data.
- ref-fvm no longer stores events in the blockstore for us. It just
  returns events to the client, who is now responsible for handling
  them as it wishes / according to its configuration.
- Add a flag to VMOpts to have the events AMT be written in the blockstore.
- Add a flag to the ChainStore to advertise to the rest of the system
  if the ChainStore is storing events.
- Enable that flag if the EthRPC is enabled (can also add an explicit
  configuration flag if wanted).
2023-02-02 19:10:30 -08:00
Mike Seiler
c6bd9bc9e0 tests that use create2 and destroy to validate evm state 2023-02-01 06:55:52 +00:00
Mike Seiler
3adafea574 merge 2023-02-01 06:51:32 +00:00
snissn
9060c474da
test: fevm: add in tests for deploying, destroying contracts, recursive calls, sending value (#10082)
adds the following tests to itests/fevm_test.go:
 - recursive tests
 - delegate call tests
 - delegate call recursive tests
 - revert tests
 - destruct tests
 - contract deploy address tests
 - send value to contracts
 - gas limit on value transfer tests
 - sending value to destroyed contracts
adds the test to itests/fevm_address_test.go:
 - deploy contract and confirm address is different second deploy
2023-01-31 19:13:13 -10:00
Łukasz Magiera
46746f3495 itests: Test FEVM recursive calls 2023-01-23 19:40:19 +01:00
Łukasz Magiera
7632f9bbba itests: Test FEVM recursive calls 2023-01-20 15:50:33 +01:00
Łukasz Magiera
eaccb571a5
fix: config: Fix eth rpc typo (#10076) 2023-01-19 20:35:19 +00:00
Łukasz Magiera
60dbd59aa0 itests: Default enable Eth rpc 2023-01-19 19:21:00 +01:00
Mike Seiler
2a95648625 linter fixes 2023-01-17 16:53:28 +00:00
Mike Seiler
b49c455df0 golint fix ++ instead of +=1 and add comment to script to build .hex files 2023-01-16 17:06:25 +00:00
Mike Seiler
77cdf26223 refactor of fevm_test, addition of delegate call test and a script to compile the .sol solidity files to .hex, add sharable methods into kit/evm 2023-01-14 03:03:06 +00: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