63 Commits

Author SHA1 Message Date
17067d655d fix: reduce amount of buildconstant hacking in itests 2025-03-19 13:43:52 +11:00
34061ef387 chore(docs): minor godoc fixes in tests (#12956)
Signed-off-by: growfrow <growfrow@outlook.com>
2025-03-17 12:08:20 +11:00
a526c480d4 feat: tstore fevm test (#12849)
* check in fevm tstorage test. note that the network upgrade is a todo. Because the network upgrade does not happen the tests currently fail so they are commented with what needs to change once the network upgrade can be wired in.

* remove TODOs from tstore test and update asserts to assert that the expected correct result happens.

* typo bugfix

* Update itests/contracts/TransientStorageTest.sol

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

* Update itests/contracts/TransientStorageTest.sol

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

* upgrade go-state-types version for tstore migration code

* ran `make bundle-gen` and `bash pack.sh v16 v16.0.0-dev1`

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
2025-01-31 12:31:07 +01:00
c6d2e700ab fix(eth_trace): don't decode return value in EAM create error case (#12730)
Fixes: https://github.com/filecoin-project/lotus/issues/12731
2024-12-03 16:53:09 +00:00
e9393dfe8c fix(eth): present revert "data" as plain bytes
decode the cbor return value for reverts and present that, as is expected by
Ethereum tooling
2024-11-07 16:29:22 +11:00
6a70c6b01b feat(eth): return consistent error for null rounds from RPC methods (#12655) 2024-10-31 20:12:34 +11:00
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
082b7caab5 feat(api): populate data field for revert error in EthEstimateGas and EthCall (#12553)
Co-authored-by: Aryan Tikarya <aryan.tikarya@dojima.network>
2024-10-25 01:13:32 +00:00
bc50e5dc2b test(fvm): validate MCOPY opcode for FIP-0094 (#12556)
---------

Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Mikers <snissn@gmail.com>
2024-10-14 11:36:08 +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
2687f13b0a feat: update EthGetTransactionCount test for earliest, latest, and pending block parameters (#12548)
* chore: fix EthGetTransactionCount for earliest block parameter

* feat: update `EthGetTransactionCount` test for `earliest`, `latest`, and `pending` block parameters and refactor `EthGetTransactionCount` to return empty block for `earliest`

* chore: refactor EthGetTransactionCount test

* update changelog

* refactor EthGetTransactionCount test and fix for earliest block parameter

* Update CHANGELOG.md
2024-10-03 15:43:46 +04:00
918a68f222 parse block hash as a free param (#12539) 2024-10-02 09:23:24 +04:00
13fb3223fc feat(eth): fix EthGetTransactionCount for pending block parameter (#12520)
* feat(eth): fix EthGetTransactionCount for pending block parameter

* update changelog

* feat: add test for EthGetTransactionCount function

* make changes suggested by @rvagg

* Update node/impl/full/eth.go

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

* feat: improve error handling in EthGetTransactionCount test

* Update itests/fevm_test.go

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

* fix: update EthGetTransactionCount test to handle pending block parameter correctly

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
2024-10-01 10:20:41 +05:30
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
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
21abfc69fb feat: api: Clean API for Miners (#12112)
* proofparams alternate

* createminer

* const factored from /build and types updated to use it

* buildconstants for more places

* deprecate msg

* itest cleanup

* alerting interface

* house cleaning

* rm policy and drand from buildconstants

* clean up curio further

* aussie waffle

* pr fixes

* fix lints

* little fixes

* oops this got updated

* unbreak test builds

* test fixes

* comments - cleanups

* itests fix alerting

* rm obsolete alertinginterface

* spelling oops

* changelog

* tests need buildconstants port

* Fully migrate BlockGasTarget

* ulimit should not depend on build

* complete the simplest deprecations

* bringing back versions
2024-07-14 09:06:08 -05:00
6d403bf18d fix: state: rename Actor.Address and only use it for f4 addresses (#12155)
Per the FIP [1], the top-level actor address field should only be used
for delegated addresses. Unfortunately, the FIP's design was changed [2]
but neither lotus genesis code nor the field name were updated to
reflect this. Fortunately, all the migration code (on mainnet, at
least), has correctly left this field unset/unchanged (except for actors
with f4 addresses).

[1]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md#new-lookup_delegated_address-syscall-and-state-changes
[2]: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md#recording-other-addresses-in-the-actorstate-root
2024-06-27 00:48:28 +00:00
d9195c464b fix: fevm: update tests for latest actors bundle (#12144)
plus some code improvement refactoring
2024-06-25 12:05:18 +04:00
c9c070727a feat: ETH compatibility in Filecoin : Support Homestead and EIP-155 Ethereum transactions("legacy" transactions) in Filecoin (#11969)
* poc for eth legacy tx

* print statements

* finished

* tests work

* remove print statements

* Remove all print statements

* remove extraneous changes

* cleaned up code and interface

* run make jen

* dont duplicate signature

* go mod tidy and remove prints

* clean up tests

* test for conversion

* changes as per review

* more unit tests for legacy txns

* Apply suggestions from code review

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

* address review comments from Rodd

* changes as per zen's 2nd review

* go mod tidy

* feat: ETH compatibility in Filecoin : Support EIP-155 Ethereum transactions in Filecoin (#11970)

* itests passing for 155 tx

* first working version for EIP-155 transactions

* green itest

* add docs

* tests

* remove print stmt

* remove print stmt

* validate signature

* changes as per zen's review

* correct signature verification

* gate tx by Network Version

* handle arajsek review

* fix imports order

* fix lint

* dont lock in mpool for network gating ETH messages

* sender can be an ID address

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
2024-06-05 09:25:50 +04:00
1879570628 chore: fix function names (#12043)
Co-authored-by: tomfees <170385392+tomfees@users.noreply.github.com>
2024-05-27 03:51:55 +00: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
92844c8921 fix recursive test 2023-09-23 14:32:53 -04:00
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
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
5e6e011fe2 fix: FEVM_tests: update recursive limits 2023-04-23 14:21:26 -04:00
19f1ad2762 Merge branch 'releases' into asr/merge-release-into-master 2023-03-01 14:18:35 -05:00
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
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
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
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
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
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
9f2f9154d2 itest for block.difficulty (#10263) 2023-02-13 18:29:11 -08:00
3177f63a17 add test for transparent delegate proxy from openzeppelin 2023-02-13 13:57:18 +01:00
37e1ac5d93 eth: FIP-0055: implement final version of transitory delegated signature. (#10239) 2023-02-12 21:08:42 +00:00
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
c98093be03 Merge remote-tracking branch 'origin/release/v1.20.0' into mikers/create2test2 2023-02-09 18:19:47 +01:00
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
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
23eaee49d4 clean up test for recursive delegate call count. improved readability (#10195) 2023-02-06 13:32:39 -08:00
fc2a6a82cb Merge branch 'release/v1.20.0' into mikers/create2test2 2023-02-06 20:40:29 +00:00
2673ec3c82 use WithValue language for test 2023-02-06 20:35:35 +00:00
f671a3c81c merge 2023-02-06 20:24:23 +00:00
e0931f8f90 itest: fix remaining fevm failures 2023-02-06 11:01:49 -08:00
d16b2902d4 itest: fix: test comment 2023-02-06 09:52:38 -08:00
6bf3a21158 itest: fix FEVM tests for upstream changes 2023-02-06 09:20:22 -08:00